VERILOG parser¶
The header <lorina/verilog.hpp>
implements methods to parse a very
simplistic version of the VERILOG format.
The class lorina::verilog_reader
provides the following public
member functions.
Function |
Description |
---|---|
|
Callback method for parsed module header |
|
Callback method for parsed input declarations |
|
Callback method for parsed output declarations |
|
Callback method for parsed wire declarations |
|
Callback method for parsed parameter definitions |
|
Callback method for parsed immediate assignment |
|
Callback method for parsed immediate assignment |
|
Callback method for parsed AND assignment (with 2 operands) |
|
Callback method for parsed NAND assignment (with 2 operands) |
|
Callback method for parsed OR assignment (with 2 operands) |
|
Callback method for parsed NOR assignment (with 2 operands) |
|
Callback method for parsed XOR assignment (with 2 operands) |
|
Callback method for parsed XNOR assignment (with 2 operands) |
|
Callback method for parsed AND assignment (with 3 operands) |
|
Callback method for parsed OR assignment (with 3 operands) |
|
Callback method for parsed XOR assignment (with 3 operands) |
|
Callback method for parsed MAJ3 assignment |
|
Callback method for parsed end of module |
The following reader functions are available.
Function
|
Description
|
---|---|
Reader function for VERILOG format.
|
|
Reader function for VERILOG format.
|
-
inline return_code lorina::read_verilog(const std::string &filename, const verilog_reader &reader, diagnostic_engine *diag = nullptr)¶
Reader function for VERILOG format.
Reads a simplistic VERILOG format from a file and invokes a callback method for each parsed primitive and each detected parse error.
- Parameters
filename – Name of the file
reader – A VERILOG reader with callback methods invoked for parsed primitives
diag – An optional diagnostic engine with callback methods for parse errors
- Returns
Success if parsing has been successful, or parse error if parsing has failed
-
inline return_code lorina::read_verilog(std::istream &in, const verilog_reader &reader, diagnostic_engine *diag = nullptr)¶
Reader function for VERILOG format.
Reads a simplistic VERILOG format from a stream and invokes a callback method for each parsed primitive and each detected parse error.
- Parameters
in – Input stream
reader – A VERILOG reader with callback methods invoked for parsed primitives
diag – An optional diagnostic engine with callback methods for parse errors
- Returns
Success if parsing has been successful, or parse error if parsing has failed