The Class NetlistParser parses an input netlist file. More...
#include <NetlistParser.h>
Public Types | |
typedef std::map< std::string, std::vector< std::pair < SimTime, LogicVal > > > | StimulusMapType |
Public Member Functions | |
NetlistParser (const char *netlistFile) | |
Instantiates a new netlist parser. | |
void | parse (const char *fileName) |
Parses the netlist contained in fileName. | |
const SimTime & | getFinishTime () const |
Gets the finish time. | |
const char * | getNetlistFile () const |
Gets the netlist file. | |
const std::vector< std::string > & | getInputNames () const |
Gets the input names. | |
const std::vector< std::string > & | getOutputNames () const |
Gets the output names. | |
const std::map< std::string, LogicVal > & | getOutValues () const |
Gets the out values. | |
const StimulusMapType & | getInputStimulusMap () const |
Gets the input stimulus map. | |
const std::vector< GateRec > & | getGates () const |
Gets the gates. | |
Static Public Attributes | |
static const char * | DELIM = " \n\t,;()=" |
following is the list of token separators; characters meant to be ignored | |
static const char * | COMMENTS = "//" |
beginning of a comment string | |
Static Private Member Functions | |
static const std::set < std::string > | oneInputGates () |
A set of names of valid logic gates with one input. | |
static const std::set < std::string > | twoInputGates () |
A set of names of valid logic gates with two inputs. | |
static void | parsePortList (NetlistTokenizer &tokenizer, std::vector< std::string > &portNames) |
Parses the port list i.e. | |
static void | parseOutValues (NetlistTokenizer &tokenizer, std::map< std::string, LogicVal > &outValues) |
Parses the out values, which are the expected values of the circuit outputs at the end of simulation. | |
static void | parseInitList (NetlistTokenizer &tokenizer, StimulusMapType &inputStimulusMap) |
Parses the initialization list for all the inputs. | |
static void | parseNetlist (NetlistTokenizer &tokenizer, std::vector< GateRec > &gates) |
Parses the actual list of gates. | |
Private Attributes | |
const char * | netlistFile |
The netlist file. | |
std::vector< std::string > | inputNames |
The input names. | |
std::vector< std::string > | outputNames |
The output names. | |
std::map< std::string, LogicVal > | outValues |
The out values. | |
StimulusMapType | inputStimulusMap |
The input stimulus map has a list of (time, value) pairs for each input. | |
std::vector< GateRec > | gates |
The gates. | |
SimTime | finishTime |
The finish time. |
The Class NetlistParser parses an input netlist file.
typedef std::map<std::string, std::vector<std::pair<SimTime, LogicVal> > > NetlistParser::StimulusMapType |
NetlistParser::NetlistParser | ( | const char * | netlistFile | ) | [inline] |
Instantiates a new netlist parser.
netlistFile | the netlist file |
const SimTime& NetlistParser::getFinishTime | ( | ) | const [inline] |
Gets the finish time.
const std::vector<GateRec>& NetlistParser::getGates | ( | ) | const [inline] |
Gets the gates.
const std::vector<std::string>& NetlistParser::getInputNames | ( | ) | const [inline] |
Gets the input names.
const StimulusMapType& NetlistParser::getInputStimulusMap | ( | ) | const [inline] |
Gets the input stimulus map.
const char* NetlistParser::getNetlistFile | ( | ) | const [inline] |
Gets the netlist file.
const std::vector<std::string>& NetlistParser::getOutputNames | ( | ) | const [inline] |
Gets the output names.
const std::map<std::string, LogicVal>& NetlistParser::getOutValues | ( | ) | const [inline] |
Gets the out values.
static const std::set<std::string> NetlistParser::oneInputGates | ( | ) | [inline, static, private] |
A set of names of valid logic gates with one input.
void NetlistParser::parse | ( | const char * | fileName | ) | [inline] |
Parses the netlist contained in fileName.
Parsing steps parse input signal names parse output signal names parse finish time parse stimulus lists for each input signal parse the netlist
fileName | the file name |
static void NetlistParser::parseInitList | ( | NetlistTokenizer & | tokenizer, | |
StimulusMapType & | inputStimulusMap | |||
) | [inline, static, private] |
Parses the initialization list for all the inputs.
tokenizer | the tokenizer | |
inputStimulusMap | the input stimulus map |
static void NetlistParser::parseNetlist | ( | NetlistTokenizer & | tokenizer, | |
std::vector< GateRec > & | gates | |||
) | [inline, static, private] |
Parses the actual list of gates.
tokenizer | the tokenizer | |
gates | the gates |
static void NetlistParser::parseOutValues | ( | NetlistTokenizer & | tokenizer, | |
std::map< std::string, LogicVal > & | outValues | |||
) | [inline, static, private] |
Parses the out values, which are the expected values of the circuit outputs at the end of simulation.
tokenizer | the tokenizer | |
outValues | the expected out values at the end of the simulation |
static void NetlistParser::parsePortList | ( | NetlistTokenizer & | tokenizer, | |
std::vector< std::string > & | portNames | |||
) | [inline, static, private] |
Parses the port list i.e.
inputs and outputs
tokenizer | the tokenizer | |
portNames | the net names for input/output ports |
static const std::set<std::string> NetlistParser::twoInputGates | ( | ) | [inline, static, private] |
A set of names of valid logic gates with two inputs.
const char * NetlistParser::COMMENTS = "//" [static] |
beginning of a comment string
const char * NetlistParser::DELIM = " \n\t,;()=" [static] |
following is the list of token separators; characters meant to be ignored
SimTime NetlistParser::finishTime [private] |
The finish time.
std::vector<GateRec> NetlistParser::gates [private] |
The gates.
std::vector<std::string> NetlistParser::inputNames [private] |
The input names.
The input stimulus map has a list of (time, value) pairs for each input.
const char* NetlistParser::netlistFile [private] |
The netlist file.
std::vector<std::string> NetlistParser::outputNames [private] |
The output names.
std::map<std::string, LogicVal> NetlistParser::outValues [private] |
The out values.