I am running a test to compare output data of the system to a set of golden data generated on a text file, but when the test runs to around 2000 frames +, I start getting an error where is says:
warning-Cannot open file
file could not be opened. Too many open files.
I tried to look for a system task in SystemVerilog to see if there is a task that can show all currently open files while the test is running, but I can't seem to find one. Is there a way for this to be done?
I don't think the IEEE Std 1800-2017 offers any way to directly know how many files are currently open.
However, you could look at the integer value returned by $fopen
to see the value of the last file descriptor which was opened. When I open many files, the value increments by one every time a new file is opened. I tried this on 2 simulators.
Keep in mind that there are 2 ways to call $fopen
: multichannel descriptor and file descriptor. They return different values.
Perhaps your simulator has a proprietary way to check for the number of open files. Look through your documentation, or contact the vendor for support.