Jump to content

Accessing arrays


Recommended Posts

may I know how the ap aray created in build_phase can be accessed later.

 

   uvm_analysis_port #(req_trans) ap_a[];

 

   function void build_phase (uvm_phase phase);

  

    ..

   ..   

    for(int i = 0; i < num_of_agents; i++) begin

      $sformat(inst_name, "req_agent[%0d]", i);

      m_req_agent = req_agent::type_id::create(inst_name, this);

      ap_a = new($sformatf("ap_a[%0d]",i), this);

    end

 

  function void connect_phase (uvm_phase phase);

    for(int i = 0; i < num_of_agents; i++) begin

      m_req_agent.ap_a.connect(this.ap_a);

     end

  endfunction

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