cdonovick / peak

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

[Feature Request] Pipeline Operator to be used in __call__ #237

Open rdaly525 opened 2 years ago

rdaly525 commented 2 years ago

Description: Have an operator or a function that represents a pipeline register that can be used in __call__. Currently the only way to add a register is to declare it in __init__.

Benefits: Creating pipelined designs would become more ergonomic (cc @jack-melchert). Also possibly allows for interpreting time-sequences of values which could be used for testing, verification, and maybe timing-aware rewrite rules.

Semantics: Pipeline(init: T, val: T) -> T - For atemporal semantics, it would just return init. for time-sequences, it would prepend init (shifting the sequence by 1). For magma compilation, it would just stamp out a register initialized to init.

Possible APIs: (+) unary operation could be used with a default (0 or X) init. Otherwise an imported function Pipeline(init: T, val: T) -> T

rdaly525 commented 2 years ago

Let me know if either of you have comments or concerns.