Fabien
Full Member level 1
- Joined
- May 22, 2011
- Messages
- 96
- Helped
- 10
- Reputation
- 20
- Reaction score
- 10
- Trophy points
- 1,288
- Location
- Grenoble
- Activity points
- 2,025
Hi all,
I'm designing a test bench in VHDL-AMS and I would like to write files of the simulation results. It works but I'd like a new file after each new simulation or each different parameter of the simulation.
Is it possible to have un index term in the file name depending on the simulation parameter?
The best thing is to have a pin where the input would be a character or string to be added in the index. I don't know how.
my code is:
=====================================================================
ENTITY VHDL_writer IS
PORT(
SIGNAL clk : IN bit;
SIGNAL bs : IN bit;
TERMINAL s1 : ELECTRICAL -- port for the desire index term
);
END ENTITY VHDL_writer;
BEGIN
PROCESS(clk)
FILE outfile : TEXT;
VARIABLE ligne : LINE;
variable b : character := 'h';
BEGIN
IF clk'event and clk = '1' THEN
file_open(outfile,"/prj/shiva3/users/tf38/my_file" & index & ".txt",APPEND_MODE);
IF bs = '1' THEN
WRITE(ligne,STRING'("1"));
WRITELINE(OUTFILE,ligne);
ELSE
WRITE(ligne,STRING'("0"));
WRITELINE(OUTFILE,ligne);
END IF;
file_close(outfile);
END IF;
END PROCESS;
=====================================================================
Thank you very much for your help!
I'm designing a test bench in VHDL-AMS and I would like to write files of the simulation results. It works but I'd like a new file after each new simulation or each different parameter of the simulation.
Is it possible to have un index term in the file name depending on the simulation parameter?
The best thing is to have a pin where the input would be a character or string to be added in the index. I don't know how.
my code is:
=====================================================================
ENTITY VHDL_writer IS
PORT(
SIGNAL clk : IN bit;
SIGNAL bs : IN bit;
TERMINAL s1 : ELECTRICAL -- port for the desire index term
);
END ENTITY VHDL_writer;
BEGIN
PROCESS(clk)
FILE outfile : TEXT;
VARIABLE ligne : LINE;
variable b : character := 'h';
BEGIN
IF clk'event and clk = '1' THEN
file_open(outfile,"/prj/shiva3/users/tf38/my_file" & index & ".txt",APPEND_MODE);
IF bs = '1' THEN
WRITE(ligne,STRING'("1"));
WRITELINE(OUTFILE,ligne);
ELSE
WRITE(ligne,STRING'("0"));
WRITELINE(OUTFILE,ligne);
END IF;
file_close(outfile);
END IF;
END PROCESS;
=====================================================================
Thank you very much for your help!