相关疑难解决方法(0)

在VHDL中声明实体内的数组

我正在尝试建立一个缓冲区,以便为小型CPU设计保存16位,16位宽的指令.

我需要一种从我的测试平台将指令加载到缓冲区的方法.所以我想使用一个std_logic_vectors数组来实现这一目标.但是,我收到语法错误,我不知道为什么(或者如果我允许在VHDL中执行此操作).

语法错误位于我声明的行 instructions

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;




entity instruction_buffer is
    port
    (
    reset               : in std_logic;
    instructions        : in array(0 to 15) of std_logic_vector(15 downto 0);
    instruction_address : in  std_logic_vector(3 downto  0);
    clk                 : in std_logic;
    instruction_out     : out std_logic_vector(15 downto 0)
    );
end instruction_buffer;
Run Code Online (Sandbox Code Playgroud)

我也试过这样做,但后来我的实体端口映射中出现语法错误,告诉我这std_logic_vector是一个未知的类型.我发誓,VHDL的语法错误没有C哈哈那么有意义

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;

package instructionBuffer is
    type instructionBuffer is array(0 to 15) of std_logic_vector (15 downto 0);
end package instructionBuffer;

entity instruction_buffer is
    port
    (
    instruction_address …
Run Code Online (Sandbox Code Playgroud)

syntax-error vhdl hdl

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

hdl ×1

syntax-error ×1

vhdl ×1