0

我有一个很大的设计,包括一个测试台、一些测试电路和被测电路本身。我使用 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;

干杯,斯特

4

2 回答 2

5

最后一个参数vcd add是要添加的信号的设计*层次结构路径(使用实例名称)(表示所有信号,尽管使用-r信号它也扩展到您指定的层次结构下的所有设计级别)。

因此,如果您minimips是在sim_minimips使用实例名称中实例化的i_minimips,那么在(特定的)minimips和它可能实例化的任何块中添加所有信号的正确方法是

vcd add -r /sim_minimips/i_minimips/*

如果您想进一步限制添加到 VCD 的项目,您可以添加一个或多个参数-in-inout、或-out,它们仅选择这些类型的项目。或者省略不下降到层次结构 - 一个常见的用法是只添加设计顶层的端口,适用于为多种类型的测试台生成激励。-internal-ports-rvcd add -ports /sim_minimips/minimips/*

应该注意的是,vcd add“就像”一样工作wave add,即对象规范的格式完全相同。因此,将项目添加到 VCD 的最简单方法通常是将它们添加到 Modelsim UI 中的波形,从脚本复制粘贴命令,然后简单地wave addvcd add.

此外,文件名在这里无关紧要,只有设计本身的结构。例如,如果你有类似的东西:

entity sim_minimips is
    port (
        -- ...
    );
end sim_minimips;

entity minimips is
    port (
        -- ...
    );
end minimips;

architecture tb of sim_minimips is
    component minimips
        port (
            -- ...
        );
    end component;
begin
    I_MINIMIPS: minimips
        port map (
            -- ...
        );
end architecture tb;

minimips在这种情况下,您的实例的路径是/sim_minimips/I_MINIMIPS/.

于 2011-08-10T06:08:58.617 回答
0

这个问题的答案在上一篇文章中已经给出。下面给出了在 Modelsim 中生成 VCD 文件的另一种方法,它将被 Synopsys 的 Tetramax ATPG 工具接受

# Simulate the design
vsim -novopt work.mips_tb

# Create the VCD file
vcd dumpports -file mips.vcd /mips_tb/tb/*

我的测试台(供参考)

module mips_tb;
mips_core tb
        (
            clk,rst,cop_dout,
            din,  ins_i,iack_o,cop_addr_o,
            cop_data_o,cop_mem_ctl_o,  addr_o,
            dout,  pc_o,  wr_en_o
        );
...
于 2017-03-06T06:27:52.193 回答