kartikkg

Members
  • Content count

    31
  • Joined

  • Last visited

About kartikkg

  • Rank
    Advanced Member

Recent Profile Visitors

140 profile views
  1. Hi remove the line stafx.h and try using std::cin instead of gets.
  2. Remove the include line stafx.h, as far as the differences are considered between Visual Studio and Linux certain header files will be different between them.
  3. Hi please see sc_fifo for your requirement. sc_fifo provides both blocking & non-blocking calls . Blocking call will wait until a slot is free.
  4. Hi Ziga, Since you are using sc_inout_resolved in both files & since ACK in I2C is a '0' I am assuming you are parking the SDA line to '1' from master.cpp which is getting resolved as '1' , hence you are not getting ACK.
  5. Hi Ziga, Since you are using sc_inout_resolved in both files & since ACK in I2C is a '0' I am assuming you are parking the SDA line to '1' from master.cpp which is getting resolved as '1' , hence you are not getting ACK.
  6. Hi Ziga, How are you connecting the ports b/w those two modules, have you used sc_signal_resolved for connection? Can you provide an mcve code ?
  7. I am suspecting it should be , memory[0]->d(d[0]); Please check it and let me know.
  8. Before the break statement you can change the state HTRANS = new_state.
  9. Can you post the error message ? A cursory glance at the code reveals you trying to access an out-of-bonds bit. ff is 8-bit wide and the for loop goes beyond that.
  10. Are you calling wait from an SC_METHOD? That can cause an runtime error.
  11. Glad that I was of help. You can format the code by first pasting the code here and then selecting the code and clicking on <> present in the options.
  12. Hi it works for me , here is the code // main.cpp #include <systemc> #include "my_module.h" using namespace sc_core; int sc_main(int argc, char* argv[]) { my_module my_module_i("my_module_i"); sc_start(); return 0; } // my_module.h #include <systemc> using namespace sc_core; // my_module.h #ifndef MY_MODULE_H #define MY_MODULE_H #include <systemc> SC_MODULE(my_module) { // this constructor works //SC_CTOR(my_module); // this constructor doesn't work my_module(sc_module_name nm); };//endclass #endif & // my_module.cpp #include <iostream> using std::cout; using std::endl; #include <systemc> #include "my_module.h" using namespace sc_core; SC_HAS_PROCESS(my_module); my_module::my_module(sc_module_name nm) : sc_module(nm) { cout << "Hello world" << endl; } I used g++ costr.cpp my_module.cpp -lsystemc to compile. Can you check this if it works? else can you post your compiler errors?
  13. Hi Hooman, Please see sc_event_or_list for your requirement. An example can be found here https://www.doulos.com/knowhow/systemc/new_standard/
  14. Wait will cause the current sc thread to yield. It's not synthesizable .
  15. Is the public Base also an sc_module?