通过 modelsim 仅转储设计的子部分的 VCD
我有一个大型设计,包括一个测试台、一些测试电路和被测电路本身。 我使用 modelsim 来模拟设计,并且想要转储模拟结果。建议我使用以下命令生成转储:
vcd file myvcd1.vcd
vcd add -r /sim_minimips/*
它似乎可以工作,但我想要的是仅为被测电路生成转储。
我尝试使用相同的命令来指定我希望考虑的文件名:
vcd file myvcd2.vcd
vcd add -r /minimips/*
但生成了以下错误:
Error vsim 3561 No object matching minimips
我不明白该错误,并且我不确定即使这是正确的过程隔离一个子部分。
有谁知道该怎么做或知道我在哪里可以获得有关此值更改转储的简单教程?
我附上我的测试台实体:
library IEEE;
use IEEE.std_logic_1164.all;
library std;
use std.textio.all;
library work;
use work.pack_mips.all;
entity sim_minimips is
end;
architecture bench of sim_minimips is
component minimips is
port (
clock : in std_logic;
reset : in std_logic;
ram_req : out std_logic;
ram_adr : out bus32;
ram_r_w : out std_logic;
ram_data : inout bus32;
ram_ack : in std_logic;
it_mat : in std_logic
);
end component;
component ram is
generic (mem_size : natural := 256;
latency : time := 10 ns);
port(
req : in std_logic;
adr : in bus32;
data_inout : inout bus32;
r_w : in std_logic;
ready : out std_logic
);
end component;
component rom is
generic (mem_size : natural := 256;
start : natural := 0;
latency : time := 10 ns);
port(
adr : in bus32;
donnee : out bus32;
ack : out std_logic;
load : in std_logic;
fname : in string
);
end component;
signal clock : std_logic := '0';
signal reset : std_logic;
signal it_mat : std_logic := '0';
-- Connexion with the code memory
signal load : std_logic;
signal fichier : string(1 to 7);
-- Connexion with the Ram
signal ram_req : std_logic;
signal ram_adr : bus32;
signal ram_r_w : std_logic;
signal ram_data : bus32;
signal ram_rdy : std_logic;
begin
U_minimips : minimips port map (
clock => clock,
reset => reset,
ram_req => ram_req,
ram_adr => ram_adr,
ram_r_w => ram_r_w,
ram_data => ram_data,
ram_ack => ram_rdy,
it_mat => it_mat
);
U_ram : ram port map (
req => ram_req,
adr => ram_adr,
data_inout => ram_data,
r_w => ram_r_w,
ready => ram_rdy
);
U_rom : rom port map (
adr => ram_adr,
donnee => ram_data,
ack => ram_rdy,
load => load,
fname => fichier
);
clock <= not clock after 20 ns;
reset <= '0', '1' after 5 ns, '0' after 70 ns;
ram_data <= (others => 'L');
process
variable command : line;
variable nomfichier : string(1 to 3);
begin
write (output, "Enter the filename : ");
readline(input, command);
read(command, nomfichier);
fichier <= nomfichier & ".bin";
load <= '1';
wait;
end process;
-- Memory Mapping
-- 0000 - 00FF ROM
process (ram_adr, ram_r_w, ram_data)
begin -- Emulation of an I/O controller
ram_data <= (others => 'Z');
case ram_adr is
when X"00001000" => -- program an interrupt after 1000ns
it_mat <= '1' after 1000 ns;
ram_rdy <= '1' after 5 ns;
when X"00001001" => -- clear interrupt line on cpu
it_mat <= '0';
ram_data <= X"FFFFFFFF";
ram_rdy <= '1' after 5 ns;
when others => ram_rdy <= 'L';
end case;
end process;
end bench;
干杯, 斯特
I have a big design that includes a test-bench, some testing circuit and the circuit under test itself.
I use modelsim to simulate the design and I want to have a dump of the simulation. I was suggested to generate the dump using the command:
vcd file myvcd1.vcd
vcd add -r /sim_minimips/*
it seams to work but what i would like is to generate the dump only for the circuit under test.
i tried to use the same command in specifying just the name of the file i would like to be taken in consideration:
vcd file myvcd2.vcd
vcd add -r /minimips/*
but the following error was generated:
Error vsim 3561 No object matching minimips
I do not understand the error and i am not sure even if this is the correct procedure to isolate a subpart.
does anyone knows how to do or knows where could i get a decent simply tutorial about this Value Change Dump?
I attach my test bench entity:
library IEEE;
use IEEE.std_logic_1164.all;
library std;
use std.textio.all;
library work;
use work.pack_mips.all;
entity sim_minimips is
end;
architecture bench of sim_minimips is
component minimips is
port (
clock : in std_logic;
reset : in std_logic;
ram_req : out std_logic;
ram_adr : out bus32;
ram_r_w : out std_logic;
ram_data : inout bus32;
ram_ack : in std_logic;
it_mat : in std_logic
);
end component;
component ram is
generic (mem_size : natural := 256;
latency : time := 10 ns);
port(
req : in std_logic;
adr : in bus32;
data_inout : inout bus32;
r_w : in std_logic;
ready : out std_logic
);
end component;
component rom is
generic (mem_size : natural := 256;
start : natural := 0;
latency : time := 10 ns);
port(
adr : in bus32;
donnee : out bus32;
ack : out std_logic;
load : in std_logic;
fname : in string
);
end component;
signal clock : std_logic := '0';
signal reset : std_logic;
signal it_mat : std_logic := '0';
-- Connexion with the code memory
signal load : std_logic;
signal fichier : string(1 to 7);
-- Connexion with the Ram
signal ram_req : std_logic;
signal ram_adr : bus32;
signal ram_r_w : std_logic;
signal ram_data : bus32;
signal ram_rdy : std_logic;
begin
U_minimips : minimips port map (
clock => clock,
reset => reset,
ram_req => ram_req,
ram_adr => ram_adr,
ram_r_w => ram_r_w,
ram_data => ram_data,
ram_ack => ram_rdy,
it_mat => it_mat
);
U_ram : ram port map (
req => ram_req,
adr => ram_adr,
data_inout => ram_data,
r_w => ram_r_w,
ready => ram_rdy
);
U_rom : rom port map (
adr => ram_adr,
donnee => ram_data,
ack => ram_rdy,
load => load,
fname => fichier
);
clock <= not clock after 20 ns;
reset <= '0', '1' after 5 ns, '0' after 70 ns;
ram_data <= (others => 'L');
process
variable command : line;
variable nomfichier : string(1 to 3);
begin
write (output, "Enter the filename : ");
readline(input, command);
read(command, nomfichier);
fichier <= nomfichier & ".bin";
load <= '1';
wait;
end process;
-- Memory Mapping
-- 0000 - 00FF ROM
process (ram_adr, ram_r_w, ram_data)
begin -- Emulation of an I/O controller
ram_data <= (others => 'Z');
case ram_adr is
when X"00001000" => -- program an interrupt after 1000ns
it_mat <= '1' after 1000 ns;
ram_rdy <= '1' after 5 ns;
when X"00001001" => -- clear interrupt line on cpu
it_mat <= '0';
ram_data <= X"FFFFFFFF";
ram_rdy <= '1' after 5 ns;
when others => ram_rdy <= 'L';
end case;
end process;
end bench;
Cheers,
Ste
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
vcd add
的最后一个参数是要添加的信号的设计层次结构路径(使用实例名称)(*
表示所有信号,尽管使用-r
信号,它也会扩展到您指定的层次结构下方的所有设计级别)。因此,如果您的
minimips
使用实例名称i_minimips
在sim_minimips
中实例化,则在(该特定)中添加所有信号的正确方法>minimips
及其可能实例化的任何块是如果您想进一步限制添加到 VCD 的项目,您可以添加一个或多个参数
-in
,-inout
、-out
、-internal
或-ports
,仅选择这些类型的项目。或者省略-r
以不下降到层次结构中 - 常见用法是vcd add -ports /sim_minimips/minimips/*
,它将仅添加设计顶层,适合为多种类型的测试台生成激励。应该注意的是,
vcd add
的工作原理与wave add
类似,即对象规范的格式完全相同。因此,通常将项目添加到 VCD 的最简单方法是将它们添加到 Modelsim UI 中的 Wave,从脚本中复制粘贴命令,然后简单地将wave add
更改为vcd 添加
。此外,文件名在这里并不重要,只有设计本身的结构。例如,如果您有类似的内容:
在本例中,
minimips
实例的路径为/sim_minimips/I_MINIMIPS/
。The last parameter for
vcd add
is the design hierarchy path (using instance names) of the signal(s) you want to add (the*
means all signals, though with the-r
signal it also expands to all levels of the design below the hierarchy you've specified).Thus, if your
minimips
is instantiated withinsim_minimips
using the instance namei_minimips
, the correct way to add all signals in (that particular)minimips
and any blocks it might instantiate isIf you want to restrict the items to add to the VCD a bit further, you could add one or more of the parameters
-in
,-inout
,-out
,-internal
or-ports
, which select only items of these types. Or leave out the-r
to not descend into the hierarchy -- a common usage isvcd add -ports /sim_minimips/minimips/*
which will add only the ports of the design top level, suitable for generating stimulus for many types of test benches.It should be noted that
vcd add
works "just" likewave add
, i.e. the object specification is in exactly the same format. Thus, often the simplest way to add items to a VCD is to add them to a wave in the Modelsim UI, copy-pasting the command from the transcript, and simply changing thewave add
to avcd add
.Also, file names are of no consequence here, only the structure of the design itself. For example, if you have something like:
In this case, the path to your
minimips
instance is/sim_minimips/I_MINIMIPS/
.这个问题的答案已经在上一篇文章中给出了。下面给出了在 Modelsim 中生成 VCD 文件的替代方法,该方法将被 Synopsys 的 Tetramax ATPG 工具接受
我的测试平台(供参考)
The answer to the question is already given in the previous post. Given below is an alternative method to generate the VCD file in Modelsim which will be accepted by Tetramax ATPG tool by Synopsys
My testbench (for reference)