Modelsim仿真使用教程
最近写了个设计《基于FPGA的汉明码编译码器设计》
之前用QuartusII+modelsim联合仿真,没有出现任何问题,后面在别的电脑上也安装了两个软件,结果QuartusII中无法正常的启动modelsim软件,没有找到很好的解决办法,干脆直接使用modelsim仿真。
激励文件的作用:仿真无疑就是希望它能工作起来,那此时我们就需要从设计的模块外部给他一个激励,让他能够运转起来。如果没有激励文件,程序无法进行仿真。
新建库 打开modelsim:File->New-->library->Create a New Library->输入库名

新建工程 File->New->Project->Create Project->输入工程名 选择工程存放的路径

增加文件到工程中或者新建文件, 弹出Add items to the project界面。如果有文件的话,使用Add Existing File. 如果需要新建文件,点击Create New File.

确保工程中需要的文件全部都有

编译文件 选择文件右键选择编译或者在菜单中选择compile,编译文件成功。

仿真设置 Simulate-->Start Simulation-->选择激励文件,取消到优化选项:Enable Optimization.

仿真结果: 点击运行按钮,出现波形

另一种仿真方式:选择激励文件,右键->Simulate, 同样开始仿真,点击run,运行仿真

之前一直有个疑问:
刚开始新建的库名为worktest,也添加了对应的文件,没想到新建好后work库里面有内容,反而worktest里面是empty,仔细查看work库下面的文件都是worktest下的文件,难道work统一为当前运动的库...
原因:因为我在建工程的对话框时,默认选的库是work,如果我选择了worktest的话,文件都在worktest中,这样就不会有任何问题。

学习让人快乐!!!