Mouhsen.Ibrahim Posted February 12, 2018 Report Posted February 12, 2018 (edited) 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)’ sc_start(10000); ./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 February 12, 2018 by Mouhsen.Ibrahim Fix code and URLs Quote
Mouhsen.Ibrahim Posted February 12, 2018 Author Report Posted February 12, 2018 I solved sc_string error by adding this line to packet.h file typedef std::string sc_string; Quote
maehne Posted February 20, 2018 Report Posted February 20, 2018 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". Quote
Mouhsen.Ibrahim Posted February 25, 2018 Author Report Posted February 25, 2018 @maehne Thanks a lot for your reply, I already started writing my systemc models, I am having very few problems so far. I will follow your guidelines here and hope to improve my code quality. Is there a change log for systemc, so I can see what changed and modify my systemc models according to it? Quote
Philipp A Hartmann Posted February 25, 2018 Report Posted February 25, 2018 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. maehne 1 Quote
Aaron0127 Posted February 27, 2018 Report Posted February 27, 2018 (edited) 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 February 27, 2018 by Aaron0127 Quote
maehne Posted February 27, 2018 Report Posted February 27, 2018 Maybe you could share what was the cause and how you fixed the issue? Quote
shanh Posted March 15, 2018 Report Posted March 15, 2018 Hi @maehne, I am reading the book "SystemC: from the ground up". It refers to some example codes at www.EklecticAlly.com but this link is not functional anymore. It would be a great help in my SystemC adventure if someone can give me those example codes. Thanks! Quote
maehne Posted March 15, 2018 Report Posted March 15, 2018 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. Quote
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.