Altera_Forum
Honored Contributor
11 years agoUsing ModelSim to simulate ROM (hex file initalized)
Hello and thanks for the help
First of all I apologize because I know this is a common issue, I've spent all day today reading forum posts about simulating ROMs and various fixes, but I still can't get this to work right. A lot of solutions seem to be using some "convert_hex2ver utility that isn't even present in my quartus install. I have a simple single port ROM in my design, and it's initialized from a hex file. If I exclude the ROM it simulates fine, when I try to simulate with the ROM, the latches that should be reading from the ROM simply read high impedance 'zzz...' I don't get any errors indicating that modelsim is having trouble finding the hex file, no warnings at all indicating it shouldn't be working. I'm simulating using a script that (pared down) is:
vlib work
vmap work work
vlog -reportprogress 300 -work work {../*.v}
vsim work.Project
restart -force -nowave
add wave Dx1
add wave lagcounter
....
...
add wave ready
add wave data2
force KEY 0000 100ps
force KEY 1111 200ps
force KEY 0000 300ps
force KEY 1111 400 ps
force SW 110111111111111111 500ps
force SW 111111111111111111 600ps
...
force SW 111111111111111111 3800ps
# Run the simulation for 4000ps
run 4000ps
Any thoughts?