UVM: referring testcase number in interface

Hi,

I have testcase_num which represents testcase number. I want refer that in interface
How to refer


initial
  begin
   $value$plusargs("testcase_number=%d",testcase_number);
   if($value$plusargs("testcase_number=%d",testcase_number)== 1) begin
   end
 end

that

I am getting this error

Failed to find ‘testcase_number’ in hierarchical name ‘testcase_number’.

can anyone help me in this?

In reply to poonamnlwd:

It would help if you provide a complete example that can be run which demonstrates the issue you are encountering.

Are you declaring testcase_number as a variable somewhere?

This works:


module top();
  int testcase_number;
  initial begin
    if($value$plusargs("testcase_number=%d",testcase_number)) begin
      $display("Running testcase_number %d", testcase_number);
    end
      else $display("+testcase_number not provided");
  end
endmodule

In reply to cgales:

In reply to poonamnlwd:
It would help if you provide a complete example that can be run which demonstrates the issue you are encountering.
Are you declaring testcase_number as a variable somewhere?
This works:


module top();
int testcase_number;
initial begin
if($value$plusargs("testcase_number=%d",testcase_number)) begin
$display("Running testcase_number %d", testcase_number);
end
else $display("+testcase_number not provided");
end
endmodule

I wasnt declaring variable. so getting error. Thank you for your reply