我正在尝试使用32位地址对字节通道写入使能进行编码。但是,当我尝试访问(读取或写入)大于x1F的地址时,使用GHDL编译时会出现“浮点异常8”。下面是一些代码片段:ghdl浮点异常8
entity data_mem is
port(addr : in std_logic_vector(31 downto 0);
enable : in std_logic;
rd : in std_logic;
wr : in std_logic;
we : in std_logic_vector(3 downto 0);
din : in std_logic_vector(31 downto 0);
-- outputs
dout : out std_logic_vector(31 downto 0);
ack : out std_logic
);
end data_mem;
architecture structure of data_mem is
type mem_type is array (31 downto 0) of std_logic_vector(31 downto 0);
signal mem : mem_type := ((others => (others => '0'))); -- initialize to zero
begin
mem_write : process(addr,enable, wr, we, din)
begin
if (enable = '1') then
if (wr = '1') then
if (we(0) = '1') then
mem(to_integer(signed(addr)))(7 downto 0) <= din(7 downto 0) after 2 ns;
end if; ...
所以,当我在测试平台地址设置为x0000_001F或更低,它编译,而不是当我把x0000_0020或更大。
完整的可运行示例可能会有用。我认为vermaete已经发现了这个问题,但如果是这样的话,如果其他人能够重现症状,ghdl的诊断输出可能会更有用。 – 2013-02-19 17:34:52