windows下构建systemc环境
1.vbox+ubuntu linux
下载systemc
GitHub - systemc/systemc-2.3: New release of the systemc libraries
make一下
make install
找一个helloworld的例子;
// Learn with Examples, 2020, MIT license
#include <systemc> // include the systemC header file
using namespace sc_core; // use namespace
void hello1() { // a normal c++ function
std::cout << "Hello world using approach 1" << std::endl;
}
struct HelloWorld : sc_module { // define a systemC module
SC_CTOR(HelloWorld) {// constructor function, to be explained later
SC_METHOD(hello2); // register a member function to the kernel
}
void hello2(void) { // a function for systemC simulation kernel, void inside () can be omitted
std::cout << "Hello world using approach 2" << std::endl;
}
};
int sc_main(int, char*[]) { // entry point
hello1(); // approach #1: manually invoke a normal function
HelloWorld helloworld("helloworld"); // approach #2, instantiate a systemC module
sc_start(); // let systemC simulation kernel to invoke helloworld.hello2();
return 0;
}
g++ 编译一下
g++ hello.cpp -lsystemc
生成.out可以执行;
2.windows+visual studio
下载安装visual studio
下载另一份systemc的代码
git clone https://github.com/accellera-official/systemc.git
双击打开工程文件,编译
\systemc\msvc10\SystemC\SystemC.sln
新建project;c++ 命令行helloworld的模板
配置项目编译器和链接器配置
C/C++ ->常规->附加包含目录 /systemc/src/ ../include
C/C++ ->语言->启用运行时类型信息 是(/GR)
C/C++ ->命令行->其他选项 (/vmg)
链接器 ->常规->附加库目录 /systemc/msvc10/systemc/x64/Debug/
链接器 ->输入->附加依赖项 systemc.lib
编译执行;
3.找到一个clion搭建systemc的链接,不过没试