Jump to content

DS1701

Members
  • Content Count

    61
  • Joined

  • Last visited

  • Days Won

    1

DS1701 last won the day on December 14 2018

DS1701 had the most liked content!

About DS1701

  • Rank
    Advanced Member

Recent Profile Visitors

728 profile views
  1. hi @David Black, I posted my code to https://www.edaplayground.com/x/Nn9e Thank you so much
  2. Thank @Eyck and @David Black for your information, I tried with your method by change : sc_event ev_wait => ThreadSafeEvent ev_wait; but It still not work. notify() is called but update() function isn't called. Maybe something wrong. note: If I use ThreadSafeEvent instead of sc_event , I can't using wait(event). Do you have another way? Thanks for your kind words header.h pthread_function.c Source.cpp
  3. Hi all, I'm trying to build source code using pthread and SystemC ( SystemC build as quickThread) Step 1 : Create pthread tmodule->threadID[i] = i; result_code = pthread_create(&tmodule->thread[i], NULL, perform_func, (void*)tmodule); Step 2 : Kick a thread to wait event void wait_thread() { while (1) { wait(ev_wait); //wait(wait_time_val, SC_NS); cout << "@" << sc_time_stamp() << " :: " << "Waiting " << wait_time_val << " second." << endl; resume_thread(); } } In perform_func will call to void wa
  4. Hi all, I got some issue when test memory check (valgrind 3.11.0). ==467== Use of uninitialised value of size 8 ==467== at 0x300B000: ??? (in /lib64/libsystemc-2.3.1.so) ==467== by 0x3000B02: sc_core::wait(…) (in /lib64/libsystemc-2.3.1.so) ==467== by 0x3000C04: sc_core::sc_module::wait(…) (sc_module.h) ==467== by 0x40B0B9A: SAZZ::EndThread() (SAZZ.cpp:813) ==467== by 0x40EB0B1: sc_core::sc_thread_cor_fn (in /lib64/libsystemc-2.3.1.so) ==467== by 0x4139044: ??? (in /lib64/libsystemc-2.3.1.so) ==467== Uninitialized value was created by a stack allocation ==467== at 0x300B000: ??? (in /lib
  5. I have a simple code as bellow: class Tmodel{ private: sc_event notify_method_2; sc_event notify_method_4; public: sc_event notify_method_3; sc_in<bool> input_port; ... SC_METHOD(method_1); dont_initialize(); sensitive << input_port; SC_METHOD(method_2); dont_initialize(); sensitive << notify_method_2; SC_METHOD(method_3); dont_initialize(); sensitive << notify_method_3; SC_METHOD(method_4); dont_initialize(); sensitive << notify_method_4; ... void method_1(void){ ... notify_method_2.notify(
  6. hi @Philipp A Hartmann I get the following message: ==25661== 16 bytes in 1 blocks are possibly lost in loss record 1,400 of 14,166 ==25661== at 0x402B9B4: operator new(unsigned int) (vg_replace_malloc.c:333) ==25661== by 0x40D8AB3: sc_core::sc_port_base::make_sensitive(sc_core::sc_method_process*,sc_core::sc_event_finder*) const (in /usr/lib/i386-linux-gnu/libsystemc-2.3.1.so) ==25661== by 0x40D8C41: sc_core::sc_sensitive::operator<<(sc_core::sc_port_base const&) (in /usr/lib/i386-linux-gnu/libsystemc-2.3.1.so) ==25661== Address 0x5C2BB94 is 32 bytes inside a blo
  7. In my case: I bind directly initiator and target iSocket(tSocket); when target receive transaction, it will copy data to payload unsigned char data[1024]; for (unsigned int i = 0; i < NUM_MAX; i++) { data[i] = i ; } memcpy(trans.get_data_ptr(), &data, length); with length = 128, Initiator read 128 byte from "trans", and I get 0, 1, 2, 3, 4,...127 I think if BUSWIDTH = 32 then I only get 0 ,1 ,2, 3, 0, 0, 0, 0.... It is mean, Initiator can get 128 bytes, in spite of BUSWIDTH= 32, So, I'm not clarify about BUSWIDTH
  8. Hi all, I dont know what is mean using Bus width when declare a socket. eg: model A has an initiator socket : tlm::tlm_initiator_socket<32,tlm::tlm_base_protocol_types,0> iSocket; //BUSWIDTH = 32 model B has a target socket : tlm::tlm_target_socket<32,tlm::tlm_base_protocol_types,0> tSocket; //BUSWIDTH = 32 iSocket will bind with tSocket. when I issue a transaction from model A to model B with trans.set_data_length(128); // 128 > BUSWIDTH I received 128 byte data, What is mean BUSWIDTH when I declare a socket?
  9. Hi all, I have 2 models, model A and model B Model A has an output port out_A (bool) Model B has an input port in_B (bool) when integrate, I will instance 3 objects of Model A, 1 object of Model B //file @connection.cpp ... void initializeENV(){ ... objA_1 = new ModelA("objA_1"); objA_2 = new ModelA("objA_2"); objA_3 = new ModelA("objA_3"); objB = new ModelB("objB"); ... } the value of in_B = objA_1->out_A or objA_2->out_A or objA_3->out_A I think that, if I bind as below . It is wrong. Because of when objA_1->out_A is change then affect to obj_2-&g
  10. Master and Slave use same clock, so I think Slave need only care data_in. class slave : public sc_module { public: sc_in<bool> clk; sc_in<uint32_t> data_in; slave(sc_module_name name):clk("clk"),data_in("data_in"){ SC_HAS_PROCESS(slave); SC_METHOD(run); dont_initialize(); sensitive << data_in; } void run(){ cout<<hex<<data_in.read()<<endl; } ~slave(){ } }; or class slave : public sc_module { public: sc_in<bool> clk; sc_in<uint32_t> data_in; slave
  11. I'm sorry make you confused. Summary: if my test case is: sc_start(2*period,time_unit); while (sc_pending_activity_at_current_time()) { sc_start(SC_ZERO_TIME); } or sc_start(3*period,time_unit); then compare match occur.( is correct) If my test case is: sc_start(2*period,time_unit); then compare match don't occur . I want to my source code detect when time simulate near the over to pending to execute event m_update before over.
  12. i try : void GTimer::end_of_simulation() { while (sc_pending_activity_at_current_time()) { sc_start(SC_ZERO_TIME); } } But It is not true? My problem is the time simulates is over before trigger event. I want to force trigger event before end simulate.
  13. Thanks @Philipp A Hartmann it is OK if I use : sc_start(2*period,time_unit); while( sc_pending_activity_at_current_time() ) sc_start( SC_ZERO_TIME ); But I want to pending in my code. Is it possible?
×
×
  • Create New...