CGRA-ME
Functions
OpGraphsForTesting.hpp File Reference
#include <CGRA/OpGraph.h>
#include <CGRA/ConfigStore.h>
#include <vector>

Go to the source code of this file.

Functions

OpGraph finalFixup (OpGraph opgraph)
 
OpGraph makeDFG_Linear2Node (ConfigStore options={})
 a--> b More...
 
OpGraph makeDFG_Linear3Node ()
 
OpGraph makeDFG_SelfLoop1Node ()
 
OpGraph makeDFG_SelfLoop1NodeWith1ExtraFanout ()
 
OpGraph makeDFG_SelfLoop3Node ()
 
OpGraph makeDFG_Loop2Node ()
 
OpGraph makeDFG_Loop3Node ()
 
OpGraph makeDFG_2NodeLoop4Node ()
 
OpGraph makeDFG_Tree12 ()
 
OpGraph makeDFG_Tree112 ()
 
OpGraph makeDFG_Converging121 ()
 
OpGraph makeDFG_Converging21 (ConfigStore options={})
 
OpGraph makeDFG_Parallel11_11 ()
 
OpGraph makeDFG_MultiInputReconverging2121 ()
 
OpGraph makeDFG_MultiEdge11 (ConfigStore options={})
 
OpGraph makeDFG_TriangeWithAntiparellelDoubledBottomEdge ()
 
OpGraph makeDFG_MultiInputReconverging3x2Grid ()
 
OpGraph makeDFG_CrossbarWithBranchComp ()
 
OpGraph makeDFG_Small (ConfigStore options={})
 
OpGraph makeDFG_Large (bool require_non_NN_FUs)
 
OpGraph makeDFG_Larger ()
 
OpGraph makeDFG_Huge (const std::vector< int > &allowed_ids={}, ConfigStore options={})
 
OpGraph makeDFG_Tree (const ConfigStore &options)
 
OpGraph makeDFG_DeviceFiller (const ConfigStore &options)
 

Function Documentation

◆ finalFixup()

OpGraph finalFixup ( OpGraph  opgraph)

Mark nodes with no fanin as inputs, no fanout as outputs, and also verify it

Definition at line 5 of file OpGraphsForTesting.cpp.

◆ makeDFG_2NodeLoop4Node()

OpGraph makeDFG_2NodeLoop4Node ( )

a -> l -> m -> d ^-—'

Definition at line 115 of file OpGraphsForTesting.cpp.

◆ makeDFG_Converging121()

OpGraph makeDFG_Converging121 ( )

a -> b -> c '--> b2 –^

Definition at line 151 of file OpGraphsForTesting.cpp.

◆ makeDFG_Converging21()

OpGraph makeDFG_Converging21 ( ConfigStore  options = {})

a -> b a2 –^

Operands default to BINARY_ANY. Can set the "operands" key to "commutative" (default), "non-commutative" (BINARY_RHS and _LHS), or "untagged" (both UNTAGGED)

Definition at line 163 of file OpGraphsForTesting.cpp.

◆ makeDFG_CrossbarWithBranchComp()

OpGraph makeDFG_CrossbarWithBranchComp ( )

i1 —> a1 —> o1 ‘**\,--^ ,__/’–v i2 —> a2 —> b1 (br)

Definition at line 251 of file OpGraphsForTesting.cpp.

◆ makeDFG_DeviceFiller()

OpGraph makeDFG_DeviceFiller ( const ConfigStore options)

Make a connected 3-dimensional grid of nodes. Takes options 'width', 'height' and 'num_contexts'. Grid will have connection between neighbours, in time and space, but no more than 2 inputs. No torus connections. Self loops if 'self_loop_via_regfile' is truthy Const units to buff up inputs to 2 if 'num_consts_in_pe' > 0 No context N-1 to contex 0 connections – would be impossible to balance latency otherwise

Definition at line 1086 of file OpGraphsForTesting.cpp.

◆ makeDFG_Huge()

OpGraph makeDFG_Huge ( const std::vector< int > &  allowed_ids = {},
ConfigStore  options = {} 
)

Derived from mibench/aes allowed_ids is a whitelist of node numbers to include, however, an empty list is interpreted as 'allow-all'

  • 270 ops total
  • 1 input ops
  • 4 output ops
  • 100 const ops
  • 20 loads
  • 0 stores
  • 145 computation ops
  • 5 max fanout, occurring 8 times

Definition at line 408 of file OpGraphsForTesting.cpp.

◆ makeDFG_Large()

OpGraph makeDFG_Large ( bool  require_non_NN_FUs)

Derived from "microbench/accumulate"

  • 18 ops total
  • 0 input ops
  • 1 output ops
  • 5 const ops
  • 3 loads
  • 1 stores
  • 8 computation ops
  • 4 max fanout

Definition at line 288 of file OpGraphsForTesting.cpp.

◆ makeDFG_Larger()

OpGraph makeDFG_Larger ( )

Derived from microbench/mults1

  • 31 ops total
  • 0 input ops
  • 1 output ops
  • 11 const ops
  • 4 loads
  • 0 stores
  • 15 computation ops
  • 5 max fanout

Definition at line 335 of file OpGraphsForTesting.cpp.

◆ makeDFG_Linear2Node()

OpGraph makeDFG_Linear2Node ( ConfigStore  options = {})

a--> b

"ops" key – comma-separated list of ops, one for each node. Defaults to "add,add"

Definition at line 34 of file OpGraphsForTesting.cpp.

◆ makeDFG_Linear3Node()

OpGraph makeDFG_Linear3Node ( )

a -> b -> c

Definition at line 50 of file OpGraphsForTesting.cpp.

◆ makeDFG_Loop2Node()

OpGraph makeDFG_Loop2Node ( )

a -> b ^-—'

Definition at line 92 of file OpGraphsForTesting.cpp.

◆ makeDFG_Loop3Node()

OpGraph makeDFG_Loop3Node ( )

a -> b -> c ^------—'

Definition at line 103 of file OpGraphsForTesting.cpp.

◆ makeDFG_MultiEdge11()

OpGraph makeDFG_MultiEdge11 ( ConfigStore  options = {})

a -> b '-—^

Definition at line 203 of file OpGraphsForTesting.cpp.

◆ makeDFG_MultiInputReconverging2121()

OpGraph makeDFG_MultiInputReconverging2121 ( )

a --> b -> c -> d a2 –^'--> c2 –^

Definition at line 188 of file OpGraphsForTesting.cpp.

◆ makeDFG_MultiInputReconverging3x2Grid()

OpGraph makeDFG_MultiInputReconverging3x2Grid ( )
   i2
   \/

i1 --> a1 --> b1 \/ \/ \/ a2 --> b2 --> c

Definition at line 234 of file OpGraphsForTesting.cpp.

◆ makeDFG_Parallel11_11()

OpGraph makeDFG_Parallel11_11 ( )

a1 -> b1 a2 -> b2

Definition at line 176 of file OpGraphsForTesting.cpp.

◆ makeDFG_SelfLoop1Node()

OpGraph makeDFG_SelfLoop1Node ( )

l ^ \ '-'

Definition at line 60 of file OpGraphsForTesting.cpp.

◆ makeDFG_SelfLoop1NodeWith1ExtraFanout()

OpGraph makeDFG_SelfLoop1NodeWith1ExtraFanout ( )

l -> b ^ \ '-'

Definition at line 70 of file OpGraphsForTesting.cpp.

◆ makeDFG_SelfLoop3Node()

OpGraph makeDFG_SelfLoop3Node ( )

a -> l —> c ^ \ '-'

Definition at line 80 of file OpGraphsForTesting.cpp.

◆ makeDFG_Small()

OpGraph makeDFG_Small ( ConfigStore  options = {})

Derived from "microbench/nomem1"

  • 6 ops total
  • 1 input op
  • 1 output op
  • 2 const ops
  • 0 loads
  • 0 stores
  • 3 computation ops
    • all 2-input commutative
  • 2 max fanout
  • 2 self-loop
  • 0 other cycles
  • 0 reconvergences

c5 -> a4 -> m0 -> a2 -> o3 -^ c1-^-^

Definition at line 268 of file OpGraphsForTesting.cpp.

◆ makeDFG_Tree()

OpGraph makeDFG_Tree ( const ConfigStore options)

Make a DFG consisting of (possibly overlapping) converging trees Must specify option 'num_levels'. See source for more options.

Ex. { num_levels = 2, num_trees = 2, tree_overlap = 1 } i i i \/ \/

  • + | | o o

Ex. { num_levels = 3, num_trees = 2, tree_overlap = 2 } i i i i \/ \/ \/

  • + + \/ \/
    • + | | o o

Definition at line 1021 of file OpGraphsForTesting.cpp.

◆ makeDFG_Tree112()

OpGraph makeDFG_Tree112 ( )

a -> b -> c '--> c2

Definition at line 139 of file OpGraphsForTesting.cpp.

◆ makeDFG_Tree12()

OpGraph makeDFG_Tree12 ( )

a -> b '--> b2

Definition at line 128 of file OpGraphsForTesting.cpp.

◆ makeDFG_TriangeWithAntiparellelDoubledBottomEdge()

OpGraph makeDFG_TriangeWithAntiparellelDoubledBottomEdge ( )

i ---—> a '--> b <–^ Interesting because there there is one trail balancing constraint system ( nameley (in->a)+(a->b) == (in->b);(in->b)+(b->a) == (in->a) ) that implies a zero latency loop

Definition at line 222 of file OpGraphsForTesting.cpp.