UVM_MAX_QUIT_COUNT

Hi all,

any one can you give example for uvm_max_quit_count?

UVM_MAX_QUIT_COUNT is an argument you can pass to the UVM command line processor.
The syntax is
+UVM_MAX_QUIT_COUNT=
+UVM_MAX_QUIT_COUNT=5 menas the simulation will stop after 5 errors.

In reply to chr_sue:

Hi chr_sue.

Thank you.

In reply to chr_sue:

Hi chr_sue

my code given below

report.sv

class rept extends uvm_component;

	virtual intf vif;
	
	`uvm_component_utils(rept)
	
	tx tx1;

	function new(string name,uvm_component parent);
		super.new(name,parent);
	endfunction

	function void build_phase(uvm_phase phase);
		tx1=tx::type_id::create("tx1",this);

		if (!uvm_config_db#(virtual intf)::get(this,"","intf",vif)) begin
			`uvm_error(get_full_name(),"interface handle is not in config_db");
		end
		$display("REPOTER");
	endfunction

		
		 

	task run();
		
		uvm_report_info(get_full_name(),"Info Message : adcd1,run_phase,",UVM_NONE,`__FILE__,`__LINE__);
		uvm_report_info(get_full_name(),"Info Message : adcd2,run_phase,",UVM_LOW,`__FILE__,`__LINE__);
		uvm_report_info(get_full_name(),"Info Message : adcd3,run_phase,",UVM_MEDIUM,`__FILE__,`__LINE__);
		uvm_report_info(get_full_name(),"Info Message : adcd4,run_phase,",UVM_HIGH,`__FILE__,`__LINE__);
		uvm_report_error(get_full_name(),"Info Message : adcd5,run_phase,",UVM_HIGH,`__FILE__,`__LINE__);
		uvm_report_error(get_full_name(),"Info Message : adcd6,run_phase,",UVM_HIGH,`__FILE__,`__LINE__);
		uvm_report_error(get_full_name(),"Info Message : adcd7,run_phase,",UVM_HIGH,`__FILE__,`__LINE__);
		uvm_report_warning(get_full_name(),"Info Message : adcd8,run_phase,",UVM_NONE,`__FILE__,`__LINE__);
		uvm_report_error(get_full_name(),"Info Message : adcd9,run_phase,",UVM_LOW,`__FILE__,`__LINE__);
		uvm_report_fatal(get_full_name(),"Info Message : adcd10,run_phase,",UVM_MEDIUM,`__FILE__,`__LINE__);
		uvm_report_warning(get_full_name(),"Info Message : adcd11,run_phase,",UVM_HIGH,`__FILE__,`__LINE__);
		//set_quit_count(int quit_count);
		uvm_config_db#(int)::get(this,"", "count", tx1.count);
		uvm_config_db#(int)::get(this,"r2", "count", tx1.count);

		//$display("count=%d",tx1.count);
		tx1.print();
	endtask

	

	
endclass

top.sv

`include"uvm_pkg.sv"
import uvm_pkg::*;
`include"tx.sv"
`include"intf.sv"
`include"report.sv"
module top;
//int file;
UVM_FILE file;
rept r1;
rept r2;
rept r3;
rept r4;
tx tx1;

intf pif();

initial begin
	r1=new("r1",null);
	r2=new("r2",null);
	r3=new("r3",null);
	r4=new("r4",null);
	
end





initial begin
	int UVM_MAX_COUNT=6;

	file=$fopen("log_info9.log","w");
	//fh=$fopen("log_info1.txt","w");
	$fwrite(file);
	uvm_config_db#(virtual intf)::set(uvm_root::get(),"*","intf",pif);
	r1.set_report_verbosity_level(UVM_MEDIUM);
	r2.set_report_verbosity_level(UVM_LOW);
	r3.set_report_verbosity_level(UVM_NONE);
	r4.set_report_verbosity_level(UVM_HIGH);
	uvm_config_db#(int)::set(null,"*" , "count" ,10);
	uvm_config_db#(int)::set(null,"r2*" , "count" ,20);
	r1.set_report_default_file_hier (file);
	r1.set_report_severity_action(UVM_INFO, UVM_DISPLAY+UVM_LOG+UVM_COUNT);
	r2.set_report_default_file_hier (file);
	r2.set_report_severity_action(UVM_INFO, UVM_DISPLAY+UVM_LOG);
	r3.set_report_default_file_hier (file);
	r3.set_report_severity_action(UVM_INFO, UVM_DISPLAY+UVM_LOG);
	r4.set_report_default_file_hier (file);
	r4.set_report_severity_action(UVM_INFO, UVM_DISPLAY+UVM_LOG);
//	r1.set_report_severity_action(UVM_INFO,UVM_NO_ACTION|UVM_EXIT);//done
//	r2.set_report_severity_action(UVM_INFO,UVM_NO_ACTION|UVM_EXIT);//done
//	r2.set_report_severity_action(UVM_INFO,UVM_EXIT|UVM_COUNT);
	//r4.set_report_severity_action(UVM_ERROR, UVM_EXIT|UVM_LOG|UVM_COUNT);
//	r4.set_report_severity_action(UVM_ERROR, UVM_MAX_COUNT|UVM_EXIT);
//	r4.get_quit_count(UVM_ERROR, UVM_MAX_COUNT|UVM_EXIT);


	//r4.set_report_severity_action(UVM_INFO, UVM_STOP|UVM_LOG);
//	r4.set_report_severity_action(UVM_DISPLAY, UVM_STOP|UVM_LOG);
	run_test();
//	$fclose(fh);
	//tx1.print();
	
end
endmodule


intf.sv

interface intf;
endinterface

tx.sv

class tx extends uvm_sequence_item;
	int count=30;

	`uvm_object_utils_begin(tx)
	`uvm_field_int(count,UVM_ALL_ON|UVM_NOPACK)
	`uvm_object_utils_end
endclass

if i am setting +UVM_MAX_QUIT_COUNT=1 means i am getting below output.

UVM_INFO @ 0: reporter [RNTST] Running test …

REPOTER

REPOTER

REPOTER

REPOTER

UVM_INFO report.sv(27) @ 0: r4 [r4] Info Message : adcd1,run_phase,

UVM_INFO report.sv(28) @ 0: r4 [r4] Info Message : adcd2,run_phase,

UVM_INFO report.sv(29) @ 0: r4 [r4] Info Message : adcd3,run_phase,

UVM_INFO report.sv(30) @ 0: r4 [r4] Info Message : adcd4,run_phase,

UVM_ERROR report.sv(31) @ 0: r4 [r4] Info Message : adcd5,run_phase,

UVM_ERROR report.sv(32) @ 0: r4 [r4] Info Message : adcd6,run_phase,

UVM_ERROR report.sv(33) @ 0: r4 [r4] Info Message : adcd7,run_phase,

UVM_WARNING report.sv(34) @ 0: r4 [r4] Info Message : adcd8,run_phase,

UVM_ERROR report.sv(35) @ 0: r4 [r4] Info Message : adcd9,run_phase,

UVM_FATAL report.sv(36) @ 0: r4 [r4] Info Message : adcd10,run_phase,

— UVM Report Summary —

** Report counts by severity

UVM_INFO : 5

UVM_WARNING : 1

UVM_ERROR : 4

UVM_FATAL : 1

** Report counts by id

[RNTST] 1

[r4] 10

** Note: $finish : C:/LOCAL D/Local Disk/UVM_OCT2016/uvm-1.1d/src/base/uvm_report_object.svh(292)

Time: 0 ns Iteration: 33 Region: /uvm_pkg::uvm_task_phase::execute

1

Break in Function uvm_pkg/uvm_report_object::die at C:/LOCAL D/Local Disk/UVM_OCT2016/uvm-1.1d/src/base/uvm_report_object.svh line 292

so output is correct or not?

please tell me. i am learning UVM myself so i cont understand easily.

In reply to yuvi66:

To be honest, what yo are presenting here is not a UVM testbench. It is a SV testbench using UVM constructs.
The key thing is a test is missing.
Your code is even not compiling in my environment.
How do you invoke your simulator and with which arguments?

In reply to chr_sue:

Hi chr_sue,

I will correct mistakes. can you give example coding for severity?

Thank you

In reply to yuvi66:

Please read this article form the UVM Cookbook:
https://verificationacademy.com/cookbook/reporting/verbosity
At the bottom you’ll find a code example.