perlindgren / syncrim

17 stars 4 forks source link

Memory component #9

Open perlindgren opened 1 year ago

perlindgren commented 1 year ago

I will now start implementing a memory component.

In order to avoid double work I think its a good idea if we create tracking issues for the work we do.

A key problem here is howto manage the state in order to allow reversing (aka, UnClocking). We probably don't want to make history buffer containing the complete memory state for each clock cycle. A good design to solve this effectively might be re-usable for other purposes (when we later implement other stateful components, e.g., peripherals). Stateful reversal was never really correctly implemented in the original SyncSim model, with the effect that reversing interrupts never worked totally correct.

Features:

Implemented:

Todo:

perlindgren commented 1 year ago

As a comment to self, the reg_file component currently has no history.

perlindgren commented 1 year ago

A first POC is available in the https://github.com/perlindgren/syncrim/tree/memory_component branch. It currently supports only u8 accesses.

Todo:s include

Notice, we will likely need to add un_clock, and reset to the Component trait (but this will be a separate issue/PR).

The implementation showcases how we can provide structured abstractions to inputs and outputs using num_enum. This allows to give meaning to signals (e.g., the ctrl signal being an enum of variants (None, Read, Write) etc. This will improve readability/ease of use of components.

perlindgren commented 1 year ago

A minimal viable implementation has been merged.

perlindgren commented 1 year ago

Added simple vizia frontend, with an example (data_mem).

perlindgren commented 1 year ago

Fixed some clippy warning and updated dependencies, will merge if passing.

onsdagens commented 3 months ago

Partly addressed with #78 . I think optimally you have a generic memory component with an architecture specific wrapper (exposing ports specific to some architecture). That way we can re-use most of the generic memory code and UI. Let's keep this issue around.