isomatch
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
CircuitGroup Class Reference

#include <circuitGroup.h>

Inheritance diagram for CircuitGroup:
CircuitTree

Classes

class  InnerIoIter
 

Public Member Functions

IoIter inp_begin () const
 
IoIter out_begin () const
 
IoIter out_end () const
 
 CircuitGroup (const std::string &name)
 
 CircuitGroup (const std::string &name, WireManager *manager)
 
 ~CircuitGroup ()
 
CircType circType () const
 
void addChild (CircuitTree *child)
 
void addInput (const IOPin &pin)
 
void addInput (const std::string &formal, WireId *actual)
 
void addOutput (const IOPin &pin)
 
void addOutput (const std::string &formal, WireId *actual)
 
std::vector< CircuitTree * > & getChildren ()
 
const std::vector< CircuitTree * > & getChildren () const
 
const std::vector< CircuitTree * > & getChildrenCst () const
 Groups's subcircuits, const version. More...
 
std::vector< IOPin * > & getInputs ()
 
const std::vector< IOPin * > & getInputs () const
 
std::vector< IOPin * > & getOutputs ()
 
const std::vector< IOPin * > & getOutputs () const
 
sign_t ioSigOf (WireId *id)
 
WireManagerwireManager ()
 
std::vector< MatchResultfind (CircuitGroup *needle)
 
const std::string & name () const
 Get the group's name. More...
 
size_t inputCount () const
 Get the number of inputs. More...
 
size_t outputCount () const
 Get the number of outputs. More...
 
WireIdnth_input (size_t circId) const
 Get the nth input. More...
 
WireIdnth_output (size_t circId) const
 Get the nth input. More...
 
virtual void unplug ()
 Unplug the circuit from its ancestor. More...
 
void toDot (std::basic_ostream< char > &out, int indent=0)
 
- Public Member Functions inherited from CircuitTree
 CircuitTree ()
 
virtual ~CircuitTree ()
 
sign_t sign (int level=2)
 
bool equals (CircuitTree *oth)
 
bool operator== (const CircuitTree &oth) const
 
CircuitGroupancestor ()
 
size_t id () const
 
IoIter inp_end () const
 
IoIter io_begin () const
 
IoIter io_end () const
 
void alter (bool uprec=true)
 

Protected Member Functions

void alteredChild ()
 
virtual sign_t innerSignature () const
 
virtual bool innerEqual (CircuitTree *othTree)
 
void computeIoSigs ()
 
- Protected Member Functions inherited from CircuitTree
virtual sign_t computeSignature (int level)
 
void unplug_common ()
 Common steps for every overridden implementation of unplug More...
 

Friends

class CircuitTree
 

Additional Inherited Members

- Public Types inherited from CircuitTree
enum  CircType {
  CIRC_GROUP, CIRC_COMB, CIRC_DELAY, CIRC_TRI,
  CIRC_ASSERT
}
 
- Protected Types inherited from CircuitTree
typedef size_t memo_ts_t
 
- Protected Attributes inherited from CircuitTree
memo_ts_t curHistoryTime
 Current history "timestamp" for this circuit, used for memoization. More...
 
memo_ts_t lastAlterationTime
 
std::vector< MemoSignmemoSig
 
CircuitGroupancestor_
 

Constructor & Destructor Documentation

◆ CircuitGroup() [1/2]

CircuitGroup::CircuitGroup ( const std::string &  name)

Create a CircuitGroup with a given name. Its internal WireManager is automatically created.

◆ CircuitGroup() [2/2]

CircuitGroup::CircuitGroup ( const std::string &  name,
WireManager manager 
)

Create a CircuitManager with a given name and WireManager. The wire manager should not be shared with another CircuitGroup, as this would mean they would share the same wire naming scope. The manager gets automatically deleted when the group is de-allocated.

◆ ~CircuitGroup()

CircuitGroup::~CircuitGroup ( )

Destroys the inner WireManager.

Member Function Documentation

◆ addChild()

void CircuitGroup::addChild ( CircuitTree child)

Adds child as a child of this group. All external pins of child are disconnected, and reconnected to this group's corresponding wires during the process.

◆ addInput() [1/2]

void CircuitGroup::addInput ( const IOPin pin)

Adds pin as input pin of this group.

◆ addInput() [2/2]

void CircuitGroup::addInput ( const std::string &  formal,
WireId actual 
)

Adds an input pin to this group.

◆ addOutput() [1/2]

void CircuitGroup::addOutput ( const IOPin pin)

Adds pin as output pin of this group.

◆ addOutput() [2/2]

void CircuitGroup::addOutput ( const std::string &  formal,
WireId actual 
)

Adds an output pin to this group.

◆ alteredChild()

void CircuitGroup::alteredChild ( )
protected

◆ circType()

CircType CircuitGroup::circType ( ) const
inlinevirtual

Returns the tree element's type

Implements CircuitTree.

◆ computeIoSigs()

void CircuitGroup::computeIoSigs ( )
protected

◆ find()

std::vector< MatchResult > CircuitGroup::find ( CircuitGroup needle)

Returns every match of needle found (recursively in the hierarchy) in this group. Two results will never be overlapping; if two overlapping subcircuits are matches, it is undefined which one will be returned.

◆ getChildren() [1/2]

std::vector< CircuitTree * > & CircuitGroup::getChildren ( )

Group's subcircuits, mutable.

◆ getChildren() [2/2]

const std::vector< CircuitTree * > & CircuitGroup::getChildren ( ) const

Group's subcircuits

◆ getChildrenCst()

const std::vector< CircuitTree * > & CircuitGroup::getChildrenCst ( ) const

Groups's subcircuits, const version.

◆ getInputs() [1/2]

std::vector< IOPin * > & CircuitGroup::getInputs ( )

Group's inputs, mutable.

◆ getInputs() [2/2]

const std::vector< IOPin * > & CircuitGroup::getInputs ( ) const

Group's inputs

◆ getOutputs() [1/2]

std::vector< IOPin * > & CircuitGroup::getOutputs ( )

Group's outputs, mutable.

◆ getOutputs() [2/2]

const std::vector< IOPin * > & CircuitGroup::getOutputs ( ) const

Group's outputs

◆ innerEqual()

bool CircuitGroup::innerEqual ( CircuitTree othTree)
protectedvirtual

Computes the actual equality of two gates, assumed of the same type

Implements CircuitTree.

◆ innerSignature()

sign_t CircuitGroup::innerSignature ( ) const
protectedvirtual

Computes the inner signature of a gate. This should be reimplemented for every gate type.

Implements CircuitTree.

◆ inp_begin()

IoIter CircuitGroup::inp_begin ( ) const
inlinevirtual

Get an iterator to the first input wire

Implements CircuitTree.

◆ inputCount()

size_t CircuitGroup::inputCount ( ) const
virtual

Get the number of inputs.

Implements CircuitTree.

◆ ioSigOf()

sign_t CircuitGroup::ioSigOf ( WireId id)

Returns the I/O signature of a belonging to this group, that is, a signature encompassing how this particular wire is connected to the I/O pins of this group.

◆ name()

const std::string& CircuitGroup::name ( ) const
inline

Get the group's name.

◆ nth_input()

WireId * CircuitGroup::nth_input ( size_t  circId) const
virtual

Get the nth input.

Implements CircuitTree.

◆ nth_output()

WireId * CircuitGroup::nth_output ( size_t  circId) const
virtual

Get the nth input.

Implements CircuitTree.

◆ out_begin()

IoIter CircuitGroup::out_begin ( ) const
inlinevirtual

Get an iterator to the first output wire

Implements CircuitTree.

◆ out_end()

IoIter CircuitGroup::out_end ( ) const
inlinevirtual

Get an iterator to the end of output wires

Implements CircuitTree.

◆ outputCount()

size_t CircuitGroup::outputCount ( ) const
virtual

Get the number of outputs.

Implements CircuitTree.

◆ toDot()

void CircuitGroup::toDot ( std::basic_ostream< char > &  out,
int  indent = 0 
)
virtual

Generates a Dot representation of the circuit, primarily intended for debugging.

Implements CircuitTree.

◆ unplug()

void CircuitGroup::unplug ( )
virtual

Unplug the circuit from its ancestor.

Unplug the circuit from its ancestor, that is, disconnects every wire. You should delete this circuit right after it has been unplugged, as its internal state is not cleaned up and will most probably break up in mean and inventive ways if you try to reuse it

Reimplemented from CircuitTree.

◆ wireManager()

WireManager* CircuitGroup::wireManager ( )
inline

Group's WireManager.

Friends And Related Function Documentation

◆ CircuitTree

friend class CircuitTree
friend

The documentation for this class was generated from the following files: