Jump to content
enchanter

factory->print() sometimes does not print instance override

Recommended Posts

When I play around with the factory/basic example from uvm-systemc-1.0-beta1, 

In the original example code, it prints the instance override information as below:

UVM_INFO @ 0 s: reporter [RNTST] Running test ...
UVM_INFO ../../../../src/uvmsc/factory/uvm_default_factory.cpp(1185) @ 0 s: reporter [UVM/FACTORY/PRINT] 
#### Print Factory Configuration (*)

Instance Overrides:

Requested Type  Override Path  Override Type
  --------------  -------------  -------------
  gen             top.e.gen1     mygen
Type Overrides:

  Requested Type  Override Type
  --------------  -------------
  packet          mypacket

All types registered with the factory: 22 total
  Type Name
  ---------
  env
  gen
  mygen
  mypacket
  packet
  reg_rw
  top
(*) Types with no associated type name will be printed as <unknown>

But when I try to comments out the line in factory/basic/top.h (top::build_phase) as below:

        set_inst_override("e.gen1", "gen", "mygen");
        // set_type_override("packet","mypacket");

I expect print factory configuration should still print the instance override but not the type override. But it doesn't print any override.

UVM_INFO @ 0 s: reporter [RNTST] Running test ...
UVM_INFO ../../../../src/uvmsc/factory/uvm_default_factory.cpp(1185) @ 0 s: reporter [UVM/FACTORY/PRINT] 
#### Print Factory Configuration (*)

No instance or type overrides are registered with this factory

All types registered with the factory: 22 total
  Type Name
  ---------
  env
  gen
  mygen
  mypacket
  packet
  reg_rw
  top
(*) Types with no associated type name will be printed as <unknown>

 

Share this post


Link to post
Share on other sites

It seems that a forgotten comment in file src/uvmsc/factory/uvm_default_factory.cpp line 1044 seems to be the culprit. Only printing should be affected. However, we will check within the workgroup if other effects are to be expected. For now, changing

if( !m_type_overrides.size() ) //&& !sorted_override_queues.size() )

to

if( !m_type_overrides.size() && !sorted_override_queues.size() )

should solve your issue.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×