Add SparseVec
Add a new utility, SparseVec. This exposes a normal Vec-like dynamic
access API. However, the dynamic access is implemented one of three ways:
1. Using a binary decoder
2. Using a one-hot decoder
3. Using when statements
This is added to better support a design pattern ("vec--decoder pattern")
where a large, sparse vector is used to describe a decoder. This pattern,
if unchecked and used in a parametric generator, can cause the vector to
grow extremely large and cause backend tools to complain.
Specifically, Cadence tooling is known to set limits on the addressable
range of a "memory" and will error if these are exceeded. This
vec--decoder pattern can easily exceed this if designers are not careful.
Signed-off-by:
Schuyler Eldridge <schuyler.eldridge@sifive.com>
parent
908ac119