Jump to content

passing unpacked array to TLM FIFO


Recommended Posts

I have monitor that collects the design output. The output is a variable length data stream. Thus, I used a dynamic array to store the collected data. The scoreboard after the monitor can't process the transaction immediately after the monitor analysis port write to the the scoreboard because it has to wait for something else.

So I need to use something to store the transaction before SB can process it. I tried to put a fifo there. But it didn't work because inside fifo it's a SystemVerilog mailbox that acts as the real fifo and the mailbox can't accept unpacked array.

What is the "best" UVM/TLM way to do this? Is there any alternative structure that I can used instead of tlm fifo?

Link to comment
Share on other sites

Normally, you'd put the array inside a transaction class object. That could be sent over TLM analysis port (uvm_analysis_port) to the scoreboard which might use a analysis fifo (uvm_tlm_analysis_fifo) to store it for later use.

A follow up question.

My understanding is --

TLM1 is pass-by-value (it's slow, I know). But the side benefit from it is that it prevents the receiver from modifying the transaction (intentionally and unintentionally). But when we pass a class object through TLM1, the handle of the object is copied and hence it gives the receiver a chance to modify the transaction content without sender knowing it.

TLM2 is pass-by-reference and it has a mechanism/protocol that the receiver should follow. The receive will notify the sender when it changes the transaction object. People know from the very beginning what they should or should not do with TLM2.

However, it seems that TLM1 does not provide such a mechanism even if sender wants to explicitly specify that the receiver should not modify the transaction object if the handle is passed.

Q1. Is there a way to use something like "const char * ptrToConstChar" in C/C++ to avoid unintentional modification of objects?

Q2. My original question about unpacked array through TLM1 is indeed caused by the fact that mailbox is used in TLM1 fifo implementation. Why is mailbox chosen? Is it possible to use some other container, which can accept unpacked array and any other data type, for the fifo implementation?

My understanding could be wrong. Correct me please.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...