student4K
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Events
Posts posted by student4K
-
-
Hello!
I am running a slightly modified (for successful compilation) example from the book "SystemC: from ground up, 2nd edition" on my Ubuntu 20.04 with g++-4.8.
SystemC version is 2.3.1.
Here is the source code:
#include <systemc> SC_MODULE(Hello_SystemC) { SC_CTOR(Hello_SystemC) { SC_THREAD(main_thread); } void main_thread(void) { SC_REPORT_INFO("main", "Hello!"); } }; int sc_main(int sc_argc, char* sc_argv[]) { Hello_SystemC HelloWorld_i("HelloWorld_i"); sc_start(1, sc_core::sc_time_unit::SC_NS); return 0; }
Upon execution and after Accellera copyright message I get the following error:
hello: /home/stud4k/fromsrc/systemc/include/sysc/kernel/sc_process.h:616: void sc_core::sc_process_b::reference_increment(): Assertion `m_references_n != 0' failed.
Is something missing or should something be rewritten in the example?
Thanks in advance.
Running "Hello SystemC": assertion `m_references_n != 0' failed
in SystemC Language
Posted
Thanks for the quick response, David.
Indeed, I have just tried rebuilding the systemc libs and the example with gcc 7.5 and it worked!
Actually, when I chose 4.8 for the compiler version I was only following the README info for the 2.3.1 release where it states "GNU C++ compiler versions gcc-3.4.6 through gcc-4.9.0" as "well tested" configurations for GCC.
But if systemc can as well be used with newer GCCs, I will stick to those of course.