Jump to content

User Guide for systemc 2.3.2


Recommended Posts

Hi everyone,


I installed `systemc v2.3.2` and followed the instructions in user guide found here but when I compile the code using this single command

g++ -I. -I/usr/local/systemc-2.3.2/include -L. -L/usr/local/systemc-2.3.2/lib-linux64 -lsystemc -lm -lstdc++ channel.cpp display.cpp packet.cpp receiver.cpp timer.cpp transmit.cpp main.cpp -o main

 I get so many errors, here are few:

/usr/local/systemc-2.3.2/include/sysc/communication/sc_signal_ports.h:311:14: error: no matching function for call to sc_trace(sc_core::sc_trace_file*&, const packet_type&, std::__cxx11::string&)’
      sc_trace( p->tf, iface->read(), p->name );

/usr/local/systemc-2.3.2/include/sysc/communication/sc_signal.h:317:26: error: no match for operator<<’ (operand types are std::basic_ostream<char> and const packet_type’)
     os << "new value = " << m_new_val << ::std::endl;

/usr/local/systemc-2.3.2/include/sysc/tracing/sc_trace.h:279:13: error: invalid conversion from const char*’ to int [-fpermissive]
     sc_trace( tf, object.read(), name );
main.cpp:42:22: error: class sc_core::sc_clock has no member named signal
   sc_trace(tf, CLOCK.signal(), "clock");
main.cpp:51:17: error: no matching function for call to sc_start(int)’

./packet.h:16:69: error: sc_string does not name a type
 extern void sc_trace(sc_trace_file *tf, const packet_type& v, const sc_string& NAME);


The source code can be found here


Thanks for any help you can offer :)

Edited by Mouhsen.Ibrahim
Fix code and URLs
Link to comment
Share on other sites

  • 2 weeks later...

Your example code uses many features, which have been deprecated for good reasons already in IEEE Std 1666-2005. The Accellera proof-of-concept implementation SystemC 2.3.2 of IEEE Std 1666-2011 continued the effort to improve the code quality and facilitate the maintenance of the implementation by removing long-deprecated features and improve the compatibility with modern C++ compilers and coding techniques. I recommend that you familiarise yourself with the "Modern C++" concepts introduced by C++'11, '14, and '17 and start to modernise your SystemC models. Following are some hints to get you started:

  • Use the <systemc> header instead of <systemc.h> and explicitly use the appropriate namespace prefixes or using statements
  • Use std::string instead of the long deprecated sc_string
  • When calling sc_core::sc_start(), always pass the appropriate time unit as second argument or pass a sc_core::sc_time constant/variable
  • Make sure to compile your model with the same flags that were used during the compilation of the SystemC library itself. Especially make sure that everything is compiled against the same language standard! Otherwise, you will face link problems!

Besides a good book on C++, I also recommend you to read a good introduction to SystemC, e.g., "SystemC from the Ground Up".

Link to comment
Share on other sites

6 hours ago, Mouhsen.Ibrahim said:

Is there a change log for systemc, so I can see what changed and modify my systemc models according to it?

Annex C in the SystemC standard lists some deprecated features.

In the SystemC proof-of-concept implementation, you find detailed information about changes in the RELEASENOTES file, but mostly only relative to the previous version.

Link to comment
Share on other sites

Hi, I spent hours trying to install systemC on visual studio 2017, i have encountered a problem. when I include the systemc.h file, the vs shows the error "unrecognized preprocessing directive". I followed the install instruction carefully in  INSTALLATION file.


update: I fixed the issue.

Edited by Aaron0127
Link to comment
Share on other sites

  • 3 weeks later...

I totally agree that it would be great if the example code from the "SystemC: from the ground up" book would be made available again on the internet. It is best to ask @David Black for that as he is one of the authors of the book. By the way, the second edition of the book has its own homepage: http://scftgu.com/ Unfortunately, it doesn't provide an archive with the example code sources either.

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...