student4K Posted January 8, 2021 Report Share Posted January 8, 2021 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. Quote Link to comment Share on other sites More sharing options...
David Black Posted January 8, 2021 Report Share Posted January 8, 2021 Code itself looks fine. I ran the above on EDAplayground without problem. I also ran on MacOS 10.15.7 (Catalina) with Apple clang++ 12.0 (LLVM ) Here is a link to where I ran it: https://edaplayground.com/x/V25h SystemC 2.3.3-Accellera --- Sep 21 2020 10:55:34g++ 7.5Using C++ standard 201402Ubuntu 18.04 You might consider upgrading g++ (4.8 is pretty old). I use g++ 9.3 normally. student4K 1 Quote Link to comment Share on other sites More sharing options...
student4K Posted January 8, 2021 Author Report Share Posted January 8, 2021 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. Quote Link to comment Share on other sites More sharing options...
Bas Arts Posted January 11, 2021 Report Share Posted January 11, 2021 On a side note, you might also consider moving to SystemC 2.3.3; SystemC 2.3.1 is fairly old. student4K 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.