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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

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

modelsim se 5.7d, can it support "shared varialbe"?

[复制链接]
发表于 2004-12-29 11:44:53 | 显示全部楼层 |阅读模式

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

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

x
I change the VHDL93=0 in modelsim.ini to VHDL93=1, but it can not compile "shared
variable".
The source file is as following:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity ram is port(
  -- Inputs
  clk : in std_logic; -- Clock, async reset
  en, we : in std_logic; -- Sync enable, write enable
  a : in std_logic_vector(5 downto 0); -- Read address
  din : in std_logic_vector(7 downto 0); -- Data input bus
  -- Outputs
  dout : out std_logic_vector(7 downto 0) -- Data output bus
);
end ram;
architecture beh of ram is
  type mram is array (39 downto 0) of std_ulogic_vector(7 downto 0);
  shared variable mem : mram; -- Memory array 40x8
begin
  -- Single port RAM model
  process(clk)
    variable n : integer;
  begin
    if clk'event and clk = '1' then
      -- Memory is written and read synchronoulsy
      -- when enabled
      if en = '1' then
        n:=conv_integer(a);
        if n < 40 then
          -- Write port
          if we = '1' then
            mem(n) := din;
          end if;
          -- Read port
          dout <= mem(n);
        else
          dout <= "XXXXXXXX";
        end if;
      end if;
    end if;
  end process;
end beh;

The error is as following:
near "shared" : expecting : BEGIN
Why? Someone can tell me.
 楼主| 发表于 2004-12-29 19:42:02 | 显示全部楼层

modelsim se 5.7d, can it support "shared varialbe"?

Why no one can tell me?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2025-5-13 13:56 , Processed in 0.019851 second(s), 9 queries , Gzip On, MemCached On.

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