Command Line Processing

Hello Everyone, i am new to UVM and commandline processing.
SOrry if the question is silly.

I want to enter a value of field called, ‘Number of transaction’ during runtime.
And the value Num_tx is needed in SEQUENCE.
code for SEQUENCE CLASS is as follows:

//////////////////// SEQUENCE CLASS //////////////////////

ifndef SEQUENCE define SEQUENCE
`include"transaction.sv"

class my_sequence extends uvm_sequence#(my_trans);
`uvm_object_utils (my_sequence)
int numtx, arg_values;
my_trans my_t;

function new (string name = “”);
super.new(name);
//numtx = 5;

//*************** LOGIC FOR COMMANDLINE PROCESSING STARTS************
uvm_info(get_type_name(),$psprintf(“Previous Value of Numtx is %0d”,numtx),UVM_NONE)

// if(cmdline_proc.get_arg_values(.match(“+enter_numtx=”),.value(arg_values)))
if(cmdline_proc.get_arg_values(“+enter_numtx=”, arg_values))

	begin
		numtx = arg_values;
	end
			`uvm_info(get_type_name(),$psprintf("Updated Value of Numtx is %0d",numtx),UVM_NONE)

endfunction: new

//*************** LOGIC FOR COMMANDLINE PROCESSING ENDS***************
virtual task body ();
begin
repeat(numtx)
begin

			`uvm_do(my_t)
		end
end

endtask: body

endclass: my_sequence

`endif
///////////// SEQUENCE CLASS ENDS ////////////

I get following error
COMPILATION ERROR: ** Error: sequence.sv(17): The actual (this.arg_values) and formal (values) for a ref must be equivalent types.

OPTIMIZATION ERROR:
** Error: (vopt-7052) test.sv(23): Failed to find ‘cmdline_proc’ in hierarchical name ‘/cmdline_proc/get_arg_value’.
** Error: (vopt-7052) test.sv(23): Failed to find ‘get_arg_value’ in hierarchical name ‘/cmdline_proc/get_arg_value’.

I have included uvm_macros.svh also in TOP MODULE…!

Can anyone please help me on this.

Thank you, in Advance.

In reply to hvgbl:

Sorry the line is:
//*************** LOGIC FOR COMMANDLINE PROCESSING STARTS************
`uvm_info(get_type_name(),$psprintf(“Previous Value of Numtx is %0d”,numtx),UVM_NONE)

In reply to hvgbl:

Which version of Questasim are you using? Your code compiles for me with Questasim 10.3b, but I have not run it.

Also, you shouldn’t `include “transaction.sv” inside your sequence code. Instead, you should have your code organized in packages. Read this article on how to organize your UVM code.

In reply to cgales:

Thank you for your reply.

Well i have 10.2a Questa.

Is it possible to add some libraries and get it done ?
Or any other possible way to ADD RUN TIME AGRUMENT ?
Suppose i want to execute only 15 transaction, or say 25 transaction. So is there any possible way to do so from command line, or else way, WITHOUT going to sequence file and changing the values ?

In reply to hvgbl:

Why do you think that you need to have the ability to change the number of transactions? Why don’t you fix the number of transactions? If you need to improve coverage, re-run the same test with a different random seed? Or perhaps randomize the number of transactions? When you add a command line option to constrain the behavior of your testbench, you are reducing the effectiveness of the Constrained Random Verification methodology.

In reply to cgales:

ok.

Thank you Sir, for your kind reply.
As if i used to do the same in SV Verification Architecture, so thought to do the same in UVM also.
But the over here the constructor is fixed, we can not add a value to the constructor, so thought for the run time argument.

Thank you very much.