Jump to content

Moreshwar Salpekar

  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Moreshwar Salpekar's Achievements


Member (1/2)



  1. Hello, This may have been asked earlier but I cant find it so I am asking again. If it is already asked, please let me know the link I have two possible extensions A and B (for simplicity only). Both are derived from tlm_extension I have a module name MOD (for simplicity again). In this I am checking if extension A is attached or not. I am not checking the extension B in MOD. It is just for tracking purposes. Extension A may or may not be present. Therefore, i am making check like this A *extA; req->get_extension(ext); // tlm::tlm_generic_payload *req is the declaration if (extA == nullptr) { do ActionX } else { do ActionY } Now what is happening is while sending a request to MOD, I attach extension B. There is not extension A attached. Therefore, I think that the check if (extA == nullptr) should return true. However, this is not the case. gdb is showing extA is actually B when doing p *extA. I think this is because both A and B are derived from tlm_extension. Is there anyway, I can do a correct check so that if extension A is not present, it should extA as nullptr especially when A is not present but B is present.? Regards Moreshwar
  2. Hello, I have checked and found this to be true "producer_write_share_sc_fifo() writes multiple messages to sc_fifo1, sc_fifo2 and sc_fifo3. I think I can expect each of method1, method2 and method3 to be called once at least.". I just need a reconfirmation. Regards Moreshwar
  3. Thanks for the clarifications. I will try to check your clarifications in code. I may have some questions after reading the specification with respect to your clarification and my trials. I just wanted a reconfirmation for the following If producer_write_share_sc_fifo() writes to one sc_fifo, then there is one notification irrespective of number of entries written to that sc_fifo If producer_write_share_sc_fifo() writes to more than one sc_fifo, then there will be one notification per sc_fifo assuming there is one method per sc_fifo that is sensitive to the data_written_event() of the sc_fifo. To be clearer with an example: If have 3 sc_fifos: sc_fifo1, sc_fifo2 and sc_fifo3 method1 is sensitive to data_written_event of sc_fifo1 method2 is sensitive to data_written_event of sc_fifo2 method3 is sensitive to data_written_event of sc_fifo3 producer_write_share_sc_fifo() writes multiple messages to sc_fifo1, sc_fifo2 and sc_fifo3. I think I can expect each of method1, method2 and method3 to be called once at least.
  4. Hello, I am learning sc_fifo and I cant find anything on below points. it will be helpful if someone can answer or at least point me where i can get more info. What i have done: 1. I have a sc_fifo shared between producer and consumer the consumer is declared sensitive to sc_fifo data_written_event by using SC_METHOD(consumer_read_shared_sc_fifo) sensitive << shared_sc_fifo.data_written_event() 2. I write 3 entries to shared_sc_fifo within same function producer_write_shared_sc_fifo as follows shared_sc_fifo.write(msg1) shared_sc_fifo.write(msg2) where msg1 and msg 2 are the two messages of struct Message I have defined What noticing is that the function producer_write_shared_sc_fifo returns successfully implying that data is now in shared_sc_fifo My Questions/ Doubts are 1. I am expecting that consumer_read_shared_sc_fifo will be called twice but it is called once even though the available count (value returned by num_available() method) is 2. I think this is because i am writing in the same function. Am I right? 2. I am thinking of calling nb_write() instead of write() as I dont want to block if there is insufficient space . However, I am not sure the behaviour of caller i.e., producer_write_share_sc_fifo() in case space is not available. i know it will return false. What I am not sure is, what should be the behaviour in case nb_write returns false. Do i have to try this nb_write again? 3. When does the delta cycle end for write nb_write Regards Moreshwar
  5. Dear Sir, Thank you for your information. it clears my understanding well. Regards Moreshwar
  6. I want to know if a method can be triggered only when two two signals or ports are high. To be specific, I want my module (Write_Data_out) to output data only when all of the following conditions hold: 1. Clock positive edge is detected 2. Address Valid (AV) signal is low 3. Read (RD) is High. The method (Write_Data_out) must not be triggered otherwise. I cannot find any information or examples to do this. The only way i see this that I declare a method sensitive to clock and in the method, do processing if the AV is low RD is high else return from method the && operator does not support sc_event_finder and << does not support bool (if << operator for sensitive supported boo, i could do something like this clk.posedge()& (!AV.read()) && (RD.read). where AV and RD are sc_in<bool>
  • Create New...