diff --git a/kite/src/KiteEngine.cpp b/kite/src/KiteEngine.cpp index 84348df8..7125e6fd 100644 --- a/kite/src/KiteEngine.cpp +++ b/kite/src/KiteEngine.cpp @@ -461,10 +461,9 @@ namespace Kite { //DebugSession::addToTrace ( getCell(), "mips_r3000_1m_dp_addsub32_carith_se_gi_1_29" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.instaddbracry_sd.gi_1_29" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.instseqadr_sd.pi_2_26" ); - //DebugSession::addToTrace ( getCell(), "mips_r3000_1m_dp_addsub32_carith_se_pi_3_29" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_1m_dp_res_se(28)" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.etat32_otheri_sd_2.enx" ); - //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.yoper_se(13)" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.yoper_se(31)" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.toper_se(5)" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.soper_se(20)" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.shift32_rshift_se.muxoutput(68)" ); @@ -473,7 +472,6 @@ namespace Kite { //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.res_re(20)" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.nextpc_rd(21)" ); //DebugSession::addToTrace ( getCell(), "addr_i(1)" ); - //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.opcod_rd(1)" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.otheri_sd(29)" ); //DebugSession::addToTrace ( getCell(), "d_in_i(22)" ); //DebugSession::addToTrace ( getCell(), "ng_i" ); @@ -481,28 +479,40 @@ namespace Kite { //DebugSession::addToTrace ( getCell(), "d_out_i(19)" ); //DebugSession::addToTrace ( getCell(), "dout_e_i(1)" ); //DebugSession::addToTrace ( getCell(), "dout_e_i(2)" ); - //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.aux44" ); - //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.na4_x1_11_sig" ); - //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.nxr2_x1_7_sig" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.aux178" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.nxr2_x1_2_sig" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.na4_x1_23_sig" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.ao22_x2_38_sig" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.rsdnbr_sd(14)" ); //DebugSession::addToTrace ( getCell(), "d_out_i(28)" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_1m_ct_mbk_buf_opcod_sd_0" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.break_re" ); //DebugSession::addToTrace ( getCell(), "d_atype_i(0)" ); - //DebugSession::addToTrace ( getCell(), "addr_i(0)" ); + //DebugSession::addToTrace ( getCell(), "addr_i(7)" ); + //DebugSession::addToTrace ( getCell(), "addr_i(8)" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.opcod_sd_5" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.not_opcod_sd_1" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.opcod_rd(1)" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.i_write_sm" ); - //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.not_i_ri(11)" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.not_i_ri(29)" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.not_opcod_rd(0)" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.no4_x1_7_sig" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.on12_x1_15_sig" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.nextsr_rx(27)" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.not_wsr_sm" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.i_ri(5)" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.not_aux144" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.not_aux143" ); - //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.aux78" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.aux71" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.not_hold_si" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_ct.not_i_ri(30)" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.data_rm(0)" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.toper_se(0)" ); //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.res_se(17)" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.addsub32_carith_se.pi_0_20" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.addsub32_carith_se.pi_2_23" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.addsub32_carith_se.gi_2_23" ); + //DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.addsub32_carith_se.gi_1_21" ); createDetailedGrid (); buildPowerRails (); diff --git a/kite/src/NegociateWindow.cpp b/kite/src/NegociateWindow.cpp index 8f5a06bf..d596bb9e 100644 --- a/kite/src/NegociateWindow.cpp +++ b/kite/src/NegociateWindow.cpp @@ -8,7 +8,7 @@ // // $Id$ // -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ // | | // | C O R I O L I S | // | K i t e - D e t a i l e d R o u t e r | @@ -20,7 +20,7 @@ // | *************************************************************** | // | U p d a t e s | // | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ #include @@ -110,7 +110,8 @@ namespace { // } cost.setOverlap (); - cost.incTerminals ( data->getCost().getTerminals()*100 ); + if ( segment->isLocal() or (Session::getRoutingGauge()->getLayerDepth(segment->getLayer()) < 3) ) + cost.incTerminals ( data->getCost().getTerminals()*100 ); cost.incDelta ( intersect.getSize() ); } @@ -387,21 +388,24 @@ namespace Kite { while ( not _eventQueue.empty() and not isInterrupted() ) { RoutingEvent* event = _eventQueue.pop (); - event->process ( _eventQueue, _eventHistory, _eventLoop ); if (tty::enabled()) { cmess2 << " " << tty::cr; cmess2.flush (); } else { cmess2 << " @" - << DbU::getValueString(event->getSegment()->getAxis()) << " id:" - << event->getSegment()->getId() << " " - << event->getSegment()->getNet()->getName() + << RoutingEvent::getProcesseds() << setfill(' ') << " " + << event->getEventLevel() << ":" << event->getPriority() << "> " + << event->getSegment() + //<< "> @" << DbU::getValueString(event->getSegment()->getAxis()) + //<< " id:" << event->getSegment()->getId() + //<< " " << event->getSegment()->getNet()->getName() << endl; cmess2.flush(); } + event->process ( _eventQueue, _eventHistory, _eventLoop ); + if ( RoutingEvent::getProcesseds() >= limit ) setInterrupt ( true ); count++; } diff --git a/kite/src/RoutingEvent.cpp b/kite/src/RoutingEvent.cpp index 2cdb2beb..45e54f6d 100644 --- a/kite/src/RoutingEvent.cpp +++ b/kite/src/RoutingEvent.cpp @@ -869,6 +869,7 @@ namespace { , RoutingEventQueue& , RoutingEventHistory& ); + inline bool isFullBlocked () const; inline RoutingEvent* getEvent (); inline RoutingEventQueue& getQueue (); inline RoutingEventHistory& getHistory (); @@ -895,6 +896,7 @@ namespace { bool conflictSolve1_v1b (); bool conflictSolve1_v2 (); bool conflictSolve2 (); + bool desaturate (); bool slackenTopology ( unsigned int flags=0 ); bool solveFullBlockages (); @@ -908,6 +910,7 @@ namespace { Interval _optimal; vector _costs; vector _actions; + bool _fullBlocked; }; @@ -990,8 +993,10 @@ namespace { , _optimal () , _costs () , _actions () + , _fullBlocked (true) { TrackElement* segment = _event->getSegment(); + unsigned int depth = Session::getRoutingGauge()->getLayerDepth(segment->getLayer()); _event->setTracksFree ( 0 ); _data = segment->getDataNegociate(); @@ -1034,7 +1039,12 @@ namespace { ltrace(148) << "* Constraints: " << _constraint << endl; ltracein(148); - bool inLocalDepth = (Session::getRoutingGauge()->getLayerDepth(segment->getLayer()) < 3); + // if ( segment->isLocal() and (_data->getState() >= DataNegociate::MaximumSlack) ) + // _constraint.inflate ( 0, DbU::lambda(1.0) ); + + bool inLocalDepth = (depth < 3); + bool isOneLocalTrack = (segment->isLocal()) + and (segment->base()->getAutoSource()->getGCell()->getGlobalsCount(depth) >= 9.0); RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(segment->getLayer()); forEach ( Track*, itrack, Tracks_Range::get(plane,_constraint)) { @@ -1045,7 +1055,15 @@ namespace { if ( inLocalDepth and (_costs.back().getDataState() == DataNegociate::MaximumSlack) ) _costs.back().setInfinite (); + if ( isOneLocalTrack + and _costs.back().isOverlapGlobal() + and (_costs.back().getDataState() >= DataNegociate::ConflictSolve1) ) + _costs.back().setInfinite (); + _costs.back().consolidate (); + if ( _fullBlocked and (not _costs.back().isBlockage() and not _costs.back().isFixed()) ) + _fullBlocked = false; + ltrace(149) << "| " << (*itrack) << " - " << _costs.back() << endl; } ltraceout(148); @@ -1080,6 +1098,7 @@ namespace { } + inline bool State::isFullBlocked () const { return _fullBlocked and _costs.size(); } inline RoutingEvent* State::getEvent () { return _event; } inline RoutingEventQueue& State::getQueue () { return _queue; } inline RoutingEventHistory& State::getHistory () { return _history; } @@ -1612,59 +1631,97 @@ namespace { bool State::solveFullBlockages () { bool success = false; - bool blocked = (getCosts().size() > 0); TrackElement* segment = getEvent()->getSegment(); ltrace(200) << "State::solveFullBlockages: " << " " << segment << endl; ltracein(200); - for ( size_t itrack=0 ; itrackisLocal() ) { - success = Manipulator(segment,*this).pivotUp(); - if ( not success ) { - ltrace(200) << "Tightly constrained local segment overlapping a blockage, move up." << endl; - ltrace(200) << segment << endl; - success = Manipulator(segment,*this).moveUp - (Manipulator::AllowLocalMoveUp|Manipulator::AllowTerminalMoveUp); - } - } else { - Interval overlap = segment->getCanonicalInterval(); - size_t begin; - size_t end; - - getCost(0).getTrack()->getOverlapBounds ( overlap, begin, end ); - for ( ; begingetSegment(begin); - Interval otherOverlap = other->getCanonicalInterval(); - - if ( other->getNet() == segment->getNet() ) continue; - if ( not otherOverlap.intersect(overlap) ) continue; - - ltrace(200) << "| " << begin << " Blockage conflict: " << " " << other << endl; - if ( (success = Manipulator(segment,*this).relax - (otherOverlap,Manipulator::NoDoglegReuse|Manipulator::NoExpand)) ) { - break; - } - } - } + if ( segment->isLocal() ) { + success = Manipulator(segment,*this).pivotUp(); if ( not success ) { - cerr << "[ERROR] Tighly constrained segment overlapping a blockage." << endl; - ltrace(200) << "Segment is hard blocked, bypass to Unimplemented." << endl; + ltrace(200) << "Tightly constrained local segment overlapping a blockage, move up." << endl; + ltrace(200) << segment << endl; + success = Manipulator(segment,*this).moveUp + (Manipulator::AllowLocalMoveUp|Manipulator::AllowTerminalMoveUp); + } + } else { + Interval overlap = segment->getCanonicalInterval(); + size_t begin; + size_t end; + + getCost(0).getTrack()->getOverlapBounds ( overlap, begin, end ); + for ( ; begingetSegment(begin); + Interval otherOverlap = other->getCanonicalInterval(); + + if ( other->getNet() == segment->getNet() ) continue; + if ( not otherOverlap.intersect(overlap) ) continue; + + ltrace(200) << "| " << begin << " Blockage conflict: " << " " << other << endl; + if ( (success = Manipulator(segment,*this).relax + (otherOverlap,Manipulator::NoDoglegReuse|Manipulator::NoExpand)) ) { + break; + } } } - + if ( not success ) { + cerr << "[ERROR] Tighly constrained segment overlapping a blockage." << endl; + ltrace(200) << "Segment is hard blocked, bypass to Unimplemented." << endl; + } + ltraceout(200); return success; } + bool State::desaturate () + { + TrackElement* segment = _event->getSegment(); + unsigned int depth = Session::getRoutingGauge()->getLayerDepth(segment->getLayer()); + + ltrace(200) << "State::desaturate()" << segment << endl; + ltracein(200); + + if ( segment->getLength() > DbU::lambda(75.0) ) { + ltraceout(200); + return false; + } + + GCell* gcell = segment->base()->getAutoSource()->getGCell(); + const vector* globals = (segment->isHorizontal()) + ? gcell->getHSegments() : gcell->getVSegments(); + + ltrace(200) << gcell << endl; + + if ( (*globals).empty() ) { + ltraceout(200); + return false; + } + + for ( size_t i=0 ; i<(*globals).size() ; ++i ) { + size_t gdepth = Session::getRoutingGauge()->getLayerDepth((*globals)[i]->getLayer()); + if ( gdepth != depth ) continue; + + ltrace(200) << "| " << (*globals)[i] << endl; + + TrackElement* gsegment = Session::lookup ( (*globals)[i] ); + ltrace(200) << "|*" << (*globals)[i] << endl; + + if ( (*globals)[i] == segment->base() ) continue; + + if ( gsegment ) { + if ( Manipulator(gsegment,*this).moveUp() ) { + ltrace(200) << "Successful desaturation of " << gcell << endl; + ltraceout(200); + return true; + } + } + } + + ltraceout(200); + return false; + } + bool State::slackenTopology ( unsigned int flags ) { TrackElement* segment = getEvent()->getSegment(); @@ -1747,6 +1804,7 @@ namespace { break; } case DataNegociate::MoveUp: + //if ( (success = desaturate()) ) break; nextState = DataNegociate::MaximumSlack; success = Manipulator(segment,*this).moveUp(); if ( success ) break; @@ -1770,7 +1828,8 @@ namespace { if ( not success and (nextState == DataNegociate::Unimplemented) - and segment->isSlackened() ) { + and segment->isSlackened() + and isFullBlocked() ) { solveFullBlockages (); } } else { @@ -1779,6 +1838,11 @@ namespace { ltrace(200) << "Global segment FSM." << endl; case DataNegociate::RipupPerpandiculars: ltrace(200) << "Global, State: RipupPerpandiculars." << endl; + // if ( isFullBlocked() ) { + // actionFlags &= ~SegmentAction::EventLevel5; + // success = Manipulator(segment,*this).ripupPerpandiculars(Manipulator::PerpandicularsFirst); + // if ( success ) break; + // } nextState = DataNegociate::Desalignate; break; case DataNegociate::Minimize: @@ -1797,6 +1861,7 @@ namespace { } case DataNegociate::MoveUp: ltrace(200) << "Global, State: MoveUp." << endl; + //if ( (success = desaturate()) ) break; if ( (success = Manipulator(segment,*this).moveUp(Manipulator::AllowShortPivotUp)) ) { break; } @@ -1985,7 +2050,12 @@ namespace { for ( size_t i=0 ; i < perpandiculars.size() ; i++ ) { track = perpandiculars[i]->getTrack(); - if ( not track ) continue; + if ( not track ) { + if ( flags & Manipulator::PerpandicularsFirst ) { + _S.addAction ( perpandiculars[i], perpandicularActionFlags ); + } + continue; + } bool dislodgeCaged = false; if ( Manipulator(perpandiculars[i],_S).isCaged(_event->getSegment()->getAxis()) ) { @@ -2497,6 +2567,14 @@ namespace { } } + if ( _segment->isLocal() and segment2->isLocal() ) { + if ( shrinkLeft and shrinkRight ) { + Interval interval1 = segment2->getCanonicalInterval(); + if ( toFree.getCenter() < interval1.getCenter() ) shrinkRight = false; + else shrinkLeft = false; + } + } + if ( not (shrinkLeft xor shrinkRight) ) { ltrace(200) << "- Hard overlap/enclosure/shrink " << segment2 << endl; if ( _segment->isStrap() and segment2->isGlobal() ) continue; @@ -2846,7 +2924,9 @@ namespace { if ( _segment->isFixed () ) return false; if ( _segment->isStrap () ) return false; - if ( not _segment->canMoveUp(0.5) ) return false; + + float reserve = (_segment->isLocal()) ? 0.5 : 1.0; + if ( not _segment->canMoveUp(reserve) ) return false; _segment->moveUp (); return true; @@ -2870,7 +2950,7 @@ namespace { { ltrace(200) << "Manipulator::moveUp() " << _segment << endl; - unsigned int kflags = Katabatic::AutoSegment::Propagate; + unsigned int kflags = Katabatic::AutoSegment::Propagate|Katabatic::AutoSegment::PerpandicularFrag; kflags |= (flags & AllowLocalMoveUp ) ? Katabatic::AutoSegment::AllowLocal : 0; kflags |= (flags & AllowTerminalMoveUp) ? Katabatic::AutoSegment::AllowTerminal : 0; @@ -2881,12 +2961,12 @@ namespace { } else { if ( _segment->getLength() < DbU::lambda(100.0) ) { if ( not (flags & AllowShortPivotUp) ) return false; - if ( not _segment->canPivotUp(2.0) ) return false; + if ( not _segment->canPivotUp(0.5) ) return false; } - if ( not _segment->canMoveUp(1.0,kflags) ) return false; // MARK 1 + if ( not _segment->canMoveUp(0.5,kflags) ) return false; // MARK 1 } } else { - if ( not _segment->canMoveUp(1.0,kflags) ) return false; // MARK 1 + if ( not _segment->canMoveUp(0.5,kflags) ) return false; // MARK 1 } #if DISABLED @@ -3296,21 +3376,21 @@ namespace Kite { { //if ( lhs._ring xor rhs._ring ) return lhs._ring; - if ( lhs._eventLevel < rhs._eventLevel ) return true; if ( lhs._eventLevel > rhs._eventLevel ) return false; + if ( lhs._eventLevel < rhs._eventLevel ) return true; if ( lhs._canRipple xor rhs._canRipple ) return rhs._canRipple; //if ( lhs._slackenStrap xor rhs._slackenStrap ) return lhs._slackenStrap; // Uses static ordering. - //if ( lhs._tracksNb < rhs._tracksNb ) return false; //if ( lhs._tracksNb > rhs._tracksNb ) return true; + //if ( lhs._tracksNb < rhs._tracksNb ) return false; - if ( lhs._priority < rhs._priority ) return false; - if ( lhs._priority > rhs._priority ) return true; + if ( lhs._priority > rhs._priority ) return false; + if ( lhs._priority < rhs._priority ) return true; - if ( lhs._length < rhs._length ) return true; if ( lhs._length > rhs._length ) return false; + if ( lhs._length < rhs._length ) return true; if ( lhs._isHorizontal xor rhs._isHorizontal ) return rhs._isHorizontal; @@ -3519,7 +3599,11 @@ namespace Kite { _axisHint = parent->getAxis(); return; } - _axisHint = (parentEvent) ? parentEvent->getAxisHint() : parent->getAxis (); + //_axisHint = (parentEvent) ? parentEvent->getAxisHint() : parent->getAxis (); + _axisHint = parent->getAxis (); + + ltrace(200) << "cacheAxisHint() - hint:" << DbU::getValueString(_axisHint) + << " axis:" << DbU::getValueString(parent->getAxis()) << " parent:" << parent << endl; return; } @@ -3829,7 +3913,7 @@ namespace Kite { ltrace(200) << "RoutingEvent::revalidate() - " << (void*)this << ":" << this << endl; ltracein(200); - //cacheAxisHint (); + cacheAxisHint (); ltrace(200) << "axisHint:" << DbU::getValueString(getAxisHint()) << endl; _canHandleConstraints = true; diff --git a/kite/src/RoutingPlane.cpp b/kite/src/RoutingPlane.cpp index 5b3a08c1..3a1b4deb 100644 --- a/kite/src/RoutingPlane.cpp +++ b/kite/src/RoutingPlane.cpp @@ -118,6 +118,15 @@ namespace Kite { for ( size_t index = 0 ; index < trackNumber ; index++ ) { if ( plane->getLayerGauge()->getDirection() & Constant::Horizontal ) { plane->_tracks.push_back ( HorizontalTrack::create ( plane, index ) ); + // Ugly: Direct uses of CellGauge (middle tracks 4 & 5 for local use). + if ( depth == 1 ) { + switch ( index % 10 ) { + case 4: + case 5: + plane->_tracks.back()->setLocalAssigned ( true ); + break; + } + } } else { plane->_tracks.push_back ( VerticalTrack::create ( plane, index ) ); } diff --git a/kite/src/Track.cpp b/kite/src/Track.cpp index 21c6e870..ccf1e218 100644 --- a/kite/src/Track.cpp +++ b/kite/src/Track.cpp @@ -92,6 +92,7 @@ namespace Kite { , _max (routingPlane->getTrackMax()) , _segments () , _markers () + , _localAssigned(false) , _segmentsValid(false) , _markersValid (false) { } @@ -290,8 +291,8 @@ namespace Kite { ltrace(190) << "getOverlapCost() @" << DbU::getValueString(_axis) << " [" << DbU::getValueString(interval.getVMin()) - << ":" << DbU::getValueString(interval.getVMax()) << "]" - << "<-> [" << begin << ":" << end << "]" + << ":" << DbU::getValueString(interval.getVMax()) + << "] <-> [" << begin << ":" << end << "]" << endl; ltracein(148); diff --git a/kite/src/TrackCost.cpp b/kite/src/TrackCost.cpp index fe448fb4..4f8ead82 100644 --- a/kite/src/TrackCost.cpp +++ b/kite/src/TrackCost.cpp @@ -109,7 +109,7 @@ namespace Kite { bool TrackCost::isFree () const { - return /*(_terminals == 0) &&*/ (!_overlap) && (!_infinite); + return /*(not _terminals) and*/ (not _overlap) and (not _infinite); } diff --git a/kite/src/TrackFixedSegment.cpp b/kite/src/TrackFixedSegment.cpp index 789d4b8d..7bf569c1 100644 --- a/kite/src/TrackFixedSegment.cpp +++ b/kite/src/TrackFixedSegment.cpp @@ -111,14 +111,16 @@ namespace Kite { guside = gcell->getUSide ( Constant::Horizontal /*, true*/ ); Interval usedLength = guside.getIntersection ( segside ); - gcell->addBlockage ( depth, usedLength.getSize() ); + gcell->addBlockage ( depth, usedLength.getSize() ); + //gcell->addBlockedAxis ( depth, track->getAxis() ); gcell = right; } if ( end ) { guside = gcell->getUSide ( Constant::Horizontal /*, true*/ ); Interval usedLength = guside.getIntersection ( segside ); - end->addBlockage ( depth, usedLength.getSize() ); + end->addBlockage ( depth, usedLength.getSize() ); + //end->addBlockedAxis ( depth, track->getAxis() ); } } else cerr << Warning("TrackFixedSegment(): TrackFixedElement outside GCell grid.") << endl; @@ -141,14 +143,16 @@ namespace Kite { guside = gcell->getUSide ( Constant::Vertical /*, true*/ ); Interval usedLength = guside.getIntersection ( segside ); - gcell->addBlockage ( depth, usedLength.getSize() ); + gcell->addBlockage ( depth, usedLength.getSize() ); + //gcell->addBlockedAxis ( depth, track->getAxis() ); gcell = up; } if ( end ) { guside = gcell->getUSide ( Constant::Vertical /*, true*/ ); Interval usedLength = guside.getIntersection ( segside ); - end->addBlockage ( depth, usedLength.getSize() ); + end->addBlockage ( depth, usedLength.getSize() ); + //end->addBlockedAxis ( depth, track->getAxis() ); } } else cerr << Warning("TrackFixedSegment(): TrackFixedElement outside GCell grid.") << endl; diff --git a/kite/src/TrackSegmentCost.cpp b/kite/src/TrackSegmentCost.cpp index 7104aa44..af35d811 100644 --- a/kite/src/TrackSegmentCost.cpp +++ b/kite/src/TrackSegmentCost.cpp @@ -118,7 +118,7 @@ namespace Kite { perpandicular = Session::lookup ( perpandiculars[i]->getCanonical(interval)->base() ); } - if ( !perpandicular ) { + if ( not perpandicular ) { cerr << Bug("Not a TrackSegment: %s:%s\n (perpandicular: %s:%s)" ,getString((void*)perpandiculars[i]->getCanonical(interval)->base()).c_str() ,getString(perpandiculars[i]->getCanonical(interval)).c_str() @@ -141,11 +141,11 @@ namespace Kite { continue; } - if ( ( interval.getVMin() != trackSegment->getAxis() ) - || AutoSegment::isTopologicalBound(perpandiculars[i] - ,false - ,perpandicular->isHorizontal() - ) ) { + if ( ( interval.getVMin() != trackSegment->getAxis() ) + or AutoSegment::isTopologicalBound(perpandiculars[i] + ,false + ,perpandicular->isHorizontal() + ) ) { map::iterator iattractor = attractorSpins.find ( interval.getVMin() ); if ( iattractor == attractorSpins.end() ) { attractorSpins.insert ( make_pair(interval.getVMin(),-1) ); @@ -155,11 +155,11 @@ namespace Kite { ltrace(148) << "Left attractor @" << DbU::getValueString(interval.getVMin()) << endl; } - if ( ( interval.getVMax() != trackSegment->getAxis() ) - || AutoSegment::isTopologicalBound(perpandiculars[i] - ,true - ,perpandicular->isHorizontal() - ) ) { + if ( ( interval.getVMax() != trackSegment->getAxis() ) + or AutoSegment::isTopologicalBound(perpandiculars[i] + ,true + ,perpandicular->isHorizontal() + ) ) { map::iterator iattractor = attractorSpins.find ( interval.getVMax() ); if ( iattractor == attractorSpins.end() ) { attractorSpins.insert ( make_pair(interval.getVMax(),1) ); diff --git a/kite/src/kite/Track.h b/kite/src/kite/Track.h index 43dc4574..06253d94 100644 --- a/kite/src/kite/Track.h +++ b/kite/src/kite/Track.h @@ -86,6 +86,7 @@ namespace Kite { KiteEngine* getKiteEngine () const; virtual bool isHorizontal () const = 0; virtual bool isVertical () const = 0; + inline bool isLocalAssigned () const; virtual unsigned int getDirection () const = 0; inline size_t getIndex () const; unsigned int getDepth () const; @@ -118,6 +119,7 @@ namespace Kite { Interval expandUsedInterval ( size_t& begin, size_t& end ) const; Interval expandFreeInterval ( size_t& begin, size_t& end, unsigned int state, Net* ) const; unsigned int checkOverlap ( unsigned int& overlaps ) const; + inline void setLocalAssigned ( bool ); void forceSort (); void insert ( TrackElement* ); void insert ( TrackMarker* ); @@ -138,6 +140,7 @@ namespace Kite { DbU::Unit _max; vector _segments; vector _markers; + bool _localAssigned; bool _segmentsValid; bool _markersValid; @@ -201,12 +204,14 @@ namespace Kite { } - inline RoutingPlane* Track::getRoutingPlane () const { return _routingPlane; } - inline size_t Track::getIndex () const { return _index; } - inline DbU::Unit Track::getAxis () const { return _axis; } - inline DbU::Unit Track::getMin () const { return _min; } - inline DbU::Unit Track::getMax () const { return _max; } - inline size_t Track::getSize () const { return _segments.size(); } + inline bool Track::isLocalAssigned () const { return _localAssigned; } + inline RoutingPlane* Track::getRoutingPlane () const { return _routingPlane; } + inline size_t Track::getIndex () const { return _index; } + inline DbU::Unit Track::getAxis () const { return _axis; } + inline DbU::Unit Track::getMin () const { return _min; } + inline DbU::Unit Track::getMax () const { return _max; } + inline size_t Track::getSize () const { return _segments.size(); } + inline void Track::setLocalAssigned ( bool state ) { _localAssigned=state; } inline unsigned int Track::setMinimalFlags ( unsigned int& state, unsigned int flags ) const { diff --git a/kite/src/kite/TrackElement.h b/kite/src/kite/TrackElement.h index 0b9e5d60..0a1659f8 100644 --- a/kite/src/kite/TrackElement.h +++ b/kite/src/kite/TrackElement.h @@ -124,7 +124,7 @@ namespace Kite { virtual bool canSlacken () const; virtual bool canPivotUp ( float reserve ) const; virtual bool canPivotDown ( float reserve ) const; - virtual bool canMoveUp ( float reserve, unsigned int flags=AutoSegment::Propagate ) const; + virtual bool canMoveUp ( float reserve, unsigned int flags=AutoSegment::Propagate|AutoSegment::PerpandicularFrag ) const; virtual bool canRipple () const; virtual bool hasSourceDogLeg () const; virtual bool hasTargetDogLeg () const;