我是SystemC的新用户,我已经在Visual Studio 2017中成功安装了SystemC 2.3.2。我唯一的问题是使用sc_main()函数。编译器抱怨无法找到入口点。我知道VS中的默认入口点是int main()。我已阅读IEEE Std 1666-2011第4.3条关于sc_main()和sc_elab_and_sim()的内容。我尝试使用以下代码来开始模拟。但它失败了。编译器显示错误消息:“identifier”sc_eabl_and_sim“未定义”。
int main(int arg, char* argv[])
{
sc_elab_and_sim(arg, argv);
//The rest code for simulation and testbench
...
}
如何在VS 2017中使sc_main(int arg,char * argv [])函数正常工作?如果不可能,如何在int main(int arg,char * argv [])中正确调用sc_eabl_and_sim(int arg,char * argv [])来启动模拟?
此外,我手动将Visual Studio中项目的入口点从main()更改为sc_main(),我得到此编译错误“无法推断子系统,必须定义”。