UseLegacyWidthBehavior
chisel3.stage.UseLegacyWidthBehavior
case object UseLegacyWidthBehavior extends NoTargetAnnotation, ChiselOption, HasShellOptions, Unserializable
Use legacy Chisel width behavior.
'''This should only be used for checking for unexpected semantic changes when bumping to Chisel 7.0.0.'''
Use as CLI option --use-legacy-width.
There are two width bugs fixed in Chisel 7.0 that could affect the semantics of user code. Enabling this option will restore the old, buggy behavior, described below:
- The width of shift-right when shift amount is >= the width of the argument
When this option is enabled, the behavior is as follows:
- Calling
.getWidthon the resulting value will report the width as 0. - The width of the resulting value will be treated as 1-bit for generating Verilog.
- The width of
ChiselEnumvalues
When this option is enabled, the behavior is as follows:
- Calling
.getWidthon a specific ChiselEnum value will give the width needed to encode the enum. This is the minimum width needed to encode the maximum value encoded by the enum. - The resulting FIRRTL will have the minimum width needed to encode the literal value for just that specific enum value.
Attributes
- Source
- ChiselAnnotations.scala
- Graph
-
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Unserializabletrait HasShellOptionstrait ChiselOptiontrait NoTargetAnnotationtrait Annotationtrait Producttrait Equalsclass Objecttrait Matchableclass Any
- Self type
Members list
In this article