E
Eric
Guest
Hi,
I would to setup a verification methodology in which a device read the
stimuli from a file given a filename and in which the filename can be
changed several time during the simulation (in order to execute several
test scenario one after the other). I encounter some problems in
passing the filename to the device because the VHDL compiler that I use
(modelsim) only accept to pass a fixed length string to the device.
Could someone help me in finding a(n elegant) workaround?
Many thanks.
Eric
-- In the appropriate package
TYPE xl_handler_type IS RECORD
filename : STRING;
END RECORD xl_handler_type;
-- The testbench looks like this.
ENTITY testbench IS
GENERIC(filename: STRING); -- defined via the command-line args
when simulating
END ENTITY testbench;
ARCHITECTURE b OF testbench IS
SIGNAL xl_handler : xl_handler_type;
BEGIN
PROCESS
BEGIN
-- set a filename to be used by the device
WAIT -- for some time
-- set another filename to be used by the device
WAIT -- for some more time
END PROCESS;
duv: device
PORT MAP(xl_handler => xl_handler);
END ARCHITECTURE b;
-- The device looks like this.
ENTITY device IS
PORT(xl_handler : INOUT xl_handler_type);
END ENTITY device;
ARCHITECTURE b OF device IS
BEGIN
main: PROCESS(clk)
BEGIN
-- I open the file whose name is transmitted using xl_handler
.... but how?
END PROCESS main;
END ARCHITECTURE b;
I would to setup a verification methodology in which a device read the
stimuli from a file given a filename and in which the filename can be
changed several time during the simulation (in order to execute several
test scenario one after the other). I encounter some problems in
passing the filename to the device because the VHDL compiler that I use
(modelsim) only accept to pass a fixed length string to the device.
Could someone help me in finding a(n elegant) workaround?
Many thanks.
Eric
-- In the appropriate package
TYPE xl_handler_type IS RECORD
filename : STRING;
END RECORD xl_handler_type;
-- The testbench looks like this.
ENTITY testbench IS
GENERIC(filename: STRING); -- defined via the command-line args
when simulating
END ENTITY testbench;
ARCHITECTURE b OF testbench IS
SIGNAL xl_handler : xl_handler_type;
BEGIN
PROCESS
BEGIN
-- set a filename to be used by the device
WAIT -- for some time
-- set another filename to be used by the device
WAIT -- for some more time
END PROCESS;
duv: device
PORT MAP(xl_handler => xl_handler);
END ARCHITECTURE b;
-- The device looks like this.
ENTITY device IS
PORT(xl_handler : INOUT xl_handler_type);
END ENTITY device;
ARCHITECTURE b OF device IS
BEGIN
main: PROCESS(clk)
BEGIN
-- I open the file whose name is transmitted using xl_handler
.... but how?
END PROCESS main;
END ARCHITECTURE b;