A
ALuPin@web.de
Guest
Hi newsgroup,
working on a VHDL testbench for image processing
I want to instantiate the following component several times:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use std.textio.all;
entity gen_ppm is
port( Clk : in std_logic;
Data : in std_logic_vector(23 downto 0);
DataEnable : in std_logic
);
end gen_ppm;
architecture behavior of gen_ppm is
signal frames_cnt : integer range 0 to 8191;
begin
process(Clk)
file F: TEXT;
variable L: LINE;
variable FNAME : LINE;
variable P3 : string(1 TO 2) := "P3";
variable homepage : string(1 TO 32):= "# http://www.richardrosenman.com";
variable resu_x : string(1 TO 5) := "1920 ";
variable resu_y : string(1 TO 5) := "1200 ";
variable space : string(1 TO 1) := " ";
begin
if falling_edge(Clk) then
...
write(FNAME, string'("./images/images_read/"));
write(FNAME, string'("images_read_"));
write(FNAME, frames_cnt);
write(FNAME, string'(".ppm"));
file_open(F, FNAME.all, write_mode);
write(L, P3);
writeline(F, L);
write(L, homepage);
writeline(F, L);
write(L, resu_x);
write(L, resu_y);
writeline(F, L);
write(L, 255);
...
end if;
end process;
end behavior;
Now for every instance of that component I need to have a different
path,
and a different resolution (resu_x, resu_y)
for example:
"./images/images_read/" with resolution 1920x1200
"./images/images_read_direct/" with resolution 1280x1024
....
How can I pass different strings of different lengths as generics ?
Thank you for your help.
Rgds
Andre
working on a VHDL testbench for image processing
I want to instantiate the following component several times:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use std.textio.all;
entity gen_ppm is
port( Clk : in std_logic;
Data : in std_logic_vector(23 downto 0);
DataEnable : in std_logic
);
end gen_ppm;
architecture behavior of gen_ppm is
signal frames_cnt : integer range 0 to 8191;
begin
process(Clk)
file F: TEXT;
variable L: LINE;
variable FNAME : LINE;
variable P3 : string(1 TO 2) := "P3";
variable homepage : string(1 TO 32):= "# http://www.richardrosenman.com";
variable resu_x : string(1 TO 5) := "1920 ";
variable resu_y : string(1 TO 5) := "1200 ";
variable space : string(1 TO 1) := " ";
begin
if falling_edge(Clk) then
...
write(FNAME, string'("./images/images_read/"));
write(FNAME, string'("images_read_"));
write(FNAME, frames_cnt);
write(FNAME, string'(".ppm"));
file_open(F, FNAME.all, write_mode);
write(L, P3);
writeline(F, L);
write(L, homepage);
writeline(F, L);
write(L, resu_x);
write(L, resu_y);
writeline(F, L);
write(L, 255);
...
end if;
end process;
end behavior;
Now for every instance of that component I need to have a different
path,
and a different resolution (resu_x, resu_y)
for example:
"./images/images_read/" with resolution 1920x1200
"./images/images_read_direct/" with resolution 1280x1024
....
How can I pass different strings of different lengths as generics ?
Thank you for your help.
Rgds
Andre