Next: The Library Specification Up: Compiling for Computational Origami Previous: Running the Compiler

The Architecture Specification

The compiler supports arbitrary architecture specifications. Even though only simple two-dimensional routing is currently implemented, the support is present for much more complex architectures. The architecture file defines the number of dimensions in an architecture, the processor flavors available, and the interconnection of the processors. An architecture specification must be read in before any other compiler operations are performed. The format of an architecture specfication is shown below. All white space is ignored in the file.


file := DIMENS integer node_defs kernel_def

node_defs := node_defs node_def

node_def := NODEDEF string INPUTS integer OUTPUTS integer 
            node_flavors

node_flavors := node_flavors node_flavor

node_flavor := FLAVOR id id

kernel_def := KERNEL string INPUTS integer OUTPUTS integer
              kernel_nodes

kernel_nodes := kernel_nodes kernel_node

kernel_node := TYPE string kern_conn_in kern_conn_out

kern_conn_in := INPUTS io_list

kern_conn_out := OUTPUTS io_list

io_list := input_list input_item

io_item := KERN integer
         | NODE integer ':' integer

The DIMENS clause defines the number of dimensions in the architecture. The node_defsdefines the types of nodes that are available. Each type of node can have a different number of inputs and outputs and different flavors available. The flavors have both a short name (the first id) which is used for internal use, and a long function name, which can be used for external representation. The kernel_defdefines the kernel of the architecture, and how the nodes are connected within it. As an example, the alternate-slant architecture can be defined as follows:


DIMENS 2

NODEDEF "2D-alt-node"
inputs 2
outputs 2
FLAVOR PT passthru /* 0=0 1=1 */
FLAVOR XOVER crossover /* 0=1 1=0 */
FLAVOR RBRD rightbroadcast /* 0=1 1=1 */
FLAVOR LBRD leftbroadcast /* 0=0 1=0 */
FLAVOR AND andbothnodes /* 0=AND(0,1) 1=AND(0,1) */
FLAVOR OR orbothnodes /* 0=OR(0,1) 1=OR(0,1) */
FLAVOR NOT notbothnodes /* 0=NOT(0) 1=NOT(1) */
FLAVOR HA halfadder /* 0=XOR(0,1) 1=AND(0,1) */
FLAVOR NOOP noop /* 0=X 1=X */

KERNEL "2D-alt-slant"
inputs 3
outputs 3

type "2D-alt-node"
inputs kern 1 kern 2
outputs node 1:1 kern 2

type "2D-alt-node"
inputs kern 0 node 0:0
outputs kern 0 kern 1

The only portion of this description that should be confusing is the kernel definition. The ``2D-alt-slant'' kernel consists of two ``2D-alt-node'' nodes. The first node takes its inputs from outputs 1 and 2 of other kernels. Its outputs go to input 1 of the second node, and input 2 of another kernel. The second node takes its inputs from input 0 of the kernel and output 0 of the first node. Its outputs go to inputs 0 and 1 of the next kernel.



Next: The Library Specification Up: Compiling for Computational Origami Previous: Running the Compiler


Robert French