Bug 58

Summary: create pipeline from a python3 function with type information
Product: Libre-SOC's first SoC Reporter: Luke Kenneth Casson Leighton <lkcl>
Component: Source CodeAssignee: Luke Kenneth Casson Leighton <lkcl>
Status: CONFIRMED ---    
Severity: enhancement CC: libre-soc-bugs
Priority: Low    
Version: unspecified   
Hardware: PC   
OS: Linux   
NLnet milestone: --- total budget (EUR) for completion of task and all subtasks: 0
budget (EUR) for this task, excluding subtasks' budget: 0 parent task for budget allocation:
child tasks for budget allocation: The table of payments (in EUR) for this task; TOML format:

Description Luke Kenneth Casson Leighton 2019-04-07 01:04:46 BST
> (makes me wish we were using Rust:
> CombStage would just be:
> impl<I: SignalGroup, O: SignalGroup, F: Fn(I, &mut Module) -> O> Stage<I,
> O> for F {...}

 it's probably doable, using iterators and reduce, or something
equally obscure.  overriding __add__ or something as a way to connect
two stage instances [basically __add__ is calling connect_to_next,
then reduce on... you get the idea]

 actually... *click*... the input "type" and the return "type" of the
function: that's it.  it should be possible to do introspection on
them.  i was trying to work out how the hell you could encode the
input and output data types into a function.  without the input and
output data types, the function itself has to declare them (somehow)
and it gets complex enough to make it not worthwhile, you might as
well use a class.

> that way you could just use any function with the right prototype as a
> Stage without needing to make a CombStage or anything.)