#include <oagFpgaModuleCompiler.h>
Collaboration diagram for oagFpga::ModuleCompiler:
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 | |
Manager * | currentManager = NULL |
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.
|
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(). |
|
Annotates an asychronous signal to a sequential AI node.
Definition at line 1356 of file oagFpgaModuleCompiler.cpp. References oagFpga::Manager::ai, currentManager, and DEBUG_PRINTLN. Referenced by compileFunctionalSeqBBNode(), and latch(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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".
Definition at line 1204 of file oagFpgaModuleCompiler.cpp. References annotateAsynchronousSignal(), and seq(). Referenced by compileFunctionalSeqBBNode(). |
|
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(). |
|
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. |
|
Multiplexes a bus (N-1 MUX).
Definition at line 1274 of file oagFpgaModuleCompiler.cpp. References notOf(), reductionAnd(), and reductionOr(). |
|
Multiplexes two buses.
Definition at line 1255 of file oagFpgaModuleCompiler.cpp. References mux(). |
|
Multiplexes two bits.
Definition at line 1240 of file oagFpgaModuleCompiler.cpp. References andOf(), currentManager, notOf(), and orOf(). Referenced by arithmeticDivide(), arithmeticModulo(), compileFunctionalMuxBBNode(), and mux(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
Creates a generic sequential element.
Definition at line 1222 of file oagFpgaModuleCompiler.cpp. References oagFpga::Manager::ai, currentManager, and DEBUG_PRINTLN. Referenced by compileFunctionalSeqBBNode(), and latch(). |
|
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(). |
|
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(). |
|
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(). |