Exporting data in Modelsim??

S

SD

Hi all,

I've implemented a signal processing algorithm in a design. I want to
write a text file (export data) from the simulation results of
Modelsim. That would enable me to compare the Matlab output with the
Modelsim output and I can make a good comparison. I would appreciate if
somebody suggests me a way to do so.

In my testbench I read the input from the text file created by the
Matlab input, in other words I use the same input for both the
environments and now I want to compare the outputs from both the
environment.

Thanks in advance.

SD
 
S

SD

I figured out a way to do it.

1. From the ModelSim console window, select "View" -> "List". A
separate List window will pop up.
2. Go to the waveform view, and select the signals you want to save as
data.
3. Drag and drop the signals into the "List" window, opened in step 1.
4. The left row will be shown as time, the right row as signal status
at that time.
5. From the List window, chose "File" -> "Write List" -> "Tabular" to
save data.

The saved data can now be opened in programs like Microsoft Excel.


Thanks,
SD
 
K

Kai Harrekilde-Petersen

SD said:
I figured out a way to do it.

1. From the ModelSim console window, select "View" -> "List". A
separate List window will pop up.
2. Go to the waveform view, and select the signals you want to save as
data.
3. Drag and drop the signals into the "List" window, opened in step 1.
4. The left row will be shown as time, the right row as signal status
at that time.
5. From the List window, chose "File" -> "Write List" -> "Tabular" to
save data.

The saved data can now be opened in programs like Microsoft Excel.

Why not use the texio functions for writing the data during
simulation? - it should be pretty straightforward, given that you
know how to read in and apply stimulus.

Regards,


Kai
 
T

Tim Hubberstey

Kai said:
Why not use the texio functions for writing the data during
simulation? - it should be pretty straightforward, given that you
know how to read in and apply stimulus.

While that would work, the OP's method has some huge advantages:

1. It requires no coding time. The transcript created by his drag and
drop operations can be very easily edited into a Tcl script (just remove
comment characters from the front of the "add list" lines).

2. It requires little to no debugging, as a consequence of (1).

3. It is extremely easy to modify (drag and drop, then repeat (1).

4. It uses functions built into the simulation engine and (hopefully)
heavily optimized for speed. At the very least, it's running native code
rather than interpreting the compiled VHDL code.

5. If you use "add log" instead of "add list", you can extract the data
(and view waveforms) AFTER the simulation is complete by post-processing
the .wlf file.

No manager worth his salt will ever give you points for "doing it right"
when a near zero cost option provides results almost as good.
 
N

newman5382

Kai Harrekilde-Petersen said:
Why not use the texio functions for writing the data during
simulation? - it should be pretty straightforward, given that you
know how to read in and apply stimulus.

Regards,


Kai

Kai,

In a point-counter-point to another view presented, I used the textio
functions for writing the data during the simulation. This provided a large
reduction in the amount of data that needed to be post processed, and my
customers were very happy. Several designers found lots of bugs very
quickly even after they had finished with there own custom standalone
testing. Your mileage may vary depending on the particulars of the project.

-Newman
 
K

Kai Harrekilde-Petersen

Tim Hubberstey said:
While that would work, the OP's method has some huge advantages:

1. It requires no coding time. The transcript created by his drag and
drop operations can be very easily edited into a Tcl script (just
remove comment characters from the front of the "add list" lines).

2. It requires little to no debugging, as a consequence of (1).

3. It is extremely easy to modify (drag and drop, then repeat (1).

4. It uses functions built into the simulation engine and (hopefully)
heavily optimized for speed. At the very least, it's running native
code rather than interpreting the compiled VHDL code.

5. If you use "add log" instead of "add list", you can extract the
data (and view waveforms) AFTER the simulation is complete by
post-processing the .wlf file.

No manager worth his salt will ever give you points for "doing it
right" when a near zero cost option provides results almost as good.

Almost as good? I beg to disagree. One word: automation.

Sure, if this is a one-off simulation, it's easy to just write out the
data needed manually. But if you run a lot of simulations, and I
certainly do, you want everything scripted and driven by makefiles.
All the way from generating stimulus to checking the simulation output
against the expectations. We even have auto-generated summary webpages
that links everything together, with statistics on number of fatals,
errors, warnings, hung simulations, etc.

Once you've passed the initial hurdle of doing this, you wonder why
you haven't done it before.


Cheers,

Kai
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top