Accessing env variables inside uvm_env

hi,
i want to access env variable inside uvm_env class file. is that possible?

siva_dv

In reply to siva_dv:

If you have a handle to your object, and the variable is not protected, you can access anything in that object. The question in your question is from where to you want to access it from?

In reply to dave_59:

linux env variable

setenv FILENAME “vector.txt”

UVM env class:

fd = $fopen($FILENAME,“r”); // I am trying to access the linux env var inside uvm env.

In reply to siva_dv:

The tool independent way of doing this is to pass the env variable on the simulation command line and use $value$plusargs

string filename;

if ($value$plusargs("FILENAME=%s",filename))
  fd = $fopen(filename,"r");
else 
  $error("file not found");

and then on your linux command line, add +FILENAME=${FILENAME}

Other alternatives exist, but are tool specific.