Jump to content

liyd

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by liyd

  1. "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.
  2. 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.
×
×
  • Create New...