Allow modules to globally enable layers (#3799)
Add a function that allows the layer to be "enabled" within the current
module scope. This has the effect of emitting the module with the
"enablelayer <layer>" FIRRTL format. This is not currently in the FIRRTL
spec---it is being prototyped inside CIRCT and is expected to land in the
spec soon.
This is done to allow for the use case of a Test Harness needing to enable
one or more layers (more than one layer is the union of several layers)
inside a DUT in order to drive it properly. The specific use case is to
get access to an expensive core trace inside a microprocessor that is
hidden behind a layer.
This was originally written using an API where the layer provided a trait
that enabled the layer. This runs afoul of Scala's restriction on
inheriting the same trait multiple times.
Signed-off-by:
Schuyler Eldridge <schuyler.eldridge@sifive.com>
parent
0a5a6de0