Export data from Modelsim

D

DW

Guest
Hello,
does anyone know a way of exporting data from Modelsim? I want to pick a
particular buss and save the simulation data in csv format or similar so I
can import into Excel.
Thanks.
 
"DW" <dave_wooff@hotmail.com> writes:

Hello,
does anyone know a way of exporting data from Modelsim? I want to pick a
particular buss and save the simulation data in csv format or similar so I
can import into Excel.
You could try $monitor and insert tabs appropriate positions.

Petter
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
 
On Wed, 19 May 2004 14:20:48 +0100, "DW"
<dave_wooff@hotmail.com> wrote:

does anyone know a way of exporting data from Modelsim? I want to pick a
particular buss and save the simulation data in csv format or similar so I
can import into Excel.
You could log the signal, then use the "examine -time" command in a
Tcl script to read the data out of the waveform log at specified
times. Tcl could easily write out these values as a .csv or
similar file.

However, it would probably be both easier and more elegant to get
Verilog to write out the .csv file for you, using $fdisplay.
That way, you could easily save data per-clock, per-transaction
or on-change. Something like this (in your top-level
test fixture):

initial begin: CSV_Dump
integer csv; -- ID of CSV file
f = $fopen("somefile.csv");
if (!f) begin
$display("Couldn't open CSV file");
$stop;
end
// Wait for reset to go away:
@(negedge reset);
// Assumes there's a signal called "running" in the
// test bench, which is true at the start and goes
// false when simulation is finished
while (running) @(posedge clk or running) begin
$fdisplay(f, "%0d,%0d,%0d", $time, dataIn, dataOut);
end
// ok, simulation is done, close the output file:
$fclose(f);
end // CSV_Dump

Not tested, not carefully proof-read, but I hope you can
see the general idea.
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 
Got the idea and have it working, thanks for the help.
"Jonathan Bromley" <jonathan.bromley@doulos.com> wrote in message
news:vg2na05jmjd9sdn0pvr9jonqf3hgsh8gk2@4ax.com...
On Wed, 19 May 2004 14:20:48 +0100, "DW"
dave_wooff@hotmail.com> wrote:

does anyone know a way of exporting data from Modelsim? I want to pick a
particular buss and save the simulation data in csv format or similar so
I
can import into Excel.

You could log the signal, then use the "examine -time" command in a
Tcl script to read the data out of the waveform log at specified
times. Tcl could easily write out these values as a .csv or
similar file.

However, it would probably be both easier and more elegant to get
Verilog to write out the .csv file for you, using $fdisplay.
That way, you could easily save data per-clock, per-transaction
or on-change. Something like this (in your top-level
test fixture):

initial begin: CSV_Dump
integer csv; -- ID of CSV file
f = $fopen("somefile.csv");
if (!f) begin
$display("Couldn't open CSV file");
$stop;
end
// Wait for reset to go away:
@(negedge reset);
// Assumes there's a signal called "running" in the
// test bench, which is true at the start and goes
// false when simulation is finished
while (running) @(posedge clk or running) begin
$fdisplay(f, "%0d,%0d,%0d", $time, dataIn, dataOut);
end
// ok, simulation is done, close the output file:
$fclose(f);
end // CSV_Dump

Not tested, not carefully proof-read, but I hope you can
see the general idea.
--
Jonathan Bromley, Consultant

DOULOS - Developing Design Know-how
VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services

Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:jonathan.bromley@doulos.com
Fax: +44 (0)1425 471573 Web: http://www.doulos.com

The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.
 

Welcome to EDABoard.com

Sponsor

Back
Top