Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)

Modelsim/TCL problem

Altera_Forum
Honored Contributor II
1,504 Views

Hi! 

 

I'm writing a TCL script to automate simulations in modelsim. When I left work last night, my script worked fine. This morning it causes modelsim to freeze, and I've identified the script that causes it but I can't figure out why. 

 

do "run_$file_name.do" 

onbreak resume  

for {set x $holder} {$x >=0} {incr x -1} { 

run -all 

What I'm trying to do, is loop through the number of tests I want to do, and then return control to the script when they are done. This is one of the SEVERAL methods I have tried to use to return control to the script. All of them involved looping of some sort. Modelsim runs all the simulations just fine, but when it tries to return control to the script, it just freezes. I used a while loop before, using signals from the simulation to trigger the loop to stop, but that doesn't work anymore either. 

 

Any insight would be greatly appreciated! Thank you in advance!
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
791 Views

UPDATE: 

 

I've narrowed down my problem further. The last thing my verilog file does in the simulation is writememh("file.txt", mem, 0, i). If I comment out the writememh my script works fine. I don't understand why this matters, because running the simulation without the scripting works fine.
0 Kudos
Altera_Forum
Honored Contributor II
791 Views

Well, problem solved. For some reason having writememh as the last thing in the verilog code before the $stop command caused the problem. Moving writememh to a different location in the code fixed the problem. Still have no idea why.

0 Kudos
Reply