degate  0.1.2
Public Member Functions
degate::ERCOpenPorts Class Reference

Electrical Rule Checks that detects open ports, that means if a port is electrically unconnected. More...

#include <ERCOpenPorts.h>

Inheritance diagram for degate::ERCOpenPorts:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ERCOpenPorts ()
void run (LogicModel_shptr lmodel)
 The run method is abstract and must be implemented in derived classes.

Detailed Description

Electrical Rule Checks that detects open ports, that means if a port is electrically unconnected.

Definition at line 35 of file ERCOpenPorts.h.


Constructor & Destructor Documentation

Definition at line 27 of file ERCOpenPorts.cc.

                           :
  RCBase("open_port", "Check for unconnected ports.", RC_WARNING) {
}

Member Function Documentation

void ERCOpenPorts::run ( LogicModel_shptr  lmodel) [virtual]

The run method is abstract and must be implemented in derived classes.

The implementation should check for design rule violations. Each RC violation must be stored via method add_rc_violation(). Note: Because run() can be called multiple times, at the beginning of run() you must clear the list of detected violations.

Implements degate::RCBase.

Definition at line 31 of file ERCOpenPorts.cc.

References degate::RCBase::add_rc_violation(), degate::RCBase::clear_rc_violations(), debug(), degate::RCBase::get_rc_class_name(), and TM.

                                              {
  clear_rc_violations();

  if(lmodel == NULL) return;

  // iterate over Gates
  debug(TM, "\tRC: iterate over gates.");

  for(LogicModel::gate_collection::iterator g_iter = lmodel->gates_begin();
      g_iter != lmodel->gates_end(); ++g_iter) {

    Gate_shptr gate = g_iter->second;
    
    for(Gate::port_const_iterator p_iter = gate->ports_begin();
        p_iter != gate->ports_end(); ++p_iter) {
      
      GatePort_shptr port = *p_iter;
      assert(port != NULL);
      
      Net_shptr net = port->get_net();
      if(net == NULL || net->size() <= 1) {
        
        boost::format f("Port %1% is unconnected.");
        f % port->get_descriptive_identifier();

        debug(TM, "\tRC: found a vioation.");
        add_rc_violation(RCViolation_shptr(new RCViolation(port, f.str(),
                                                           get_rc_class_name())));
      }
    }
  }
}

Here is the call graph for this function:


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