我有使用闲置语法的 VHDL 代码:
signal_1 <= (others => '0') when cau_state = st_idle else
signal_2 - signal_3 when cau_state = st_cycle_1 else
signal_4 when cau_state = st_cycle_2 else
signal_5 when cau_state = st_cycle_3 else
signal_6 when cau_state = st_cycle_4 else
signal_1;
wherecau_state
是保持当前状态的信号。这种语法在 Model-Sim 上的模拟中工作,一切正常。但是当我想将代码烧录到 FPGA 上时,代码并没有在 Altera Quartus II 32 位版本上合成。12.1 我收到了以下错误消息:
Warning (13012): Latch CAU:uut|cross_3_sig[0][31] has unsafe behavior
Warning (13013): Ports D and ENA on the latch are fed by the same signal CAU:uut|cau_state.st_cycle_2
Warning (13012): Latch CAU:uut|cross_3_sig[0][30] has unsafe behavior
Warning (13013): Ports D and ENA on the latch are fed by the same signal CAU:uut|cau_state.st_cycle_2
我收到许多信号的这些消息,但不是所有使用此语法的信号。对于获得此消息的信号,我得到它的所有位:cross_3_sig[0][31]
to cross_3_sig[0][0]
. 信号的语法cross_3_sig(0)
是:
constant WIDTH : integer := 32;
...
subtype scalar is std_logic_vector((WIDTH-1) downto 0);
type vector_nd is array (natural range <>) of scalar;
subtype vector_3d is vector_nd(2 downto 0);
...
signal cross_3_sig : vector_3d;
...
cross_3_sig(0) <= sum_mults_out_sig when cau_state = st_cycle_2 else
mult1_out_sig - mult2_out_sig when cau_state = st_cycle_9 else
cross_3_sig(0);
还有一些地方我分配给cross_3_sig(0)
其他信号,即:
numer_sig <= C_ZERO - cross_3_sig(0) & (16 downto 0 => '0');
mult1_in2_sig <= (others => '0') when cau_state = st_idle else
...
cross_3_sig(0) when cau_state = st_cycle_11 else
...
有什么问题,我该如何解决?