户型图在哪个网站找,仿织梦小说网站源码,网站建设合同报价单 模板,ui网页设计课程总结项目场景#xff1a; 写ip 时#xff0c; 使用参数化的方式实现2w1r 时#xff0c;出现计算读返回index 时#xff0c;减下溢#xff01; 问题描述 verilog中会使用parameter 参数化#xff0c;例如使用dpth 和$clog2(dpth)addr 。 常见的写法没有什么问题。
module …项目场景 写ip 时 使用参数化的方式实现2w1r 时出现计算读返回index 时减下溢 问题描述 verilog中会使用parameter 参数化例如使用dpth 和$clog2(dpth)addr 。 常见的写法没有什么问题。
module A(parameter DPRT1024parameter ADDR_WDTH $clog2(DPTH)
)(
input clk,
input rst_ninput [ADDR_WDTH-1:0] wr_addr,……
);
但是如果不是dpth 这种变量 而是可以从1~无穷的数据。此时$clog21 0。 出现wr_addr 的位宽就是【0-10】显然不符合设计 原因分析 $clog(xxx)是一种向上取整的函数 $clog(3)1.332 但是其仅左右与2~无穷的数据对于1 需要单独处理 解决方案
划分为 1 和2~无穷 2种情况。 ADDR DPTH11 $clog2(DPTH);