Jump to content

Mark

Members
  • Content Count

    5
  • Joined

  • Last visited

  1. what you saw in first post is called pure virtual class. It's inherited by derived class where sensitivity list is supplied.
  2. I'm forced to use whatever systemC version that comes with latest VCS version(vcs_vP-2019.06-SP2). Here is healer file: #include "systemc.h" #include "tkn.h" #include "cmod_utils.h" #include <cmod_module.h> // from Dierke model #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <math.h> //#include "global.h" //#include "ISP_Utils.h" #include "ltm.h" #include "ltm.HW_MOD_BA.h" #define CTRL LTM_Ctrl<sc_uint<14>, sc_uint<13>, sc_uint<20>, sc_uint<20> > #define TKN MDA3_tkn<sc_int<2>,unsigned int > class ltm_func: public cmod_module<TKN, unsigned int > { public: sc_fifo_in< CTRL> params_in_fifo; CTRL params; hdr_param hdr; unsigned int pxl_out; virtual bool hasBufferSpace(); virtual bool canSendTkn(); virtual void processRcvdTkn(TKN& tkn); virtual void processTknToSend(unsigned int& tkn); virtual void processParams(); SC_CTOR(ltm_func) { numTknsRcvd=0; numTknsSent=0; SC_THREAD(ingress); dont_initialize(); sensitive << tkn_in_fifo.data_written(); SC_THREAD(egress); sensitive << tkn_in_fifo.data_written() << tkn_out_fifo.data_read(); dont_initialize(); //SC_THREAD(params); //sensitive << params_in_fifo.data_written(); } }; ltm_func.cpp #include "ltm_func.h" bool ltm_func::hasBufferSpace() { return true; } bool ltm_func::canSendTkn() { return this->numTknsRcvd > this->numTknsSent; } void ltm_func::processRcvdTkn(TKN& tkn) { unsigned int Y1; ltm_debug debug; cout << "result before is::: " << pxl_out << endl; LTM_HW_func_BA(tkn.data, &hdr, &Y1, &pxl_out, &debug); cout << "result after is::: " << pxl_out << endl; } void ltm_func::processTknToSend(unsigned int& tkn) { tkn = pxl_out; } void ltm_func::processParams() { while(true){ while (! canSendTkn()) { wait(params_in_fifo.data_written_event()); } params_in_fifo.read(params); wait(); } }
  3. I'm new to systemC. My code needs to process some data after reading it from fifo. So I created sc_event tkn_in_fifo_data_written. However compiler produces this error message: Can someone please tell me what's wrong? Also perhaps error message should say something else? template <class T, class M> class cmod_module: public sc_module { public: sc_fifo_in< T > tkn_in_fifo; sc_fifo_out< M > tkn_out_fifo; sc_event tkn_in_fifo_data_written; int numTknsRcvd; int numTknsSent; BAYER_TYPE *bayer_444; //virtual void ingress(); //get tkn in void ingress() { T tkn; while(true) { while(! hasBufferSpace() ) { // do something } tkn_in_fifo.read(tkn); processRcvdTkn(tkn); numTknsRcvd++; cout << name() << " " << numTknsRcvd << " tkns receivedd!" << endl; tkn_in_fifo_data_written.notify(); wait(); } } void egress() { M tkn; cout << name() << " " << numTknsSent << " tkns sent!" << endl; while(true){ while (! canSendTkn()) { cout << "waiting!" <<endl; //wait(tkn_in_fifo.data_written_event()); wait(tkn_in_fifo_data_written); } processTknToSend(tkn); tkn_out_fifo.write(tkn); numTknsSent++; cout << name() << " " << numTknsSent << " tkns sent!" << endl; wait(); } } virtual bool hasBufferSpace() = 0; virtual bool canSendTkn() = 0; virtual void processRcvdTkn(T& tkn) = 0; virtual void processTknToSend(M& tkn) = 0; };
  4. Thanks, I confirm that installation of GNU 6.2 was broken. It is just not something I expected so did not try compiling anything else.
  5. I'm running into issues while installing SystemC using gcc version 6.2 gcc version 5.2.2 goes through fine. Running this command: I'm attaching config.log file. config.log
×
×
  • Create New...