Exporting data in Modelsim??

Discussion in 'VHDL' started by SD, Feb 22, 2005.

  1. SD

    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
     
    SD, Feb 22, 2005
    #1
    1. Advertising

  2. SD

    SD Guest

    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, Feb 22, 2005
    #2
    1. Advertising

  3. "SD" <> 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, Feb 22, 2005
    #3
  4. Kai Harrekilde-Petersen wrote:

    > "SD" <> 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
     
    Tim Hubberstey, Feb 23, 2005
    #4
  5. SD

    newman5382 Guest

    "Kai Harrekilde-Petersen" <> wrote in message
    news:...
    > "SD" <> 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
     
    newman5382, Feb 23, 2005
    #5
  6. Tim Hubberstey <> writes:

    > Kai Harrekilde-Petersen wrote:
    >
    >> "SD" <> 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>
     
    Kai Harrekilde-Petersen, Feb 23, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    1,927
    Alvin Bruney [MVP]
    May 10, 2004
  2. Bernard O'Flynn

    Exporting to Excel with Unicode data

    Bernard O'Flynn, Aug 11, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    6,489
    bmgty
    Aug 22, 2007
  3. Eric Caron

    Exporting data to lotus notes?

    Eric Caron, Sep 14, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    354
    Eric Caron
    Sep 14, 2004
  4. http://www.visual-basic-data-mining.net/forum

    Exporting Datagrid's data to an Excel Sheet.

    http://www.visual-basic-data-mining.net/forum, Oct 25, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    611
    Steve C. Orr [MVP, MCSD]
    Oct 25, 2004
  5. =?Utf-8?B?cG11ZA==?=
    Replies:
    2
    Views:
    1,007
    =?Utf-8?B?cG11ZA==?=
    Jan 10, 2005
Loading...

Share This Page