A Simple RTL Synthesizer in OAGear (our starting point) | ||
The main entrance of the
source code in OAGear's RTL synthesizer is in "$OAGear_HOME/Func" directory.
The author is Aaron Hurst <ahurst@eecs.berkeley.edu>,
who is very nice to answer questions.
Verilog Parser: A simple but powerful enough Verilog parser is
implemented in OAGear. The main feature in Verilog language that is not
implemented in this parser is the handler for loop statements (indicated by
for/while). A good thing is that the structure of this parser
is very easy to understand so that the update is not difficult. The Verilog
grammar and handler have been implemented in oagFuncVerilogParser.yxx.
Intermediate Format: The internal
representation after parsing a Verilog format is a direct reflection of the
original Verilog structure. Basically they are a linked-list of modules,
within each of which a sequence of statements/blocks are contained. The data
structure of OAGear's IF can be found in file oagFuncVerilogDesign.h. Elaboration and Module Compiler: The
basic idea of OAGear RTL synthesizer is to convert a behavioral Verilog to
an AND-INVERTER graph (AIG), which is a logic level netlist with only AND2
gates and inverters. In this sense, there is no inference procedure during
the whole RTL synthesis flow in OAGear since the existing synthesizer in
OAGear is essentially technology-independent. In OAGear, synthesizer's
Elaboration and module are basically combined together and the
implementation can be found in oagFuncVerilogSynthesis.cpp/.h and
oagFuncSynthesis.cpp/.h. The implementation strategy in module compiler is
detailed in its documentation (located in "Documentation" subdirectory under
"Func" directory). Structural Netlist Writer.
OAGear has implemented a simple netlist writer to output the AIG based logic
level design to a structural Verilog file. All registers are represented by
a always block. What Is Missing. All white blocks are the missing parts in OAGear Verilog synthesizer to build a complete RTL synthesizer. Systematically, we have to implement the following major building blocks.
To enable the bridge between 1 and 2, a data structure that represents the structural netlist after elaboration and before inference should be designed. |