Jump to content

SiGa

Members
  • Content Count

    14
  • Joined

  • Last visited

About SiGa

  • Rank
    Member

Profile Information

  • Location
    Munich, Germany
  1. Thank you for the explanation, I changed it. To prove your statement I tried it with a static integer, and it is traced correctly. About the remaining bugs, regarding dangling references. Only private member of my class is private: std::vector<int> vec; Access methods return ref to vec or store elements of passed argument inside the local ref, by copying. I added an exception for invalid vector size, to avoid reallocation of vector and thus dangling references. const std::vector<int>& read() const { return vec; } void write(std::vector<int> var) { if (var.size() != 4) { throw std::invalid_argument("Argument is not size 4!"); } this->vec.assign(var.begin(), var.end()); } The assignment operator uses the write method. TraceVector operator= (const TraceVector& var) { write(var.read()); return *this; } I don't see the error where I leave dangling references that would cause the sc_trace mechanism to display wrong values. In sc_main I declare my sc_signal like this typedef TraceVector sim_type; // typedef for swapping signal type in one code line #define SIM_TYPE_INIT std::vector<int>{9999,9999,9999,9999} // different type needs different inits sc_main() { ... sc_signal< sim_type, SC_MANY_WRITERS> test{"test", SIM_TYPE_INIT }; ... sc_trace_file *tf = sc_create_vcd_trace_file("traces"); sc_trace(tf, test, "test"); sc_start(); sc_close_vcd_trace_file(tf); }
  2. Are you missing the function prototype in the "Cnt_time.h" class ? Or does the parameter list not match with what you implemented in "Cnt_time.cpp"? Btw you for loop wont work like this. A few suggestions. for (int i = 0; i < 20; i++) { wait(20, SC_SEC); cout << i << endl; cout << "INFO: Time is " << sc_time_stamp() << "!" << endl; }
  3. When I add the 'const' keyqord to the reference parameter it works. void sc_trace(sc_trace_file* tf, const TraceList& var, const std::string& nm); // works Additionally I had to change my read method. // Old std::list<int>& read() { return lst; } // New const std::list<int>& read() const { return lst; } I could not trace the values of a list, even when the size of the list remained constant. So I tried it with a vector and created TraceVector. The size of the vector will be 4. There are some size checks missing to ensure this, but that's not what I try to show with this. class TraceVector { private: std::vector<int> vec; public: // Methods for accessing list const std::vector<int>& read() const { return vec; } void write(std::vector<int> var) { this->vec.assign(var.begin(), var.end()); } // CTOR TraceVector() { vec.reserve(4); } // CTOR for init values TraceVector(std::vector<int> var) { vec = var; } // Required by sc_signal<> and sc_fifo<> TraceVector operator= (const TraceVector& var) { write(var.read()); return *this; } // Required by sc_signal<> bool operator== ( const TraceVector& var) const { auto temp = var.read(); // size check if (temp.size() != vec.size()) { return false; } // element wise comparison bool equal = std::equal(vec.begin(), vec.end(), temp.begin()); return equal; } }; // Required functions by SystemC ostream& operator<< (ostream& os, TraceVector var); void sc_trace(sc_trace_file* tf, const TraceVector& var, const std::string& nm); Since I can not store multiple values in one datatype and trace it, I decided to create a trace for each element in the vector. void sc_trace(sc_trace_file* tf, const TraceVector& var, const std::string& nm) { int pos = 0; sc_core::sc_trace(tf, 0, nm + "_test"); for (auto val : var.read()) { // use namespace, compiler otherwise chooses wrong function sc_core::sc_trace(tf, val, nm + "_" + std::to_string(pos++)); } } The result looks like this: The displayed values are not the values from the vector. Even the value of test_test is not 0, even though I set it to a constant 0. Somebody knows why sc_trace is tracing the wrong values?
  4. @Eyck Thank you for the hint. Now that I know it, I also saw that it was done that way in the book, and I didn't spot the closing curly bracket. My overloaded sc_trace function is only matched correctly, when I don't use a ref for the TraceList argument. void sc_trace(sc_trace_file* tf, TraceList& var, const std::string& nm); // doesn't work void sc_trace(sc_trace_file* tf, TraceList var, const std::string& nm); // works Compiler output for not working case: 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\communication\sc_signal_ports.h(307): error C2665: 'sc_trace': none of the 61 overloads could convert all the argument types 1>c:\users\xx\xx\xx\milbus_cosimulator\helper.h(96): note: could be 'void sc_trace(sc_core::sc_trace_file *,TraceList &,const std::string &)' [found using argument-dependent lookup] 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(324): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const void *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(249): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxnum_fast *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(249): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxnum_fast &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(248): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxnum *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(248): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxnum &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(247): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxval_fast *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(247): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxval_fast &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(246): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxval *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(246): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxval &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(244): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_lv_base *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(244): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_lv_base &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(243): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_bv_base *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(243): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_bv_base &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(241): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_unsigned *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(241): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_unsigned &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(240): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_signed *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(240): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_signed &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(239): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_uint_base *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(239): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_uint_base &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(238): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_int_base *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(238): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_int_base &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(236): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_logic *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(236): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_logic &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(235): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_bit *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(235): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_bit &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(232): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::uint64 *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(232): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::uint64 &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(231): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::int64 *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(231): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::int64 &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(230): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const long *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(230): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const long &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(229): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const int *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(229): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const int &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(228): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const short *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(228): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const short &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(227): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const char *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(227): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const char &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(226): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned long *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(226): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned long &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(225): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned int *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(225): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned int &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(224): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned short *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(224): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned short &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(223): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned char *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(223): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned char &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(221): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const double *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(221): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const double &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(220): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const float *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(220): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const float &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(219): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const bool *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(219): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const bool &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(217): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_core::sc_time *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(217): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_core::sc_time &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(216): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_core::sc_event *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(216): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_core::sc_event &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\communication\sc_signal_ports.h(307): note: while trying to match the argument list '(sc_core::sc_trace_file *, const T, std::string)' 1> with 1> [ 1> T=sim_type 1> ] 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\communication\sc_signal_ports.h(302): note: while compiling class template member function 'void sc_core::sc_in<T>::end_of_elaboration(void)' 1> with 1> [ 1> T=sim_type 1> ] 1>c:\users\xx\xx\xx\milbus_cosimulator\milbus_if.h(14): note: see reference to class template instantiation 'sc_core::sc_in<T>' being compiled 1> with 1> [ 1> T=sim_type 1> ] 1>c:\users\xx\xx\xx\milbus_cosimulator\milbus_if_with_model.h(14): note: see reference to class template instantiation 'milbus_if_inputs<sim_type>' being compiled 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\communication\sc_signal_ports.h(1144): error C2665: 'sc_trace': none of the 61 overloads could convert all the argument types With sim_type being: typedef TraceList sim_type; Why is it like that?
  5. Hello Forum, I want to have std::list<int> as type for a sc_port and sc_signal. In the e-book "SystemC : From The Ground Up" and "IEEE Std 1666™-2011" I found the necessary information. So I created a wrapper class that implements the necessary overloaded operators, and the sc_trace function that are needed for this purpose. // List that is traceable by sc_trace class TraceList { private: std::list<int> lst; public: // Methods for accessing list std::list<int>& read() { return lst; } void write(std::list<int> var) { lst = var; } // CTOR TraceList() { } // CTOR for init values TraceList(std::list<int> var) { lst = var; } // Required by sc_signal<> and sc_fifo<> TraceList& operator= (const TraceList& var) { lst = var.lst; return *this; } // Required by sc_signal<> bool operator== (const TraceList& var) const { return lst == var.lst; } // Required functions by SystemC friend ostream& operator<< (ostream& os, const TraceList& var) { os << "{"; auto it = var.lst.begin(); while (it != var.lst.end()) { os << *it; it = std::next(it); } os << "}"; return os; } void sc_trace(sc_trace_file* tf, const TraceList& var, const std::string& nm) { int pos = 0; auto it = var.lst.begin(); while (it != var.lst.end()) { // use namespace, compiler otherwise chooses wrong function sc_core::sc_trace(tf, *it, nm + std::to_string(pos++)); it = std::next(it); } } }; I get these kind of errors: Severity Code Description Project File Line Suppression State Error C2665 'sc_core::sc_trace': none of the 60 overloads could convert all the argument types MILBUS_CoSimulator c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\communication\sc_signal_ports.h 307 Error C2665 'sc_core::sc_trace': none of the 60 overloads could convert all the argument types MILBUS_CoSimulator c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\communication\sc_signal_ports.h 1144 Error C2665 'sc_core::sc_trace': none of the 60 overloads could convert all the argument types MILBUS_CoSimulator c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h 279 Reading the output of the compiler gives me the hint that this errors are caused by a non matching overload of sc_trace. 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\communication\sc_signal_ports.h(307): error C2665: 'sc_core::sc_trace': none of the 60 overloads could convert all the argument types 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(324): note: could be 'void sc_core::sc_trace(sc_core::sc_trace_file *,const void *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(249): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxnum_fast *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(249): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxnum_fast &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(248): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxnum *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(248): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxnum &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(247): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxval_fast *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(247): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxval_fast &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(246): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxval *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(246): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_fxval &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(244): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_lv_base *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(244): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_lv_base &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(243): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_bv_base *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(243): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_bv_base &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(241): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_unsigned *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(241): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_unsigned &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(240): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_signed *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(240): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_signed &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(239): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_uint_base *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(239): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_uint_base &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(238): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_int_base *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(238): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_int_base &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(236): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_logic *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(236): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_logic &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(235): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_bit *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(235): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::sc_bit &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(232): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::uint64 *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(232): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::uint64 &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(231): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::int64 *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(231): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_dt::int64 &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(230): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const long *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(230): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const long &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(229): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const int *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(229): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const int &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(228): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const short *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(228): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const short &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(227): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const char *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(227): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const char &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(226): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned long *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(226): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned long &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(225): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned int *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(225): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned int &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(224): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned short *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(224): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned short &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(223): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned char *,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(223): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const unsigned char &,const std::string &,int)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(221): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const double *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(221): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const double &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(220): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const float *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(220): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const float &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(219): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const bool *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(219): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const bool &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(217): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_core::sc_time *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(217): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_core::sc_time &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(216): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_core::sc_event *,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\tracing\sc_trace.h(216): note: or 'void sc_core::sc_trace(sc_core::sc_trace_file *,const sc_core::sc_event &,const std::string &)' 1>c:\users\xx\xx\xx\systemc-2.3.3\src\sysc\communication\sc_signal_ports.h(307): note: while trying to match the argument list '(sc_core::sc_trace_file *, const T, std::string)' 1> with 1> [ 1> T=TraceList 1> ] Why is the overloading of sc_trace not working? What am I doing wrong? Is my approach a bad choice and should I solve it in a different way? If yes, which one?
  6. I have a class with an sc_event which should be readable and writeable through getter and setter methods. class IntWithEvent { private: sc_event _ev_wr; sc_event _ev_trigger; public: const sc_event& get_write_event() const { return _ev_wr; } const sc_event& get_trigger_event() const { return _ev_trigger; } void set_trigger_event(sc_event &ev) const { _ev_trigger = ev; // E0349 no operator "=" matches these operands } } Writing the getters was no problem. However the setter throws me an error of no matching assignment operator. Do I need to store a pointer to a sc_event and then set the pointer to the address of the parameter? It doesn't give me compile errors like this. class IntWithEvent { private: sc_event _ev_wr; sc_event *_ev_trigger; public: const sc_event& get_write_event() const { return _ev_wr; } const sc_event& get_trigger_event() const { return *_ev_trigger; } void set_trigger_event(sc_event *ev) { _ev_trigger = ev; } } I was taught to avoid pointers where I can. Is there a way to avoid the pointers?
  7. Thank you Philipp, this solved my runtime errors. I also removed if_inputs/-outputs as parents for the monitor class, since I nested them into stub and sim. class monitor : public sc_module { ... }; _________________________________ Thank you for the explanation and the provided examples. Now I know two ways of solving my problem. Your solution seems to have lesse overhead, or is the same with Phlipp's solution? Philipp's way lets me have inputs and outputs in the same scope when I connect signals to the ports in the main.cpp. Which fits my modeling style more. Is there a way to also archieve this with your solution? Without changing if_inputs/-outputs?
  8. I'm trying to use this approach for my problem. I created a header with two classes as you mentioned. Then I inherit them into the module where I want the "port bundle" to be. I get a lot of these Warnings: "Warning: (W505) object already exists: monitor.R_OP_MODE. Latter declaration will be renamed to monitor.R_OP_MODE_0 In file: c:\xx\xx\xx\xx\systemc-2.3.3\src\sysc\kernel\sc_object_manager.cpp:153" And one error, which probably causes the abortion. Error: (E109) complete binding failed: port not bound: port 'monitor.T_PRESET_MANUAL' (sc_inout) In file: c:\xx\xx\xx\xx\systemc-2.3.3\src\sysc\communication\sc_port.cpp:235 A minimal example is provided at the of my post with zipped source files. //interface.h #pragma once #include <systemc.h> // Class is meant to be inherited from, to have all Interface inputs struct if_inputs { // port declaration sc_inout<sc_uint<4> > R_OP_MODE{ "R_OP_MODE" }; sc_inout<sc_uint<8> > R_PRESET_MANUAL{ "R_PRESET_MANUAL" }; }; // Class is meant to be inherited from, to have all Interface outputs struct if_outputs { // port declaration sc_inout<sc_uint<2> > T_BIT{ "T_BIT" }; sc_inout<sc_uint<4> > T_OP_MODE{ "T_OP_MODE" }; sc_inout<sc_uint<8> > T_PRESET_MANUAL{ "T_PRESET_MANUAL" }; }; //A.h #pragma once #include <systemc.h> #include "interface.h" class A : public sc_module, public if_inputs, public if_outputs { public: public: SC_CTOR(A) { //SC_METHOD(T01_SBIT_sig_forward); //sensitive << T01_SBIT_in; } }; //B.h #pragma once #define SC_INCLUDE_DYNAMIC_PROCESSES //for sc_spawn #include <systemc.h> #include "interface.h" #include <functional> class B : public sc_module, public if_inputs, public if_outputs { public: // port declaration sc_in<bool> POWER_ON{ "POWER_ON" }; // process functionality void B::some_process(); private: std::vector<sc_time> timings{sc_time(3,SC_SEC), sc_time(6,SC_SEC), sc_time(9,SC_SEC) }; public: //constructor SC_CTOR(B) { //register processes SC_THREAD(some_process); sensitive << POWER_ON; } }; //stimulator.h #pragma once #define SC_INCLUDE_DYNAMIC_PROCESSES //for sc_spawn #include <systemc.h> #include "interface.h" struct if_inputs; struct if_outputs; class stimulator: public sc_module, public if_inputs, public if_outputs { public: sc_out<bool> POWER_ON; //processes void stimulator::stimulus_generator(); public: // constructor SC_CTOR(stimulator): // name ports for easier debugging POWER_ON("POWER_ON") { // Register processes SC_THREAD(stimulus_generator); // waits on fifo write_event } }; // monitor.h #pragma once #define SC_INCLUDE_DYNAMIC_PROCESSES //for sc_spawn #include <systemc.h> #include"interface.h" class monitor : public sc_module, public if_inputs, public if_outputs { public: //// port declaration sc_in<bool> POWER_ON; public: class sim: public if_inputs, public if_outputs { }sim; class stub : public if_inputs, public if_outputs { }stub; public: SC_HAS_PROCESS(monitor); //// constructor monitor::monitor(sc_module_name name_); }; //stimulator.cpp #include "stimulator.h" void stimulator::stimulus_generator() { POWER_ON = true; } //source file: blackbox.cpp #include "B.h" void B::some_process() { } //monitor.cpp #include "monitor.h" monitor::monitor(sc_module_name name_) :sc_module(name_) { } // main.cpp #pragma once #include <systemc.h> #include "B.h" #include "A.h" #include "stimulator.h" #include "monitor.h" int sc_main(int argc, char** argv) { // Set some SystemC time parameters (maybe not necessarily needed). sc_set_time_resolution(1.0, SC_US); // signal declaration sc_signal<bool > POWER_ON{ "POWER_ON" }; sc_signal<sc_uint<2>, SC_MANY_WRITERS> T_BIT_sim{"T_BIT_sim"}; sc_signal<sc_uint<2>, SC_MANY_WRITERS> T_BIT_stub{"T_BIT_stub"}; sc_signal<sc_uint<4>, SC_MANY_WRITERS> T_OP_MODE_sim{ "T_OP_MODE_sim" }; sc_signal<sc_uint<4>, SC_MANY_WRITERS> T_OP_MODE_stub{ "T_OP_MODE_stub" }; sc_signal<sc_uint<8>, SC_MANY_WRITERS> T_PRESET_MANUAL_sim{ "T_PRESET_MANUAL_sim" }; sc_signal<sc_uint<8>, SC_MANY_WRITERS> T_PRESET_MANUAL_stub{ "T_PRESET_MANUAL_stub" }; sc_signal<sc_uint<4>, SC_MANY_WRITERS> R_OP_MODE_sim{ "R_OP_MODE_sim" }; sc_signal<sc_uint<4>, SC_MANY_WRITERS> R_OP_MODE_stub{ "R_OP_MODE_stub" }; sc_signal<sc_uint<8>, SC_MANY_WRITERS> R_PRESET_MANUAL_sim{ "R_PRESET_MANUAL_sim" }; sc_signal<sc_uint<8>, SC_MANY_WRITERS> R_PRESET_MANUAL_stub{ "R_PRESET_MANUAL_stub" }; B sim("sim"); sim.POWER_ON(POWER_ON); sim.T_BIT(T_BIT_sim); sim.T_OP_MODE(T_OP_MODE_sim); sim.T_PRESET_MANUAL(T_PRESET_MANUAL_sim); sim.R_OP_MODE(R_OP_MODE_sim); sim.R_PRESET_MANUAL(R_PRESET_MANUAL_sim); A stub("stub"); stub.T_BIT(T_BIT_stub); stub.T_OP_MODE(T_OP_MODE_stub); stub.T_PRESET_MANUAL(T_PRESET_MANUAL_stub); stub.R_OP_MODE(R_OP_MODE_stub); stub.R_PRESET_MANUAL(R_PRESET_MANUAL_stub); monitor mon("monitor"); mon.POWER_ON(POWER_ON); mon.sim.T_BIT(T_BIT_sim); mon.sim.T_OP_MODE(T_OP_MODE_sim); mon.sim.T_PRESET_MANUAL(T_PRESET_MANUAL_sim); mon.sim.R_OP_MODE(R_OP_MODE_sim); mon.sim.R_PRESET_MANUAL(R_PRESET_MANUAL_sim); mon.stub.T_BIT(T_BIT_stub); mon.stub.T_OP_MODE(T_OP_MODE_stub); mon.stub.T_PRESET_MANUAL(T_PRESET_MANUAL_stub); mon.stub.R_OP_MODE(R_OP_MODE_stub); mon.stub.R_PRESET_MANUAL(R_PRESET_MANUAL_stub); sc_start(); return 0; } MinExample.zip
  9. Thank you for the suggestions. In the end I upgraded my project to c++17 and stored lambda functions with a variant as parameter. When I need to create a delayed stimulus I spawn a SC_THREAD function that takes the function pointer, a delay and a variante as parameter. In the spawned function I wait for the delay and then call the function pointer and pass the variant as argument. #pragma once #include <systemc.h> #include <map> typedef std::variant< bool, unsigned int > value_types; typedef std::function< void(value_types) > func_ptr_type; typedef std::map <std::string, func_ptr_type> Map0; class stimulator: public sc_module { public: sc_out<bool> POWER_ON; sc_out<unsigned int> T01_SBIT_mil_stub; private: Map0 dict; public: void stimulator::stimulus_generator() { std::string key0; for(int i=0; i<=1; i++) { if(i==0) key0 = "VOLTAGE"; else key0 = "T01_SBIT_mil_stub"; dict::iterator it0 = dict.find(key0); if (it0 == dict.end()) cout << "Map lookup key not found." << endl; func_ptr_type func = it0->second; value_types argument; if(i==0) argument = true; else argument = 2; sc_time delay = sc_time(10 ,SC_MS); auto temp = sc_bind(&stimulator::delayed_execution, this, func, argument, delay); sc_spawn( temp ); } } private: void stimulator::delayed_execution(func_ptr_type func, value_types value, sc_time delay) { cout << "stimulator::delayed_stimulus" << endl; wait(delay); func(value); } public: SC_CTOR(stimulator): POWER_ON("POWER_ON"), T01_SBIT_mil_stub("T01_SBIT_mil_stub") { dict["VOLTAGE"] = [this](value_types val) { POWER_ON.write(std::get<bool>(val)); }; dict["T01_SBIT_mil_stub"] = [this](value_types val) { T01_SBIT_mil_stub.write(std::get<unsigned int>(val)); }; // runs one time at creation, which is sufficient to demonstrate SC_THREAD(stimulus_generator); } } Thank you fo the help.
  10. Hello Eyck, thank you for the reply. I have read that dynamic_cast will cause a perfomance penalty due to runtime checking things. Since I will be doing this a lot of times I should probably avoid this solution. This seems like a good solution. In the end I only need to write a function for each type of port instead of a function for each port. With this approach I run into a different problem. I tried using c++17 through installing VisualStudio2017, but it did not accept the /std::c++17 build parameter. I will need additional time googling it up and will eventually get there. For now my solution with c++14 would look like this: #pragma once #define SC_INCLUDE_DYNAMIC_PROCESSES //for sc_spawn #include <systemc.h> #include <map> typedef std::map < std::string, std::function<void(sc_time,bool,sc_out<bool>)>> Map0; class stimulator: public sc_module { public: sc_out<bool> POWER_ON; sc_out<sc_uint<2>> T01_SBIT_mil_stub; private: Map0 dict; void delayed_stimulus_bool(sc_time delay, bool value, sc_out<bool> *port) { wait(delay); port->write(value); } void delayed_stimulus_uint2(sc_time delay, sc_uint<2> value, sc_out<sc_uint<2>> *port) { wait(delay); port->write(value); } public: void stimulator::stimulus_generator() { std::string key0; for(int i=0; i<=1; i++) { if(i==0) key0 = "VOLTAGE"; else key0 = "T01_SBIT_mil_stub"; dict::iterator it0 = dict.find(key0); if (it0 == dict.end()) cout << "Map lookup key not found." << endl; if(i==0) sc_spawn( sc_bind(it0->second, this, true, value, &POWER_ON) ); else sc_spawn( sc_bind(it0->second, this, 1, value, &T01_SBIT_mil_stub) ); } } public: SC_CTOR(stimulator): POWER_ON("POWER_ON"), T01_SBIT_mil_stub("T01_SBIT_mil_stub") { dict.insert( std::make_pair("VOLTAGE", this->delayed_stimulus_bool) ); dict.insert( std::make_pair("T01_SBIT_mil_stub", this->delayed_stimulus_uint2) ); // can not add this function pointer because it's type is different SC_THREAD(stimulus_generator); // runs one time at creation, which is sufficient to demonstrate } } How can I add two different method pointers into the same list without using std::variant?
  11. I have an SC_MODULE that contains two types(probably multiple types in the future) of sc_out ports. I want to store a reference(or pointer) of the port in a std::map, so that I can later get the right port through lookup of strings and access the write method of it. Following post helped me understand the topic better but for me it is still unclear how I can achieve my goal. I don't understand how I should cast my stored reference. Small example for showing how I want to use it. #pragma once #include <systemc.h> #include <map> //typedef std::map<std::string, sc_interface*> Map0; //typedef std::map<std::string, sc_object*> Map0; typedef std::map<std::string, (????)*> Map0; // what type should I use since sc_out<T> varies on type T class stimulator: public sc_module { public: sc_out<bool> POWER_ON; sc_out<sc_uint<2>> T01_SBIT_mil_stub; private: Map0 dict; public: void stimulator::stimulus_generator() { std::string key0; for(int i=0; i<=1; i++) { if(i==0) key0 = "VOLTAGE"; else key0 = "T01_SBIT_mil_stub"; dict::iterator it0 = dict.find(key0); if (it0 == dict.end()) cout << "Map lookup key not found." << endl; // How to cast it? Type Erasure? if(i==0) it0->second->write(true); //write method not available else it0->second->write(1); //write method not available } } public: SC_CTOR(stimulator): POWER_ON("POWER_ON"), T01_SBIT_mil_stub("T01_SBIT_mil_stub") { // if type of map is sc_object* use get_parent() instead of get_interface() dict.insert( std::make_pair("VOLTAGE", POWER_ON.get_interface()) ); dict.insert( std::make_pair("T01_SBIT_mil_stub", T01_SBIT_mil_stub.get_interface()) ); SC_THREAD(stimulus_generator); // runs one time at creation, which is sufficient to demonstrate } } Is an sc_object* the best way to do it? If yes how do I cast it back to the right sc_out<T>? I know that I could solve my problem with a different approach, like defining enums and each enum indicates a port and thus I know which port I should write to. But that would involve more lines of code that is not really flexible. I prefer the generic way and would like to understand the SystemC framework better. Thanks for any help or guidance in advance 🙂
  12. I run SystemC in VisualStudio2015. I found this post very helpful, even though it is vor VS2013. https://stackoverflow.com/q/41990606/6574400
  13. After trying out different things by googling the error messages I realized that I build the libs for systemC with the wrong properties. In "systemc-2.3.3/msvc10/SystemC/SystemC.sln" I changed in VisualStudio DEBUG ->Configuration Properties -> Platform: Active(Win32) to Win32 and in my "SystemC_FirstTest.sln Configuration Properties -> C/C++ -> Code Generation -> Runtime Library" to Multi-threaded Debug DLL (/MDd). Now it seems to work.
  14. Hello Forum, I want to get started with a systemC Model Project in Microsoft Visual Studio 2013. So far I have found this stackoverflow question, that gives a step by step guide for how to get started. The answer is related to SystemC-2.3.1a and I thought it might be similar with SystemC-2.3.3. https://stackoverflow.com/questions/41990606/installing-systemc-for-vs2013 I followed the instructions but I got stuck on compiling the Hello World project. I get a lot of Linker errors like (xxx stands for user name) Error 40 error LNK2005: "bool __cdecl std::uncaught_exception(void)" (?uncaught_exception@std@@YA_NXZ) already defined in libcpmtd.lib(uncaught.obj) C:\Users\xxx\Documents\Visual Studio 2013\Projects\SystemC_FirstTest\SystemC_FirstTest\msvcprtd.lib(MSVCP120D.dll) SystemC_FirstTest Error 133 error LNK1169: one or more multiply defined symbols found C:\Users\xxx\Documents\Visual Studio 2013\Projects\SystemC_FirstTest\Debug\SystemC_FirstTest.exe SystemC_FirstTest Error 13 error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in stdafx.obj C:\Users\xxx\Documents\Visual Studio 2013\Projects\SystemC_FirstTest\SystemC_FirstTest\SystemC.lib(sc_prim_channel.obj) SystemC_FirstTest Warning 132 warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library C:\Users\xxx\Documents\Visual Studio 2013\Projects\SystemC_FirstTest\SystemC_FirstTest\LINK SystemC_FirstTest It might be the case that I misused the libraries in my solution and that some short changes will make it run. If I can fix the errors myself I will answer my own question in this thread. If someone could point me in the right direction, or show me a getting started guide that works, I would be thankful for it.
×
×
  • Create New...