Resolve "Print PG"
- Adds
__str__
function to GraphComponent and Operation which can be used to print information about an Operation. - Reworked print SFG in signal_flow_graph by making it use the
__str__
function of Operation. Changed so that the printing now shows which operations map to which ports of the operations. - Adds a method for printing the precedence graph of an SFG which gives output that looks like the following:
------------------------------------------------------------------------------------------------------------------------
1.1 id: in1, name: IN1, value: 0, inputs: {}, outputs: {0: ['cmul1']}
1.2 id: reg1, name: T1, initial_value: 0, inputs: {0: ['cmul2']}, outputs: {0: ['reg2', 'cmul4', 'cmul7']}
1.3 id: reg2, name: T2, initial_value: 0, inputs: {0: ['reg1']}, outputs: {0: ['cmul5', 'cmul6']}
------------------------------------------------------------------------------------------------------------------------
2.1 id: cmul1, name: C0, value: 5, inputs: {0: ['in1']}, outputs: {0: ['add1']}
2.2 id: cmul4, name: A1, value: 4, inputs: {0: ['reg1']}, outputs: {0: ['add4']}
2.3 id: cmul7, name: B1, value: 3, inputs: {0: ['reg1']}, outputs: {0: ['add2']}
2.4 id: cmul5, name: A2, value: 6, inputs: {0: ['reg2']}, outputs: {0: ['add4']}
2.5 id: cmul6, name: B2, value: 2, inputs: {0: ['reg2']}, outputs: {0: ['add2']}
------------------------------------------------------------------------------------------------------------------------
3.1 id: add4, name: ADD3, inputs: {0: ['cmul4'], 1: ['cmul5']}, outputs: {0: ['add3']}
3.2 id: add2, name: ADD2, inputs: {0: ['cmul7'], 1: ['cmul6']}, outputs: {0: ['add1']}
------------------------------------------------------------------------------------------------------------------------
4.1 id: add1, name: ADD1, inputs: {0: ['cmul1'], 1: ['add2']}, outputs: {0: ['cmul2']}
------------------------------------------------------------------------------------------------------------------------
5.1 id: cmul2, name: Q1, value: 1, inputs: {0: ['add1']}, outputs: {0: ['reg1', 'cmul3']}
------------------------------------------------------------------------------------------------------------------------
6.1 id: cmul3, name: A0, value: 7, inputs: {0: ['cmul2']}, outputs: {0: ['add3']}
------------------------------------------------------------------------------------------------------------------------
7.1 id: add3, name: ADD4, inputs: {0: ['cmul3'], 1: ['add4']}, outputs: {0: ['out1']}
------------------------------------------------------------------------------------------------------------------------
Closes #26 (closed)