【问题标题】:VHDL alias syntax "<< ... >>"VHDL 别名语法“<< ... >>”
【发布时间】:2013-06-25 00:05:58
【问题描述】:

我想了解下面代码行中使用的语法,其中使用 ALIAS 声明创建了备用名称。具体来说,我想知道&lt;&lt;&gt;&gt; 的含义。一个示例别名语句是,

alias x2_dac_data is
   << signal server.x2_dac_data : std_logic_vector(23 downto 0) >>;

其中server 是一个实例化组件,x2_dac_data 是该组件的信号,但未在端口声明中列出。

我查看了 Pedroni 的文本和课程指南,两者都没有引用与别名相关的 &lt;&lt; ... &gt;&gt; 语法。

谢谢

【问题讨论】:

    标签: syntax alias vhdl


    【解决方案1】:

    双小于和双大字符(>)包含一个外部名称,它是通过设计模型层次结构的对象(例如信号、常量、变量)的路径名称。预期用途是用于设计验证,允许测试台访问在设计顶层不可见的对象。

    参见 Peter Ashenden 和 Jim Lewis The Designer's Guide to VHDL(第 3 版),第 18.1 节 External Names 和 Doulos VHDL-2008: Easier to use,分层名称,或 IEEE Std 1076-2008, 8.7 External名字。

    The Designer's Guide to VHDL的第 561 页上有一个示例:

    alias duv_data_bus is
     <<signal .tb.duv_rtl.data_bus : std_ulogic_vector(0 to 15)>>;
    

    语法在第 560 页上进行了描述。第 559-562 页在 Google 图书预览中可见。 The Designer's Guide to VHDL 中处理外部名称的示例也可以在同一作者的第 2 章第 2.1 节 VHDL 2008 Just the New Stuff 的外部名称中找到而在没有 EBNF 语法描述的情况下,则更深入地了解了外部名称背后的哲学。不幸的是,这本书的 Google 图书预览没有达到第 2.1 节。 Jim Lewis 正在组织 IEEE VHDL 分析和标准化组 (VASG) 的 P1076 研究组,负责开发 IEEE Std 1076-201X 的下一个修订版。 Peter Ashenden 也是 VHDL 标准化工作的长期贡献者。

    【讨论】:

      【解决方案2】:

      比包中分层信号引用的别名更好的解决方案:使用包在 bfm-procedures 和 testbench 顶层之间共享信号。示例:

      library ieee;
      use ieee.std_logic_1164.all;
      
      --VHDL 2008 with questasim
      package bfm is
      
        signal tb_ii_a : std_logic;
        signal tb_ii_b : std_logic;
        signal tb_oo_c : std_logic;
      
        procedure wiggle;
      end package;
      
      package body bfm is
      
        procedure wiggle;
        begin
          tb_oo_c <= force in '1';
          wait for 10 ns;
          tb_oo_c <= force in '0';
          wait for 10 ns;
          tb_oo_c <= force in tb_ii_a and tb_ii_b;
        end procedure;
      
      end package body;
      
      
      library ieee;
      use ieee.std_logic_1164.all;
      use std.textio.all;
      use std.env.all;
      
      library work;
      use work.bfm.all;
      
      entity tb;
      end tb;
      
      architecture tb_dut1 of tb is
      begin
      
        dut : entity work.dut port map(
          oo_a => tb_ii_a,  -- output of dut input  of tb bfm
          oo_b => tb_ii_b,  -- output of dut input  of tb bfm
          ii_c => tb_oo_c   -- input  of dut output of tb bfm
        );
      
      
      testcase : process
      begin
      
        wiggle;
      
        wait for 100 ns;
        std.env.stop(0);
      end process;
      
      end architecture;
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-11-21
        相关资源
        最近更新 更多