$clog2(转)
(转http://www.xilinx.com/support/answers/44586.html)
13.2 Verilog $clog2 function implemented improperly
Description
The $clog2 function returns the ceiling of the logarithm to the base e (natural logarithm)rather than the ceiling of
Here is a sample Verilog code that uses the $clog2 function,
module tb;
parameter A = $clog2(325);
endmodule
When 13.2 XST synthesizes the above piece of Verilog,it generatesa value 6 for A instead of an expected value of 9,
Solution
The XST parser of ISE 13.2design tools supports Verilog-2001, therefore,customers will not be able to get a proper outputfor $clog2 function.
The Math function $clog2 was incorporated starting from Verilog-2005 (IEEE 1364-2005). Before that, clog2 could be realized as a Constant Function
in Verilog 2001. Following is a samplefunction that can be used insteadfor the $clog2 function to get a proper output:
function integer clog2;
input integer value;
begin
value = value-1;
for (clog2=0; value>0; clog2=clog2+1)
value = value>>1;
end
endfunction
The above sample Verilog code with use of this function willnow become as follows:
module tb;
parameter A = clog2(325);
function integer clog2;
input integer value;
begin
value = value-1;
for (clog2=0; value>0; clog2=clog2+1)
value = value>>1;
end
endfunction
endmodule
This issue has been fixed as part of the 14.1 XST release. Also, It is in the road map to support System Verilog, which isa superset of Verilog-2005
using Xilinx tools and would include all advanced functionsmentioned in theLRM.
随机推荐
- Spring Boot Unregistering JMX-exposed beans on shutdown
创建springboot项目运行的时候报这个错误Unregistering JMX-exposed beans on shutdown,搜索发现第一条是: Spring boot 嵌入的tomcat不 ...
- Java中static代码块,{}大括号代码块,构造方法代码块执行顺序!
注:下列代码中的注释都是JUnit4单元测试运行结果. 首先,没有父类的(父类是Object)的类A package Static.of; public class A { { System.out. ...
- tesseract 4.0 编译安装(CentOS)
1.安装依赖工具 yum install autoconf automake libtool libjpeg-devel libpng-devel libtiff-devel zlib-devel 2 ...
- 关于时间查询的sql语句
今天 select * from 表名 where to_days(时间字段名) = to_days(now()); 昨天 SELECT * FROM 表名 WHERE TO_DAYS( NOW( ) ...
- sqlserver批量导出存储过程、函数、视图
select text from syscomments s1 join sysobjects s2 on s1.id=s2.id where xtype = 'V' xtype V 视图 P ...
- linux - 文件拆分
核心: split 例如,把一个文件以10万行为单位拆分文件, 并且以perfix作为前缀,3位数数字,从000开始递增 split -l 100000 filename.txt -d -a 3 pe ...
- mysql中树形结构表的操作
一种是:邻接表模型(局限性:对于层次结构中的每个级别,您需要一个自联接,并且随着连接的复杂性增加,每个级别的性能自然会降低.在纯SQL中使用邻接列表模型充其量是困难的.在能够看到类别的完整路径之前,我 ...
- 动态加载JS,并执行回调函数
有些时候我们需要动态的加载一些JS,并在JS加载完成后执行一些回调函数. var loadscript = { $$: function (id) { return document.getEleme ...
- DataTable的序列化和反序列化
/// <summary> /// DataTable序列化 /// </summary> /// <param name="dt"></ ...
- 原生JS获取url汇总
在WEB开发中,许多开发者都比较喜欢使用javascript来获取当前url网址,本文就此为大家总结一下比较常用获取URL的javascript实现代码 URL即统一资源定位符 (Uniform Re ...