Flow block
- Flow block is part of Hybrid Design Flow (HDF). the block is control flow directive to tell the Kathryn how to manage the control flow of the hardware via Node.
Flow Block Structure
src/model/flowBlock/abstract/flowBlock_Base.h
-
FlowIdentfiableassist flow block to have a name, id, flow localization. -
ModelDebuggableis and interface for debugger. -
simplified FlowBlockBase
FlowBlockBase -
class FlowBlockBase{ std::vector<FlowBlockBase*> _subBlocks; std::vector<int> _subBlocksOrder; std::vector<FlowBlockBase*> _conBlocks; std::vector<int> _conBlocksOrder; std::vector<Node*> _basicNodes; std::vector<int> _basicNodesOrder; std::vector<Node*> _sysNodes; OprNode* intNodes [INT_CNT]; virtual NodeWrap* sumarizeBlock() = 0; virtual void buildHwComponent() = 0; } -
_subBlocksis the collection of block, belonging to current block. -
_conBlocksis the collection of block, chaining with current block such aselifblock is the conblock ofcifblock. -
_basicNodes and _sysNodesis the collection of node, belonging to current block. -
intNodesis the collection of interrupt node. -
*Orderis the vectors that contain order of its related components by sequence of user declaration -
sumarizeBlock()is used to build Flow Block representationNodeWrapwhich contain entrance and exit nodes. -
buildHwComponent()is used to build hardware component coresponding to its nodes and blocks.
Flow Block Types
- This session introduces provided Flow Block in Kathryn and illustrates how node is composed coresponding to Flow Block type.
Sequential Block
src/model/flowBlock/seq/seq.h- this block will arrange the its node, subBlock, and conBlock Sequentially coresponding to designers' input
-
seq{ a = 48; ///// take 1 cycle cwhile(x < a) ///// cwhile block take N/A cycle x <<= x + 3; ///// x and y assignment will run sequentially too y <<= y + 3; ///// b = 24; ///// take 1 cycle } ///// total cycle usage = 2 + cwhile's cycle usage - the node diagram will be like this
Parallel Block
src/model/flowBlock/par/par.h- this block will arrange the its node, subBlock, and conBlock Parallelly coresponding to designers' input
- in case, kathryn cannot determine cycle usage of its subBlock
-
par{ a = 48; ///// take 1 cycle cwhile(x < a){ ///// cwhile block take N/A cycle x <<= x + 3; ///// x and y assignment will run parallely y <<= y + 3; ///// } b = 24; ///// take 1 cycle } - the node diagram will be like this
- in case, kathryn can determine all cycle usage of its subBlock
-
par{ a = 48; ///// take 1 cycle cwhile(x < a) seq{ ///// seq take 2 cycle x <<= x + 3; ///// x and y assignment will run for 2 cycle y <<= y + 3; ///// } b = 24; ///// take 1 cycle } - the node diagram will be like this
-
selects only node wrap as a trigger not because it can be sure that has finished execute already.
-
Additionally, if there is any SINGLE subBlock marked with
markAsMasterJoin, the node will only listen the exit signal from the marked block (cwhile(z < b)block in this case). The marker also serves as resource usage optimization because when designers deeply know the behavior of the hardware flow and mark the block, kathryn won't generate unnecessary synchronization hardware logic. -
par{ a = 48; ///// take 1 cycle cwhile(x < a){ ///// seq take 2 cycle x <<= x + 3; ///// x and y assignment will run sequentially too y <<= y + 3; ///// } cwhile(z < b){ markAsMasterJoin z <<= z + 2; } b = 24; ///// take 1 cycle } -
the node diagram will be like this
Conditional Block
src/model/flowBlock/cond- this block will arrange node according to condition that designers specify
C/S condition
- the task inside
conditional block (cif, celif, celse, sif, selif, selse)will be arrange coresponding to the flow mechanism (sequentially/ parrallelly) of the nearest outter block that it can be determined. - if there is no detectable outter block, it will automatically set to parrallel.
-
[c/s]if(x){ a = 48; b = 24; }[c/s]elif(y){ c = 50; d = 25; } - the node diagram will be like this
Z condition
- the task inside the Z block can be only cycle-consider element (assignment <<= or =)
- it will be group to a signle state node
-
zif(x){ a = 48; b = 24; }zelif(y){ c = 50; d = 25; } - the node diagram will be like this
Loop Block
src/model/flowBlock/loop- this block will arrange node according to condition and loop type that designers specify
C/S/CDO condition
- the task inside
loop block (cwhile, swhile, cdowhile)will be arrange coresponding to the flow mechanism (sequentially/ parrallelly) of the nearest outter block that it can be determined. - if there is no detectable outter block, it will automatically set to parrallel.
-
[c/s/cdo]while(x){ a = 48; b = 24; } - the node diagram will be like this
Pipeline Block
src/model/flowBlock/pipeline- It composes of two major component:
pipWrapis the flow directive to command the order ofpipBlkpipBlkis the loop block which synchronizes with its consecutive block- the task inside
pipBlkwill be treated as Sequential task. -
pipWrap{ pipBlk{ a <<= a + 1; } pipBlk{ b <<= a + 1; } pipBlk{ cif(b == 10){ syWait(100) }celse{ c <<= b + 1; } } pipBlk{ d <<= c + 1; } }
Timming Block
src/model/flowBlock/time/wait.h- It is used to delay the hardware flow
-
scWait(x) syWait(100);