Unverified Commit 52a1ee81 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub
Browse files

Infer resets last connect semantics (bp #1291) (#1292)

* Respect last connect semantics in InferResets

InferResets will now support last connect semantics (within the same
scope) when determining the concrete reset type for components of type
Reset. This only includes *unconditional* last connects; it remains
illegal to drive a component of type Reset with different concrete types
under differing when conditions.

For example, the following is now legal:

input a : UInt<1>
input b : AsyncReset
output z : Reset
z <= a
z <= b

The second connect will when and z will be of type AsyncReset.

The following remains illegal:

input a : UInt<1>
input b : AsyncReset
input c : UInt<1>
output z : Reset
z <= a
when c :
  z <= b

This commit also ensures that components of type Reset with no drivers
(or only invalidation) default to type UInt<1>. This fixes a bug where
the transform would crash with such input.

(cherry picked from commit 1f63318b)

* Minor code cleansup in InferResets

* Move Map lookup into closure so it only occurs if necessary
* Replace gender with flow and improve code clarity

(cherry picked from commit 4fd2e6e9

)

Co-authored-by: default avatarJack Koenig <jack.koenig3@gmail.com>
parent 5845d825
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