2.1 其中msim目录可以用于modelsim下的仿真,打开下面的readme文件:
hex2dual.c ......... C source code for a program to convert a Intel hex file into a text file
containing binary entries, 8 bit per line.
keil.dua ........... Converted output file from KEIL simulator containing binary data, 8 bit
per line.
keil.hex ........... Output file from KEIL simulator after executing the tc1.asm program.
(Caution: The KEIL software adds a line at the beginning of this file, which
is not needed - it has to be deleted manually before conversion with hex2dual
to have identical files.)
mc8051_compile.do .. Compile script for modelsim.
mc8051_rom.dua ..... Textfile containing the ROM contents for VHDL code simulation.
mc8051_sim.do ...... Simulation script for modelsim.
mc8051_wave.do ..... Wave file for modelsim.
readme.txt ......... This file. Descriptions to ease verification.
regs.log ........... Ouput file after executing the write2gfile.do Tcl script in modelsim.
tc1.asm ............ 8051 assembler program.
tc1.dua ............ Converted 8051 program (can be copied to mc8051_rom.dua).
tc1.hex ............ 8051 program in Intel hex format.
write2file.do ...... Tcl script to write signal values to a text file.
2.2 doc部分有较详细的文档说明,可以作为实际设计过程的参考。
3 开始仿真
3.1打开modelsim,选择File->Change directory…,选择msim目录,如:F:/MC8051/mc8051_design/msim。
3.2 创建work库
选择FileàNewàLibrary…,输入work,点击[ok],确认选择。
3.3 在TransScript中输入:do mc8051_compile.do编译VHDL文件。
3.4在TransScript中输入:do mc8051_sim.do开始仿真调试。
调试和gdb调试基本相似,输入step,单步调试。另外可以点击workspace中的file选项调出需要设置断点的文件,设置完毕后调试。
如图,我在control_fsm_rtl.vhd设置断点