$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.
随机推荐
- python os模块常用命令
python编程时,经常和文件.目录打交道,这是就离不了os模块.os模块包含普遍的操作系统功能,与具体的平台无关.以下列举常用的命令 1. os.name()——判断现在正在实用的平台,Window ...
- Haskell语言学习笔记(59)Bitraversable
Bitraversable class (Bifunctor t, Bifoldable t) => Bitraversable t where bitraverse :: Applicativ ...
- jsp页面转发获取不到参数
使用的是<input type="hidden" name="nameid" value="${nameid}"/>,隐藏默认值 ...
- oracle老是出现监听错误
解决方法之一: 点击开始-->选择程序--->选中你安装的oracle版本-->选中配置与移植工具-->选中Net Configuration Assistant-->在 ...
- 疯狂JAVA——第四章 流程控制与数组
4.5 数组类型 数组也是一种类型.它本身是引用类型.例如int是一种基本类型,int[]就是引用类型. 两种定义数组的方式: 1.type[] arrayName; 2.type arrayName ...
- docker问题
Docker报错 WARNING: IPv4 forwarding is disabled. Networking will not work. 解决办法: # vim /usr/lib/sysctl ...
- js indexOf within Switch
https://stackoverflow.com/questions/22277447/indexof-within-switch switch (true) { case (msgRes.inde ...
- DEXSeq
1)Introduction DEXSeq是一种在多个比较RNA-seq实验中,检验差异外显子使用情况的方法. 通过差异外显子使用(DEU),我们指的是由实验条件引起的外显子相对使用的变化. 外显子的 ...
- php去除bom
<?php /*检测并清除BOM*/ if(isset($_GET['dir'])){ $basedir=$_GET['dir']; }else{ $basedir = '.'; } $auto ...
- Factorial Trailing Zeroes (Divide-and-Conquer)
QUESTION Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should ...