Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by VanTeo

  1. I just saw the new features in systemc-2.3.1a, they helped me solve this problem SC_CTHREAD(Fetch, clk.pos()); Fe = sc_get_current_process_handle(); SC_CTHREAD(Decode, clk.pos()); De = sc_get_current_process_handle(); SC_CTHREAD(EvaluateAddress, clk.pos()); Ev = sc_get_current_process_handle(); SC_CTHREAD(FetchOperands, clk.pos()); FeO = sc_get_current_process_handle(); SC_CTHREAD(Execute, clk.pos()); Ex = sc_get_current_process_handle(); SC_CTHREAD(Store, clk.pos()); St = sc_get_current_process_handle(); sc_process_handle Fe; sc_process_handle De; sc_process_handle Ev; sc_process_han
  2. Becasue I am modeling a CPU, I have threads: Fetch, Decode, EvaluateAddress, FetchOperands, Execute, Store. I want to each thread will run in one clock cycle, the Fetch thread will run in first one clock cycle (sensitive by clock posedge) then will suspend and Decode thread will run after (in one clock cycle too), and the next wil be EvaluateAddress, FetchOperands, Execute, Store .... I don't know how to do it. Please help me. Regard, Huy
  3. Hi, I have 6 thread s1, s2, s3 and I want to that these thread each take one clock cycle. Thread s1 is sensitive at first clock posedge and run in one clock cycle, s2 is sensitive at sencond clock posedge and run in one clock cycle, s3 is sensitive at third clock posedge and run in one clock cycle. Regard, VanTeo
  4. Hi, In sc_main function I have a sc_clock and I instance a module A, too. Now inside module A, I want to get period of that sc_clock to delay. Thanks, VanTeo
  5. Hi, I have a module. My module has two port: sc_in_clk SCKi sc_in<sc_bv<12>> RXDi and has a process: SC_THREAD(do_thread) sensitive << RXDi; In sc_main I will do: RXDi.write("111111111111"); Now I want to implement do_thread to data on RXDi will delay in 16-cycles of SCKi. Please help me, thanks, VanTeo
  6. Sorry Philipp, because I'm a beginer so I understand your mind clearly. When I remove SCI_func("sci_func"), it's error error C2512: 'SCI_func' : no appropriate default constructor available Thanks, VanTeo
  7. Hi all, I have a problem with my project Error: (E100) port specified outside of module: port 'RXDi' (sc_port_base) In file: ..\..\src\sysc\communication\sc_port.cpp:231 this is my codes #include "SCI.h" #include "conio.h" int sc_main(int argc,char* argv[]) { SCI SCI_01("SCI_01"); sc_signal<sc_bv<8>> RXDi; SCI_01.RXDi(RXDi); SCI_01.SCI_setting("asynchronous", "external_clock", "7-bit", "parity", "even", "two_stopbit", "1/1", "MSB"); SCI_01.SCI_BitRate(32); //RXDi.write("00000000"); sc_start(); //sc_stop(); getch(); return 0; } #include "SCI_function.h" clas
  8. Hi all, I am a novice in systemC. When I learn about systemC from examples, I find that SC_MODULE will be used for combination logic and SC_THREAD will be used for sequential logic. Why is it? Can you explain to me clearly, please? How do SC_MODULE and SC_THREAD work? Thank you,
  9. Hi all, I have a problem with my assignment. I have "General_Register" class, this class has constructor which will receive arguments: General_Reg(sc_module_name reg_Name_, sc_uint<N> reg_DataDefault_, int reg_BitRangeNum_, string bit_Name_[], int bit_Start_[], int bit_Length_[], int bit_Status_[]): sc_module(reg_Name_), reg_Name(reg_Name_), reg_DataDefault(reg_DataDefault_), reg_BitRangeNum(reg_BitRangeNum_), bit_Name(bit_Name_), bit_Start(bit_Start_), bit_Length(bit_Length_), bit_Status(bit_Status_) I have "Generator_Register" class, too. This class has constructor which will r
  10. Hi Alan, I have declared int d; i want to show the result of tranfering transaction from initiator to target through "d" variable. Kartik Gurlhosur helped me add sc_out<int> dummy_port within Memory and connect memory[0]->dummy_port(d[0]) (Similar to memory[1,2,3]), it ran ok
  11. Hi Kartik Gurlhosur thanks your replay but it's not right c:\users\giahuy\onedrive\tlm\example\routing - copy - copy\routing\routing\main.cpp(44): error C2676: binary '[' : 'sc_core::sc_signal<T>' does not define this operator or a conversion to a type acceptable to the predefined operator 1> with 1> [ 1> T=int 1> ] 1>c:\users\giahuy\onedrive\tlm\example\routing - copy - copy\routing\routing\main.cpp(44): error C2064: term does not evaluate to a function taking 1 arguments 1> 1>Build FAILED. 1> 1>Time Elapsed 00:00:06.
  12. I don't know how to fix this error, help me please #define SC_INCLUDE_DYNAMIC_PROCESSES #include "systemc" using namespace sc_core; using namespace sc_dt; using namespace std; #include "tlm.h" #include "tlm_utils/simple_initiator_socket.h" #include "tlm_utils/simple_target_socket.h" #include "Initiator.h" #include "Router.h" #include "Memory.h" int sc_main(int argc, char* argv[]) { Initiator* initiator; Router<4>* router; Memory* memory[4]; initiator = new Initiator("initiator"); router = new Router<4>("router"); for (int i = 0; i < 4; i++) {
  13. I have an example of systemc which implements "and" function. I have assigned 4 value for input signal but it have implemented only 1 value. help me please! #define SC_INCLUDE_DYNAMIC_PROCESSES #include "systemc" using namespace sc_core; using namespace sc_dt; using namespace std; #include "tlm.h" #include "tlm_utils/simple_initiator_socket.h" #include "tlm_utils/simple_target_socket.h" #include "Initiator.h" #include "Memory.h" #include "Router.h" unsigned int Memory::mem_nr = 0; int sc_main(int argc, char* argv[]) { Initiator* initiator; Router<4>* router; Memory* memor
  14. Hi all, I have a example with systemC. This example is implement and function. I have tried print results out to the monitor, but it seems to be incorrect ( it seems like the "c" variable updates slower than "a" and "b" variable). Help me, please! #define SC_INCLUDE_DYNAMIC_PROCESSES #include "systemc" using namespace sc_core; using namespace sc_dt; using namespace std; #include "tlm.h" #include "tlm_utils/simple_initiator_socket.h" #include "tlm_utils/simple_target_socket.h" #include "Initiator.h" #include "Memory.h" /*struct Top : public sc_module { Initiator *initiator; Me
  15. Hi all, I tried working with "routing" example on https://www.doulos.com/knowhow/systemc/tlm2/tutorial__3/ , but it's fails c:\users\giahuy\dropbox\tlm\tlm-2.0.1\tlm-2009-07-15\include\tlm\tlm_utils\simple_target_socket.h(64): error C3861: 'bind': identifier not found 1> c:\users\giahuy\dropbox\tlm\tlm-2.0.1\tlm-2009-07-15\include\tlm\tlm_utils\simple_target_socket.h(59) : while compiling class template member function 'tlm_utils::simple_target_socket<MODULE>::simple_target_socket(const char *)' 1> with 1> [ 1> MODULE=Memory 1>
  • Create New...