Jump to content

Creation of SystemC DLL


ARI

Recommended Posts

I want to create the SystemC DLL but failed, while building the SystemC 2.3.2 I get the following errors:

--sc_main_main.obj : error LNK2019: unresolved external symbol sc_main referenced in function sc_elab_and_sim
--x64\DebugDLL\SystemC.dll : fatal error LNK1120: 1 unresolved externals.

How to resolve this error, any help will be appreciated.

Please find the project properties setting.

 

Thanks,

ARI image.thumb.png.6b28a461c883a293f9e7680ede0e5888.png

Link to comment
Share on other sites

First, why the focus on a DLL? You should be focused on obtaining an executable simulation model. If you need a library, create a static one. The type of library has practically no application for SystemC since it’s not usually placed in an environment that needs so much sharing at runtime. A serious simulation usually wants an entire processor.

Also, SystemC is currently single threaded due to some fundamental aspects of event driven simulators. There has been work towards multi ore , but that is not a completely solved problem. 

Due to heavy usage of templates, SystemC is heavily include-file dominated. So libraries don’t do a lot anyhow. 

The next question I would ask: where did you define sc_main? This is the required top level function of any systemc application. 

SystemC itself provides main, because models are often linked into cosimulations under EDA tools that already have defined main. Cosimulations provide interaction with hardware models written in RTL SystemVerilog or VHDL. There may also be interactions with SystemVerilogUVM.

Link to comment
Share on other sites

Hi David,

Thanks for your reply.

First, why the focus on a DLL? -> I can only use DLL in my project, I can't use static SystemC lib. 

where did you define sc_main? -> For the moment, I wants to use SystemC DLL in the simple hello world example. But I am unable to create the DLL first.

any suggestions on how to resolve the errors?

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...

It seems weird to me that you can only use DLL. The way I see most folks use SystemC under VS is to create a SystemC project and then just link it into the result (i.e., static). I tend to use SystemC exclusively under Linux or macOS (i.e., BSD Linux). WSL2 Ubuntu works very nicely under Windows 10/11.

Perhaps you can use cmake to accomplish your goal. SystemC does have a cmake pathway. I use it all the time now because it is much easier to use than the antiquated autotools approach. Although the cmake approach is marked as experimental in the SystemC README, I can assure you that it works quite nicely and I've found it easier to use across platforms. VS does have cmake support.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...