[i3c] Bitwidth parameters should use `prim_util_pkg::vbits()`
Nobody has claimed this yet.
- Dominant language
- SystemVerilog
- Stars
- 3.6k
- Forks
- 1.1k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 141
Description
Description
I've noticed that in a lot of places the I3C code uses $clog2() directly. The main use is for bitwidth computations like localparam int unsigned Log2NT = $clog2(NumTargets). However, if NumTargets = 1, which I think is a valid option, all these signal declarations won't compile anymore.
We should use prim_util_pkg::vbits() which ensures we always at least get 1.
cc @alees24 @glaserf
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the I3C code for direct $clog2() bitwidth calculations and inspect prim_util_pkg::vbits() before changing the relevant declarations. Confirm that all applicable parameters use the helper and that the I3C code compiles when NumTargets = 1.
Written by the indexing model from the issue text.
Assessment
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100