I've tried that the following codes works with VCS.It may help.
first, add the following codes to your testbench:
- string tb_home;
- initial begin
- $value$plusargs ("tb_home=%s",tb_home);
- $readmemb({tb_home,"dat_file.dat"},mem);
- end
复制代码
then, add the following parameter to run your vcs:
- vcs ........... +tb_home=${TB_HOME}
复制代码
now, the ${TB_HOME} is passed to tb_home via $value$plusargs function. |