Uzmeed Posted December 28, 2017 Report Share Posted December 28, 2017 I am going to simulate the following code but getting the error I am newbie to systemc (in fact C) your valuable input will help me to understand the error arith.h arith_proc.cpp cmd.h result_proc.cpp write_result.cpp Simple_Bus_csim.log Quote Link to comment Share on other sites More sharing options...
AmeyaVS Posted December 29, 2017 Report Share Posted December 29, 2017 Hello @Uzmeed, In you attachements you are missing the header file: file.h Which seems to re-declare: enum state class cmd You are also missing the include guard in your arith.h and cmd.h header file. You can see the possible solution here: //////////////////////////// // Observe these added lines #ifndef ARITH_H_ #define ARITH_H_ //////////////////////////// #include "systemc.h" #include "file.h" SC_MODULE(arith){ sc_port<sc_fifo_in_if<cmd> > data_in; sc_port<sc_fifo_out_if<cmd> > data_out; sc_fifo<cmd> result_buffer; void write_result (cmd&, sc_int<64>&); void return_proc(); void arith_proc(); SC_CTOR(arith) { SC_THREAD(return_proc); SC_THREAD(arith_proc); } }; //////////////////////////// // Observe these added lines #endif // ARITH_H_ //////////////////////////// I think you should probably start by learning C++, you can find excellent tutorials online (some of them mentioned below): C++ Standard Tutorials http://www.cplusplus.com/ Regards, Ameya Vikram Singh Quote Link to comment Share on other sites More sharing options...
Uzmeed Posted December 29, 2017 Author Report Share Posted December 29, 2017 Thanks Ameya I was adding these guards but in cmd.h only adding to both cmd.h and arith.h worked moreover file.h = cmd.h i just change the name to see if trhere any conflict with name or not One more thing please I am also getrting the following error you can also see that in the log i attached previously C:/Xilinx/Vivado_HLS/2015.4/win64/tools/systemc/include/sysc/communication/sc_fifo.h: In member function 'void sc_core::sc_fifo<T>::print(std::ostream&) const [with T = cmd, std::ostream = std::basic_ostream<char>]': ../../../main.cpp:9:2: instantiated from here C:/Xilinx/Vivado_HLS/2015.4/win64/tools/systemc/include/sysc/communication/sc_fifo.h:314:13: error: no match for 'operator<<' in 'os << *(((cmd*)((const sc_core::sc_fifo<cmd>*)this)->sc_core::sc_fifo<cmd>::m_buf) + ((unsigned int)(((unsigned int)i) * 16u)))' C:/Xilinx/Vivado_HLS/2015.4/win64/tools/systemc/include/sysc/communication/sc_fifo.h:314:13: note: candidates are: c:\xilinx\vivado_hls\2015.4\msys\bin\../lib/gcc/mingw32/4.6.2/include/c++/ostream:110:7: note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char, _Traits = std::char_traits<char>, std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]............................................. Can u please also help in this regard Regards Quote Link to comment Share on other sites More sharing options...
AmeyaVS Posted December 29, 2017 Report Share Posted December 29, 2017 Hello @Uzmeed, I cannot really know what you are doing here (main.cpp line 9) without the source code. 47 minutes ago, Uzmeed said: ../../../main.cpp:9:2: instantiated from here Do you really need to use such a heavy weight tool (Vivado HLS) for exploration? I would recommend that you first try to use the basic tools for developing SystemC models (some of them listed here): C++ Compiler/Debugger: GCC, Clang and MSVC. SystemC proof of concept simulation code: http://www.accellera.org/downloads/standards/systemc Then move onto to the tools when you have mastered the basics. Regards, Ameya Vikram Singh Quote Link to comment Share on other sites More sharing options...
Uzmeed Posted December 29, 2017 Author Report Share Posted December 29, 2017 main.cpp is just for running the simulation otherwise the tool does not simulate I am bound to develop the code in vivado HLS :( Quote Link to comment Share on other sites More sharing options...
AmeyaVS Posted December 29, 2017 Report Share Posted December 29, 2017 What is the type of cmd_t in cmd.h line 6? Regards, Ameya Vikram Singh Quote Link to comment Share on other sites More sharing options...
David Black Posted December 29, 2017 Report Share Posted December 29, 2017 I concur with the idea of becoming more proficient in C++. This is the number one best way to improve your SystemC skills. It also helps to get good formal training on SystemC. Suggestions: Define your enum's inside your class declarations (e.g. inside a module). Then you enumeration items become CLASS_NAME::ENUM_NAME Adopt C++11 and use enum classes. See http://en.cppreference.com/w/cpp/language/enum for more details. Do both! Any serious C++ programmer should be using C++11 or C++14 by now unless restricted by some antiquated toolset. These are now well supported by modern versions of GCC, CLANG (LLVM), Microsoft Visual Studio, Oracle, and IBM. This even includes most embedded compilers. Philipp A Hartmann 1 Quote Link to comment Share on other sites More sharing options...
Uzmeed Posted January 2, 2018 Author Report Share Posted January 2, 2018 Thanx David I am doing my MS and studying the course of reconfigurable computing . I admitt that i have to study C before system C but compulsion of doing projects in system C forces me to seek advice . However I am trying my level best Any way thanks ur advice solved my problem Quote Link to comment Share on other sites More sharing options...
David Black Posted January 2, 2018 Report Share Posted January 2, 2018 Study C++ (not C). If you learn C for this, you will get most things wrong and it will be much harder for you. C++ is not a small upgrade to C. 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.