Commit 816df140 authored by Jack Koenig's avatar Jack Koenig Committed by mergify-bot
Browse files

Fix optimization of register with reset but invalid connection (#2520)

Fixes #2516

Previously,

reg r : UInt<8>, clock with :
  reset => (p, UInt<8>(3))
r is invalid

would compile to:

reg r : UInt<8>, clock
r <= UInt<8>(0)

now it compiles to:

reg r : UInt<8>, clock
wire r_1 : UInt<8>
r_1 is invalid
r <= mux(reset, UInt<8>(3), r_1)

This is consistent with the behavior for a reset with an asynchronous
reset.

(cherry picked from commit 5093da03)

# Conflicts:
#	src/main/scala/firrtl/transforms/RemoveReset.scala
#	src/test/scala/firrtlTests/transforms/RemoveResetSpec.scala
parent 2ff74ab1
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