uwes Posted July 9, 2010 Report Share Posted July 9, 2010 (edited) hi, attached is an example showing howto use the end of test facilities in uvm. also included are some examples of messages written after the run phase or really just before the simulator exits. i usually do not call global_stop_request() or $finish directly in order to give other components the time they need to shutdown gracefully. if one requires specific messaging at the end of test usually the phases check() and/or report() are good to use. in case of a very final (after all uvm phasing) message before quit i would suggest a final block. the functions for reporting: uvm_report_(info|warning|error|fatal)(<tag>,<msg>,<severity>) objections: <objection.(raise|drop)_objection(); regards /uwe (the right way to go are objections - as in ovm) // @test: module test10; import uvm_pkg::*; `include "uvm_macros.svh" class lower_comp extends uvm_component; function new(string name, uvm_component parent); super.new(name,parent); endfunction task run; fork repeat(3) #40 uvm_test_done.raise_objection(this); repeat(3) #61 uvm_test_done.drop_objection(this); join endtask endclass class test extends uvm_component; lower_comp tc; `uvm_component_utils(test) function new(string name, uvm_component parent); super.new(name,parent); tc = new("tc", this); endfunction virtual task all_dropped (uvm_objection objection, uvm_object source_obj, string description, int count); uvm_report_info("MSG","message",UVM_NONE); assert(2==2) else uvm_report_error("MSG","some error message",UVM_NONE); endtask function void report(); $display("here we are in the report phase - and simulation has ended"); endfunction endclass initial run_test("test"); // this is really at the end of everything final begin $display("this is really the end of all"); end endmodule Edited July 9, 2010 by uwes Quote Link to comment Share on other sites More sharing options...
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.