Jump to content

Is the UVM write_* imp port function by default a static function?


liyd

Recommended Posts

In my TB, I have an array of uvm_agents, whose analysis ports all broadcast to the same write analysis imp port function in the singleton scoreboard. These uvm_agents are of the same type and their analysis port packet is of same type too.

Running into this case, where two agents happen to monitor transactions in the same cycle, and the scoreboard's write_ imp port function gets confused within these two callers.

 

something like below (a typical scoreboard setup with analysis imp port):

`uvm_analysis_imp_decl(_req)

class my_scoreboard extends uvm_scoreboard;

  ...

  uvm_analysis_imp_req #(req_item, my_scoreboard) req_imp_port;

  function void write_req(req_item t);

    int num = t.req_id;

    // printing num

    ...

  endfunction

  ....

endclass


So in my scenario, say agent[0] and agent[1] both see a packet respectively (called T0 and T1), in the same cycle; the write_req function is invoked for T0 and T1 respectively, so 2 times, it seems to get confused on the function's context, and confusing the value of local var 'num' in the two calls.

 

I am trying to use automatic keyword to the write_ imp port function as a solution, but wondering is write_ imp port function generally a static function? Also wondering if there is a better solution.
 

Link to comment
Share on other sites

"No" as in, write imp port functions are not static?? David, can you clarify?

I am aware of the "manual clone on write" practice for the analysis port subscribers (and I do have that in the original code, maybe I shouldn't simplify it out in the code snippet above); regardless, since the agent[0] and agent[1] are separate instances, they have separate instances of monitors and analysis ports, therefore, both analysis ports calling the same write_req imp function should not confuse on their transaction handles.

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