Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by TRANG

  1. TRANG

    Initial value port

    I usually don't use sc_fifo ( only use sc_signal, sc_in, sc_out ). But I don't see any function initialize the value for sc_fifo . Both "write()" and "nb_write()" (sc_fifo) will call to sc_prim_channel::request_update() . So I think , sc_fifo can set value for buffer ( this isn't called initialize the value forbuffer ) Thank you so much!!! @David Black
  2. TRANG

    Initial value port

    Thank @David Black and @Roman Popov Thank you so much!!! But I think that, initialize the value depend on specification model require. Ex: Model A can reset Model B with reset port active with LOW level Then sc_out<bool> resetPort; in the Model A must be set initialize the value for resetPort is 1 on constructor So I think that , Should set initialize the value of port on constructor --> Clearly --> Easy maintain source code / //A.h class A: public sc_module { public: sc_in<bool> clkAPM; sc_out<bool> resetPort; sc_signal<bool> sig; ... ///A.cpp A::A(sc_module_name name) :sc_module(name) // Initializing ,clkAPM("clkAPM") ,resetPort("resetPort") ,sig("sig") {//{{{ /// Initializing resetPort.initialize(true); sig.write(true); SC_METHOD(AMethod); dont_initialize(); sensitive << sig ; ...
  3. TRANG

    Process sensitivity with sc_vector

    I think if use pointer, my code faster and save memory . my project: ///APM.h class APM: public sc_module { public: sc_in<bool> clkAPM; sc_in<bool> *IFA[4]; ... ///APM.cpp APM::APM(sc_module_name name) :sc_module(name) // Initializing ,clkAPM("clkAPM") {//{{{ /// Initializing std::ostringstream port_name; for (unsigned int index = 0; index < 4; index++) { port_name.str(""); port_name << "IFA" << index; IFA[index] = new sc_in<bool>(port_name.str().c_str()); sc_assert(IFA[index] != NULL); } SC_METHOD(AMethod); dont_initialize(); sensitive << (*IFA)[0]; ... I know this it old style code. So, I want to use sc_vector. Thanks.
  4. TRANG

    Process sensitivity with sc_vector

    Thanks @Philipp A Hartmann How to use sc_vector with pointer? sc_vector< sc_in< int> > *in_vec;
  5. TRANG

    Array when declare port for model

    @David Black @Roman Popov Thank for your info. I'm using systemc 2.3.2.
  6. Hi all, I'm a new member, I am training systemc language, I'm not clear how to declare "ports" sc_in<bool> *input; sc_in<bool> *input[5]; sc_in<bool> input[5]; Can you explain how to use in each case? (When ?, how to initialize ?, difference?,....) Thank all.
  7. TRANG

    Array when declare port for model

    I tried above code ,but it's not working , Can you share me docs about "SC_NAMED" ? Thank @Roman Popov
  8. TRANG

    Array when declare port for model

    Thank you so much @Roman Popov
  9. TRANG

    Array when declare port for model

    @David Black Thank you so much !! I see some projects . They use code as bellow: //exxe.h class EXXE { public: sc_in<sc_dt::uint64> *clock[3]; sc_in<bool> *input[5]; EXXE(); ~EXXE(); } //exxe.cpp ///Constructor EXXE::EXXE() { std::ostringstream name; for (unsigned int index = 0; index < 5; index++) { name.str(""); name << "input" << index; input[index] = new sc_in<bool>(name.str().c_str()); } for (unsigned int index = 0; index < 3; index++) { name.str(""); name << "clock" << index; clock[index] = new sc_in<sc_dt::uint64>(name.str().c_str()); } } But you said that: "None of your three attempted examples appear correct,...." Are they incorrect? Thank @David Black
  10. TRANG

    Scope of SC_HAS_PROCESS

    Dear @AmeyaVS I appreciate all of your help . Thanks
  11. TRANG

    Scope of SC_HAS_PROCESS

    Dear @David Black Thanks for your support , I have a question: " Why haven't you never used <systems.h> ?" What is different between <systemc> and <systemc.h> ? Thanks.
  12. TRANG

    A SystemC installl problem on Ubuntu

    refer to : https://stackoverflow.com/questions/38352801/systemc-error-with-the-library
  13. TRANG

    When exactly an event is servicd

    Hi @David Black event.cancel(); event.notify(SC_ZERO_TIME); Can you explain it mean when use cancel() above code ?
  14. Can you explain the difference between sc_spawn and another process (SC_METHOD, SC_THREAD, SC_CTHREAD )? How to use sc_spawn? Thanks all
  15. TRANG

    sc_spawn and anthoer process

    This is it means: sc_spawn can use for function have parameter and SC_* it not. Right or wrong?
  16. Hi @Philipp A Hartmann what is the purpose? Thanks.
  17. Hi , can you explain the diffrence between " eoc.initialize(false) and eoc .write ( false) "?
  18. I don't know what is "argc" and "argv []" , Can you explain about this?And when does it change ? #include "systemc.h" int sc_main (int argc, char* argv[]) { cout<<"Value of argc="<<argc<<endl; cout <<"Value of argc[]="<<hex<<argc<<endl; return 0; }
  19. Could you explain LT ( loosely-timed) and AT(approximately-timed ) thanks
  20. TRANG

    Timing Annotation

    Thanks @Eyck I want to understand clearly in figure 26 above, The initiator sends to target with timing annotation is 10ns, when targets received the request, it is delay 10ns (timing annotation) then the target begin handing request I understand is right or wrong????
  21. TRANG

    Timing Annotation

    @apfitch can you explain timing annotation ??
  22. TRANG

    define sc_main in VS 2017

    @Aaron0127 try this : Project->property->Linker->All Option->Subsystem : Console (/SUBSYSTEM:CONSOLE) Regards, Hook
  23. TRANG

    Changing the width in sc_bv<W>

    In many cases , I cant use "const" I often use : #define or enum{}; you can try : #define WDW_SIZE 2 or enum {WDW_SIZE=2}; Best regards
  24. #define STREAM_REPORT_INFO(MSGID,message_stream) \ do {\ std::ostringstream mout;\ mout << sc_core::sc_time_stamp() << ": " << message_stream;\ SC_REPORT_INFO(MSGID,mout.str().c_str());\ } while (0) Hi All, I dont understand symbol "\" in above code , when I erase symbol "\" then it not working . . why we need "\" in above code , thanks