cdonovick / peak

Peak : Processor Specification Language ala Newell and Bell's ISP
19 stars 3 forks source link

Adds register with update_state semantics, with a hierarchical test #212

Open rdaly525 opened 3 years ago

rdaly525 commented 3 years ago

Using this PR as a new feature review (eg not meant to be merged)

Goal: Add precise verilator-like simulation semantics for peak classes and registers

Under this paradigm (only using Register3 for any state), __call__(...) does not ever update state, but only evaluates the combinational logic defined in Peak. The Peak.update_state() method does the state update exactly analogous to toggling the clock in verilator.

To evaluate multiple cycles:

peak_obj(...)
peak_obj.update_state()
peak_obv(...)
peak_obj.update_state()
...

In addition, there are set() and get() methods for Regsister3 for to dynamically peak and poke the state.

One ultimate goal is to treat state input/outputs similar to peak outputs/inputs (respectively)for the automatic rewrite rule generation cod generation.