Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
B-ASIC Signal Flow Graph Module.
TODO: More info.
"""
from b_asic.operation import OperationId, Operation, BasicOperation
from b_asic.signal import SignalSource, SignalDestination
from b_asic.simulation import SimulationState, OperationState
from typing import List, final
class SFG(BasicOperation):
"""
Signal flow graph.
TODO: More info.
"""
_operations: List[Operation]
def __init__(self, identifier: OperationId, input_destinations: List[SignalDestination], output_sources: List[SignalSource]):
"""
Construct a SFG.
"""
super().__init__(identifier)
# TODO: Allocate input/output ports with appropriate IDs.
self._operations = []
# TODO: Traverse the graph between the inputs/outputs and add to self._operations.
# TODO: Connect ports with signals with appropriate IDs.
@final
def evaluate(self, inputs: list) -> list:
return [] # TODO: Implement
@final
def split(self) -> List[Operation]:
return self._operations
# TODO: More stuff.