Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

oagFpga::ModuleCompiler Class Reference

Class for synthesizing various design objects into OpenAccess functional designs. AIG is used as the intermediate storage. More...

#include <oagFpgaModuleCompiler.h>

Collaboration diagram for oagFpga::ModuleCompiler:

Collaboration graph
[legend]
List of all members.

Auxilary Operations

void compileModules (oa::oaLib *lib, oa::oaView *view)
 The main entrance of the ModuleCOmpiler, convert the RTLGraph based design to AIG based one.
void scalarNet2Ai (oa::oaModBitNet *net)
 Convert a scalar net to an AI node.
void busNet2Ai (oa::oaModBusNet *bus)
 Convert a scalar net to AI nodes.
void compileOneModule (oa::oaModule *module)
 Convert the RTLGraph based design to AIG based one for one module.
void compileFunctionalBBNode (BBRef e)
 Synthesize/decompose a functional (OPERATOR, MUX, or SEQ) BBNode to AIG nodes.
void compileFunctionalMuxBBNode (RtlNode *bbNode)
 Synthesize/decompose a functional MUX BBNode to AIG nodes.
void compileFunctionalSeqBBNode (RtlNode *bbNode)
 Synthesize/decompose a functional SEQ BBNode to AIG nodes.
void compileFunctionalOptBBNode (RtlNode *bbNode)
 Convert individual RTL node (operator) to AI nodes.
void compileBBNode (BBRef e)
 Synthesize/decompose a BBNode to AIG nodes.
oagAi::Ref BBRef2AiRef (BBRef e)
 Convert BBRef to AiRef for a BB node with a single-bit output.
void BBRef2AiRef (BBRef e, vector< oagAi::Ref > &aiRefs)
 Convert BBRef to AiRef for a BB node with a multiple-bit output.
void BBRef2AiRef (list< BBRef > &e, list< oagAi::Ref > &aiRefs)
 Convert multiple BBRef to AiRef for a BB node with a multiple-bit output.

Static Public Member Functions

Connecting OA and AI Objects
void annotateAsynchronousSignal (oagAi::Ref sequential, const string label, oagAi::Ref signal)
 Annotates an asychronous signal to a sequential AI node.
Primitive Logic
oagAi::Ref notOf (oagAi::Ref e)
 Return the not.
oagAi::Ref orOf (oagAi::Ref e1, oagAi::Ref e2)
 Return the logical OR of two oagAi::Ref.
oagAi::Ref andOf (oagAi::Ref e1, oagAi::Ref e2)
 Return the logical AND of two oagAi::Ref.
oagAi::Ref xorOf (oagAi::Ref e1, oagAi::Ref e2)
 Return the logical XOR of two oagAi::Ref.
oagAi::Ref mux (oagAi::Ref select, oagAi::Ref in0, oagAi::Ref in1)
 Multiplexes two bits.
void fullAdder (oagAi::Ref &sum, oagAi::Ref &carryOut, oagAi::Ref e1, oagAi::Ref e2, oagAi::Ref carryIn)
 Creates a full adder.
Multi-bit Comparison and Selection Operations
oagAi::Ref reductionOr (list< oagAi::Ref > &l)
 Returns the logical OR of a list of oagAi::Ref.
oagAi::Ref reductionXor (list< oagAi::Ref > &l)
 Returns the logical OR of a list of BBRefs.
oagAi::Ref reductionAnd (list< oagAi::Ref > &l)
 Returns the logical AND of a list of BBRefs.
oagAi::Ref lessThan (list< oagAi::Ref > &l1, list< oagAi::Ref > &l2)
 This generates an unbalanced architecture. It should be improved.
oagAi::Ref equalTo (list< oagAi::Ref > &l1, list< oagAi::Ref > &l2)
 This generates an unbalanced architecture. It should be improved.
void mux (list< oagAi::Ref > &result, oagAi::Ref select, list< oagAi::Ref > &in0, list< oagAi::Ref > &in1)
 Multiplexes two buses.
oagAi::Ref mux (list< oagAi::Ref > &select, list< oagAi::Ref > &in)
 Multiplexes a bus (N-1 MUX).
Arithmetic Operations
void arithmeticAdd (list< oagAi::Ref > &result, list< oagAi::Ref > &l1, list< oagAi::Ref > &l2)
 Returns the sum of two list<oagAi::Ref>.
void arithmeticSubtract (list< oagAi::Ref > &result, oagAi::Ref &negFlag, list< oagAi::Ref > &l1, list< oagAi::Ref > &l2)
 Returns the difference of two list<oagAi::Ref> and a sign flag.
void arithmeticMultiply (list< oagAi::Ref > &result, list< oagAi::Ref > &l1, list< oagAi::Ref > &l2)
 Returns the product of two list<oagAi::Ref>.
void arithmeticDivide (list< oagAi::Ref > &result, list< oagAi::Ref > &l1, list< oagAi::Ref > &l2)
 Returns the dividend of two list<oagAi::Ref>.
void arithmeticModulo (list< oagAi::Ref > &result, list< oagAi::Ref > &l1, list< oagAi::Ref > &l2)
 Returns the remainder after division of two list<oagAi::Ref>.
Sequential Elements
oagAi::Ref latch (oagAi::Ref enable, oagAi::Ref in, const string name="")
 Creates a simple latch. The latch is transparent when enable is true.
oagAi::Ref seq (oagAi::Ref in, const string name="")
 Creates a generic sequential element.
Constants
void zeroExpand (list< oagAi::Ref > &l1, list< oagAi::Ref > &l2)
 Expands the smaller of two bit vectors to the length of the larger.
void multiBitConstant (list< oagAi::Ref > &result, int value, int bits=0)
 Converts an integer value into a constant bits of the specified width.

Static Public Attributes

State Information
ManagercurrentManager = NULL

Detailed Description

Class for synthesizing various design objects into OpenAccess functional designs. AIG is used as the intermediate storage.

All calls are static functions. This class is meant as a utility box for synthesizing new designs.

Definition at line 29 of file oagFpgaModuleCompiler.h.


Member Function Documentation

oagAi::Ref oagFpga::ModuleCompiler::andOf oagAi::Ref  e1,
oagAi::Ref  e2
[static]
 

Return the logical AND of two oagAi::Ref.

The necessary oagAI structures are created to represent the function.

Definition at line 809 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, and currentManager.

Referenced by arithmeticMultiply(), compileFunctionalOptBBNode(), fullAdder(), lessThan(), mux(), and reductionAnd().

void oagFpga::ModuleCompiler::annotateAsynchronousSignal oagAi::Ref  sequential,
const string  label,
oagAi::Ref  signal
[static]
 

Annotates an asychronous signal to a sequential AI node.

Parameters:
sequential a reference to a sequential node
label the label for the asychronous input
signal the signal that drives this input

Definition at line 1356 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, currentManager, and DEBUG_PRINTLN.

Referenced by compileFunctionalSeqBBNode(), and latch().

void oagFpga::ModuleCompiler::arithmeticAdd list< oagAi::Ref > &  result,
list< oagAi::Ref > &  l1,
list< oagAi::Ref > &  l2
[static]
 

Returns the sum of two list<oagAi::Ref>.

A ripply carry adder is built. The operands l1 and l2 must be of the same width |l1|=|l2|. The result will be one bit wider, |l1|+1.

Definition at line 1021 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, currentManager, and fullAdder().

Referenced by arithmeticMultiply(), and compileFunctionalOptBBNode().

void oagFpga::ModuleCompiler::arithmeticDivide list< oagAi::Ref > &  result,
list< oagAi::Ref > &  l1,
list< oagAi::Ref > &  l2
[static]
 

Returns the dividend of two list<oagAi::Ref>.

Builds an array divider. There is no requirement on the widths of the operands, |l1| and |l2|. The result l1/l2 will be of width |l1|;

Definition at line 1126 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, arithmeticSubtract(), currentManager, mux(), and zeroExpand().

Referenced by compileFunctionalOptBBNode().

void oagFpga::ModuleCompiler::arithmeticModulo list< oagAi::Ref > &  result,
list< oagAi::Ref > &  l1,
list< oagAi::Ref > &  l2
[static]
 

Returns the remainder after division of two list<oagAi::Ref>.

Builds an array divider. There is no requirement on the widths of the operands, |l1| and |l2|. The result l1%l2 will be of width |l2|;

Definition at line 1160 of file oagFpgaModuleCompiler.cpp.

References arithmeticSubtract(), currentManager, mux(), and zeroExpand().

Referenced by compileFunctionalOptBBNode().

void oagFpga::ModuleCompiler::arithmeticMultiply list< oagAi::Ref > &  result,
list< oagAi::Ref > &  l1,
list< oagAi::Ref > &  l2
[static]
 

Returns the product of two list<oagAi::Ref>.

Builds an array multiplier. There is no requirement on the widths of the operands, |l1| and |l2|. The result l1*l2 will be of width |l1|+|l2|;

Definition at line 1081 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, andOf(), arithmeticAdd(), and currentManager.

Referenced by compileFunctionalOptBBNode().

void oagFpga::ModuleCompiler::arithmeticSubtract list< oagAi::Ref > &  result,
oagAi::Ref &  negFlag,
list< oagAi::Ref > &  l1,
list< oagAi::Ref > &  l2
[static]
 

Returns the difference of two list<oagAi::Ref> and a sign flag.

Builds a ripply carry subtractor. The operands l1 and l2 must be of the same width. The result, l1-l2, will be of the same width as the operands.

Definition at line 1051 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, currentManager, fullAdder(), and notOf().

Referenced by arithmeticDivide(), arithmeticModulo(), and compileFunctionalOptBBNode().

void oagFpga::ModuleCompiler::BBRef2AiRef list< BBRef > &  e,
list< oagAi::Ref > &  aiRefs
[static, protected]
 

Convert multiple BBRef to AiRef for a BB node with a multiple-bit output.

Definition at line 747 of file oagFpgaModuleCompiler.cpp.

References oagFpga::RtlNode::aiRef, oagFpga::Manager::bbg, compileBBNode(), currentManager, and oagFpga::RtlGraph::getNode().

void oagFpga::ModuleCompiler::BBRef2AiRef BBRef  e,
vector< oagAi::Ref > &  aiRefs
[static, protected]
 

Convert BBRef to AiRef for a BB node with a multiple-bit output.

Definition at line 730 of file oagFpgaModuleCompiler.cpp.

References oagFpga::RtlNode::aiRef, oagFpga::Manager::bbg, compileBBNode(), currentManager, and oagFpga::RtlGraph::getNode().

oagAi::Ref oagFpga::ModuleCompiler::BBRef2AiRef BBRef  e  )  [static, protected]
 

Convert BBRef to AiRef for a BB node with a single-bit output.

Definition at line 707 of file oagFpgaModuleCompiler.cpp.

References oagFpga::RtlNode::aiRef, oagFpga::Manager::bbg, compileBBNode(), currentManager, DEBUG_PRINTLN, oagFpga::RtlGraph::getNode(), and oagFpga::RtlGraph::getOutputBit().

Referenced by compileFunctionalMuxBBNode(), compileFunctionalOptBBNode(), and compileFunctionalSeqBBNode().

void oagFpga::ModuleCompiler::busNet2Ai oa::oaModBusNet *  bus  )  [static, protected]
 

Convert a scalar net to AI nodes.

Definition at line 50 of file oagFpgaModuleCompiler.cpp.

References abs, oagFpga::Manager::ai, currentManager, and oagFpga::Manager::setNetToAiConnection().

void oagFpga::ModuleCompiler::compileBBNode BBRef  e  )  [static, protected]
 

Synthesize/decompose a BBNode to AIG nodes.

Definition at line 630 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, oagFpga::RtlNode::aiRef, oagFpga::AiRefAppDef, oagFpga::Manager::bbg, oagFpga::BBRef, compileFunctionalBBNode(), oagFpga::RtlGraph::constantOne(), oagFpga::RtlGraph::constantZero(), currentManager, oagFpga::Manager::get(), oagFpga::Manager::getNetToBBConnection(), oagFpga::RtlGraph::getNode(), oagFpga::RtlGraph::getOutputBit(), oagFpga::RtlGraph::getTerminalDriver(), oagFpga::RtlGraph::isFunctional(), oagFpga::RtlGraph::isNull(), oagFpga::RtlGraph::isSequential(), and oagFpga::RtlGraph::isTerminal().

Referenced by BBRef2AiRef(), and compileModules().

void oagFpga::ModuleCompiler::compileFunctionalBBNode BBRef  e  )  [static, protected]
 

Synthesize/decompose a functional (OPERATOR, MUX, or SEQ) BBNode to AIG nodes.

Definition at line 598 of file oagFpgaModuleCompiler.cpp.

References oagFpga::RtlNode::aiRef, oagFpga::Manager::bbg, compileFunctionalMuxBBNode(), compileFunctionalOptBBNode(), compileFunctionalSeqBBNode(), currentManager, oagFpga::RtlNode::funcType, and oagFpga::RtlGraph::getNode().

Referenced by compileBBNode().

void oagFpga::ModuleCompiler::compileFunctionalMuxBBNode RtlNode bbNode  )  [static, protected]
 

Synthesize/decompose a functional MUX BBNode to AIG nodes.

Definition at line 545 of file oagFpgaModuleCompiler.cpp.

References oagFpga::RtlNode::aiRef, BBRef2AiRef(), oagFpga::RtlNode::funcType, mux(), and oagFpga::RtlNode::muxInfo.

Referenced by compileFunctionalBBNode().

void oagFpga::ModuleCompiler::compileFunctionalOptBBNode RtlNode bbNode  )  [static, protected]
 

Convert individual RTL node (operator) to AI nodes.

Definition at line 143 of file oagFpgaModuleCompiler.cpp.

References oagFpga::RtlNode::aiRef, andOf(), arithmeticAdd(), arithmeticDivide(), arithmeticModulo(), arithmeticMultiply(), arithmeticSubtract(), BBRef2AiRef(), equalTo(), oagFpga::RtlNode::funcType, lessThan(), notOf(), oagFpga::RtlNode::optInfo, oagFpga::RtlNode::optType, orOf(), reductionAnd(), reductionOr(), reductionXor(), xorOf(), and zeroExpand().

Referenced by compileFunctionalBBNode().

void oagFpga::ModuleCompiler::compileFunctionalSeqBBNode RtlNode bbNode  )  [static, protected]
 

Synthesize/decompose a functional SEQ BBNode to AIG nodes.

Definition at line 562 of file oagFpgaModuleCompiler.cpp.

References oagFpga::RtlNode::aiRef, annotateAsynchronousSignal(), BBRef2AiRef(), oagFpga::RtlNode::funcType, latch(), seq(), oagFpga::RtlNode::seqInfo, and oagFpga::RtlNode::seqType.

Referenced by compileFunctionalBBNode().

void oagFpga::ModuleCompiler::compileModules oa::oaLib *  lib,
oa::oaView *  view
[static]
 

The main entrance of the ModuleCOmpiler, convert the RTLGraph based design to AIG based one.

Definition at line 92 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, oagFpga::Manager::bbg, compileBBNode(), compileOneModule(), currentManager, oagFpga::RtlGraph::dataBBNodes, oagFpga::managerAppDef, and oagFpga::Manager::print().

void oagFpga::ModuleCompiler::compileOneModule oa::oaModule *  module  )  [static, protected]
 

Convert the RTLGraph based design to AIG based one for one module.

Definition at line 69 of file oagFpgaModuleCompiler.cpp.

References scalarNet2Ai().

Referenced by compileModules().

oagAi::Ref oagFpga::ModuleCompiler::equalTo list< oagAi::Ref > &  l1,
list< oagAi::Ref > &  l2
[static]
 

This generates an unbalanced architecture. It should be improved.

Returns an BBRef that is true if l1 == l2. The lists must be of the same size. Destroys their contents but does not deallocate.

Definition at line 996 of file oagFpgaModuleCompiler.cpp.

References currentManager, notOf(), reductionAnd(), and xorOf().

Referenced by compileFunctionalOptBBNode().

void oagFpga::ModuleCompiler::fullAdder oagAi::Ref &  sum,
oagAi::Ref &  carryOut,
oagAi::Ref  e1,
oagAi::Ref  e2,
oagAi::Ref  carryIn
[static]
 

Creates a full adder.

The signal carryIn is given the fastest path.

Definition at line 1311 of file oagFpgaModuleCompiler.cpp.

References andOf(), currentManager, orOf(), and xorOf().

Referenced by arithmeticAdd(), and arithmeticSubtract().

oagAi::Ref oagFpga::ModuleCompiler::latch oagAi::Ref  enable,
oagAi::Ref  in,
const string  name = ""
[static]
 

Creates a simple latch. The latch is transparent when enable is true.

The latch enable is appended as an asynchronous signal with the label "enable".

Parameters:
enable 
in 
name an optional name for the element
Returns:
reference to new sequential node

Definition at line 1204 of file oagFpgaModuleCompiler.cpp.

References annotateAsynchronousSignal(), and seq().

Referenced by compileFunctionalSeqBBNode().

oagAi::Ref oagFpga::ModuleCompiler::lessThan list< oagAi::Ref > &  aiFanins1,
list< oagAi::Ref > &  aiFanins2
[static]
 

This generates an unbalanced architecture. It should be improved.

Returns an oagAi::Ref that is true if l1 < l2. The lists must be of the same size. Destroys their contents but does not deallocate.

Definition at line 967 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, andOf(), currentManager, notOf(), orOf(), and xorOf().

Referenced by compileFunctionalOptBBNode().

void oagFpga::ModuleCompiler::multiBitConstant list< oagAi::Ref > &  result,
int  value,
int  bits = 0
[static]
 

Converts an integer value into a constant bits of the specified width.

If the number of bits is zero, the function uses the smallest number of bits required.

Definition at line 1330 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, and currentManager.

oagAi::Ref oagFpga::ModuleCompiler::mux list< oagAi::Ref > &  select,
list< oagAi::Ref > &  in
[static]
 

Multiplexes a bus (N-1 MUX).

Definition at line 1274 of file oagFpgaModuleCompiler.cpp.

References notOf(), reductionAnd(), and reductionOr().

void oagFpga::ModuleCompiler::mux list< oagAi::Ref > &  result,
oagAi::Ref  select,
list< oagAi::Ref > &  in0,
list< oagAi::Ref > &  in1
[static]
 

Multiplexes two buses.

Definition at line 1255 of file oagFpgaModuleCompiler.cpp.

References mux().

oagAi::Ref oagFpga::ModuleCompiler::mux oagAi::Ref  select,
oagAi::Ref  in0,
oagAi::Ref  in1
[static]
 

Multiplexes two bits.

Definition at line 1240 of file oagFpgaModuleCompiler.cpp.

References andOf(), currentManager, notOf(), and orOf().

Referenced by arithmeticDivide(), arithmeticModulo(), compileFunctionalMuxBBNode(), and mux().

oagAi::Ref oagFpga::ModuleCompiler::notOf oagAi::Ref  e  )  [static]
 

Return the not.

Definition at line 794 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, and currentManager.

Referenced by arithmeticSubtract(), compileFunctionalOptBBNode(), equalTo(), lessThan(), and mux().

oagAi::Ref oagFpga::ModuleCompiler::orOf oagAi::Ref  e1Ai,
oagAi::Ref  e2Ai
[static]
 

Return the logical OR of two oagAi::Ref.

The necessary oagAI structures are created to represent the function.

Definition at line 824 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, and currentManager.

Referenced by compileFunctionalOptBBNode(), fullAdder(), lessThan(), mux(), and reductionOr().

oagAi::Ref oagFpga::ModuleCompiler::reductionAnd list< oagAi::Ref > &  l  )  [static]
 

Returns the logical AND of a list of BBRefs.

OR's together a list of BBRef. This is especially useful in determining logical truth. Build graph as a tree to minimize unnecessary depth. The function will destroy the contents of list l.

Definition at line 932 of file oagFpgaModuleCompiler.cpp.

References andOf().

Referenced by compileFunctionalOptBBNode(), equalTo(), and mux().

oagAi::Ref oagFpga::ModuleCompiler::reductionOr list< oagAi::Ref > &  l  )  [static]
 

Returns the logical OR of a list of oagAi::Ref.

OR's together a list of oagAi::Ref. This is especially useful in determining logical truth. Build graph as a tree to minimize unnecessary depth. The function will destroy the contents of list l.

Definition at line 860 of file oagFpgaModuleCompiler.cpp.

References currentManager, and orOf().

Referenced by compileFunctionalOptBBNode(), and mux().

oagAi::Ref oagFpga::ModuleCompiler::reductionXor list< oagAi::Ref > &  l  )  [static]
 

Returns the logical OR of a list of BBRefs.

OR's together a list of BBRef. This is especially useful in determining logical truth. Build graph as a tree to minimize unnecessary depth. The function will destroy the contents of list l.

Definition at line 896 of file oagFpgaModuleCompiler.cpp.

References currentManager, and xorOf().

Referenced by compileFunctionalOptBBNode().

void oagFpga::ModuleCompiler::scalarNet2Ai oa::oaModBitNet *  net  )  [static, protected]
 

Convert a scalar net to an AI node.

Definition at line 32 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, currentManager, and oagFpga::Manager::setNetToAiConnection().

Referenced by compileOneModule().

oagAi::Ref oagFpga::ModuleCompiler::seq oagAi::Ref  in,
const string  name = ""
[static]
 

Creates a generic sequential element.

Parameters:
in 
name an optional name for the element
Returns:
reference to new sequential node

Definition at line 1222 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, currentManager, and DEBUG_PRINTLN.

Referenced by compileFunctionalSeqBBNode(), and latch().

oagAi::Ref oagFpga::ModuleCompiler::xorOf oagAi::Ref  e1Ai,
oagAi::Ref  e2Ai
[static]
 

Return the logical XOR of two oagAi::Ref.

The necessary oagAI structures are created to represent the function.

Definition at line 840 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, and currentManager.

Referenced by compileFunctionalOptBBNode(), equalTo(), fullAdder(), lessThan(), and reductionXor().

void oagFpga::ModuleCompiler::zeroExpand list< oagAi::Ref > &  l1,
list< oagAi::Ref > &  l2
[static]
 

Expands the smaller of two bit vectors to the length of the larger.

The additional bits wired to constant zero.

Definition at line 773 of file oagFpgaModuleCompiler.cpp.

References oagFpga::Manager::ai, and currentManager.

Referenced by arithmeticDivide(), arithmeticModulo(), and compileFunctionalOptBBNode().


Member Data Documentation

Manager * oagFpga::ModuleCompiler::currentManager = NULL [static]
 

Definition at line 23 of file oagFpgaModuleCompiler.cpp.

Referenced by andOf(), annotateAsynchronousSignal(), arithmeticAdd(), arithmeticDivide(), arithmeticModulo(), arithmeticMultiply(), arithmeticSubtract(), BBRef2AiRef(), busNet2Ai(), compileBBNode(), compileFunctionalBBNode(), compileModules(), equalTo(), fullAdder(), lessThan(), multiBitConstant(), mux(), notOf(), orOf(), reductionOr(), reductionXor(), scalarNet2Ai(), seq(), xorOf(), and zeroExpand().


The documentation for this class was generated from the following files:
Generated on Mon Jul 9 14:17:22 2007 for OA Gear Fpga by  doxygen 1.3.9.1