add support for simulator-only values #35

Merged
programmerjake merged 6 commits from programmerjake/fayalite:sim-non-hdl-data into master 2025-09-09 05:35:24 +00:00

Fixes: libre-chip/grant-tracking#7

This adds a new SimOnly<T> HDL type and the corresponding SimOnlyValue<T> value, you can put just about any arbitrary type inside (it needs to support a few traits and [de]serialization to JSON) and the simulator will feed the values through the simulation, so you can have modules that have inputs and outputs that are BTreeMap<String, Vec<Option<u32>>> if you like.

See the test test_sim_only_connects for an example. Here's the generated .vcd file.

Fixes: libre-chip/grant-tracking#7 This adds a new `SimOnly<T>` HDL type and the corresponding `SimOnlyValue<T>` value, you can put just about any arbitrary type inside (it needs to support a few traits and [[de]serialization to JSON](https://github.com/serde-rs/json)) and the simulator will feed the values through the simulation, so you can have modules that have inputs and outputs that are `BTreeMap<String, Vec<Option<u32>>>` if you like. See the test [`test_sim_only_connects`](https://git.libre-chip.org/libre-chip/fayalite/src/commit/db9b1c202c7d5a7ec486469523ff45f3239c0763/crates/fayalite/tests/sim.rs#L1693) for an example. Here's the [generated `.vcd` file](https://git.libre-chip.org/libre-chip/fayalite/src/commit/db9b1c202c7d5a7ec486469523ff45f3239c0763/crates/fayalite/tests/sim/expected/sim_only_connects.vcd).
programmerjake added 5 commits 2025-09-06 02:26:26 +00:00
programmerjake force-pushed sim-non-hdl-data from 9dd3b7e7e4 to 9334dff776 2025-09-09 05:04:13 +00:00 Compare
programmerjake force-pushed sim-non-hdl-data from 9334dff776 to db9b1c202c 2025-09-09 05:20:54 +00:00 Compare
programmerjake changed title from WIP: add support for simulator-only values to add support for simulator-only values 2025-09-09 05:26:26 +00:00
programmerjake merged commit db9b1c202c into master 2025-09-09 05:35:24 +00:00
programmerjake deleted branch sim-non-hdl-data 2025-09-09 05:35:24 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: libre-chip/fayalite#35
No description provided.