Quantcast
Channel: SystemC Language Forum RSS Feed
Viewing all articles
Browse latest Browse all 595

Linking systemC to legacy C++ code

$
0
0

Hi

I am providing a systemC model to another team that uses a non-systemC legacy model. The idea is to include systemC libraries and then replace the legacy main() function with systemC's sc_main() so that sc_start() command could be called. Here is an sketch:

 

 

sc_main () {

 

   // legacy code here

 

  // instantiate/initial systemC modules

 

  // systemC code

  sc_start(sim_time);

  sc_stop();

 

  // process systemC output with the legacy code

 

 

}

 

For various reasons, the other team is not willing to replace the main() function with sc_main(). One obvious way is to make the systemC portion an executable and call it from main(). But this requires file I/O that would slow down the sim.  I was wondering if there is a way to accomplish this without replacing the main() function?

 

Thanks

Farzad


Viewing all articles
Browse latest Browse all 595

Trending Articles