$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.
随机推荐
- UI5-文档-导航栏
UI5-文档-1-前言 UI5-文档-2-开发环境 UI5-文档-2.1-使用OpenUI5开发应用 UI5-文档-2.2-使用SAP Web IDE开发应用程序 UI5-文档-2.3-使用SAPUI ...
- 递归实现tree JQuery
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- mongodb基础学习9-分片
分片和复制集不同,复制集是多个实例存储相同的内容,而分片是将内容存储到不同的分片上,不同分片存储的数据不同 下面看看具体的操作: 先启动两个片的实例: 再启动configsvr,要加上configsv ...
- 关于U3D场景烘焙的一个想法
U3D进行场景烘焙时,发现阴影无法选择烘焙质量,其实想一下也合理,毕竟是烘焙,是将光照与阴影信息保存到lightmap中,因此阴影的质量取决于光照贴图的精度, 就算光照贴图再大,也远不可能达到实时光照 ...
- Haskell语言学习笔记(66)Aeson
Data.Aeson 安装 aeson $ cabal install aeson Installed aeson-1.2.3.0 Prelude> :m +Data.Aeson Prelude ...
- 播放一个wav文件
use mmsystem;SndPlaySound('hello.wav',SND_FILENAME or SND_SYNC) ///////////////////////////////////u ...
- BlockingQueue深入解析-BlockingQueue看这一篇就够了
本篇将详细介绍BlockingQueue,以下是涉及的主要内容: BlockingQueue的核心方法 阻塞队列的成员的概要介绍 详细介绍DelayQueue.ArrayBlockingQueue.L ...
- 一个团队和他们的调查表-----("调查表与调查结果分析"心得体会)
注:这篇blog主要是描述六小灵童团队在从接到调查表任务到分析调查数据最后完成本次任务的过程,以及过程中的点滴和心德体会.---蔡何 1.制表历程 随着课程的推进,我们逐步进入了软件项目中比较重要的需 ...
- 创建第一个Maven项目
-----------------------siwuxie095 创建第一个 Maven 项目 1.打开 Ec ...
- log4j每天,每小时产生一日志文件
log4j每天,每小时产生一日志文件 2016年08月05日 14:14:33 阅读数:6254 一.之前的文章中有log4j的相关配置以及属性的介绍,下面我们先把配置列出来: log4j.roo ...