Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by ankitks

  1. ankitks

    customizing sockets

  2. Folks, I have requirement to calculate bandwidth per socket. This means I need to count how many transactions were sent on a given socket, and also pass clock information. Are there any example of customizing socket where I can calculate these things and print of at the end of the simulations.
  3. I create and use lot of instance/tlm specific extensions in my code. I frequently do new/delete on them. Thinking of adding allocator and free method so that I don't have to do frequent delete/new on these objects. My only confusion is that, if I look at code for instance specific extension, it already has pool class called 'instance_specific_extension_container_pool'. Is this class their to manager different extensions and not specific extension that I need to manage? Thanks
  4. seeing this crazy behavior that when I add a 'double m_temp' variable to my class, I end up getting very different behavior where my sc_assert fires. This only happens when I set my optimization flag -O3 with g++. If I remove -O3 and add -g (for debug) to my g++ flag, I go back to my original behavior and everything passes. This doesn't look random, as I can reproduce it. I ran it with valgrind and I don't see any memory leak. ==23030== LEAK SUMMARY: ==23030== definitely lost: 0 bytes in 0 blocks ==23030== indirectly lost: 0 bytes in 0 blocks ==23030== possibly lost: 177,955 bytes in 592 blocks ==23030== still reachable: 3,585,485 bytes in 2,563 blocks ==23030== suppressed: 0 bytes in 0 blocks ==23030== ==23030== For counts of detected and suppressed errors, rerun with: -v ==23030== Use --track-origins=yes to see where uninitialised values come from ==23030== ERROR SUMMARY: 25300 errors from 286 contexts (suppressed: 6 from 6) Not sure what's going on. Any suggestions. Can't seem to run gdb/ddd since adding -g to g++ doesn't reproduce the behavior.
  5. I am looking at MultiSocketSimpleSwitchAT example, and I can't seem to figure out how to implement priority based request selection. For example, in this simple switch, if we get multiple request on a given time, I need a stage where after collecting all the requests I can arbitrate between request in Round Robin manner. In this example, it is just selecting first request that happens to execute. Any suggestion on how can I implement that. Thanks
  6. ankitks

    Priority and PEQ

    It's in Regression library (separate download) at systemc-regressions-2.3.1a/tests/tlm/multi_sockets/MultiSocketSimpleSwitchAT.h:
  7. Ah..that make sense. Missed out on that one. Thanks!
  8. I have a function (nb_trasport_fw) that is been called few times in same cycle ...nb_transport_fw(...) { ... queue.push_back(trans); e.notify() } I also have a thread that's waiting on event 'e'. arbitrate() { wait(e); //do I have all the transactions in my queue. //arbitrate among trasactions in queue. } Basically I need a point where I collect all the transactions and arbitrate among them. I can't really look at single transaction and make a decision. Challenging part is I don't know if function will be called 0,1 or N times. Thanks
  9. ankitks

    Priority and PEQ

    pinging again. Any suggestions?
  10. I have array of target sockets. sc_vector<target_socket_type> m_target_socket; which are bind to tagged nonblocking forward function and here is declaration of the function sync_enum_type my_forward_function(int port_id,...) { m_peq.notify(trans, phase, t); return tlm::TLM_ACCEPTED; } registered callback for peq is peq_cb. Is there a way for my callback to to know port_id? I need to send END_REQ back on same port's backward path, but I need to know id. Thanks
  11. ankitks

    Priority and PEQ

    Any help?
  12. Looks like I can just use tlm_extention and add static counter there. That will work, right?
  13. Is there a way to identify each generic payload transactions with id? I need some id that I can print out as my transaction flows from initiator to target via different modules. Thanks
  14. I couldn't find a fifo that I can attached to socket. Are there any fifo available or do we have to create our own fifo? Thanks
  15. So for my understanding, there are two type of extension. 1. TLM extension: This will be only one type of extension, and extension will be static in the sense that it will be there till we delete the payload. 2. Instance specific extensions: There can be many time of extension, and we are allowed to attach and detach them as we like. Correct?
  16. I created vector of fifos: sc_vector<sc_fifo> fifos; and in my constructor: template <unsigned S> class my_chnl : public my_chnl_if, public sc_channel { sc_vector<sc_fifo> fifos; //vectors of fifos //----------------------------------------------------------- public: //----------------------------------------------------------- //constructor //----------------------------------------------------------- explicit my_chnl(sc_module_name nm, unsigned _size = 4) : sc_channel(nm), fifos("FIFO") { fifos.init(S, _size); } ..... I am getting compile error saying that include/sysc/utils/sc_vector.h:634: error: \u2018c\u2019 cannot be used as a function If I do fifos.init(S), it works, but I get default size of 16. How do I set custom size? Any help? Thanks
  17. ankitks

    passing size value of sc_fifo in sc_vector

    I don't have C++11 features. Can I still go with custom creator approach.
  18. ankitks

    passing size value of sc_fifo in sc_vector

    Hello, _size is not the size of sc_vector which I am already setting by passing S. _size is the size of buffer inside each sc_fifo. sc_fifo constructor takes size argument and I don't know how to pass that argument.