Skip to content

Commit

Permalink
fixup! [internal] Add Builder state save/restore fns
Browse files Browse the repository at this point in the history
  • Loading branch information
seldridge committed Jan 23, 2025
1 parent e4f35e3 commit a73d2b2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/src/main/scala/chisel3/internal/Builder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,19 @@ private[chisel3] object Builder extends LazyLogging {

object State {

/** Return a [[State]] suitable for doing module construction.
*/
def default: State = State(
currentModule = Builder.currentModule,
whenStack = Nil,
blockStack = Nil,
layerStack = layer.Layer.Root :: Nil,
prefix = Nil,
clock = None,
reset = None,
enabledLayers = Nil
)

/** Capture the current [[Builder]] state.
*/
def save: State = {
Expand Down

0 comments on commit a73d2b2

Please sign in to comment.