• 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. How do I instantiate a UVM agent with a monitor, functional...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 66
  • Views 17022
  • 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

How do I instantiate a UVM agent with a monitor, functional coverage and scoreboard in a legacy testbench

Rajat Mitra
Rajat Mitra over 11 years ago

Hello all,

 I have a traditional testbench that instantiates a Stimulus Generator and a DUT. Looks like this

//in module tb.v

module tb; 

driver i_driver(...);

dut i_dut(..); 

endmodule

The stimulus generation occurs within the driver.

I would like to add an UVM Environment with only a Monitor, Scoreboard and Functional Coverage to this testbench. I created a wrapper called "svid_packet_monitor" and instantiated that in the tb. 

module tb; 

driver i_driver(...);

dut i_dut(..);

svid_packet_mon_wrapper i_svid_packet_mon_wrapper();

endmodule 

I am new to the whole UVM thing and am not sure how the code inside the monitor wrapper should look like. I took a first stab at creating a package with the monitor and associated class items and  imported this inside the svid_packet_mon_wrapper. Then I created my_test inside the wrapper that extends uvm_test but I am not sure how to start this up. I am attaching the code for the monitor package and  the monitor wrapper( with questions inside the monitor_wrapper code ). Any help to put this together would be highly appreciated...

Best

Raj 

 

svid_packet_mon_wrapper.pdf
  • Cancel
Parents
  • LaydnerF
    LaydnerF over 8 years ago

    Thanks a lot for your help Tim.

    You were right. I had an error in my scripts, omitting the tc_driver file when "-uvm" option was active. I Fixed it. Now I can instantiate and see both environments running together, the non-uvm systemC and the passive UVM SV.

    I am just having a little problem with the end of simulation. The systemC environment finishes the simulation trough sc_stop() and the UVM environment is unable to run the report_phase after that.

    The way I managed to add both environments to run together on incsim was: I created an uvm test which instatiates an environment with all agents configured to passive (monitors and collectors only). On the run_phase of this test I had to raise an objection, because it was finishing on time zero through UVM. Am I making it right?

    class test_cov_only extends uvm_test
    ...
      task run_phase(uvm_phase phase);
        `uvm_info(get_type_name(), "Starting test", UVM_MEDIUM)
        phase.raise_objection(this);
        //phase.drop_objection(this); // no objection drop to avoid end of test on time zero
      endtask: run_phase
    ...
    endclass

    I know I could probably edit my systemC stimulus routines to comunicate with the SV-UVM passive test environment. I'm trying to avoid that since I hope there is an easier way to accomplish this "sincronization" between the environments. If there is no other way, I will probably leave it like it is now (no uvm report_phase is ran). At least I'm getting the coverage I wanted...

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • LaydnerF
    LaydnerF over 8 years ago

    Thanks a lot for your help Tim.

    You were right. I had an error in my scripts, omitting the tc_driver file when "-uvm" option was active. I Fixed it. Now I can instantiate and see both environments running together, the non-uvm systemC and the passive UVM SV.

    I am just having a little problem with the end of simulation. The systemC environment finishes the simulation trough sc_stop() and the UVM environment is unable to run the report_phase after that.

    The way I managed to add both environments to run together on incsim was: I created an uvm test which instatiates an environment with all agents configured to passive (monitors and collectors only). On the run_phase of this test I had to raise an objection, because it was finishing on time zero through UVM. Am I making it right?

    class test_cov_only extends uvm_test
    ...
      task run_phase(uvm_phase phase);
        `uvm_info(get_type_name(), "Starting test", UVM_MEDIUM)
        phase.raise_objection(this);
        //phase.drop_objection(this); // no objection drop to avoid end of test on time zero
      endtask: run_phase
    ...
    endclass

    I know I could probably edit my systemC stimulus routines to comunicate with the SV-UVM passive test environment. I'm trying to avoid that since I hope there is an easier way to accomplish this "sincronization" between the environments. If there is no other way, I will probably leave it like it is now (no uvm report_phase is ran). At least I'm getting the coverage I wanted...

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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