VHDL出现综合错误:“ERROR:Xst:827 - file_name Line xx: Signal xx cannot be synthesized, bad synchronous desc

出错的代码有可能是类似下面两对代码的结构

1.在一个进程中 if 和 elsif 的判断条件都为上升沿,执行语句对同一个信号赋值,导致电路无法综合。

process (c, r) is begin

if r'event and r = '1' then

q <= '0';

elsif c'event and c = '1' then

q <= d;

end if;

end process;
  1. 在一个进程中出现了两个 if 判断语句,对同一个信号赋值,这样综合的电路会有冲突导致出错,
process (c, r) is begin

if (r = '1' ) then

q <= '0';

if c'event and c = '1' then

q <= d;

end if;

end if;

end process;

解决方法

对于第一种形式的代码没有好的解决方案,因为用两个上升沿作为if elsif的条件是不被允许的。对于第二种我们可以将代码更改为if elsif的语句或者是一个条件下嵌入另外一个语句,这样电路就可以综合了。

process (clk, reset) is begin

if clk'event and clk = '1' then -- topmost if statement

if reset = '1' then -- synchronous reset

q <= '0';

else

q <= d;

end if;

end if;

end process;
process (clk, reset) is begin

if reset = '1' then 

q <= '0';

elsif clk'event and clk = '1' then 

q <= d; 

end if; 

end process; 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值