# VLSI SAPD Documentation

Presentation | AGDS | CIF | DTR | OPENCHAMS | SPICE | Links & Contact

Public Member Functions
Netlist Class Reference

## Public Member Functions

Device * | addDevice (const std::string &name, const std::string &model, unsigned, const std::string &mosType, bool)
| adds a Device to the netlist. More...
Instance * | addInstance (const std::string &name, const std::string &model, unsigned)
| adds an Instance (subcircuit) to the netlist. More...
Net * | addNet (const std::string &name, const std::string &type, bool)
| adds a Net to the netlist. More...
Circuit * | getCircuit ()
| returns the Circuit the netlist is associated to.
Instance * | getInstance (const std::string &)
| returns the Instance named `name` or NULL it does not exist. More...
const std::vector< Instance * > & | getInstances ()
| returns the list of netlist's instances.
Net * | getNet (const std::string &)
| returns the Net named `name` or NULL it does not exist. More...
const std::vector< Net * > & | getNets ()
| returns the list of netlist's nets.
bool | hasNoInstances ()
| returns true if netlist has no instances.
bool | hasNoNets ()
| returns true if netlist has no nets.
| Netlist (Circuit *)
| creates a new netlist. More...

## Detailed Description

This class describes a netlist.

A netlist contains the list of all circuit's instances and nets.

Note
  A Circuit must have one and only netlist. If no netlist is defined the Circuit cannot be driven to file.

## Constructor & Destructor Documentation

## ◆ Netlist()

Netlist | ( | Circuit * | circuit | ) |

creates a new netlist.

Parameters

  circuit | the circuit to which the netlist belongs.

## Member Function Documentation

## ◆ addDevice()

Device * addDevice | ( | const std::string & | name,
|  | const std::string & | model,
|  | unsigned | order,
|  | const std::string & | mosType,
|  | bool | sourceBulkConnected
| ) |  |

adds a Device to the netlist.

Parameters

  name | the name of the device.
  model | the model of the device.
  mosType | the mos type of the device (NMOS or PMOS).
  connected | if true, then device's bulk is source connected.

Returns
  the newly created Device.

## ◆ addInstance()

Instance * addInstance | ( | const std::string & | name,
|  | const std::string & | model,
|  | unsigned | order
| ) |  |

adds an Instance (subcircuit) to the netlist.

Parameters

  name | the name of the instance.
  model | the model of the instance.

Returns
  the newly created Instance.

## ◆ addNet()

Net * addNet | ( | const std::string & | name,
|  | const std::string & | type,
|  | bool | external
| ) |  |

adds a Net to the netlist.

Parameters

  name | the name of the net.
  type | the type of the net (LOGICAL, POWER, GROUND, ...).
  external | if true, then the net is set as external.

Returns
  the newly created Net.

## ◆ getInstance()

Instance * getInstance | ( | const std::string & | instanceName | ) |

returns the Instance named `name` or NULL it does not exist.

Parameters

  name | the name of the instance to get.

## ◆ getNet()

Net * getNet | ( | const std::string & | netName | ) |

returns the Net named `name` or NULL it does not exist.

Parameters

  name | the name of the net to get.