vhdl - 如何解决闩锁警告?
问题描述
我有一个关于 VHDL 的问题。以下代码用于游戏中的玩家回合选择器。它模拟得很好,但是当我生成一个比特流时,它有一个警告说:“[Synthesizer 8-327] infer latch for variable 'teToca_reg' [”C: /...../ Eleccion.vhd “: 137] ” 主要问题是由一个过程中的分配产生的,我需要它来让“cambio”信号接收该游戏中转弯的第一个值,并能够在每次按下 B1 后进行更改。出现问题的原因是稍后在相反方向上组合完成分配,因此输出“teToca”采用更改后的值。当游戏结束并且“win”给出一个值时,信号“FinPartida”设置为 1,因此“teToca”接收一个新值。
proceso_switch: process(clk,reset)
begin
if reset = '1' then
cambia <= '0';
elsif clk'event and clk='1' then
if FinPartida='1' then
cambia <= tetoca; --LATCH
elsif state = S_JUEGO and flanco='1' and B1='1' and posicion/=9 and pos1(posicion)='0' and pos2(posicion)='0' then
cambia <= NOT cambia; --OK
end if;
end if;
end process;
teToca <= empieza when state = S_ESPERA and reset = '0' else
'0' when state = S_ESPERA and reset = '1' else
--PLATCH--
cambia when state = S_JUEGO AND (flanco='1' and B1='1' and posicion/=9 and pos1(posicion)='0' and pos2(posicion)='0') else
--LATCH--
'0' when state = S_JUEGO AND win="001" else
'1' when state = S_JUEGO AND win="100";
turno <= teToca;
解决方案
推荐阅读
- javascript - 负数 JS 正则表达式只有一个减号
- c++ - 类型特征以检测具有 const 变体的特定方法的结构
- linux - 简单的 bash 脚本错误
- c++ - 将类成员作为数组访问是否合法?
- c# - 如何将源中的多个属性映射到目标中的 List 对象?
- java - Maven 资源插件排除文件夹
- tensorflow - 'NoneType' 对象在调用 model.fit_generator() 时不可调用
- firebase - 在 2 个单独的 Firebase 项目中使用相同的自定义域(不同的子域)。这可能吗?
- reactjs - 当父状态改变时 React 不会渲染子
- javascript - 在 JavaScript 中使用 Observer 处理多重错误