错误:Vhdl Testbench上的未知正式标识符

时间:2014-06-01 23:20:03

标签: vhdl modelsim

编译我的测试平台时出现以下错误:

“未知的正式标识符” _ “”。对于我正在测试的实体的每个输入都会发生这种情况。

这是我的代码:

entity Scoreboard is
    port( BTN: in std_logic_vector(3 downto 0);
        SWITCHES: in std_logic_vector(17 downto 0);
        CLK_50 : in std_logic;
        maxreset: in std_logic;
        Display0: out std_logic_vector(6 downto 0);
        Display1: out std_logic_vector(6 downto 0);
        Display2: out std_logic_vector(6 downto 0);
        Display3: out std_logic_vector(6 downto 0);
        Display4: out std_logic_vector(6 downto 0);
        Display5: out std_logic_vector(6 downto 0);
        Display6: out std_logic_vector(6 downto 0);
        Display7: out std_logic_vector(6 downto 0);
        GREEN: out std_logic_vector(7 downto 0);
        RED: out std_logic_vector(17 downto 0));        

end Scoreboard;

我的测试台:

entity Scoreboard is
end Scoreboard;

architecture Stimulus of Scoreboard is
-- Sinais para ligar as entradas da uut
signal s_BTN: std_logic_vector(3 downto 0);
signal s_SWITCHES: std_logic_vector(17 downto 0);
signal s_CLK_50, s_maxreset: std_logic;

-- Sinal para ligar as saidas da uut
signal s_Display0, s_Display1, s_Display2, s_Display3, s_Display4, s_Display5, s_Display6, s_Display7: std_logic_vector(6 downto 0);
signal s_GREEN: std_logic_vector(7 downto 0);
signal s_RED: std_logic_vector(17 downto 0);


-- Outros 
-- Outros
constant clk_period: time := 20 ns; -- 50MHz

begin
-- Instanciação da UUT --

uut:  entity work.Scoreboard(Shell)
        port map(BTN => s_BTN,
                    SWITCHES => s_SWITCHES,
                    CLK_50 => s_CLK_50,
                    maxreset => s_maxreset,
                    Display0 => s_Display0,
                    Display1 => s_Display1,
                    Display2 => s_Display2,
                    Display3 => s_Display3,
                    Display4 => s_Display4,
                    Display5 => s_Display5,
                    Display6 => s_Display6,
                    Display7 => s_Display7,
                    GREEN => s_GREEN,
                    RED => s_RED);

实体“记分板”不是顶级实体,但在其下面有许多实体。

1 个答案:

答案 0 :(得分:2)

您有两个名为Scoreboard的实体。您称为测试平台的第二个没有端口接口列表。一旦实体声明:

entity Scoreboard is
end Scoreboard;
分析

您不再需要在直接实体实例化语句中引用端口接口声明。

更改测试平台实体的名称(例如Scoreboard_tb)。也在架构声明中。