SharpWeapon
Member level 5
- Joined
- Mar 18, 2014
- Messages
- 89
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 6
- Activity points
- 705
Hello,
I use For-Generate to connect modules. For each index of the For-Generate, I want to write the output to file using the index of the For-Generate:
But I got "write expects 2 arguments" and "Type void is not an array type and cannot be indexed" errors on the line "write(outline, AReal(i));". Is there an easy way to do this?
Thanks!
I use For-Generate to connect modules. For each index of the For-Generate, I want to write the output to file using the index of the For-Generate:
Code:
type arr is array(1 to n) of STD_LOGIC_VECTOR(4 downto 0);
signal AReal: arr;
....
for i in 1 to n generate
...
tofile: process(CLK)
file outFile: text is out "~\result.txt";
variable outline: line;
begin
if(CLK'event and CLK='1') then
if(en='1') then
write(outline, AReal(i));
writeline(outFile, outline);
end if;
end if;
end process;
But I got "write expects 2 arguments" and "Type void is not an array type and cannot be indexed" errors on the line "write(outline, AReal(i));". Is there an easy way to do this?
Thanks!