• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. OVM: Unable to change objects default configuration

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 66
  • Views 13261
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

OVM: Unable to change objects default configuration

JanP
JanP over 15 years ago

Hi all,

I am just building a verification environment pretty similar to one in the XBUS examble.

I've got problems override a default values of user-configurable variables using configuration interface (set_config_int method).

 

My top level object cmux_tb instatiates enviroment switch_env (an OVC) and configures it:

class cmux_tb extends ovm_env;

  `ovm_component_utils(cmux_tb)
 
  // the Switch environment
  switch_env cmux_env;

  virtual function void build();

    super.build();
   
    set_config_int("cmux_env", "num_inputs", 3);
    set_config_int("cmux_env", "num_outputs", 1);
    set_config_int("cmux_env", "bus_width", 1);
    set_config_int("cmux_env", "ctrl_width", 2);
 
    cmux_env = switch_env::type_id::create("cmux_env", this);

  endfunction : build

...

endclass : cmux_tb

 

The switch_env has defined (and registerred in a Factory) the above mentioned varibles:

class switch_env extends ovm_env;

  // environment properties
  protected int unsigned  num_inputs = 0;
  protected int unsigned  num_outputs = 0;
  protected int unsigned  bus_width = 0;
  protected int unsigned  ctrl_width = 0;

 `ovm_component_utils_begin(switch_env)
    `ovm_field_int(num_inputs, OVM_ALL_ON)
    `ovm_field_int(num_outputs, OVM_ALL_ON)
    `ovm_field_int(bus_width, OVM_ALL_ON)
    `ovm_field_int(ctrl_width, OVM_ALL_ON)
  `ovm_component_utils_end

... 

endclass : switch_env 

When I print the topology after elaboration, I realize, that those varibles remains set to 0. When I use the same approach to object instatiated inside switch_env, the configuration works fine.

Can somebody tell me what I am doing wrong?

Thanks for help,

Jan 

  • Cancel
  • avidane
    avidane over 15 years ago

    Hi Jan, 

    One very common source for these kind of problems is forgetting to place a call to super.build() in the class that you're configuring. Maybe you overrode the build() function in switch_env but didn't call super.build() there?

    Other than that your code looks perfectly fine to me...

    As a side note, I think you'll get much quicker responses at the ovmworld forum. Traffic there is much higher and only OVM related...

     Avidan Efody

     www.specman-verification.com

     

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • JanP
    JanP over 15 years ago

     Hi Avidan,

    YES, that was it. Even if I know this and I checked my code thousand of times before I place my post here, I didn't notice it, 'developers blindness' ;-).

    Thank you very much.

     

    JanP

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information