windows下构建systemc环境

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的链接,不过没试

Windows 搭建 SystemC 开发环境 - 简书

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值