Jump to content

xiangben

Members
  • Content Count

    5
  • Joined

  • Last visited

  1. Hi janick, Does the "resizing" you mentioned is to declare a maximum size of interface we may use and then assign the interface varibles to a smaller size of interface?
  2. Hi uwes, Do we have any suggested example of parameterized interface with UVM? If there's one, we can follow it.
  3. Hi enchanter, Thanks for providing such a good article. I will try it.
  4. Hi uwes, class il_agent extends uvm_agent; il_driver drv; ..... function void build_phase(uvm_phase phase); super.build_phase(phase); drv = il_driver::type_id::create("drv",this); ... endfunction endclass: il_agent class il_driver extends uvm_driver #(il_pkt); protected virtual il_if#(.EBB_SIZE(5),.DATA_SIZE(32)) vif; ...... function build_phase(uvm_phase phase); super.build_phase(phase); if(!uvm_config_db #(virtual il_if #(.EBB_SIZE(5),.DATA_SIZE(32)))::get(this,"","vif",vif)) ...... endfunction: build_phase ... endclass:il_driver
  5. Hi, I met some problem when I use parameterized interface in UVM 1.1. I don't know where I made the mistake. It reported that "UVM_FATAL @ 0.00ns:uvm_test_top.env.ig_il.drv [NOIVF] virtual interface must be set for: uvm_test_top.env.eg_il.drv.if" If I changed .EBB_SIZE(5),.DATA_SIZE(32) to the default .EBB_SIZE(4),.DATA_SIZE(16), eveything is OK. Could any help to point out where's wrong? Thanks a lot! Following is my code: ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Interface definition in il_if.sv interface il_if #(EBB_SIZE=4, DATA_SIZE=16) (input logic clock); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// //interface instantiation in il_tb.sv il_if #(.EBB_SIZE(5),.DATA_SIZE(32)) drv_if(core_clk); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Virtual interface assignment in il_top.sv initial begin uvm_config_db#(virtual il_if #(.EBB_SIZE(5),.DATA_SIZE(32)))::set(uvm_root::get(),"*drv","vif",il_tb.drv_if); ...... end ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Interface get in il_driver.sv class il_driver extends uvm_driver #(il_pkt); protected virtual il_if #(.EBB_SIZE(5),.DATA_SIZE(32)) vif; ...... function void build phase(uvm_phase phase); super.build_phase(phase); if(!uvm_config_db #(virtual il_if #(.EBB_SIZE(5), .DATA_SIZE(32)))::get(this,"","vif",vif)) `uvm_fatal("NOVIF",{"virtual interface must be set for:",get_full_name(),".vif"}) endfunction: build_phase endclass : il_driver ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Create driver in il_agent.sv class il_agent extends uvm_agent; il_driver drv; ..... function void build_phase(uvm_phase phase); super.build_phase(phase); drv = il_driver::type_id::create("drv",this); ... endfunction endclass: il_agent Best Regards Benben
×
×
  • Create New...