uvm_rookie Posted August 4, 2011 Report Share Posted August 4, 2011 Is there a way to parameterize an UVM UVC ? The UVC is designed to have a MAX_LANES = 64. For a particular testbench, I want to configure this UVC to only has MAX_LANES=8. The following code doesn't work : class demo_tb extends uvm_env; `uvm_component_utils(demo_tb) bss_uvc_frmbuf_env #(.MAX_LANES(8)) frmbuf_env; function new (string name, uvm_component parent); super.new(name, parent); endfunction : new extern virtual function void build_phase(uvm_phase phase); endclass : demo_tb function void demo_tb::build_phase(uvm_phase phase); super.build_phase(phase); frmbuf_env = bss_uvc_frmbuf_env #(.MAX_LANES(8)) ::type_id::create("frmbuf_env", this); endfunction : build_phase I got the following error : ncelab: *E,TYCMPAT (./examples/demo_tb.sv,74|68): assignment operator type check failed (expecting datatype compatible with 'specialization of class bss_uvc_frmbuf_env' but found 'class bss_uvc_frmbuf_env' instead). ncelab: *F,CUPKGE: Elaboration cannot proceed: design unit 'demo_base_test' uses a SystemVerilog class 'demo_tb' for which an elaboration error occurred. Quote Link to comment Share on other sites More sharing options...
uwes Posted August 5, 2011 Report Share Posted August 5, 2011 hi, i does work the way you started. most likely you just missed a paramterization somewhere. please post the definition of bss_uvc_frmbuf_env. did you register your param class using the *param* version of the macros? /uwe Quote Link to comment Share on other sites More sharing options...
rajatkmr Posted July 10, 2012 Report Share Posted July 10, 2012 Hello, I was facing the same error and then realized that the object which factory was creating did not accept parameters. Parameters in class declaration were used but when factory registration using macro was done there were no parameters used. Thus, when factory created the class objects it could not understand parameters properly. Thank you. Rajat Quote Link to comment Share on other sites More sharing options...
ppinzani Posted July 11, 2012 Report Share Posted July 11, 2012 You could try with the following line in the demo_tb uvm_config_db#(int)::set(this, "*frmbus_env", "MAX_LANES", 8); Quote Link to comment Share on other sites More sharing options...
salil Posted August 23, 2012 Report Share Posted August 23, 2012 You need `uvm_component_param_utils() instead of `uvm_component_utils() to register parameterized classes with the factory. Quote Link to comment Share on other sites More sharing options...
mea1201 Posted August 24, 2012 Report Share Posted August 24, 2012 Specifically, your class definition for bss_uvc_frmbuf_env should look something like this: class bss_uvc_frmbuf_env #(int MAX_LANES = 1) extends uvm_env; `uvm_component_param_utils(bss_uvc_frmbuf_env#(MAX_LANES)) ... endclass : bss_uvc_frmbuf_env You need to be able to register the specialization with the factory, so that you can use the factory create to build the instance of that specialized type. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.