How do I read an environment variable in Verilog/System Verilog?
问题 How do I read an environment variable in Verilog ? (Running on a VCS simulator) I am trying to accomplish File=$fopen("$PATH/FileName","r"); $PATH is an environment variable. 回答1: You can simply use SystemVerilog DPI for getting environment. And because getenv is a standard C library for every POSIX platform, so you do not need to implement your own getenv() equivalent function for the function definition again. Example code in SV. import "DPI-C" function string getenv(input string env_name);