Skip to content

[chiselsim] Exclude Extract Layers from Compilation if not Enabled #4676

@seldridge

Description

@seldridge

Currently, the way that extract layers are included or excluded from a Chiselsim simulation is through the LayerControl API which will cause the bind file (the part of the FIRRTL ABI which says that a file will be provided which, when included in the build, will enable the layer) to be included or excluded from the compilation.

However, all the files associated with the extract layer will still be included in the compilation and not used. This is problematic for two reasons:

  1. It is inefficient to compile things that are known to not be used.
  2. If the extract layer is being used to guard constructs which the simulator cannot support, then the compilation will fail. E.g., Verilator does not support the s_eventually SystemVerilog construct which can be emitted by the ltl.eventually API.

Change this so that the way LayerControl is handled by ChiselSim will instead only compile what is needed.

As a workaround, this type of feature can be put in an inline layer which will result in an `ifdef macro guarded region which will be excluded from the build.

CC: @SandeepRajendran

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions