MODELSIM经典教程
12
Institute of Artificial Intelligence and Robotics
Liyong xjtu’soc center
Library browser
GUI) 从主菜单里面: design ->library browser
13
Institute of Artificial Intelligence and Robotics
Liyong xjtu’soc center
工程文件test.mpf
1)当下次再次打开这个工程时, modelsim从mpf文件中读取关于库 的定位、启动文件的定位、 ModelSim其他缺省设定等信息 2)在建立工程时,modelsim从初始 化文件 modelsim.ini中获取各种信 息,包括[Library] [vcom] [vlog] [vsim] [lmc],因此有必要修改 modelsim.ini文件以改变一些缺省 信息。 3)缺省modelsim.ini文件存在 modelsim的安装目录下,为只读 文件。 4)modelsim.ini文件的搜索顺序为 : a)环境变量所指的文件架 b)当前的工作目录 c)modelsim的安装目录
8
Institute of Artificial Intelligence and Robotics
Liyong xjtu’soc center
ModelSim实现方法
• 交互式的命令行 (Cmd)
– 唯一的界面是控制台的命令行, 没有用户界面
• 图形用户界面 (GUI)
– 能接受菜单输入和命令行输入
23
Institute of Artificial Intelligence and Robotics
Liyong xjtu’soc center
工程文件test.mpf(续)
; Maximum iterations that can be run without advancing simulation time IterationLimit = 5000 License = license.dat ; VSIM Startup command ; Startup = do startup.do ; File for saving command transcript TranscriptFile = transcript ; File for saving command history CommandHistory = cmdhist.do. [lmc] ; ModelSim's interface to Logic Modeling's SmartModel SWIFT software libsm = $MODEL_TECH/libsm.sl [project] Project_Version = 1 Cur_Top_DUs = work.test
Institute of Artificial Intelligence and Robotics
ModelSim详解
李永
西安交大SOC设计中心
2004.8
1
Institute of Artificial Intelligence and Robotics
Liyong xjtu’soc center
10
Institute of Artificial Intelligence and Robotics
Liyong xjtu’soc center
1 Ö 建立ModelSim工程
GUI) 从主菜单里面: flie ->new -> project
11
Institute of Artificial Intelligence and Robotics
• Modesim GUI的基本仿真流程 • Modelsim使用中一些问题讨论
1)命令行模式和批处理模式 2)建库 3)vcd 格式文件输出 4)时序仿真 5)PLI函数与debussy支持
• Debussy 工具介绍
Institute of Artificial Intelligence and Robotics
ModelSim 产品
• ModelSim/VHDL 或者 ModelSim/Verilog
– OEM
• ModelSim/LNL
– 许可 Verilog 或者 VHDL,但是不同时许可
• ModelSim/PLUS
– 设计者能立刻混合仿真Verilog 和 VHDL
• ModelSim/SE
– 首要的版本 – PLUS的所有功能连同附加功能
Liyong xjtu’soc center
指定ModelSim 工作库
1)指定工程名 2)指定工程目录 3)指定工作库
库的两个类型 Working (缺省值 work) 包含当前被编译的设计单元 编译前必须建立一个working库 每个编译只允许一个 Resource 包含能被当前编译引用的设计单元 在编译期间允许多个
ModelSim 仿真工具
• 由Model技术公司开发 • 工业上最通用的仿真器之一 • 可在Verilog 和 VHDL仿真
– OEM版本允许Verilog仿真 或者 VHDL 仿真
Institute of Artificial Intelligence and Robotics
Liyong xjtu’soc center
Liyong xjtu’soc center
5 Ö 运行 (run)
• GUI) run -> run –all 也可以通过点击wave窗口的 • 点击wave窗口 停止仿真
18
Institute of Artificial Intelligence and Robotics
Liyong xjtu’soc center
Wave窗口操作
通过在wave窗口可以通过菜单、工具栏和在选中信号后 点右键来完成相应的调试工作。 19
Institute of Artificial Intelligence and Robotics
Liyong xjtu’soc center
Modelsim窗口命令记录
20
Institute of Artificial Intelligence and Robotics
• 批处理模式
– 从DOS或UNIX命令行运Intelligence and Robotics
Liyong xjtu’soc center
GUI 基本仿真步骤
1 Ö 建立工程(同时指定了工作库) 2 Ö 编译源代码 3 Ö 启动仿真器 4 Ö 加入波形 5 Ö 执行仿真
Liyong xjtu’soc center
Model 技术公司的 ModelSim
main主窗口: source源窗口
structure结构窗口 Wave&list 波形和列表窗口
process处理窗口:
Signal&variable信号和变量窗口 dataflow数据流窗口 7
Institute of Artificial Intelligence and Robotics
3
Institute of Artificial Intelligence and Robotics
Liyong xjtu’soc center
Debussy是一个Verilog\VHDL调试工具
• Debussy是一套很好的Verilog\VHDL调试工具,可以帮 助设计者快速理解复杂的设计(设计小组中别人开发 的复杂、不熟悉的代码或者IP),查找和定位设计中 存在的bug,提高效率,缩短产品上市时间。 • Debussy主要有以下几个模块: 1、nTrace:超文本连接方式的源代码追踪及分析 2、nSchema:原理图显示及分析 3、nWave:波形显示及分析 4、nState:有限状态机的显示及分析 5、nCompare:分析仿真结果,比较其相异处
15
Institute of Artificial Intelligence and Robotics
Liyong xjtu’soc center
3 Ö 启动仿真器(load design)
GUI) design -> load design
16
Institute of Artificial Intelligence and Robotics
Liyong xjtu’soc center
保存运行命令
21
Institute of Artificial Intelligence and Robotics
Liyong xjtu’soc center
将命令存储成.do格式,并调用
#test3.do vlog -work work F:/test3/black_stretch.v vlog -work work F:/test3/test.v vsim work.test view signals view structure view wave add wave sim:/test/red_out_w add wave sim:/test/green_out_w add wave sim:/test/blue_out_w run -all
Liyong xjtu’soc center
4 Ö 添加波形
• GUI) view -> structure • GUI) view -> signals • GUI) view -> wave
选择需要显示的module 选择所要显示的信号 将所选择的信号调入波形窗口
17
Institute of Artificial Intelligence and Robotics
Liyong xjtu’soc center