Below I am going to share how I could integrate eclipse, systemc-2.3.3, and cygwin on a windows operating system.
Requirements:
Instructions:
- Please read the content of the INSTALL file included in the systemc extracted folder.
- Open CygWin64 terminal.
- Navigate to the folder you have extracted the systemc zip file.
- Create temporary directory "objdir" via "mkdir objdir" as explained in the INSTALL file.
- Change to the temporary directory via "cd objdir" as explained in the INSTALL file.
- Choose your compiler export CXX="g++ -std=c++14". If you would like to include fixed-point library you need to add DSC_INCLUDE_FX flag to the compiler definition, i.e., export CXX="g++ -std=c++14 -DSC_INCLUDE_FX ".
- run configure file as "../configure --prefix="location of the libs", e.g., "/sysclibs"
- After MakeFile is successfully created run it via "make"
- After the run is successful execute "make install". At this point you have created the system c libraries in "cygwin64/syslibs".
- Now open eclipse and create a C++ project, and select "Cygwin GCC" in the Toolchains listbox.
- Go to "project properties" and under "C/C++ Build" menu select "Settings"->"Cygwin C++ Compiler". In the "Command" editor type "g++ -std=c++14". Press "Apply". Do the same for "Cygwin C++ Linker". If you have included the fixed-point library, add -SC_INCLUDE_FX to the Miscellaneous of the C++ compiler.
- Under "C/C++ General" menu select "Path and Symbols". Under "Includes" tap add the path to systemc compiled include folder, e.g., "cygwin64/syslibs/include".
- Under "Library Paths" add the path to the compile system c libraries, e.g., "cygwin64/syslibs/lib-cygwin64".
- Under "Libraries" tap, add "systemc". Just press add and type "systemc".
- Compile the following code, and if there is no error, you have set up your environment properly.
#include <iostream>
using namespace std;
#include "systemc.h"
int sc_main(int, char* []) {
cout << "Done." << endl; // prints !!!Hello World!!!
return 0;
}
If you have included the fixed-point library, and Eclipse cannot resolve the defined fixed-point types, do as what follows.
- Open "/include/systemc"
- Remove "#ifdef SC_INCLUDE_FX" and its corresponding "endif".