Skip to content

Conversation

@seldridge
Copy link
Member

Remove DefaultSimulator. This is fully replaced with the ChiselSim API and is no longer needed. Notably, DefaultSimulator never made it onto an actual release of Chisel so this is safe to just remove.

Rewrite EphemeralSimulator in terms of ChiselSim APIs. Migrate tests of DefaultSimulator to tests on ChiselSim or other simulator classes, objects, and methods.

This does not have release notes, but we should delete the release notes about DefaultSimulator when releasing Chisel 7.

Remove `DefaultSimulator`.  This is fully replaced with the `ChiselSim`
API and is no longer needed.  Notably, `DefaultSimulator` never made it
onto an actual release of Chisel so this is safe to just remove.

Rewrite EphemeralSimulator in terms of ChiselSim APIs.  Migrate tests of
DefaultSimulator to tests on ChiselSim or other simulator classes,
objects, and methods.

Signed-off-by: Schuyler Eldridge <[email protected]>
@seldridge seldridge added the No Release Notes Exclude from release notes, consider using Internal instead label Mar 3, 2025
Comment on lines +21 to +28
private val chiselSim = new ChiselSim {}

def simulate[T <: RawModule](
module: => T,
layerControl: LayerControl.Type = LayerControl.EnableAll
)(body: (T) => Unit): Unit = {
implicit val temporary = HasTestingDirectory.temporary(deleteOnExit = true)
DefaultSimulator.simulateRaw(
implicit val temporary: HasTestingDirectory = HasTestingDirectory.temporary(deleteOnExit = true)
chiselSim.simulateRaw(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the ChiselSim object stateful? I assume you're sharing it between multiple runs for a reason (presumably more performant if it isn't stateful) but just want to check that's intentional.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No mutability other than that exposed by TestingDirectory's dynamic variable testName which is set from a fixture.

Or: other than that, it is definitely immutable as it is just packaging up SimulatorAPI (just methods) with PeekPokeAPI (methods and classes).

This should be safe.

@seldridge seldridge merged commit 2ec3159 into main Mar 3, 2025
15 checks passed
@seldridge seldridge deleted the dev/seldridge/rm-DefaultSimulator branch March 3, 2025 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No Release Notes Exclude from release notes, consider using Internal instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants