NetlistParser Class Reference

The Class NetlistParser parses an input netlist file. More...

#include <NetlistParser.h>

List of all members.

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 SimTimegetFinishTime () 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 StimulusMapTypegetInputStimulusMap () 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, LogicValoutValues
 The out values.
StimulusMapType inputStimulusMap
 The input stimulus map has a list of (time, value) pairs for each input.
std::vector< GateRecgates
 The gates.
SimTime finishTime
 The finish time.

Detailed Description

The Class NetlistParser parses an input netlist file.


Member Typedef Documentation

typedef std::map<std::string, std::vector<std::pair<SimTime, LogicVal> > > NetlistParser::StimulusMapType

Constructor & Destructor Documentation

NetlistParser::NetlistParser ( const char *  netlistFile  )  [inline]

Instantiates a new netlist parser.

Parameters:
netlistFile the netlist file

Member Function Documentation

const SimTime& NetlistParser::getFinishTime (  )  const [inline]

Gets the finish time.

Returns:
the finish time
const std::vector<GateRec>& NetlistParser::getGates (  )  const [inline]

Gets the gates.

Returns:
the gates
const std::vector<std::string>& NetlistParser::getInputNames (  )  const [inline]

Gets the input names.

Returns:
the input names
const StimulusMapType& NetlistParser::getInputStimulusMap (  )  const [inline]

Gets the input stimulus map.

Returns:
the input stimulus map
const char* NetlistParser::getNetlistFile (  )  const [inline]

Gets the netlist file.

Returns:
the netlist file
const std::vector<std::string>& NetlistParser::getOutputNames (  )  const [inline]

Gets the output names.

Returns:
the output names
const std::map<std::string, LogicVal>& NetlistParser::getOutValues (  )  const [inline]

Gets the out values.

Returns:
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

Parameters:
fileName the file name
static void NetlistParser::parseInitList ( NetlistTokenizer tokenizer,
StimulusMapType inputStimulusMap 
) [inline, static, private]

Parses the initialization list for all the inputs.

Parameters:
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.

Parameters:
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.

Parameters:
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

Parameters:
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.


Member Data Documentation

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

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.


The documentation for this class was generated from the following files:
Generated on Tue Aug 2 11:51:27 2011 for Galois by  doxygen 1.6.3