modelsim10.4仿真错误Error: (vlog-7) Failed to open design unit file "XXXXX" in read mode解决办法

在使用Modelsim10.4进行功能仿真时,遇到路径包含空格导致的仿真错误。本文介绍了错误的具体表现及两种解决方法:一是调整文件路径去除空格;二是使用大括号完整包裹文件路径。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在使用modelsim10.4在进行功能仿真的时候,手动操作下来程序是能正确仿真的。但当我编写do文件来代替手动操作来进行仿真的时候,会出现Error: (vlog-7) Failed to open design unit file "D:/diamond" in read mode。

do文件编写如下:

 

exit -sim
vlib work
vmap work work
vlog D:/diamond projects/cpu_if/src/cpu_if.v
vlog D:/diamond projects/cpu_if/testbeach/test_cpu_if.v
vsim -gui -novopt work.test_cpu_if
add wave -noupdate /test_cpu_if/*
run 4000ns

看了报警信息之后,原来是工程目录中有空格diamond projects,modelsim寻找的目录为diamond,而不是diamond projects;

 

解决办法有二个:

第一:把目录中的空格去掉,修改为diamond_projects

第二:把整个文件的地址用大括号括起来,如下所示

 

vlog {D:/diamond projects/cpu_if/src/cpu_if.v}
vlog {D:/diamond projects/cpu_if/testbeach/test_cpu_if.v}

 

 

 

 

 

Determining the location of the ModelSim executable... Using: E:\intelFPGA\18.1\modelsim_ase\win32aloem To specify a ModelSim executable directory, select: Tools -> Options -> EDA Tool Options Note: if both ModelSim-Altera and ModelSim executables are available, ModelSim-Altera will be used. **** Generating the ModelSim Testbench **** quartus_eda --gen_testbench --tool=modelsim_oem --format=verilog --write_settings_files=off 1 -c 1 --vector_source="E:/intelFPGA/WORK/Waveform.vwf" --testbench_file="E:/intelFPGA/WORK/simulation/qsim/Waveform.vwf.vt" Info: ******************************************************************* Info: Running Quartus Prime EDA Netlist Writer Info: Version 18.1.0 Build 625 09/12/2018 SJ Standard Edition Info: Copyright (C) 2018 Intel Corporation. All rights reserved. Info: Your use of Intel Corporation's design tools, logic functions Info: and other software and tools, and its AMPP partner logic Info: functions, and any output files from any of the foregoing Info: (including device programming or simulation files), and any Info: associated documentation or information are expressly subject Info: to the terms and conditions of the Intel Program License Info: Subscription Agreement, the Intel Quartus Prime License Agreement, Info: the Intel FPGA IP License Agreement, or other applicable license Info: agreement, including, without limitation, that your use is for Info: the sole purpose of programming logic devices manufactured by Info: Intel and sold by Intel or its authorized distributors. Please Info: refer to the applicable agreement for further details. Info: Processing started: Thu May 22 00:35:13 2025 Info: Command: quartus_eda --gen_testbench --tool=modelsim_oem --format=verilog --write_settings_files=off 1 -c 1 --vector_source=E:/intelFPGA/WORK/Waveform.vwf --testbench_file=E:/intelFPGA/WORK/simulation/qsim/Waveform.vwf.vt Warning (18236): Number of processors has not been specified which may cause overloading on shared machines. Set the global assignment NUM_PARALLEL_PROCESSORS in your QSF to an appropriate value for best performance. Completed successfully. Completed successfully. **** Generating the functional simulation netlist **** quartus_eda --write_settings_files=off --simulation --functional=on --flatten_buses=off --tool=modelsim_oem --format=verilog --output_directory="E:/intelFPGA/WORK/simulation/qsim/" 1 -c 1 Info: ******************************************************************* Info: Running Quartus Prime EDA Netlist Writer Info: Version 18.1.0 Build 625 09/12/2018 SJ Standard Edition Info: Copyright (C) 2018 Intel Corporation. All rights reserved. Info: Your use of Intel Corporation's design tools, logic functions Info: and other software and tools, and its AMPP partner logic Info: functions, and any output files from any of the foregoing Info: (including device programming or simulation files), and any Info: associated documentation or information are expressly subject Info: to the terms and conditions of the Intel Program License Info: Subscription Agreement, the Intel Quartus Prime License Agreement, Info: the Intel FPGA IP License Agreement, or other applicable license Info: agreement, including, without limitation, that your use is for Info: the sole purpose of programming logic devices manufactured by Info: Intel and sold by Intel or its authorized distributors. Please Info: refer to the applicable agreement for further details. Info: Processing started: Thu May 22 00:35:14 2025 Info: Command: quartus_eda --write_settings_files=off --simulation=on --functional=on --flatten_buses=off --tool=modelsim_oem --format=verilog --output_directory=E:/intelFPGA/WORK/simulation/qsim/ 1 -c 1 Warning (18236): Number of processors has not been specified which may cause overloading on shared machines. Set the global assignment NUM_PARALLEL_PROCESSORS in your QSF to an appropriate value for best performance. Info (204019): Generated file 1.vo in folder "E:/intelFPGA/WORK/simulation/qsim//" for EDA simulation tool Info: Quartus Prime EDA Netlist Writer was successful. 0 errors, 1 warning Info: Peak virtual memory: 4725 megabytes Info: Processing ended: Thu May 22 00:35:15 2025 Info: Elapsed time: 00:00:01 Info: Total CPU time (on all processors): 00:00:01 Completed successfully. **** Generating the ModelSim .do script **** E:/intelFPGA/WORK/simulation/qsim/1.do generated. Completed successfully. **** Running the ModelSim simulation **** E:/intelFPGA/18.1/modelsim_ase/win32aloem/vsim -c -do 1.do Reading E:/intelFPGA/18.1/modelsim_ase/tcl/vsim/pref.tcl # 10.5b # do 1.do # ** Warning: (vlib-34) Library already exists at "work". # couldn't execute "E:\intelFPGA\18.1\modelsim_ase\win32aloem\vlog": invalid argument # couldn't execute "E:\intelFPGA\18.1\modelsim_ase\win32aloem\vlog": invalid argument # vsim -novopt -c -t 1ps -L cyclonev_ver -L altera_ver -L altera_mf_ver -L 220model_ver -L sgate_ver -L altera_lnsim_ver work.1_vlg_vec_tst # Start time: 00:35:15 on May 22,2025 # ** Error: (vsim-3170) Could not find 'work.1_vlg_vec_tst'. # Searched libraries: # E:/intelFPGA/18.1/modelsim_ase/altera/verilog/cyclonev # E:/intelFPGA/18.1/modelsim_ase/altera/verilog/altera # E:/intelFPGA/18.1/modelsim_ase/altera/verilog/altera_mf # E:/intelFPGA/18.1/modelsim_ase/altera/verilog/220model # E:/intelFPGA/18.1/modelsim_ase/altera/verilog/sgate # E:/intelFPGA/18.1/modelsim_ase/altera/verilog/altera_lnsim # E:/intelFPGA/WORK/simulation/qsim/work # Error loading design Error loading design # End time: 00:35:16 on May 22,2025, Elapsed time: 0:00:01 # Errors: 1, Warnings: 0 Error.
最新发布
05-23
### 错误原因分析 在使用 ModelSim 进行仿真时遇到 `'invalid argument'` 和 `'Could not find work.1_vlg_vec_tst'` 错误,这通常是由于以下几个方面的原因造成的: #### 1. **编译失败或未成功加载设计文件** 如果 Quartus Prime 中的 EDA Netlist Writer 工具未能正确生成网表文件(`.v` 或 `.vo`),或者这些文件未被成功导入到 ModelSim 中,则可能导致 `work.<design_name>` 库中的对象无法找到。此问题也可能源于编译阶段存在语法错误或其他警告信息而未注意到[^3]。 ```bash # 检查是否有任何编译错误 transcript on vlog -reportprogress 300 -work work {path_to_your_design_files/*.v} if {"ERROR" == [catch {vsim -novopt work.top_module} errormsg]} { puts $errormsg } ``` --- #### 2. **库映射不一致** ModelSim 使用的工作库 (`work`) 必须与实际仿真的顶层模块名称相匹配。如果顶层模块名发生变化但未同步更新测试平台 (Testbench),就会触发此类错误。此外,在启动仿真之前需要确认已正确定义了目标库及其对应的路径[^4]。 ```tcl # 设置默认工作目录并重新构建 library set work_dir "./simulation/work" file delete -force -- $work_dir vlib $work_dir vmap work $work_dir ``` --- #### 3. **测试平台缺失或损坏** 错误消息提到的 `_vlg_vec_tst` 表明这是一个由 Quartus 自动生成的向量波形测试文件。假如该文件丢失、损坏或是命名发生了改变却未及时告知工具链,则同样会引起上述异常状况发生[^5]。 --- ### 解决方案建议 针对以上可能成因,可采取如下措施逐一排查解决问题: 1. **验证 Quartus 输出完整性** 确保 Quartus Prime 的 Simulation Settings 下启用了正确的 EDA Tool Options,并且指定的目标仿真器为 ModelSim-Altera 组合模式。之后再次运行全增量综合操作以刷新所有关联资源[^6]。 2. **清理重建工程结构** 删除旧有的临时数据缓存以及中间产物后再尝试重新建立整个项目体系。具体步骤包括但不限于清除既有 libraries 文件夹内容再调用相应初始化指令完成新环境部署[^7]。 3. **修正 Testbench 定义偏差** 手动编辑或通过 GUI 方式重新创建适配当前设计方案的新版 testbench script,特别注意保持其内部引用实体标签同实际 RTL 描述部分完全吻合[^8]。 --- ###
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值