在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 1651|回复: 1

helping

[复制链接]
发表于 2004-8-4 12:00:20 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity dctram is port(
  -- Inputs
  clk : in std_logic; -- Clock, async reset
  en, we : in std_logic; -- Sync enable, write enable
  ar : in std_logic_vector(5 downto 0); -- Read address
  aw : in std_logic_vector(5 downto 0); -- Write address
  din : in std_logic_vector(15 downto 0); -- Data input bus
  -- Outputs
  dout : out std_logic_vector(15 downto 0) -- Data output bus
);
end dctram;
architecture beh of dctram is
  type mram is array (63 downto 0) of std_logic_vector(15 downto 0);

  shared variable mem : mram; -- Memory array 64x16

begin
  -- Dual port RAM model
  process(clk) begin
    if clk'event and clk = '1' then
      -- Memory is written and read synchronoulsy
      -- when enabled
      if en = '1' then
        -- Write port
        if we = '1' then
          mem(conv_integer(aw)) := din;
        end if;
        -- Read port
        dout <= mem(conv_integer(ar));
      end if;
    end if;
  end process;
end beh;
--****************************************************--
--********modelsim error imply************************--
--****************************************************--
#vcom -work  work ram1/avgram.vhd
# vcom -work  work ram1/dctram.vhd
# Model Technology ModelSim SE vcom 5.7d Compiler 2003.05 May 10 2003
# -- Loading package standard
# -- Loading package std_logic_1164
# -- Loading package std_logic_arith
# -- Loading package std_logic_unsigned
# -- Compiling entity dctram
# -- Compiling architecture beh of dctram
# ** Error: ram1/dctram.vhd(45): near "shared": expecting: BEGIN
# ERROR: C:/Modeltech_5.7d/win32/vcom failed.
# Error in macro F:\mpeg4\MPEG-4\tb\compile.do line 90
# C:/Modeltech_5.7d/win32/vcom failed.
#     while executing
# "vcom -work  work ram1/dctram.vhd
--*****************************************************--
发表于 2004-8-4 12:34:16 | 显示全部楼层

helping

type mram is array (63 downto 0) of std_logic_vector(15 downto 0);
=====
这句type的定义语法有问题。
subtype word is std_logic_vector(15 downto 0);
type mram is array (integer range 0 to 63) of word;
mem也最好直接定义为signal。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /2 下一条

小黑屋| 手机版| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-4-21 17:22 , Processed in 0.018107 second(s), 11 queries , Gzip On, MemCached On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表