微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 嵌入式设计讨论 > FPGA,CPLD和ASIC > 计数器综合后警告的问题

计数器综合后警告的问题

时间:10-02 整理:3721RD 点击:
大家好,小弟刚刚做FPGA不久,现在还在学习当中,最近在做一个收发模块时,用到了一个四位的计数器counter,在整个模块里综合后,显示警告:XST:1710-FF/latch<counter_1>(without init value)has a constant value of 0 in block <rpoh>,this FF/latch will be trimmed during the optization process.同样也有counter的第二位和第三位的这样的警告,仿真时看计数器也没有波形,其他信号由于用到这个计数器也没波形,如果把这个计数器拿出来单独综合仿真都没问题。
计数器Code(fp1为帧同步信号):
process(clk,rst,fp1)
begin
if rst='1' then
  counter<="0000";
elsif fp1='1' then
  counter<="0001";
elsif clk' event and clk='0' then
  if counter="1000" then
   counter<="0001";
  else
   counter<=counter+1;
end if;
end if;
end process;
这样写有什么问题,请高手指教,谢谢!

process(clk,rst,fp1)
begin
if rst='1' then
  counter<="0000";
elsif clk' event and clk='0' then
  if counter="1000"  or  fp1='1' then
   counter<="0001";
  else
   counter<=counter+1;
end if;
end if;
end process;
把代码改成这样子试一下,看是否还有问题的

怎么是VHDL啊  现在都用Verilog HDLl了

不完整的组合逻辑if/else条件判断语句,综合后产生latch(锁存器)
在数字设计中,应尽量避免锁存器的使用
二楼:正解……(纯正的时序逻辑,综合成寄存器)
三楼:verilog HDL和VHDL各有优弱,VHDL严谨,适合底层描述,Verilog HDL风格灵活,上层的描述占优势

还是没解决问题

已经不习惯看VHDL的代码了

好人多呀,好人多,很好。

verilog是王道。

现在学校教的也是Verilog所以VHDL我就看不懂了~哎

检查一下counter是不是定义成1bit了

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top