VHDL符合错误测试台ModelSim

问题描述

我目前在ModelSim中进行项目,而Im在编译时遇到了一些麻烦。我想要做的就是将引脚的值从0更改为1,但是在我编译时却说出现错误tool directives are not supported before VHDL 2008。我不知道为什么会这样,一旦我的教授取消了一个示例文件,我就完全像他那样做了。完整代码如下。

-- João Vítor Abrantes - 19/0031085
-- UnB - Engenharia Elétrica 
--
--  - Experimento 2 -
--   Somador Completo

-- Entity 
entity testbench is end;

-- Library
library ieee;
use ieee.std_logic_1164.all;
use std.textio.all;

architecture tb_sum of testbench is
-- Component
component tb_sum1
    port(
        W    : in  std_logic; --A
        X    : in  std_logic; --B
        Y    : in  std_logic; --Cin
        Z    : out std_logic; --S
        Z1   : out std_logic  --Cout
    );
end component;

    signal i_1 : std_logic;
    signal i_2 : std_logic;
    signal i_3 : std_logic; 

Begin

    S1    : tb_sum1 port map ( W => i_1,Y => i_2,X => i_3,Z => open);
    Cout1 : tb_sum1 port map ( W => i_1,Z1 => open);

estimulo: process 

begin 

wait for 5 ns; i_1 <= `1`,-- This is the part that he says the error is
wait for 5 ns; 
wait for 5 ns; 
wait for 5 ns; 
wait for 5 ns; 
wait for 5 ns; 
wait for 5 ns; 
wait;
end process estimulo;

end tb_sum;

解决方法

您应该使用'代替`,并且还需要使用;代替,

您的代码:

wait for 5 ns; i_1 <= `1`,

替换为:

wait for 5 ns; i_1 <= '1';
,

我搜索了tool directives VHDL,我得到了:

Tool directives are arbitrary words preceded by a backtick character `.

我相信此处应使用'"