Jump to content

uvm_config_db NOT work as expected [UVM1.0p1]

Recommended Posts

In testcase:

  function void build_phase(uvm_phase phase);
    // Enable slaves
    uvm_config_db#(uvm_active_passive_enum)::set(this, "tb_inst", "en_slave*", UVM_PASSIVE);
    uvm_config_db#(uvm_active_passive_enum)::set(this, "tb_inst", "en_slave_cpu_rw1", UVM_ACTIVE);

In tb_top, I have defined en_slave_cpu_rw1,en_slave_cpu_rw2,en_slave_cpu_rw3,en_slave_cpu_rw4

Using above configuation, expected: en_slave_cpu_rw is UVM_ACTIVE, other is UVM_PASSIVE;

But to check the run log file, ALL en_* are UVM_PASSIVE

If codes like this:

    set_config_int("ocp_tb_inst", "en_slave*", UVM_PASSIVE);
    set_config_int("ocp_tb_inst", "en_slave_cpu_rw1", UVM_ACTIVE);

Only the en_slave_cpu_rw1 is UVM_ACTIVE, and others are UVM_PASSIVE.

By the way: In build phase of tb_top, I have used uvm_config_db::get..

If not using them, we can not set en_slave* by group, only one by one.

  virtual function void build_phase(uvm_phase phase);
    void'(uvm_config_db#(uvm_active_passive_enum)::get(this, "", "en_slave_cpu_rw1", en_slave_cpu_rw1));
    void'(uvm_config_db#(uvm_active_passive_enum)::get(this, "", "en_slave_cpu_rw2", en_slave_cpu_rw2));
    void'(uvm_config_db#(uvm_active_passive_enum)::get(this, "", "en_slave_cpu_rw3", en_slave_cpu_rw3));
    void'(uvm_config_db#(uvm_active_passive_enum)::get(this, "", "en_slave_cpu_rw4", en_slave_cpu_rw4));

So I think the UVM code should be improvemented.

Edited by aaron626
Link to comment
Share on other sites


if you use set_config_int, get_config_int or the automatic apply_config_setting (same applies to other numeric types such as _enum) your set() should be uvm_config_db#(uvm_bitstream_t)::set(). note the type "uvm_bitstream_t" instead of your enum.

Link to comment
Share on other sites

There is a bug with using wildcards in the field name with uvm_config_db::get. Wildcards work OK in the pathname, but are not being picked up in the fieldname.

You can still use set_config_int() calls - these are not deprecated in UVM1.0p1.

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.

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