在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 7545|回复: 17

[求助] 菜鸟求助,verilog综合问题,十万火急

[复制链接]
发表于 2011-3-27 16:45:12 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
always@(posedge clk or negedge rst or posedge act)
             begin
                if(done)
                  max_buff <= max;
                else
                  max_buff <= 0;
              end

错误显示:    ERROR:Xst:899 -: The logic for <max_buff> does not match a known FF or Latch template.
查了不少资料,也不知道该怎么改,还请各位高手帮忙,小弟在此多谢了
发表于 2011-3-27 17:09:22 | 显示全部楼层
在使用XST对设计进行综合的时候,多次出现下列错误:
"ERROR:Xst:899 - "file_name", line #: The logic for "net_name" does not match a known FF or Latch template"
其实这与编码风格有关,在写代码的时候,不光要考虑逻辑的正确性,还要清楚其硬件可实现性,这样,即使综合工具弱点也不至于影响设计本身。
下文是对上诉错误的解决办法:

General Description:
What type of clock statements does XST support?

XST does not support the use of a complex condition check inside an always block in Verilog. For example, the following code results in the error below:

always @( negedge input1 or negedge input2 or posedge clock )
begin
if ( ~input1 | ~input2 )
begin
output1 <= 1'b1;
output2 <= 1'b0;
end
else
begin
output1 <= input1;
output2 <= input2 & input1;
end
end

"ERROR:Xst:899 - "file_name", line #: The logic for "net_name" does not match a known FF or Latch template."

When you infer hardware from HDL, it is important to keep the type of hardware you want in mind. The XST User Guide contains basic templates for the various types of FPGA/CPLD hardware that can be inferred with HDL code:

If your HDL code is modeled after the templates provided, you should be able to infer the desired hardware.

解决方案 1:
To avoid this error, perform the combinatorial logic outside the always block to remove the complex clock statement from the sensitivity list, and then use that intermediate signal in the sensitivity list of the always block, as follows:

assign temp = ~input1 | ~input2;
always @( posedge temp or posedge clock )
begin
if ( temp )
begin
output1 <= 1'b1;
output2 <= 1'b0;
end
else
begin
output1 <= input1;
output2 <= input2 & input1;
end
end

解决方案 2:
Another situation that causes this error (which is unrelated to the first example) is when the reset function in the always block has no effect on the register that will be inferred:

module misc(clk,rst,in1,out1);
input clk,rst,in1;
output[1:0] out1;
reg[1:0] out1;

always @(posedge clk or posedge rst)
begin
if (rst)
out1[1] = in1;
else
out1 = {in1,in1};
end
endmodule

change to:

module misc(clk,rst,in1,out1);
input clk,rst,in1;
output[1:0] out1;
reg[1:0] out1;

always @(posedge clk or posedge rst)
begin
if (rst)
out1[1] = 0;
else
out1 = {in1,in1};
end
endmodule

解决方案 3:
The error message also appears when a dual-edge triggered FF is inferred in any device other than a CoolRunner-II. The CoolRunner-II is the only Xilinx device that contains dual-edge triggered FFs:

:
always @(posedge clk or negedge clk)
:

//-----------------------end-----------------------
 楼主| 发表于 2011-3-27 17:18:48 | 显示全部楼层
回复 2# lllccc123

多谢~ 这篇文章我也看过
但按照他说的方法 把触发条件改为两个 但还是不行 哎
发表于 2011-3-27 18:39:16 | 显示全部楼层
always@(posedge clk or negedge rst or posedge act)
一定是这句话有问题,你想,哪有flop能够有3个边沿触发的呢?ASIC方面很少的。FPGA也很少有这种的。
发表于 2011-3-27 19:36:15 | 显示全部楼层
你应该学一下D触发器结构的,莫非是半路出家?
发表于 2011-3-27 20:00:37 | 显示全部楼层
在standard cell library中很少有两个边沿触发的dff 或者latch,一般都是clk边缘触发,其他都是电平触发。
所以dc综合工具找不到对应的cell去map
发表于 2011-3-27 20:18:45 | 显示全部楼层
这样写法工具无法确定三个边沿信号哪个是时钟,三个都是按时钟对待,而库里没有带三个时钟的触发器的
发表于 2011-3-27 21:46:19 | 显示全部楼层
always@(posedge clk or negedge rst or posedge act) 这句话本身来说没有什么问题的,你这么写了,如果你下面写对了,就会综合出一个带置位和复位的D触发器。
错误的关键是楼主在always的敏感列表里面给出的是边沿触发的触发器,但下面并没有描述这个触发器的正常工作方式。其实我们应该明白:
(1)如果敏感列表没有posedge或negedge,综合出的就是组合逻辑的东西,
(2)如果有一个边沿事件,就会综合出一个没有异步复位或异步置位的D触发器;
(3)如果写了两个边沿事件,其实只是综合出一个带有异步复位或异步置位的D触发器,DC目前不支持多时钟的触发器的。
(4)如果有三个边沿事件,其实就是综合出带复位和置位的D触发器。
但楼主写的代码似乎想要一个多时钟触发的D触发器,显然不可能的,虽然有多边沿触发的触发器,但不是用一个always块描述出来的。
发表于 2011-3-27 22:02:02 | 显示全部楼层
回复 8# hahalucky


    楼上说的很有道理,顶一下!!!
发表于 2011-3-29 00:13:17 | 显示全部楼层
assign Clk_=clk | act | (~ rst);

always@(posedge Clk_ )
             begin
                if(done)
                  max_buff <= max;
                else
                  max_buff <= 0;
              end
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

X

小黑屋| 手机版| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-6-29 05:40 , Processed in 0.029400 second(s), 11 queries , Gzip On, MemCached On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表