Jump to content

leimli

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. Hi, everyone, I am a starter of SystemC. I wrote a simple example with using SC_THREAD following the example in systemc source. I have two classes which boot two threads, bootMAC and respondDrv. However, when I simulate this program, I observed that only bootMAC is running, respondDrv did not print anything. Are there anything I still need to add? Thanks so much for you guys' help. The code is follows. class SYSCMAC : public sc_core::sc_module { public: SC_HAS_PROCESS(SYSCMAC); SYSCMAC(sc_module_name name) : sc_core::sc_module(name) { SC_THREAD(bootMAC); } void bootMAC() { while(true) printf("in bootMAC\n"); } }; class SYSCNETDEV : public sc_module { public: SC_HAS_PROCESS(SYSCNETDEV); SYSCNETDEV(sc_module_name name) : sc_core::sc_module(name) { SC_THREAD(respondDrv); } void respondDrv() { while(true) printf("in respondDrv\n"); } }; int sc_main(int argc, char **argv) { printf("hello world\n"); SYSCMAC *q = new SYSCMAC("mac"); SYSCNETDEV *sn = new SYSCNETDEV("qemu"); sc_start(); printf("start simulation now\n"); return 0; }
×
×
  • Create New...