H
hemang
Guest
Hi,
I want to write a vhdl testbench which will write some results to file
at each clock edge. The testbench is generic with a parameter called
number_of_channels. For each channel, I want to write the results to
different file "results_<channel_number>.txt"
The file name can be created dynamically but the file pointer that I
need to use the std.textio functions like writeline cannot be created.
-----------------
process (clk)
type text_file_array is array(0 to number_of_channels -1 ) of text; --
<-- fails in compilation
variable results_file : text_file_array;
....
begin
if clk'event and clk='1' then
for index in 0 to number_of_channels-1 loop
write(results_line,"junk");
writeline(results_file(index), results_line);
end loop;
end if;
end process;
--------------------
It seems that VHDL-93 LRM prevents "Elements of file type in composite
types".
Any idea how I can achieve this? Different package or via procedure
etc?
Thanks
I want to write a vhdl testbench which will write some results to file
at each clock edge. The testbench is generic with a parameter called
number_of_channels. For each channel, I want to write the results to
different file "results_<channel_number>.txt"
The file name can be created dynamically but the file pointer that I
need to use the std.textio functions like writeline cannot be created.
-----------------
process (clk)
type text_file_array is array(0 to number_of_channels -1 ) of text; --
<-- fails in compilation
variable results_file : text_file_array;
....
begin
if clk'event and clk='1' then
for index in 0 to number_of_channels-1 loop
write(results_line,"junk");
writeline(results_file(index), results_line);
end loop;
end if;
end process;
--------------------
It seems that VHDL-93 LRM prevents "Elements of file type in composite
types".
Any idea how I can achieve this? Different package or via procedure
etc?
Thanks