Search the Community
Showing results for tags 'systemc 2.3'.
-
I have successful installation of SystemC 2.3.3 on Visual Studio 2017. All the enclosed examples compile and run successful. However, when I create a simple example (listed here: https://www.edaplayground.com/x/5UHA, un-comment lines 4 and 5 in testbench.cpp ), it throws an exception. The exception is thrown at line: SC_METHOD(op_DFF); And the exception thrown is // CHECK IF THIS IS AN sc_module-BASED PROCESS AND SIMUALTION HAS STARTED: if ( dynamic_cast<sc_module*>(host_p) != 0 && sc_is_running() ) { report_error( SC_ID_MODULE_METHOD_AFTER_START_, "" ); sc_abort(); // can't recover from here } in file "sc_method_process.cpp". The example runs okay on the EDA Playground, which I believe uses g++. Any tips to resolve this on VS2017? Thank you.
-
Hi I have a long story about using Systemc TLM. I am having some trouble trying to embed our existing software (including driver) into the TLM frame. Originally I called the application function in an SC_THREAD and wanted to let the driver function access tlm socket. But our software and driver are shared libraries and can not see the upper layer socket which reside in a SC_MODULE. Besides I don't want to change the existing libraries and pass the variables or function pointers (like how sockets really do) down to the driver. So I changed my mind and created another SC_THREAD to receive the tlm_generic_payload from the first one. I used a sc_fifo (dynamic sensitivity) for them to communicate. To achieve this I have to declare the fifo global in the driver. And I need to link the libsystemc.a in the shared library of driver (libsystemc.so requires the sc_main function). After everything is cleared and compilation is passed, I get this error message at the end of running phase. double free or corruption (fasttop): ... ======= Backtrace: ========= ... ======= Memory map: ======== ... Aborted (core dumped) It seems that as long as I access global variables or functions in the driver, this happens (I can still get the variable). I drew a simple schematic diagram to illustrate my project. My Question: I used static systemc library in the driver and a shared systemc library in the upper application, could this be the problem? How can I solve my problem? I believe that developing TLM model with software is a general case, is there a pattern to do this in a systematic way without changing the software (only interface) too much? Was I primarily wrong at the beginning? Any interpretation or suggestion would be appreciated. Liyuan
-
coredump using kill() in SystemC 2.3 with clang
Martin Barnasconi posted a topic in SystemC Language
When using clang++ (version 3.1 under cygwin/Windows) and SystemC 2.3, I get a coredump when killing a dynamically spawned process. The message is: terminate called after throwing an instance of 'sc_core::sc_unwind_exception' what(): KILL Aborted (core dumped) Using gcc/g++ works correctly. Any idea what is causing this? Attached a simple example to reproduce the coredump. SC_MODULE(x) { void f1() { sc_process_handle h2 = sc_spawn(sc_bind(&x::f2, this) ); wait(5, SC_MS); if (h2.valid()) h2.kill(); } void f2() { cout << "@" << sc_time_stamp() << ": A" << endl; wait(10, SC_MS); cout << "@" << sc_time_stamp() << ": B" << endl; } SC_CTOR(x) { sc_process_handle h1 = sc_spawn(sc_bind(&x::f1, this) ); }; }; int sc_main(int, char*[]) { x mod_x("x"); sc_start(); return 0; } -
Hello everyone, I’m new in systemc and in this forum. I successfully downloaded and installed systemc-2.3.0 on MSVC-2010 (Windows 7) I can compile and run the examples. BUT when I write an own program it doesn’t work. For example I wrote this simple program. #include "systemc.h"#define WIDTH 4 SC_MODULE(adder) { sc_in<sc_uint<WIDTH> > a, b; sc_out<sc_uint<WIDTH> > sum; void do_add() { sum.write(a.read() + b.read()) } SC_CTOR(adder) { SC_METHOD(do_add); sensitive << a << b; } }; systemc.lib(sc_main_main.obj) : error LNK2019: unresolved external symbol > _sc_main referenced in function _sc_elab_and_sim > Debug/addieren.exe : fatal error LNK1120: 1 unresolved externals It seems that the compiler can’t find systemc.lib, but I have add additional libraries in the properties and set the environment variable. I checked it many times but I always got the above-mentioned messages. Can you help me? Thanks in advance. Regards, Aydin Uni Bochum
- 2 replies
-
- msvs10
- visual studio 10
-
(and 3 more)
Tagged with: