I在Matlab中使用Xilinx系统生成器块。
我只是简单地使用了一个黑盒子,里面有一个入口和一个出口。
黑匣子的代码非常简单,可以正确使用ISE设计套件
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use ieee.numeric_std.ALL;
entity test44_vhdl is
Port ( row : in std_logic_vector (1 downto 0);
slice : out std_logic_vector (3 downto 0));
end test44_vhdl;
architecture Behavioral of test44_vhdl is
type oneD is array (1 to 3) of integer range 0 to 15;
constant table: oneD := (3, 9, 13);
begin
slice <= std_logic_vector(to_unsigned(table(to_integer(unsigned(row))), slice'length));
end Behavioral;
但不幸的是,它不能与matlab系统生成器一起工作。
我收到以下错误消息
Exception: ISE Simulator Simulation failed during initialization.
有人能帮我这个代码出了什么问题吗?我应该做什么更改才能使模型正常工作
在我多次检查问题后,我发现错误是,当输入为"00"时,没有为数组表分配值
所以,我唯一应该做的改变是在0 处向数组添加一个值
type oneD is array (0 to 3) of integer range 0 to 15;
constant table: oneD := (3, 9, 13, 6);
现在模型工作正常。