ModelSim SE & SystemC
From “ModelSim SE User’s Manual”
The following modifications are needed:
• Replace “sc_main()” with an SC_MODULE, and potentially add a process to contain any testbench code
• Replace “sc_start()” by using the “run” command in the GUI
• Remove calls to “sc_initialize()”
• Export the top level SystemC design unit(s) using the SC_MODULE_EXPORT macro
• Verify that SystemC signal, ports and modules are explicitly named to avoid port binding and debugging errors. Disabling of automatic name binding may be needed.
• SC_CTOR (or the SC_MTI_BIND_NAME) macro is used
• use “-nonamebind” argument when compiling
int sc_main(int argc, char* argv[]) { sc_signal<bool> mysig; mymod mod(”mod”); mod.outp(mysig); sc_start(100, SC_NS); } |
SC_MODULE(mytop) { sc_signal<bool> mysig; mymod mod; SC_CTOR(mytop): mysig(”mysig”), mod(”mod”) { mod.outp(mysig); } }; SC_MODULE_EXPORT(mytop); |