Jump to content

ankitks

Members
  • Content Count

    22
  • Joined

  • Last visited

Posts posted by ankitks


  1. 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


  2. 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.

     


  3. 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


  4. 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


  5. 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

     

     


  6. 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

×
×
  • Create New...