Compilation from (sized) vl expressions into sv::svex expressions.
There are several top-level functions for converting a VL expression into a sv::svex expression, including vl-expr-to-svex-untyped, vl-expr-to-svex-selfdet, and vl-expr-to-svex-maybe-typed.
We assume that the expressions we are dealing with are sized.
The Garbage Convention. Our goal is to produce svex expressions that are "correct" at least for this size. We don't care about the bits that are "past" the expression's final width.
For example, if we are converting
This has widespread consequences.
In many cases, we don't have to worry about the upper bits, because we know,
for instance, that after sizing, in a VL expression like
However, in certain cases we have to be more careful. For instance, if we
are translating
Why do it this way? Some possible alternatives:
Forcing the high bits to X has some appeal: it would be nice to know that
any accidental use of the upper bits would be conservative. In most ways it
would be very similar to what we are doing now: we would still have to be
careful in cases like
The other alternative seems sort of more proactive: we would essentially be
fixing everything up to be the right size whether it needs to be fixed up or
not. For instance, if we are translating something like