Skip to content

Commit bc511d4

Browse files
committed
Add README.md for arith-stats.
Signed-off-by: Tim Callahan <[email protected]>
1 parent 519b9f0 commit bc511d4

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

arith-stats-plugin/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
# arith-stats
3+
4+
Counts the number of arithmetic cells in each module, also providing a histogram by operand bitwidths.
5+
6+
7+
* Cell types counted:
8+
`$add $sub $neg $mul $div $lt $le $gt $ge $alu $fa $macc`
9+
10+
11+
* Usually you want to run at least `hierarchy -top <top>`, `proc`, `flatten`, and `clean` before calling `arith_stats`.
12+
13+
* If the design is not flattened, the counts per module refer only to the arithmetic cells directly in that module, not those contained in instantiations of other modules.
14+
15+
* If you run early in the flow, you will see `$add/$sub/$mul/$div` and comparisons.
16+
17+
* If you run after `alumacc`, the count will contain `$alu` and `$macc` cells.
18+
19+
* If you run after `maccmap`, you will see `$fa` and `$alu` counts.
20+
21+
* WARNING: the bitwidth for $macc cells is not currently correct since it doesn't parse the config of multiple inputs.
22+
23+
24+
This plugin uses C++17.
25+
26+
Sample script:
27+
```
28+
read_verilog test.v
29+
hierarchy -top top
30+
proc
31+
flatten
32+
33+
plugin -i arith-stats
34+
arith-stats
35+

0 commit comments

Comments
 (0)