file - Get memory dump in ModelSim (periodical) -
how can memory dump in modelsim on regular basis?
i know how export memory data. there way write in .do file command export memory info every 1000 ns or every x cycles?
update:
thanks answers. way i'm doing now:
mkdir -p mlog set counter 0 set limit 30 while { true } { run 100 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 in case used run -all before , don't know when simulation stops. vhdl testcase should of course of study have like
assert false study "### end of simulation!" severity failure;
to end simulation (for nicer way see answers below, works)
in case know how long simulation run can utilize 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 can utilize signal indicates end of simulation
signal end_of_sim : std_logic := '0'; ... end_of_sim <= '1'
and in do-file:
when -label end_of_simulation {/end_of_sim == '1'} { echo "end of simulation"; stop ; #quit -f }
it's not brilliant solution problem, help bit.
in tcl while loop can 2 command:
while ... { run 100 ns; mem save -outfile $filename... }
note modelsim file tcl file.
a improve solution add together dump of memory in 'onbreak' function.
onbreak {mem save ...}
whenever break or stop simulation, content of ram saved. still need trigger break simulation. somebody?
file memory dump modelsim
No comments:
Post a Comment