File size: 1,481 Bytes
d1be154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <ot/timer/gate.hpp>

namespace ot {

// Constructor
Gate::Gate(const std::string& name, CellView cell) : 
  _name {name},
  _cell {cell} {
}

// Function: cell_name
const std::string& Gate::cell_name() const {
  return _cell[MIN]->name;
}

/*// Procedure: _repower
void Gate::_repower(CellView cell) {

  assert(cell[MIN] && cell[MAX]);

  // Remap the pin
  for(auto pin : _pins) {
    FOR_EACH_EL(el) {
      assert(pin->cellpin(el));
      if(const auto cpin = cell[el]->cellpin(pin->cellpin(el)->name)) {
        pin->_remap_cellpin(el, *cpin);
      }
      else {
        OT_LOGE(
          "repower ", _name, " with ", cell[el]->name, " failed (cellpin mismatched)"
        );  
      }
    }
  }

  // Remap the arc
  for(auto arc : _arcs) {

    auto ptv = arc->timing_view();
    
    FOR_EACH_EL_IF(el, ptv[el]) {

      if(auto tcp = cell[el]->cellpin(arc->_to.cellpin(el)->name); tcp) {
        if(auto ntm = tcp->isomorphic_timing(*ptv[el]); ntm) {
          arc->_remap_timing(el, *ntm);
        }
        else {
          OT_LOGE(
            "repower ", _name, " with ", cell[el]->name, " failed (timing mismatched)"
          );
        }
      }
      else {
        OT_LOGE(
          "repower ", _name, " with ", cell[el]->name, " failed (cellpin mismatched)"
        );  
      }
    }
  }
  
  // remap to the new cell.
  _cell = cell;
}*/



};  // end of namespace ot. -----------------------------------------------------------------------