Skip to content

Commit 8043f65

Browse files
committed
Added info banner
1 parent 23709d8 commit 8043f65

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

clogb2.svh

+15-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,23 @@
55
//------------------------------------------------------------------------------
66

77
// INFO ------------------------------------------------------------------------
8-
// Calculates counter/address width based on specified vector/RAM depth
9-
//
8+
// Calculates counter width based on specified vector/RAM depth
109
// see also: http://www.sunburst-design.com/papers/CummingsHDLCON2001_Verilog2001.pdf
1110
//
11+
// WARNING:
12+
// ========
13+
// - clogb2() usage is a quite obsolete technique, left from Verilog-2001 era
14+
// when system function $clog2() was not supported or was implemented falcely
15+
//
16+
// - don`t use clogb2() for new designs! Instead:
17+
//
18+
// - use $clog2(DEPTH) when declaring wr_addr[] pointer, which can refer any
19+
// RAM element from 0 to DEPTH-1
20+
//
21+
// - use $clog2(DEPTH+1) to declare counters, which should hold any walue from
22+
// 0 up to the DEPTH (inclusive)
23+
//
24+
//
1225
// Compared with system function $clog2():
1326
// =======================================
1427
// $clog2(0) = 0; clogb2(0) = 0;

0 commit comments

Comments
 (0)