Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9283769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:42:57+00:00 2026-06-18T18:42:57+00:00

How can I get memory dump in ModelSim on a regular basis? I know

  • 0

How can I get memory dump in ModelSim on a regular basis?

I know how to export memory data. Is there a way to write in the .do file a command to export the memory data every 1000 ns or every x cycles?

Update:

Thanks for the answers.
The way I’m doing it now:

mkdir -p mlog
set counter 0
set limit 30

while { true } {
   run 100 us
  incr counter +1
  mem save -o ./mlog/spram1_${counter}.mem -f mti -data binary -addr hex /ram_tb/spram1/mem
  mem save -o ./mlog/spram2_${counter}.mem -f mti -data binary -addr hex /ram_tb/spram2/mem
  /path/to/third/mem
}

This is in case you used run -all before and you don’t know when the simulation stops.
The VHDL testcase should of course have something like

ASSERT false
    REPORT "### End of Simulation!"
    SEVERITY failure;

to end the simulation (for a nicer way see the answers below, but this works)

In case you know how long the simulation will run you can also use this way:

  mkdir -p mlog
  set counter 0
  set limit 10

  while { $counter < $limit } {
    run 1 ns
    incr counter +1
    mem save -o ./mlog/filename1_${counter}.mem -f mti -data binary -addr hex /path/to/another/mem
    mem save -o ./mlog/filename2_${counter}.mem -f mti -data symbolic -addr hex -wordsperline 1 /path/to/mem
    ## mem save -o ./mlog/anotherfile ...
  }

that can replace “run 10 ns”

alternatively you can use a signal that indicates the end of simulation

  signal end_of_sim   : std_logic := '0';
  ...
  end_of_sim <= '1'

and in the do-file:

  when -label end_of_simulation {/end_of_sim == '1'} {
    echo "End of simulation"; 
    stop ;
    #quit -f
  }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T18:42:58+00:00Added an answer on June 18, 2026 at 6:42 pm

    It’s not a brilliant solution for your problem, but it could help you a bit.

    In a TCL while loop you can do this two command:

    while ... {
        run 100 ns;
        mem save -outfile $filename...
    }
    

    Note that a Modelsim DO file is a TCL file.

    A better solution would be to add the dump of the memory in the ‘onbreak’ function.

    onbreak {mem save ...}
    

    Whenever you break or stop the simulation, the content of the RAM will be saved. Then you still need a trigger to break the simulation. Somebody?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any really low level programming language that can get access the memory
I get a protected memory exception, but how can I know which call caused
how can i get the memory address of the value a pointer points to?
When we can get good speed with OpenGL since it uses texture memory and
How can I get the total physical memory in bytes of my Linux PC?
I'm detecting the insertion of memory cards (removable media). Can I get information about
Just a simple question, but can't get an answer on my own. In memory
I can't seem to get a simple program (with lots of memory access) to
I want to get a heap dump (suspected memory leak) of a certain Java
Can get all triples with value null in specific field? All people with date_of_birth

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.