Unverified Commit fc3b4a08 authored by Will Dietz's avatar Will Dietz Committed by GitHub
Browse files

Support zero-width integer literals. (#2932)

* assert{Inferred,Known}Width: tweak to support width of zero.

Can't create -1.S(0.W), special-case zero-width.

* Bits: nicer error messages for zero-width

* Support zero-width integer literals.

These are in the FIRRTL language specification now
and supported by both SFC + MFC.

For SInt, special-case handle zero-width as not needing a sign bit.

Zero-width literals must be explicitly zero-width (`0.U(0.W)`);
literals such as `0.U` are (still) at least 1-bit.

* check zero-width to bool conversion

* onehot test

* UIntOps: test a few operations.

* SIntOps: test a few operations

* {S,U}IntOps: touchup test description, now includes head/tail/pad.

* ChiselSpec: Fix assert{Known,Inferred}Width for zero-width.

Specifically, fix the inferred-width check.

Start from zero-width literal, otherwise 0.U will need 1 bit.

* WidthSpec: update inferred zero-width test
parent b5d9c08b
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment