Exporting data in Modelsim??

S

SD

Guest
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
 
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
 
"SD" <sourabh.dhir@gmail.com> writes:

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
--
Kai Harrekilde-Petersen <khp(at)harrekilde(dot)dk>
 
Kai Harrekilde-Petersen wrote:

"SD" <sourabh.dhir@gmail.com> writes:


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.
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.
--
Tim Hubberstey, P.Eng. . . . . . Hardware/Software Consulting Engineer
Marmot Engineering . . . . . . . VHDL, ASICs, FPGAs, embedded systems
Vancouver, BC, Canada . . . . . . . . . . . http://www.marmot-eng.com
 
"Kai Harrekilde-Petersen" <khp@harrekilde.dk> wrote in message
news:uu0o4pbce.fsf@harrekilde.dk...
"SD" <sourabh.dhir@gmail.com> writes:

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
--
Kai Harrekilde-Petersen <khp(at)harrekilde(dot)dk
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
 
Tim Hubberstey <bogus@bogusname.com> writes:

Kai Harrekilde-Petersen wrote:

"SD" <sourabh.dhir@gmail.com> writes:

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.

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
--
Kai Harrekilde-Petersen <khp(at)harrekilde(dot)dk>
 

Welcome to EDABoard.com

Sponsor

Back
Top