【问题标题】:errors in VHDL code using fpga advantage使用 fpga 优势的 VHDL 代码中的错误
【发布时间】:2016-04-21 00:46:39
【问题描述】:

我需要您的帮助来修复我的 vhdl 代码中的一些错误。我正在使用fpga优势5.2,它太旧了,但是我因为框图而使用它,而不是自己编写代码。我正在使用vhdl开发mips处理器,我已经完成了除了两个块之外的所有块,它们是数据内存和指令内存。两个块都有相同的错误:

数据内存错误:

错误:C:/单周期处理器/处理器/hdl/dmem_untitled.vhd(34): “是”附近:期待:开始错误:C:/单周期 处理器/处理器/hdl/dmem_untitled.vhd(51):靠近“进程”: 期待:';'

指令内存错误:

错误:C:/单周期处理器/处理器/hdl/imem_untitled.vhd(38): “是”附近:期待:开始错误:C:/单周期 处理器/处理器/hdl/imem_untitled.vhd(53):在“进程”附近: 期待:';'

这里是数据存储器的代码:

-- hds header_start
--
-- VHDL Architecture Processor.dmem.untitled
--
-- Created:
--          by - Ahmed.UNKNOWN (AHMED-PC)
--          at - 01:58:50 04/21/2016
--
-- Generated by Mentor Graphics' HDL Designer(TM) 2001.5 (Build 170)
--
-- hds header_end
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.all;

use IEEE.STD_LOGIC_SIGNED.all;
use IEEE.STD_LOGIC_ARITH.all;
use IEEE.std_logic_textio.all;
library STD;
use STD.textio.all;


ENTITY dmem IS
-- Declarations
 port(clk, we: in STD_LOGIC;
a, wd: in STD_LOGIC_VECTOR (15 downto 0);
rd: out STD_LOGIC_VECTOR (15 downto 0));

END dmem ;

-- hds interface_end
ARCHITECTURE untitled OF dmem IS
BEGIN
process is
    type ramtype is array (63 downto 0) of  STD_LOGIC_VECTOR(15 downto 0);
    variable mem: ramtype;
    variable IADR: INTEGER;

    begin

    IADR:= CONV_INTEGER(a(7 downto 2));
    -- read or write memory
    --loop
        if rising_edge(clk) then
            if (we='1') then mem (IADR):= wd;
            end if;
        end if;
        rd <= mem (IADR);
        wait on clk, a;
    --end loop;
end process;

END untitled;

还有指令存储器的代码:

-- hds header_start
--
-- VHDL Architecture Processor.IMEM.untitled
--
-- Created:
--          by - Ahmed.UNKNOWN (AHMED-PC)
--          at - 02:17:30 04/21/2016
--
-- Generated by Mentor Graphics' HDL Designer(TM) 2001.5 (Build 170)
--
-- hds header_end
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_SIGNED.all;
use IEEE.STD_LOGIC_ARITH.all;

use IEEE.std_logic_textio.all;
library STD;
use STD.textio.all;



ENTITY IMEM IS
-- Declarations

  port(

     rd: out STD_LOGIC_VECTOR(31 downto 0);
    a: in STD_LOGIC_VECTOR(5 downto 0)
    );

END IMEM ;

    -- hds interface_end
    ARCHITECTURE untitled OF IMEM IS
    begin

    ROM_PROCESS: process(a) is
                                        type MEM is array(0 to 63) of STD_LOGIC_VECTOR(31 downto 0);
                                        variable MEMORY: MEM := (others => X"00000000");
                                        variable IADR: INTEGER;

    begin
            memory(0) := X"00611820" ; -- add $3, $3, $1
            memory(1) := X"ac030004" ; -- sw $3, 4($0)
            memory(2) := X"00221024" ; -- and $2,$1,$2
            memory(3) := X"10220001" ; -- beq $1, $2, SAME
            memory(4) := X"8c010004" ; -- lw $1, 4($0)
            memory(5) := X"0022182a" ; -- SAME: slt $3, $1, $2
            IADR:= CONV_INTEGER(a);
          rd <= MEMORY(IADR);

      end process;

    END untitled;

【问题讨论】:

    标签: vhdl


    【解决方案1】:

    过程语句中的is 从 IEEE Std 1076-1993 向前是可选的,但在 VHDL 标准的 -1987 原始修订版中是不允许的。

    删除进程敏感度列表后两个文件中的is。这告诉我们您正在使用兼容 -1987 的工具(用于综合?)分析 VHDL。

    还要注意你的使用条款是一团糟。包 numeric_std 不应与 Synopsys 包 std_logic_arith 或 std_logic_unsigned 一起使用。您可以简单地注释掉该 use 子句。

    有一个隐式库子句使库逻辑名称std 可用,您不需要它。你也没有使用 textio。

    您的代码将使用符合 -1993 修订版的 VHDL 工具进行分析。

    【讨论】:

      猜你喜欢
      • 2014-04-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多