.. _streamOperatorDoc: .. index:: single: Stream Operator .. index:: single: Stream Expression .. index:: single: >> =============== Stream Operator =============== * `One to One`_ * `One to Many`_ * `Many to Many`_ * `Many to One`_ * `Processor Blocks`_ ---- One to One ========== Single output connected to a single input. :: signal Block_1 {} signal Block_2 {} Block_1 >> Block_2; One to Many =========== Single output connected to two outputs. :: signal Block_1 {} signal Block_2 [2] {} Block_1 >> Block_2; The following is the equivalent connection: :: Block_1 >> Block_2[1]; Block_1 >> Block_2[2]; Single output connected to N outputs. :: constant N { value: 8 meta: 'Size of Block_2 signal bundle' } signal Block_1 {} signal Block_2 [N] {} Block_1 >> Block_2; ---- Many to Many ============ Many to many connections when the number of output and input ports match. :: signal Block_1 [2] {} signal Block_2 [2] {} Block_1 >> Block_2; :: Block_1[1] >> Block_2[1]; Block_1[2] >> Block_2[2]; Many to many connections is also possible when the number of input ports is an integer multiple of the number of output ports. :: signal Block_1 [2] {} signal Block_2 [4] {} # Interger multiple of 2 Block_1 >> Block_2; This is how the actual connection would be: :: Block_1[1] >> Block_2[1]; Block_1[2] >> Block_2[2]; Block_1[1] >> Block_2[3]; Block_1[2] >> Block_2[4]; ---- Many to One ============ Many to one connections are possible through processor blocks which accept multiple inputs. :: signal Block_1 [2] {} signal Block_2 {} Block_1 >> Pan ( position: 0.0 ) >> Block_2; :: [Block_1[1], Block_1[2]] >> Pan ( position: 0.0 ) >> Block_2; ---- Processor Blocks ================ **Case 1: (1-1-1)** :: constant GainValue { value: 2.0 } signal Input {} signal Output {} Input >> Level ( gain: GainValue) >> Output; **Case 2: (1-1-2)** :: constant GainValue { value: 2.0 } signal Input {} signal Output [2] {} Input >> Level ( gain: GainValue) >> Output; Equivalent code: :: Input >> Level ( gain: GainValue) >> Output[1]; Input >> Level ( gain: GainValue) >> Output[2]; **Case 3: (2-1-2)** :: constant GainValue { value: 2.0 } signal Input [2] {} signal Output [2] {} Input >> Level ( gain: GainValue) >> Output; Equivalent code: :: Input[1] >> Level ( gain: GainValue) >> Output[1]; Input[2] >> Level ( gain: GainValue) >> Output[2]; **Case 4: (2-2-2)** :: constant GainValue [2] { value: [2.0, 2.0] } signal Input [2] {} signal Output [2] {} Input >> Level ( gain: GainValue) >> Output; Equivalent code: :: constant GainValue [2] { value: 2.0 } Input[1] >> Level ( gain: GainValue[1]) >> Output[1]; Input[2] >> Level ( gain: GainValue[2]) >> Output[2]; ---- ERROR CASES: ============ Many to one connections are not possible in case of signal and control blocks. :: signal Block_1 {} signal Block_2 [2] {} # This will result in a compile time error Block_2 >> Block_1; :: # This will also result in a compile time error Block_2[1] >> Block_1; Block_2[2] >> Block_1;