diff --git a/README.rst b/README.rst index 28e9132f..fa725a4a 100644 --- a/README.rst +++ b/README.rst @@ -25,7 +25,7 @@ Documentation The complete documentation is available here, both in pdf & html: - ./documentation/_build/html/index.html + ./documentation/output/html ./documentation/UsersGuide/UsersGuide.pdf The documentation of the latest *stable* version is also diff --git a/anabatic/src/Configuration.cpp b/anabatic/src/Configuration.cpp index b265663a..bb524f92 100644 --- a/anabatic/src/Configuration.cpp +++ b/anabatic/src/Configuration.cpp @@ -25,6 +25,7 @@ #include "hurricane/BasicLayer.h" #include "hurricane/RegularLayer.h" #include "hurricane/RoutingPad.h" +#include "hurricane/Pin.h" #include "hurricane/NetExternalComponents.h" #include "hurricane/Cell.h" #include "crlcore/Utilities.h" @@ -55,6 +56,7 @@ namespace Anabatic { using Hurricane::BasicLayer; using Hurricane::RegularLayer; using Hurricane::Segment; + using Hurricane::Pin; using Hurricane::Plug; using Hurricane::Path; using Hurricane::Occurrence; @@ -458,13 +460,18 @@ namespace Anabatic { cdebug_log(112,0) << "Looking into: " << masterNet->getCell() << endl; for ( Component* component : masterNet->getComponents() ) { cdebug_log(112,0) << "@ " << component << endl; - if (not NetExternalComponents::isExternal(component)) continue; + if (not NetExternalComponents::isExternal(component)) { + cdebug_log(112,0) << " Not an external component, skip." << endl; + continue; + } - Segment* segment = dynamic_cast(component); - if (not segment) continue; - if (segment->getLayer()->getMask() != metal1->getMask()) continue; + Component* candidate = dynamic_cast(component); + if (not candidate + or (candidate->getLayer()->getMask() != metal1->getMask()) ) + candidate = dynamic_cast(component); + if (not candidate) continue; - Box bb = transformation.getBox( component->getBoundingBox() ); + Box bb = transformation.getBox( candidate->getBoundingBox() ); DbU::Unit trackPos = 0; DbU::Unit minPos = DbU::Max; DbU::Unit maxPos = DbU::Min; @@ -497,7 +504,7 @@ namespace Anabatic { cdebug_log(112,0) << "| " << occurrence.getPath() << endl; cdebug_log(112,0) << "| " << transformation << endl; - cdebug_log(112,0) << "| " << bb << " of:" << segment << endl; + cdebug_log(112,0) << "| " << bb << " of:" << candidate << endl; cdebug_log(112,0) << "| Nearest Pos: " << DbU::getValueString(trackPos) << endl; if ( (trackPos >= minPos) and (trackPos <= maxPos) ) { diff --git a/anabatic/src/NetBuilder.cpp b/anabatic/src/NetBuilder.cpp index 6d288620..6138f904 100644 --- a/anabatic/src/NetBuilder.cpp +++ b/anabatic/src/NetBuilder.cpp @@ -401,14 +401,14 @@ namespace Anabatic { for ( Hook* hook : fromHook->getHooks() ) { cdebug_log(145,0) << "Hook: " << hook << endl; cdebug_log(145,0) << "Topology [" << _connexity.connexity << "] = " - << "[" << (int)_connexity.fields.globals - << "+" << (int)_connexity.fields.M1 - << "+" << (int)_connexity.fields.M2 - << "+" << (int)_connexity.fields.M3 - << "+" << (int)_connexity.fields.Pin - << "+" << (int)_connexity.fields.Pad - << "] " << _gcell - << endl; + << "[" << (int)_connexity.fields.globals + << "+" << (int)_connexity.fields.M1 + << "+" << (int)_connexity.fields.M2 + << "+" << (int)_connexity.fields.M3 + << "+" << (int)_connexity.fields.Pin + << "+" << (int)_connexity.fields.Pad + << "] " << _gcell + << endl; Segment* toSegment = dynamic_cast( hook->getComponent() ); if (toSegment) { @@ -507,6 +507,16 @@ namespace Anabatic { if (_gcell == NULL) throw Error( missingGCell ); + cdebug_log(145,0) << "Topology [" << _connexity.connexity << "] = " + << "[" << (int)_connexity.fields.globals + << "+" << (int)_connexity.fields.M1 + << "+" << (int)_connexity.fields.M2 + << "+" << (int)_connexity.fields.M3 + << "+" << (int)_connexity.fields.Pin + << "+" << (int)_connexity.fields.Pad + << "] " << _gcell + << endl; + return *this; } @@ -543,6 +553,15 @@ namespace Anabatic { void NetBuilder::construct () { cdebug_log(145,1) << "NetBuilder::construct() [" << _connexity.connexity << "] in " << _gcell << endl; + cdebug_log(145,0) << "Topology [" << _connexity.connexity << "] = " + << "[" << (int)_connexity.fields.globals + << "+" << (int)_connexity.fields.M1 + << "+" << (int)_connexity.fields.M2 + << "+" << (int)_connexity.fields.M3 + << "+" << (int)_connexity.fields.Pin + << "+" << (int)_connexity.fields.Pad + << "] " << _gcell + << endl; if (not isTwoMetals()) { _southWestContact = NULL; @@ -586,6 +605,7 @@ namespace Anabatic { case Conn_3G_2M1: case Conn_3G_3M1: case Conn_3G_4M1: + case Conn_3G_5M1: case Conn_3G_2M3: case Conn_3G_3M3: case Conn_3G_4M3: @@ -616,17 +636,22 @@ namespace Anabatic { case Conn_4G: _do_xG(); break; // End xG cascaded cases. // Optimized specific cases. - case Conn_1G_1PinM1: _do_1G_1PinM1 (); break; - case Conn_2G_1PinM1: _do_2G_1PinM1 (); break; - case Conn_1G_1PinM2: _do_1G_1PinM2 (); break; - case Conn_2G_1PinM2: - case Conn_3G_1PinM2: _do_xG_1PinM2 (); break; - case Conn_1G_1PinM3: _do_1G_1PinM3 (); break; - case Conn_2G_1PinM3: - case Conn_3G_1PinM3: _do_xG_1PinM3 (); break; - case Conn_1G_1M1_1M2: _do_xG_1M1_1M2(); break; - case Conn_1G_1M1_1M3: _do_1G_xM1 (); break; - case Conn_2G_1M1_1M2: _do_xG_1M1_1M2(); break; + case Conn_1G_1PinM1: _do_1G_1PinM1 (); break; + case Conn_2G_1PinM1: _do_2G_1PinM1 (); break; + case Conn_1G_1PinM2: _do_1G_1PinM2 (); break; + case Conn_2G_1PinM2: + case Conn_3G_1PinM2: _do_xG_1PinM2 (); break; + case Conn_1G_1PinM3: _do_1G_1PinM3 (); break; + case Conn_2G_1PinM3: + case Conn_3G_1PinM3: _do_xG_1PinM3 (); break; + case Conn_1G_1M1_1PinM3: _do_1G_1M1_1PinM3(); break; + case Conn_1G_1M1_1PinM2: + case Conn_1G_2M1_1PinM2: _do_1G_xM1_1PinM2(); break; + case Conn_2G_1M1_1PinM2: + case Conn_2G_2M1_1PinM2: _do_2G_xM1_1PinM2(); break; + case Conn_1G_1M1_1M2: _do_xG_1M1_1M2 (); break; + case Conn_1G_1M1_1M3: _do_1G_xM1 (); break; + case Conn_2G_1M1_1M2: _do_xG_1M1_1M2 (); break; default: if (not isTwoMetals()) throw Bug( "Unmanaged Configuration [%d] = [%d+%d+%d+%d,%d+%d] %s in %s\n" @@ -1068,7 +1093,28 @@ namespace Anabatic { return false; } + + bool NetBuilder::_do_1G_1M1_1PinM3 () + { + throw Error ( "%s::_do_1G_1M1_1PinM3() method *not* reimplemented from base class.", getTypeName().c_str() ); + return false; + } + + + bool NetBuilder::_do_1G_xM1_1PinM2 () + { + throw Error ( "%s::_do_1G_xM1_1PinM2() method *not* reimplemented from base class.", getTypeName().c_str() ); + return false; + } + + + bool NetBuilder::_do_2G_xM1_1PinM2 () + { + throw Error ( "%s::_do_2G_xM1_1PinM2() method *not* reimplemented from base class.", getTypeName().c_str() ); + return false; + } + bool NetBuilder::_do_globalSegment () { throw Error ( "%s::_do_globalSegment() method *not* reimplemented from base class.", getTypeName().c_str() ); diff --git a/anabatic/src/NetBuilderHV.cpp b/anabatic/src/NetBuilderHV.cpp index 17ce88b3..d46dc31b 100644 --- a/anabatic/src/NetBuilderHV.cpp +++ b/anabatic/src/NetBuilderHV.cpp @@ -251,6 +251,45 @@ namespace Anabatic { } + AutoContact* NetBuilderHV::doRp_AccessNorthPin ( GCell* gcell, RoutingPad* rp ) + { + cdebug_log(145,1) << getTypeName() << "::doRp_AccessNorthPin() " << rp << endl; + + AutoContact* rpSourceContact = NULL; + AutoContact* rpContactTarget = NULL; + AutoContact* turn = NULL; + + doRp_AutoContacts( gcell, rp, rpSourceContact, rpContactTarget, NoProtect ); + + Net* net = rp->getNet(); + Pin* pin = dynamic_cast( rp->getOccurrence().getEntity() ); + Pin::AccessDirection pinDir = pin->getAccessDirection(); + if (pinDir == Pin::AccessDirection::NORTH) { + turn = AutoContactTurn::create( gcell, net, Session::getRoutingLayer(1) ); + AutoSegment* segment = AutoSegment::create( rpSourceContact, turn, Flags::Vertical ); + segment->setAxis( rp->getX(), Flags::Force ); + segment->setFlags( AutoSegment::SegFixed|AutoSegment::SegFixedAxis ); + rpSourceContact = turn; + + turn = AutoContactTurn::create( gcell, net, Session::getContactLayer(1) ); + segment = AutoSegment::create( rpSourceContact, turn, Flags::Horizontal ); + rpSourceContact = turn; + + DbU::Unit axis = gcell->getYMax() - Session::getDHorizontalPitch(); + cdebug_log(145,0) << "axis:" << DbU::getValueString(axis) << endl; + + segment->setAxis( axis, Flags::Force ); + //segment->setFlags( AutoSegment::SegFixed|AutoSegment::SegFixedAxis ); + cdebug_log(145,0) << segment << endl; + } else { + turn = rpSourceContact; + } + + cdebug_tabw(145,-1); + return turn; + } + + bool NetBuilderHV::_do_1G_1M1 () { cdebug_log(145,1) << getTypeName() << "::_do_1G_1M1() [Managed Configuration - Optimized] " << getTopology() << endl; @@ -744,9 +783,8 @@ namespace Anabatic { cdebug_log(145,1) << getTypeName() << "::_do_1G_1PinM3() [Managed Configuration - Optimized] " << getTopology() << endl; AutoContact* rpSourceContact = NULL; - AutoContact* rpContactTarget = NULL; - doRp_AutoContacts( getGCell(), getRoutingPads()[0], rpSourceContact, rpContactTarget, NoFlags ); + rpSourceContact = doRp_AccessNorthPin( getGCell(), getRoutingPads()[0] ); AutoContact* turn1 = AutoContactTurn::create( getGCell(), getNet(), Session::getContactLayer(1) ); AutoSegment::create( rpSourceContact, turn1, Flags::Vertical ); @@ -804,15 +842,19 @@ namespace Anabatic { setSouthWestContact( turn1 ); setNorthEastContact( htee1 ); - } else { - AutoContact* vtee1 = AutoContactVTee::create( getGCell(), getNet(), Session::getContactLayer(1) ); - AutoSegment::create( rpSourceContact, vtee1, Flags::Vertical ); - + } else if (north() and south()) { AutoContact* turn1 = AutoContactTurn::create( getGCell(), getNet(), Session::getContactLayer(1) ); - AutoSegment::create( vtee1, turn1, Flags::Vertical ); + AutoSegment::create( rpSourceContact, turn1, Flags::Vertical ); - setSouthWestContact( vtee1 ); - setNorthEastContact( turn1 ); + AutoContact* vtee1 = AutoContactVTee::create( getGCell(), getNet(), Session::getContactLayer(1) ); + AutoSegment::create( turn1, vtee1, Flags::Horizontal ); + + setBothCornerContacts( vtee1 ); + } else { // Remaining case is East & West. + AutoContact* htee1 = AutoContactHTee::create( getGCell(), getNet(), Session::getContactLayer(1) ); + AutoSegment::create( rpSourceContact, htee1, Flags::Vertical ); + + setBothCornerContacts( htee1 ); } } else { AutoContact* vtee1 = AutoContactVTee::create( getGCell(), getNet(), Session::getContactLayer(1) ); @@ -830,6 +872,144 @@ namespace Anabatic { } + bool NetBuilderHV::_do_1G_xM1_1PinM2 () + { + cdebug_log(145,1) << getTypeName() << "::_do_1G_xM1_1PinM2() [Managed Configuration - Optimized] " << getTopology() << endl; + + sortRpByX( getRoutingPads(), NoFlags ); // increasing X. + + vector rpsM1; + RoutingPad* pinM2 = NULL; + for ( RoutingPad* rp : getRoutingPads() ) { + if (dynamic_cast(rp->getOccurrence().getEntity())) pinM2 = rp; + else rpsM1.push_back( rp ); + } + + AutoContact* turn = NULL; + AutoContact* tee = NULL; + AutoContact* pinM2Contact = NULL; + AutoContact* rpM1Contact = NULL; + doRp_AutoContacts( getGCell(), pinM2, pinM2Contact, rpM1Contact, NoProtect ); + rpM1Contact = doRp_Access( getGCell(), rpsM1[0], HAccess ); + + if (north() or south()) { + turn = AutoContactTurn::create( getGCell(), getNet(), Session::getContactLayer(1) ); + tee = AutoContactVTee::create( getGCell(), getNet(), Session::getContactLayer(1) ); + + AutoSegment::create( rpM1Contact , tee , Flags::Horizontal ); + AutoSegment::create( pinM2Contact, turn, Flags::Horizontal ); + AutoSegment::create( tee , turn, Flags::Vertical ); + } else { + turn = AutoContactTurn::create( getGCell(), getNet(), Session::getContactLayer(1) ); + tee = AutoContactHTee::create( getGCell(), getNet(), Session::getContactLayer(1) ); + + AutoSegment::create( rpM1Contact , turn, Flags::Horizontal ); + AutoSegment::create( pinM2Contact, tee , Flags::Horizontal ); + AutoSegment::create( tee , turn, Flags::Vertical ); + } + setBothCornerContacts( tee ); + + for ( size_t i=1 ; i rpsM1; + RoutingPad* pinM2 = NULL; + for ( RoutingPad* rp : getRoutingPads() ) { + if (dynamic_cast(rp->getOccurrence().getEntity())) pinM2 = rp; + else rpsM1.push_back( rp ); + } + + AutoContact* pinM2Contact = NULL; + AutoContact* rpM1Contact = NULL; + doRp_AutoContacts( getGCell(), pinM2, pinM2Contact, rpM1Contact, NoFlags ); + rpM1Contact = doRp_Access( getGCell(), rpsM1[0], NoFlags ); + + if (north() and south()) { + AutoContact* htee = AutoContactHTee::create( getGCell(), getNet(), Session::getContactLayer(1) ); + AutoContact* vtee = AutoContactVTee::create( getGCell(), getNet(), Session::getContactLayer(1) ); + + AutoSegment::create( pinM2Contact, htee, Flags::Horizontal ); + AutoSegment::create( rpM1Contact , htee, Flags::Vertical ); + AutoSegment::create( htee , vtee, Flags::Horizontal ); + setBothCornerContacts( vtee ); + } else if (east() and west()) { + AutoContact* htee1 = AutoContactHTee::create( getGCell(), getNet(), Session::getContactLayer(1) ); + AutoContact* htee2 = AutoContactHTee::create( getGCell(), getNet(), Session::getContactLayer(1) ); + AutoContact* turn = AutoContactTurn::create( getGCell(), getNet(), Session::getContactLayer(1) ); + + AutoSegment::create( pinM2Contact, htee1, Flags::Horizontal ); + AutoSegment::create( rpM1Contact , htee1, Flags::Vertical ); + AutoSegment::create( htee1 , turn , Flags::Horizontal ); + AutoSegment::create( htee2 , turn , Flags::Vertical ); + setBothCornerContacts( htee2 ); + } else { + AutoContact* htee1 = AutoContactHTee::create( getGCell(), getNet(), Session::getContactLayer(1) ); + AutoContact* htee2 = AutoContactHTee::create( getGCell(), getNet(), Session::getContactLayer(1) ); + AutoContact* turn = AutoContactTurn::create( getGCell(), getNet(), Session::getContactLayer(1) ); + + AutoSegment::create( pinM2Contact, htee1, Flags::Horizontal ); + AutoSegment::create( rpM1Contact , htee1, Flags::Vertical ); + AutoSegment::create( htee1 , htee2, Flags::Horizontal ); + AutoSegment::create( htee2 , turn , Flags::Vertical ); + setNorthEastContact( htee2 ); + setSouthWestContact( turn ); + } + + for ( size_t i=1 ; i(rpM1->getOccurrence().getEntity())) std::swap( rpM1, pinM3 ); + + AutoContact* contact1 = doRp_Access( getGCell(), rpM1, HAccess ); + AutoContact* htee = AutoContactHTee::create( getGCell(), getNet(), Session::getContactLayer(1) ); + AutoSegment::create( contact1, htee, Flags::Horizontal ); + + rpSourceContact = doRp_AccessNorthPin( getGCell(), pinM3 ); + + if (north() or south()) { + AutoContact* turn = AutoContactTurn::create( getGCell(), getNet(), Session::getContactLayer(1) ); + AutoSegment::create( rpSourceContact, turn, Flags::Vertical ); + AutoSegment::create( turn , htee, Flags::Horizontal ); + } else { + AutoSegment::create( rpSourceContact, htee, Flags::Vertical ); + } + setBothCornerContacts( htee ); + + cdebug_tabw(145,-1); + return true; + } + + bool NetBuilderHV::_do_2G_1M1 () { return _do_xG_1M1(); @@ -1349,6 +1529,120 @@ namespace Anabatic { } + void NetBuilderHV::singleGCell ( AnabaticEngine* anbt, Net* net ) + { + cdebug_log(145,1) << "NetBuilderHV::singleGCell() " << net << endl; + + vector rpM1s; + Component* rpM2 = NULL; + RoutingPad* rpPin = NULL; + + for ( RoutingPad* rp : net->getRoutingPads() ) { + if (dynamic_cast(rp->getOccurrence().getEntity())) { + rpPin = rp; + continue; + } + + if (Session::getRoutingGauge()->getLayerDepth(rp->getLayer()) == 1) + rpM2 = rp; + else + rpM1s.push_back( rp ); + } + + if ( (rpM1s.size() < 2) and not (rpM2 or rpPin) ) { + cerr << Error( "For %s, less than two Plugs/Pins (%d)." + , getString(net).c_str() + , rpM1s.size() ) << endl; + cdebug_tabw(145,-1); + return; + } + + if (rpM1s.empty()) { + cerr << Error( "No METAL1 in Single GCell for Net \"%s\".", getString(net->getName()).c_str() ) << endl; + cdebug_tabw(145,-1); + return; + } + + sortRpByX( rpM1s, NetBuilder::NoFlags ); // increasing X. + + GCell* gcell1 = anbt->getGCellUnder( (*rpM1s.begin ())->getCenter() ); + GCell* gcell2 = anbt->getGCellUnder( (*rpM1s.rbegin())->getCenter() ); + + if (not gcell1) { + cerr << Error( "No GCell under %s.", getString(*(rpM1s.begin())).c_str() ) << endl; + cdebug_tabw(145,-1); + return; + } + if (gcell1 != gcell2) { + cerr << Error( "Not under a single GCell %s.", getString(*(rpM1s.rbegin())).c_str() ) << endl; + cdebug_tabw(145,-1); + return; + } + + cdebug_log(145,0) << "singleGCell " << gcell1 << endl; + + AutoContact* turn1 = NULL; + AutoContact* turn2 = NULL; + AutoContact* source = NULL; + AutoContact* target = NULL; + + for ( size_t irp=1 ; irpgetUConstraints(Flags::Vertical).intersect(target->getUConstraints(Flags::Vertical))) { + uint64_t flags = checkRoutingPadSize( rpM1s[irp-1] ); + if ((flags & VSmall) or Session::getConfiguration()->isVH()) { + if (Session::getConfiguration()->isHV()) { + turn1 = AutoContactTurn::create( gcell1, rpM1s[irp]->getNet(), Session::getDContactLayer() ); + AutoSegment::create( source, turn1, Flags::Horizontal ); + source = turn1; + } + turn1 = AutoContactTurn::create( gcell1, rpM1s[irp]->getNet(), Session::getDContactLayer() ); + AutoSegment::create( source, turn1 , Flags::Vertical ); + source = turn1; + } + flags = checkRoutingPadSize( rpM1s[irp] ); + if ((flags & VSmall) or Session::getConfiguration()->isVH()) { + if (Session::getConfiguration()->isHV()) { + turn1 = AutoContactTurn::create( gcell1, rpM1s[irp]->getNet(), Session::getDContactLayer() ); + AutoSegment::create( target, turn1, Flags::Horizontal ); + target = turn1; + } + turn1 = AutoContactTurn::create( gcell1, rpM1s[irp]->getNet(), Session::getDContactLayer() ); + AutoSegment::create( target, turn1 , Flags::Vertical ); + target = turn1; + } + AutoSegment::create( source, target, Flags::Horizontal ); + } else { + turn1 = AutoContactTurn::create( gcell1, rpM1s[irp]->getNet(), Session::getDContactLayer() ); + turn2 = AutoContactTurn::create( gcell1, rpM1s[irp]->getNet(), Session::getDContactLayer() ); + AutoSegment::create( source, turn1 , Flags::Horizontal ); + AutoSegment::create( turn1 , turn2 , Flags::Vertical ); + AutoSegment::create( turn2 , target, Flags::Horizontal ); + } + } + + if (rpM2) { + doRp_AutoContacts( gcell1, rpM1s[0], source, turn1, DoSourceContact ); + doRp_AutoContacts( gcell1, rpM2 , target, turn1, DoSourceContact ); + turn1 = AutoContactTurn::create( gcell1, rpM2->getNet(), Session::getContactLayer(1) ); + AutoSegment::create( source, turn1 , Flags::Horizontal ); + AutoSegment::create( turn1 , target, Flags::Vertical ); + } + + if (rpPin) { + doRp_AutoContacts( gcell1, rpM1s[0], source, turn1, DoSourceContact ); + target = doRp_AccessNorthPin( gcell1, rpPin ); + turn1 = AutoContactTurn::create( gcell1, rpPin->getNet(), Session::getContactLayer(1) ); + AutoSegment::create( source, turn1 , Flags::Horizontal ); + AutoSegment::create( turn1 , target, Flags::Vertical ); + } + + cdebug_tabw(145,-1); + } + + string NetBuilderHV::getTypeName () const { return "NetBuilderHV"; } diff --git a/anabatic/src/anabatic/Edge.h b/anabatic/src/anabatic/Edge.h index 20f25ddd..180a7ff8 100644 --- a/anabatic/src/anabatic/Edge.h +++ b/anabatic/src/anabatic/Edge.h @@ -60,6 +60,7 @@ namespace Anabatic { inline bool isHorizontal () const; inline bool hasNet ( const Net* ) const; inline unsigned int getCapacity () const; + inline unsigned int getRawCapacity () const; inline unsigned int getReservedCapacity () const; inline unsigned int getCapacity ( size_t depth ) const; inline unsigned int getRealOccupancy () const; @@ -137,6 +138,7 @@ namespace Anabatic { inline bool Edge::isHorizontal () const { return _flags.isset(Flags::Horizontal); } inline bool Edge::hasNet ( const Net* owner ) const { return getSegment(owner); } inline unsigned int Edge::getCapacity ( size_t depth ) const { return (_capacities) ? _capacities->getCapacity(depth) : 0; } + inline unsigned int Edge::getRawCapacity () const { return (_capacities) ? _capacities->getCapacity() : 0; } inline unsigned int Edge::getReservedCapacity () const { return _reservedCapacity; } inline unsigned int Edge::getRealOccupancy () const { return _realOccupancy; } inline float Edge::getEstimateOccupancy () const { return _estimateOccupancy; } diff --git a/anabatic/src/anabatic/NetBuilder.h b/anabatic/src/anabatic/NetBuilder.h index 81df3be5..ec060849 100644 --- a/anabatic/src/anabatic/NetBuilder.h +++ b/anabatic/src/anabatic/NetBuilder.h @@ -221,6 +221,9 @@ namespace Anabatic { virtual bool _do_xG_xM2 (); virtual bool _do_1G_1M3 (); virtual bool _do_xG_xM3 (); + virtual bool _do_1G_xM1_1PinM2 (); + virtual bool _do_2G_xM1_1PinM2 (); + virtual bool _do_1G_1M1_1PinM3 (); virtual bool _do_globalSegment (); virtual void singleGCell ( AnabaticEngine*, Net* ); AutoContact* _doHChannel (); @@ -242,73 +245,79 @@ namespace Anabatic { + ((pads) << (GlobalBSize+Metal1BSize+Metal2BSize+Metal3BSize)) \ + ((pins) << (GlobalBSize+Metal1BSize+Metal2BSize+Metal3BSize+PadsBSize)) - // Connexity Name | G|M1|M2|M3|Pad|Pin| - enum ConnexityFlag { Conn_0G = CONNEXITY_VALUE( 0, 0, 0, 0, 0 , 0 ) - , Conn_2G = CONNEXITY_VALUE( 2, 0, 0, 0, 0 , 0 ) - , Conn_3G = CONNEXITY_VALUE( 3, 0, 0, 0, 0 , 0 ) - , Conn_4G = CONNEXITY_VALUE( 4, 0, 0, 0, 0 , 0 ) - , Conn_5G = CONNEXITY_VALUE( 5, 0, 0, 0, 0 , 0 ) - , Conn_6G = CONNEXITY_VALUE( 6, 0, 0, 0, 0 , 0 ) - , Conn_0G_2M1 = CONNEXITY_VALUE( 0, 2, 0, 0, 0 , 0 ) - , Conn_1G_1M1 = CONNEXITY_VALUE( 1, 1, 0, 0, 0 , 0 ) - , Conn_1G_2M1 = CONNEXITY_VALUE( 1, 2, 0, 0, 0 , 0 ) - , Conn_1G_3M1 = CONNEXITY_VALUE( 1, 3, 0, 0, 0 , 0 ) - , Conn_1G_4M1 = CONNEXITY_VALUE( 1, 4, 0, 0, 0 , 0 ) - , Conn_1G_5M1 = CONNEXITY_VALUE( 1, 5, 0, 0, 0 , 0 ) - , Conn_1G_1M2 = CONNEXITY_VALUE( 1, 0, 1, 0, 0 , 0 ) - , Conn_1G_2M2 = CONNEXITY_VALUE( 1, 0, 2, 0, 0 , 0 ) - , Conn_1G_3M2 = CONNEXITY_VALUE( 1, 0, 3, 0, 0 , 0 ) - , Conn_1G_4M2 = CONNEXITY_VALUE( 1, 0, 4, 0, 0 , 0 ) - , Conn_1G_1M3 = CONNEXITY_VALUE( 1, 0, 0, 1, 0 , 0 ) - , Conn_1G_2M3 = CONNEXITY_VALUE( 1, 0, 0, 2, 0 , 0 ) - , Conn_1G_3M3 = CONNEXITY_VALUE( 1, 0, 0, 3, 0 , 0 ) - , Conn_1G_4M3 = CONNEXITY_VALUE( 1, 0, 0, 4, 0 , 0 ) - , Conn_1G_1M1_1M2 = CONNEXITY_VALUE( 1, 1, 1, 0, 0 , 0 ) - , Conn_1G_1M1_1M3 = CONNEXITY_VALUE( 1, 1, 0, 1, 0 , 0 ) - // Connexity Name | G|M1|M2|M3|Pad|Pin| - , Conn_2G_1M1 = CONNEXITY_VALUE( 2, 1, 0, 0, 0 , 0 ) - , Conn_2G_2M1 = CONNEXITY_VALUE( 2, 2, 0, 0, 0 , 0 ) - , Conn_2G_3M1 = CONNEXITY_VALUE( 2, 3, 0, 0, 0 , 0 ) - , Conn_2G_4M1 = CONNEXITY_VALUE( 2, 4, 0, 0, 0 , 0 ) - , Conn_2G_5M1 = CONNEXITY_VALUE( 2, 5, 0, 0, 0 , 0 ) - , Conn_2G_1M2 = CONNEXITY_VALUE( 2, 0, 1, 0, 0 , 0 ) - , Conn_2G_2M2 = CONNEXITY_VALUE( 2, 0, 2, 0, 0 , 0 ) - , Conn_2G_3M2 = CONNEXITY_VALUE( 2, 0, 3, 0, 0 , 0 ) - , Conn_2G_4M2 = CONNEXITY_VALUE( 2, 0, 4, 0, 0 , 0 ) - , Conn_2G_1M3 = CONNEXITY_VALUE( 2, 0, 0, 1, 0 , 0 ) - , Conn_2G_2M3 = CONNEXITY_VALUE( 2, 0, 0, 2, 0 , 0 ) - , Conn_2G_3M3 = CONNEXITY_VALUE( 2, 0, 0, 3, 0 , 0 ) - , Conn_2G_4M3 = CONNEXITY_VALUE( 2, 0, 0, 4, 0 , 0 ) - , Conn_2G_1M1_1M2 = CONNEXITY_VALUE( 2, 1, 1, 0, 0 , 0 ) - // Connexity Name | G|M1|M2|M3|Pad|Pin| - , Conn_3G_1M1 = CONNEXITY_VALUE( 3, 1, 0, 0, 0 , 0 ) - , Conn_3G_2M1 = CONNEXITY_VALUE( 3, 2, 0, 0, 0 , 0 ) - , Conn_3G_3M1 = CONNEXITY_VALUE( 3, 3, 0, 0, 0 , 0 ) - , Conn_3G_4M1 = CONNEXITY_VALUE( 3, 4, 0, 0, 0 , 0 ) - , Conn_3G_1M2 = CONNEXITY_VALUE( 3, 0, 1, 0, 0 , 0 ) - , Conn_3G_2M2 = CONNEXITY_VALUE( 3, 0, 2, 0, 0 , 0 ) - , Conn_3G_1M3 = CONNEXITY_VALUE( 3, 0, 0, 1, 0 , 0 ) - , Conn_3G_2M3 = CONNEXITY_VALUE( 3, 0, 0, 2, 0 , 0 ) - , Conn_3G_3M3 = CONNEXITY_VALUE( 3, 0, 0, 3, 0 , 0 ) - , Conn_3G_4M3 = CONNEXITY_VALUE( 3, 0, 0, 4, 0 , 0 ) - // Connexity Name | G|M1|M2|M3|Pad|Pin| - , Conn_4G_1M1 = CONNEXITY_VALUE( 4, 1, 0, 0, 0 , 0 ) - , Conn_4G_2M1 = CONNEXITY_VALUE( 4, 2, 0, 0, 0 , 0 ) - , Conn_4G_3M1 = CONNEXITY_VALUE( 4, 3, 0, 0, 0 , 0 ) - , Conn_4G_4M1 = CONNEXITY_VALUE( 4, 4, 0, 0, 0 , 0 ) - , Conn_4G_1M2 = CONNEXITY_VALUE( 4, 0, 1, 0, 0 , 0 ) - , Conn_4G_1M3 = CONNEXITY_VALUE( 4, 0, 0, 1, 0 , 0 ) - , Conn_1G_1Pad = CONNEXITY_VALUE( 1, 0, 0, 0, 1 , 0 ) - , Conn_2G_1Pad = CONNEXITY_VALUE( 2, 0, 0, 0, 1 , 0 ) - , Conn_3G_1Pad = CONNEXITY_VALUE( 3, 0, 0, 0, 1 , 0 ) - , Conn_1G_1PinM1 = CONNEXITY_VALUE( 1, 1, 0, 0, 0 , 1 ) - , Conn_2G_1PinM1 = CONNEXITY_VALUE( 2, 1, 0, 0, 0 , 1 ) - , Conn_1G_1PinM2 = CONNEXITY_VALUE( 1, 0, 1, 0, 0 , 1 ) - , Conn_2G_1PinM2 = CONNEXITY_VALUE( 2, 0, 1, 0, 0 , 1 ) - , Conn_3G_1PinM2 = CONNEXITY_VALUE( 3, 0, 1, 0, 0 , 1 ) - , Conn_1G_1PinM3 = CONNEXITY_VALUE( 1, 0, 0, 1, 0 , 1 ) - , Conn_2G_1PinM3 = CONNEXITY_VALUE( 2, 0, 0, 1, 0 , 1 ) - , Conn_3G_1PinM3 = CONNEXITY_VALUE( 3, 0, 0, 1, 0 , 1 ) + // Connexity Name | G|M1|M2|M3|Pad|Pin| + enum ConnexityFlag { Conn_0G = CONNEXITY_VALUE( 0, 0, 0, 0, 0 , 0 ) + , Conn_2G = CONNEXITY_VALUE( 2, 0, 0, 0, 0 , 0 ) + , Conn_3G = CONNEXITY_VALUE( 3, 0, 0, 0, 0 , 0 ) + , Conn_4G = CONNEXITY_VALUE( 4, 0, 0, 0, 0 , 0 ) + , Conn_5G = CONNEXITY_VALUE( 5, 0, 0, 0, 0 , 0 ) + , Conn_6G = CONNEXITY_VALUE( 6, 0, 0, 0, 0 , 0 ) + , Conn_0G_2M1 = CONNEXITY_VALUE( 0, 2, 0, 0, 0 , 0 ) + , Conn_1G_1M1 = CONNEXITY_VALUE( 1, 1, 0, 0, 0 , 0 ) + , Conn_1G_2M1 = CONNEXITY_VALUE( 1, 2, 0, 0, 0 , 0 ) + , Conn_1G_3M1 = CONNEXITY_VALUE( 1, 3, 0, 0, 0 , 0 ) + , Conn_1G_4M1 = CONNEXITY_VALUE( 1, 4, 0, 0, 0 , 0 ) + , Conn_1G_5M1 = CONNEXITY_VALUE( 1, 5, 0, 0, 0 , 0 ) + , Conn_1G_1M2 = CONNEXITY_VALUE( 1, 0, 1, 0, 0 , 0 ) + , Conn_1G_2M2 = CONNEXITY_VALUE( 1, 0, 2, 0, 0 , 0 ) + , Conn_1G_3M2 = CONNEXITY_VALUE( 1, 0, 3, 0, 0 , 0 ) + , Conn_1G_4M2 = CONNEXITY_VALUE( 1, 0, 4, 0, 0 , 0 ) + , Conn_1G_1M3 = CONNEXITY_VALUE( 1, 0, 0, 1, 0 , 0 ) + , Conn_1G_2M3 = CONNEXITY_VALUE( 1, 0, 0, 2, 0 , 0 ) + , Conn_1G_3M3 = CONNEXITY_VALUE( 1, 0, 0, 3, 0 , 0 ) + , Conn_1G_4M3 = CONNEXITY_VALUE( 1, 0, 0, 4, 0 , 0 ) + , Conn_1G_1M1_1M2 = CONNEXITY_VALUE( 1, 1, 1, 0, 0 , 0 ) + , Conn_1G_1M1_1M3 = CONNEXITY_VALUE( 1, 1, 0, 1, 0 , 0 ) + // Connexity Name | G|M1|M2|M3|Pad|Pin| + , Conn_2G_1M1 = CONNEXITY_VALUE( 2, 1, 0, 0, 0 , 0 ) + , Conn_2G_2M1 = CONNEXITY_VALUE( 2, 2, 0, 0, 0 , 0 ) + , Conn_2G_3M1 = CONNEXITY_VALUE( 2, 3, 0, 0, 0 , 0 ) + , Conn_2G_4M1 = CONNEXITY_VALUE( 2, 4, 0, 0, 0 , 0 ) + , Conn_2G_5M1 = CONNEXITY_VALUE( 2, 5, 0, 0, 0 , 0 ) + , Conn_2G_1M2 = CONNEXITY_VALUE( 2, 0, 1, 0, 0 , 0 ) + , Conn_2G_2M2 = CONNEXITY_VALUE( 2, 0, 2, 0, 0 , 0 ) + , Conn_2G_3M2 = CONNEXITY_VALUE( 2, 0, 3, 0, 0 , 0 ) + , Conn_2G_4M2 = CONNEXITY_VALUE( 2, 0, 4, 0, 0 , 0 ) + , Conn_2G_1M3 = CONNEXITY_VALUE( 2, 0, 0, 1, 0 , 0 ) + , Conn_2G_2M3 = CONNEXITY_VALUE( 2, 0, 0, 2, 0 , 0 ) + , Conn_2G_3M3 = CONNEXITY_VALUE( 2, 0, 0, 3, 0 , 0 ) + , Conn_2G_4M3 = CONNEXITY_VALUE( 2, 0, 0, 4, 0 , 0 ) + , Conn_2G_1M1_1M2 = CONNEXITY_VALUE( 2, 1, 1, 0, 0 , 0 ) + // Connexity Name | G|M1|M2|M3|Pad|Pin| + , Conn_3G_1M1 = CONNEXITY_VALUE( 3, 1, 0, 0, 0 , 0 ) + , Conn_3G_2M1 = CONNEXITY_VALUE( 3, 2, 0, 0, 0 , 0 ) + , Conn_3G_3M1 = CONNEXITY_VALUE( 3, 3, 0, 0, 0 , 0 ) + , Conn_3G_4M1 = CONNEXITY_VALUE( 3, 4, 0, 0, 0 , 0 ) + , Conn_3G_5M1 = CONNEXITY_VALUE( 3, 5, 0, 0, 0 , 0 ) + , Conn_3G_1M2 = CONNEXITY_VALUE( 3, 0, 1, 0, 0 , 0 ) + , Conn_3G_2M2 = CONNEXITY_VALUE( 3, 0, 2, 0, 0 , 0 ) + , Conn_3G_1M3 = CONNEXITY_VALUE( 3, 0, 0, 1, 0 , 0 ) + , Conn_3G_2M3 = CONNEXITY_VALUE( 3, 0, 0, 2, 0 , 0 ) + , Conn_3G_3M3 = CONNEXITY_VALUE( 3, 0, 0, 3, 0 , 0 ) + , Conn_3G_4M3 = CONNEXITY_VALUE( 3, 0, 0, 4, 0 , 0 ) + // Connexity Name | G|M1|M2|M3|Pad|Pin| + , Conn_4G_1M1 = CONNEXITY_VALUE( 4, 1, 0, 0, 0 , 0 ) + , Conn_4G_2M1 = CONNEXITY_VALUE( 4, 2, 0, 0, 0 , 0 ) + , Conn_4G_3M1 = CONNEXITY_VALUE( 4, 3, 0, 0, 0 , 0 ) + , Conn_4G_4M1 = CONNEXITY_VALUE( 4, 4, 0, 0, 0 , 0 ) + , Conn_4G_1M2 = CONNEXITY_VALUE( 4, 0, 1, 0, 0 , 0 ) + , Conn_4G_1M3 = CONNEXITY_VALUE( 4, 0, 0, 1, 0 , 0 ) + , Conn_1G_1Pad = CONNEXITY_VALUE( 1, 0, 0, 0, 1 , 0 ) + , Conn_2G_1Pad = CONNEXITY_VALUE( 2, 0, 0, 0, 1 , 0 ) + , Conn_3G_1Pad = CONNEXITY_VALUE( 3, 0, 0, 0, 1 , 0 ) + , Conn_1G_1PinM1 = CONNEXITY_VALUE( 1, 1, 0, 0, 0 , 1 ) + , Conn_2G_1PinM1 = CONNEXITY_VALUE( 2, 1, 0, 0, 0 , 1 ) + , Conn_1G_1PinM2 = CONNEXITY_VALUE( 1, 0, 1, 0, 0 , 1 ) + , Conn_2G_1PinM2 = CONNEXITY_VALUE( 2, 0, 1, 0, 0 , 1 ) + , Conn_3G_1PinM2 = CONNEXITY_VALUE( 3, 0, 1, 0, 0 , 1 ) + , Conn_1G_1M1_1PinM2 = CONNEXITY_VALUE( 1, 1, 1, 0, 0 , 1 ) + , Conn_1G_2M1_1PinM2 = CONNEXITY_VALUE( 1, 2, 1, 0, 0 , 1 ) + , Conn_2G_1M1_1PinM2 = CONNEXITY_VALUE( 2, 1, 1, 0, 0 , 1 ) + , Conn_2G_2M1_1PinM2 = CONNEXITY_VALUE( 2, 2, 1, 0, 0 , 1 ) + , Conn_1G_1PinM3 = CONNEXITY_VALUE( 1, 0, 0, 1, 0 , 1 ) + , Conn_2G_1PinM3 = CONNEXITY_VALUE( 2, 0, 0, 1, 0 , 1 ) + , Conn_3G_1PinM3 = CONNEXITY_VALUE( 3, 0, 0, 1, 0 , 1 ) + , Conn_1G_1M1_1PinM3 = CONNEXITY_VALUE( 1, 1, 0, 1, 0 , 1 ) }; #undef CONNEXITY_VALUE diff --git a/anabatic/src/anabatic/NetBuilderHV.h b/anabatic/src/anabatic/NetBuilderHV.h index 59f79fda..b4442ea7 100644 --- a/anabatic/src/anabatic/NetBuilderHV.h +++ b/anabatic/src/anabatic/NetBuilderHV.h @@ -28,33 +28,38 @@ namespace Anabatic { class NetBuilderHV : public NetBuilder { public: - NetBuilderHV (); - virtual ~NetBuilderHV (); - virtual void doRp_AutoContacts ( GCell*, Component*, AutoContact*& source, AutoContact*& target, uint64_t flags ); - virtual AutoContact* doRp_Access ( GCell*, Component*, uint64_t flags ); + NetBuilderHV (); + virtual ~NetBuilderHV (); + virtual void doRp_AutoContacts ( GCell*, Component*, AutoContact*& source, AutoContact*& target, uint64_t flags ); + virtual AutoContact* doRp_Access ( GCell*, Component*, uint64_t flags ); + AutoContact* doRp_AccessNorthPin ( GCell*, RoutingPad* ); private: - virtual bool _do_1G_1M1 (); - virtual bool _do_1G_xM1 (); - virtual bool _do_xG (); - virtual bool _do_2G (); - virtual bool _do_2G_1M1 (); - virtual bool _do_xG_1Pad (); - virtual bool _do_1G_1PinM1 (); - virtual bool _do_2G_1PinM1 (); - virtual bool _do_1G_1PinM2 (); - virtual bool _do_xG_1PinM2 (); - virtual bool _do_1G_1PinM3 (); - virtual bool _do_xG_1PinM3 (); - virtual bool _do_xG_1M1 (); - virtual bool _do_xG_1M1_1M2 (); - virtual bool _do_xG_xM1_xM3 (); - virtual bool _do_4G_1M2 (); - virtual bool _do_xG_xM2 (); - virtual bool _do_1G_1M3 (); - virtual bool _do_xG_xM3 (); - virtual bool _do_globalSegment (); - public: - virtual string getTypeName () const; + virtual bool _do_1G_1M1 (); + virtual bool _do_1G_xM1 (); + virtual bool _do_xG (); + virtual bool _do_2G (); + virtual bool _do_2G_1M1 (); + virtual bool _do_xG_1Pad (); + virtual bool _do_1G_1PinM1 (); + virtual bool _do_2G_1PinM1 (); + virtual bool _do_1G_1PinM2 (); + virtual bool _do_xG_1PinM2 (); + virtual bool _do_1G_1PinM3 (); + virtual bool _do_xG_1PinM3 (); + virtual bool _do_xG_1M1 (); + virtual bool _do_xG_1M1_1M2 (); + virtual bool _do_xG_xM1_xM3 (); + virtual bool _do_4G_1M2 (); + virtual bool _do_xG_xM2 (); + virtual bool _do_1G_1M3 (); + virtual bool _do_xG_xM3 (); + virtual bool _do_1G_xM1_1PinM2 (); + virtual bool _do_2G_xM1_1PinM2 (); + virtual bool _do_1G_1M1_1PinM3 (); + virtual bool _do_globalSegment (); + virtual void singleGCell ( AnabaticEngine*, Net* ); + public: + virtual string getTypeName () const; }; diff --git a/bootstrap/allianceInstaller.sh b/bootstrap/allianceInstaller.sh new file mode 100755 index 00000000..71f02906 --- /dev/null +++ b/bootstrap/allianceInstaller.sh @@ -0,0 +1,19 @@ +#!/bin/bash + + srcDir=${HOME}/coriolis-2.x/src/alliance/alliance/src + commonRoot=${HOME}/coriolis-2.x/Linux.el7_64/Release.Shared + buildDir=${commonRoot}/build + installDir=${commonRoot}/install + + export ALLIANCE_TOP=${installDir} + export LD_LIBRARY_PATH=${installDir}/lib:${LD_LIBRARY_PATH} + + cd ${srcDir} + # Skip doc generation to avoid pulling TeXLive in docker images. + sed -i 's,dirs="\$newdirs documentation",dirs="$newdirs",' ./autostuff + ./autostuff clean + ./autostuff + mkdir -p ${buildDir} + cd ${buildDir} + ${srcDir}/configure --prefix=${ALLIANCE_TOP} --enable-alc-shared + make -j1 install diff --git a/bootstrap/builder/Builder.py b/bootstrap/builder/Builder.py index 6c199377..b3240ee0 100644 --- a/bootstrap/builder/Builder.py +++ b/bootstrap/builder/Builder.py @@ -187,8 +187,8 @@ class Builder: if self._ninja: command += [ "-G", "Ninja" ] if self._macports: command += [ "-D", "WITH_MACPORTS:STRING=TRUE" ] if self._noSystemBoost: command += [ "-D", "Boost_NO_SYSTEM_PATHS:STRING=TRUE" - , "-D", "BOOST_INCLUDEDIR:STRING=/usr/include/boost169" - , "-D", "BOOST_LIBRARYDIR:STRING=/usr/lib64/boost169" + #, "-D", "BOOST_INCLUDEDIR:STRING=/usr/include/boost169" + #, "-D", "BOOST_LIBRARYDIR:STRING=/usr/lib64/boost169" ] if self._qt5: command += [ "-D", "WITH_QT5:STRING=TRUE" ] if self._openmp: command += [ "-D", "WITH_OPENMP:STRING=TRUE" ] @@ -198,6 +198,7 @@ class Builder: , "-D", "CMAKE_INSTALL_PREFIX:STRING=%s" % self.installDir , "-D", "CMAKE_INSTALL_DIR:STRING=%s" % cmakeInstallDir #, "-D", "CMAKE_MODULE_PATH:STRING=%s" % cmakeModules + #, "-D", "Boost_DEBUG:STRING=TRUE" , toolSourceDir ] if not os.path.isdir(toolBuildDir): diff --git a/bootstrap/cmake_modules/CMakeLists.txt b/bootstrap/cmake_modules/CMakeLists.txt index f0c6c9d1..b5083345 100644 --- a/bootstrap/cmake_modules/CMakeLists.txt +++ b/bootstrap/cmake_modules/CMakeLists.txt @@ -8,6 +8,7 @@ FindLibbfd.cmake FindQwt.cmake FindSphinx.cmake + FindPelican.cmake GetGitRevisionDescription.cmake GetGitRevisionDescription.cmake.in ) diff --git a/bootstrap/cmake_modules/FindBootstrap.cmake b/bootstrap/cmake_modules/FindBootstrap.cmake index 94db395b..5e51c3cd 100644 --- a/bootstrap/cmake_modules/FindBootstrap.cmake +++ b/bootstrap/cmake_modules/FindBootstrap.cmake @@ -39,6 +39,15 @@ message("-- Distribution is ${DISTRIBUTION}") endmacro(check_distribution) +# +# Specific setup for MacOS X. +# + if(WITH_MACPORTS) + set(Boost_PYVER "27") + else() + set(Boost_PYVER "") + endif() + # # Get the svn revision version and configure a svn.h.in file based on this version # The include directory name is passed as argument @@ -85,9 +94,11 @@ set(ADDTIONAL_FLAGS "") set(CXX_STANDARD "c++11") endif() - set(CMAKE_C_FLAGS_DEBUG " -Wall -fsanitize=address ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C Compiler Debug options." FORCE) +#set(CMAKE_C_FLAGS_DEBUG " -Wall -fsanitize=address ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C Compiler Debug options." FORCE) + set(CMAKE_C_FLAGS_DEBUG " -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C Compiler Debug options." FORCE) set(CMAKE_C_FLAGS_RELEASE " -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C Compiler Release options." FORCE) - set(CMAKE_CXX_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall -fsanitize=address ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C++ Compiler Debug options." FORCE) +#set(CMAKE_CXX_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall -fsanitize=address ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C++ Compiler Debug options." FORCE) + set(CMAKE_CXX_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall ${ADDTIONAL_FLAGS} ${DEBUG_FLAGS}" CACHE STRING "C++ Compiler Debug options." FORCE) set(CMAKE_CXX_FLAGS_RELEASE "-std=${CXX_STANDARD} -Wall -O2 ${ADDTIONAL_FLAGS} -DNDEBUG" CACHE STRING "C++ Compiler Release options." FORCE) @@ -175,15 +186,6 @@ endmacro(hurricane_check_libraries) -# -# Find Boost, checking different versions. -# - if(WITH_MACPORTS) - set(Boost_PYVER "27") - else() - set(Boost_PYVER "") - endif() - macro(setup_boost) #set(Boost_USE_STATIC_LIBS ON) #message(STATUS "Always uses Boost static libraries.") @@ -191,7 +193,7 @@ find_package(Boost 1.35.0 REQUIRED) else(ARGC LESS 1) foreach(component ${ARGV}) - if(${component} EQUAL "python") + if(${component} STREQUAL "python") set(component ${component}${Boost_PYVER}) endif() set(components ${components} ${component}) @@ -278,11 +280,13 @@ else() find_path(QWT_INCLUDE_DIR NAMES qwt.h PATHS /usr/include/qwt-qt4 + /opt/local/libexec/qt4/include /usr/include/qt4 /usr/include PATH_SUFFIXES qwt ) find_library(QWT_LIBRARY NAMES qwt-qt4 qwt - PATHS /usr/lib${LIB_SUFFIX} ) + PATHS /opt/local/libexec/qt4/lib + /usr/lib${LIB_SUFFIX} ) endif() if( QWT_INCLUDE_DIR AND QWT_LIBRARY) diff --git a/bootstrap/cmake_modules/FindPelican.cmake b/bootstrap/cmake_modules/FindPelican.cmake new file mode 100644 index 00000000..a9bb76ca --- /dev/null +++ b/bootstrap/cmake_modules/FindPelican.cmake @@ -0,0 +1,10 @@ + + find_program( PELICAN_EXECUTABLE NAMES pelican + HINTS $ENV{PELICAN_DIR} + PATH_SUFFIXES bin + DOC "Pelican blog generator" + ) + + include( FindPackageHandleStandardArgs ) +find_package_handle_standard_args( Pelican DEFAULT_MSG PELICAN_EXECUTABLE ) + mark_as_advanced( PELICAN_EXECUTABLE ) diff --git a/bootstrap/coriolisEnv.py b/bootstrap/coriolisEnv.py index 098e2003..38814d68 100755 --- a/bootstrap/coriolisEnv.py +++ b/bootstrap/coriolisEnv.py @@ -130,7 +130,6 @@ def guessOs (): print "[WARNING] Unrecognized OS: \"%s\"." % lines[0][:-1] print " (using: \"%s\")" % osType - ldLibraryPath = os.getenv('LD_LIBRARY_PATH') if ldLibraryPath and 'devtoolset' in ldLibraryPath: useDevtoolset = False @@ -187,6 +186,7 @@ if __name__ == "__main__": parser.add_option ( "--shared" , action="store_true" , dest="shared" ) parser.add_option ( "--no-python" , action="store_true" , dest="nopython" ) parser.add_option ( "--root" , action="store" , type="string", dest="rootDir" ) + parser.add_option ( "--remove" , action="store_true" , dest="remove" ) ( options, args ) = parser.parse_args () if options.release: buildType = "Release" @@ -207,6 +207,32 @@ if __name__ == "__main__": strippedLibraryPath = scrubPath( "LD_LIBRARY_PATH" ) strippedPythonPath = scrubPath( "PYTHONPATH" ) + if options.remove: + shellScript = 'echo "Removing Coriolis environment";' + if osType == "Darwin": + ldVar = 'DYLD_LIBRARY_PATH' + else: + ldVar = 'LD_LIBRARY_PATH' + + if isBourneShell: + shellScript += 'export PATH={};hash -r;'.format(strippedPath) + shellScript += 'BOOTSTRAP_TOP="";CORIOLIS_TOP="";export -n BOOTSTRAP_TOP CORIOLIS_TOP;' + if strippedLibraryPath: + shellScript += 'export {}={};'.format(ldVar, strippedLibraryPath) + else: + shellScript += '{0}=""; export -n {0};'.format(ldVar) + else: + shellScript += 'setenv PATH {};rehash;'.format(strippedPath) + shellScript += 'unsetenv BOOTSTRAP_TOP CORIOLIS_TOP;' + if strippedLibraryPath: + shellScript += 'setenv {} {};'.format(ldVar, strippedLibraryPath) + else: + shellScript += 'unsetenv {};'.format(ldVar) + + print(shellScript) + sys.exit(0) + + shellScriptSh = \ 'echo "%(MESSAGE)s";' \ 'echo "Switching to Coriolis 2.x (%(buildDir)s)";' \ @@ -273,16 +299,25 @@ if __name__ == "__main__": if not options.nopython: pyVersion = sys.version_info version = "%d.%d" % (pyVersion[0],pyVersion[1]) - if osType.startswith("Linux.SL") \ - or osType.startswith("Linux.sl") \ - or osType.startswith("Linux.el") \ - or osType.startswith("Linux.fc") \ - or osType.startswith("Cygwin"): - sitePackagesDir = "%s/python%s/site-packages" % (absLibDir,version) - elif osType.startswith("Darwin"): - sitePackagesDir = "%s/%s/site-packages" % (absLibDir,version) - else: - sitePackagesDir = "%s/python%s/dist-packages" % (absLibDir,version) + #if osType.startswith("Linux.SL") \ + # or osType.startswith("Linux.sl") \ + # or osType.startswith("Linux.el") \ + # or osType.startswith("Linux.fc") \ + # or osType.startswith("Cygwin"): + # sitePackagesDir = "%s/python%s/site-packages" % (absLibDir,version) + #elif osType.startswith("Darwin"): + # sitePackagesDir = "%s/%s/site-packages" % (absLibDir,version) + #else: + # sitePackagesDir = "%s/python%s/dist-packages" % (absLibDir,version) + + sitePackagesDir = "sitePackageDir_has_been_not_found" + for pyPackageDir in [ "%s/python%s/site-packages" % (absLibDir,version) + , "%s/python%s/dist-packages" % (absLibDir,version) + , "%s/%s/site-packages" % (absLibDir,version) + ]: + if os.path.isdir(pyPackageDir): + sitePackagesDir = pyPackageDir + break strippedPythonPath = "%s:" % (sitePackagesDir) + strippedPythonPath strippedPythonPath = "%s/crlcore:" % (sitePackagesDir) + strippedPythonPath diff --git a/bootstrap/docker/debian-9/Dockerfile.bash b/bootstrap/docker/debian-9/Dockerfile.bash new file mode 100644 index 00000000..9f936374 --- /dev/null +++ b/bootstrap/docker/debian-9/Dockerfile.bash @@ -0,0 +1,6 @@ + +FROM debian9.coriolis + +COPY root/dot.bashrc /root/.bashrc + +CMD [ "/bin/bash", "-i" ] diff --git a/bootstrap/docker/debian-9/Dockerfile.coriolis b/bootstrap/docker/debian-9/Dockerfile.coriolis new file mode 100644 index 00000000..278a21c2 --- /dev/null +++ b/bootstrap/docker/debian-9/Dockerfile.coriolis @@ -0,0 +1,10 @@ + +FROM debian9.system + +COPY root/socInstaller.py /root/socInstaller.py +RUN mkdir -p coriolis-2.x/src \ + && git clone https://github.com/m-labs/nmigen.git \ + && cd nmigen \ + && python3 setup.py develop \ + && /root/socInstaller.py --docker --profile=Debian9 --do-alliance --do-coriolis --benchs + diff --git a/bootstrap/docker/debian-9/Dockerfile.system b/bootstrap/docker/debian-9/Dockerfile.system new file mode 100644 index 00000000..f7b9b58f --- /dev/null +++ b/bootstrap/docker/debian-9/Dockerfile.system @@ -0,0 +1,21 @@ + +FROM debian:stretch-slim + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get -y install build-essential binutils-dev \ + git cmake bison flex gcc python-dev \ + libboost-all-dev libboost-python-dev \ + zlib1g-dev libxml2-dev rapidjson-dev libbz2-dev \ + qt4-dev-tools libqwt-dev python-qt4 \ + python3-setuptools \ + \ + autotools-dev automake \ + libxt-dev libxpm-dev libmotif-dev \ + \ + yosys \ + \ + vim \ + && apt-get clean + diff --git a/bootstrap/docker/debian-9/docker-conf.sh b/bootstrap/docker/debian-9/docker-conf.sh new file mode 100644 index 00000000..4cca36c0 --- /dev/null +++ b/bootstrap/docker/debian-9/docker-conf.sh @@ -0,0 +1,4 @@ + + systemImage="debian9.system" + coriolisImage="debian9.coriolis" + bashImage="debian9.bash" diff --git a/bootstrap/docker/debian-9/root/allianceInstaller.sh b/bootstrap/docker/debian-9/root/allianceInstaller.sh new file mode 100755 index 00000000..71f02906 --- /dev/null +++ b/bootstrap/docker/debian-9/root/allianceInstaller.sh @@ -0,0 +1,19 @@ +#!/bin/bash + + srcDir=${HOME}/coriolis-2.x/src/alliance/alliance/src + commonRoot=${HOME}/coriolis-2.x/Linux.el7_64/Release.Shared + buildDir=${commonRoot}/build + installDir=${commonRoot}/install + + export ALLIANCE_TOP=${installDir} + export LD_LIBRARY_PATH=${installDir}/lib:${LD_LIBRARY_PATH} + + cd ${srcDir} + # Skip doc generation to avoid pulling TeXLive in docker images. + sed -i 's,dirs="\$newdirs documentation",dirs="$newdirs",' ./autostuff + ./autostuff clean + ./autostuff + mkdir -p ${buildDir} + cd ${buildDir} + ${srcDir}/configure --prefix=${ALLIANCE_TOP} --enable-alc-shared + make -j1 install diff --git a/bootstrap/docker/debian-9/root/dot.bashrc b/bootstrap/docker/debian-9/root/dot.bashrc new file mode 100644 index 00000000..0e2c1e18 --- /dev/null +++ b/bootstrap/docker/debian-9/root/dot.bashrc @@ -0,0 +1,14 @@ + + echo "Running /root/.bashrc" + + for archDir in `ls /root/coriolis-2.x/`; do + if [ "$archDir" = "src" ]; then continue; fi + break + done + echo "Found Coriolis architecture directory \"${archDir}\"." + + installDir="/root/coriolis-2.x/${archDir}/Release.Shared/install" + . ${installDir}/etc/profile.d/alc_env.sh + eval `${installDir}/etc/coriolis2/coriolisEnv.py` + + export QT_X11_NO_MITSHM=1 diff --git a/bootstrap/docker/debian-9/root/socInstaller.py b/bootstrap/docker/debian-9/root/socInstaller.py new file mode 100755 index 00000000..e744c38a --- /dev/null +++ b/bootstrap/docker/debian-9/root/socInstaller.py @@ -0,0 +1,627 @@ +#!/usr/bin/env python +# +# -*- mode:Python -*- +# +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2015-2018, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | C o r i o l i s I n s t a l l e r | +# | | +# | Authors : Jean-Paul Chaput | +# | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +# | =============================================================== | +# | Python : "./socInstaller.py" | +# +-----------------------------------------------------------------+ +# +# WARNING: +# This script has been designed only for internal use in the +# LIP6/CIAN department. If you want to use it you will need to +# change the hardwired configuration. + + +showTrace = True + +try: + import sys + import os.path + import shutil + import optparse + import time + import traceback + import distutils.sysconfig + import subprocess + import socket + import re + import bz2 + import smtplib + from email.mime.text import MIMEText + from email.mime.multipart import MIMEMultipart + from email.mime.application import MIMEApplication +except ImportError, e: + module = str(e).split()[-1] + + +class ErrorMessage ( Exception ): + + def __init__ ( self, code, *arguments ): + self._code = code + self._errors = [ 'Malformed call to ErrorMessage()', '%s' % str(arguments) ] + + text = None + if len(arguments) == 1: + if isinstance(arguments[0],Exception): text = str(arguments[0]).split('\n') + else: + self._errors = arguments[0] + elif len(arguments) > 1: + text = list(arguments) + + if text: + self._errors = [] + while len(text[0]) == 0: del text[0] + + lstrip = 0 + if text[0].startswith('[ERROR]'): lstrip = 8 + + for line in text: + if line[0:lstrip ] == ' '*lstrip or \ + line[0:lstrip-1] == '[ERROR]': + self._errors += [ line[lstrip:] ] + else: + self._errors += [ line.lstrip() ] + return + + def __str__ ( self ): + if not isinstance(self._errors,list): + return "[ERROR] %s" % self._errors + + formatted = "\n" + for i in range(len(self._errors)): + if i == 0: formatted += "[ERROR] %s" % self._errors[i] + else: formatted += " %s" % self._errors[i] + if i+1 < len(self._errors): formatted += "\n" + return formatted + + def addMessage ( self, message ): + if not isinstance(self._errors,list): + self._errors = [ self._errors ] + if isinstance(message,list): + for line in message: + self._errors += [ line ] + else: + self._errors += [ message ] + return + + def terminate ( self ): + print self + sys.exit(self._code) + + @property + def code ( self ): return self._code + + +class BadBinary ( ErrorMessage ): + + def __init__ ( self, binary ): + ErrorMessage.__init__( self, 1, "Binary not found: <%s>." % binary ) + return + + +class BadReturnCode ( ErrorMessage ): + + def __init__ ( self, status ): + ErrorMessage.__init__( self, 1, "Command returned status:%d." % status ) + return + + +class Command ( object ): + + def __init__ ( self, arguments, fdLog=None ): + self.arguments = arguments + self.fdLog = fdLog + + if self.fdLog != None and not isinstance(self.fdLog,file): + print '[WARNING] Command.__init__(): is neither None or a file.' + return + + def _argumentsToStr ( self, arguments ): + s = '' + for argument in arguments: + if argument.find(' ') >= 0: s += ' "' + argument + '"' + else: s += ' ' + argument + return s + + def log ( self, text ): + print text[:-1] + sys.stdout.flush() + sys.stderr.flush() + if isinstance(self.fdLog,file): + self.fdLog.write( text ) + self.fdLog.flush() + return + + def execute ( self ): + global conf + sys.stdout.flush() + sys.stderr.flush() + + homeDir = os.environ['HOME'] + workDir = os.getcwd() + if homeDir.startswith(homeDir): + workDir = '~' + workDir[ len(homeDir) : ] + user = 'root' + if os.environ.has_key('USER'): user = os.environ['USER'] + prompt = '%s@%s:%s$' % (user,conf.masterHost,workDir) + + try: + self.log( '%s%s\n' % (prompt,self._argumentsToStr(self.arguments)) ) + print self.arguments + child = subprocess.Popen( self.arguments, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) + + while True: + line = child.stdout.readline() + if not line: break + + self.log( line ) + except OSError, e: + raise BadBinary( self.arguments[0] ) + + (pid,status) = os.waitpid( child.pid, 0 ) + status >>= 8 + if status != 0: + raise BadReturnCode( status ) + + return + + +class CommandArg ( object ): + + def __init__ ( self, command, wd=None, host=None, fdLog=None ): + self.command = command + self.host = host + self.wd = wd + self.fdLog = fdLog + return + + def __str__ ( self ): + s = '' + if self.wd: s = 'cd %s && ' % self.wd + + for i in range(len(self.command)): + if i: s += ' ' + s += self.command[i] + return s + + def getArgs ( self ): + if not self.host: return self.command + return [ 'ssh', self.host, str(self) ] + + def execute ( self ): + if not self.host and self.wd: os.chdir( self.wd ) + Command( self.getArgs(), self.fdLog ).execute() + return + + +class AllianceCommand ( CommandArg ): + + def __init__ ( self, alcBin, fdLog=None ): + CommandArg.__init__ ( self, [ alcBin ], fdLog=fdLog ) + return + + +class CoriolisCommand ( CommandArg ): + + def __init__ ( self, ccbBin, rootDir, threads=1, otherArgs=[], fdLog=None ): + CommandArg.__init__ ( self, [ ccbBin + , '--root='+rootDir + , '--project=coriolis' + , '--make=-j%d install' % threads + ] + otherArgs + , fdLog=fdLog ) + return + + +class BenchsCommand ( CommandArg ): + + def __init__ ( self, benchsDir, fdLog=None ): + CommandArg.__init__ ( self, [ '../bin/go.sh' ], wd=benchsDir, fdLog=fdLog ) + return + + + +class GitRepository ( object ): + + @staticmethod + def getLocalRepository ( url ): + localRepo = url.split( '/' )[-1] + if localRepo.endswith('.git'): + localRepo = localRepo[:-4] + return localRepo + + def __init__ ( self, url, cloneDir, fdLog=None ): + self.url = url + self.cloneDir = cloneDir + self.localRepo = GitRepository.getLocalRepository( url ) + self.fdLog = fdLog + return + + @property + def localRepoDir ( self ): return self.cloneDir+'/'+self.localRepo + + def removeLocalRepo ( self ): + if os.path.isdir(self.localRepoDir): + print 'Removing Git local repository: <%s>' % self.localRepoDir + shutil.rmtree( self.localRepoDir ) + return + + def clone ( self ): + print 'Clone/pull from:', self.url + if not os.path.isdir(self.cloneDir): + os.makedirs( self.cloneDir ) + + if not os.path.isdir(self.localRepoDir): + os.chdir( self.cloneDir ) + Command( [ 'git', 'clone', self.url ], self.fdLog ).execute() + else: + os.chdir( self.localRepoDir ) + Command( [ 'git', 'pull' ], self.fdLog ).execute() + return + + def checkout ( self, branch ): + os.chdir( self.localRepoDir ) + Command( [ 'git', 'checkout', branch ], self.fdLog ).execute() + return + + +class Configuration ( object ): + + PrimaryNames = \ + [ 'sender' , 'receivers' + , 'coriolisRepo', 'benchsRepo' , 'supportRepos' + , 'homeDir' , 'masterHost' + , 'debugArg' , 'nightlyMode', 'dockerMode', 'chrootMode' + , 'rmSource' , 'rmBuild' + , 'doGit' , 'doAlliance' , 'doCoriolis', 'doBenchs', 'doSendReport' + , 'success' , 'rcode' + ] + SecondaryNames = \ + [ 'rootDir', 'srcDir', 'logDir', 'logs', 'fds', 'alcBin', 'ccbBin', 'benchsDir' + ] + + def __init__ ( self ): + self._sender = 'Jean-Paul.Chaput@soc.lip6.fr' + self._receivers = [ 'Jean-Paul.Chaput@lip6.fr', ] + self._supportRepos = [ 'http://github.com/miloyip/rapidjson' ] + self._allianceRepo = 'https://gitlab.lip6.fr/jpc/alliance.git' + self._coriolisRepo = 'https://gitlab.lip6.fr/jpc/coriolis.git' + self._benchsRepo = 'https://gitlab.lip6.fr/jpc/alliance-check-toolkit.git' + self._homeDir = os.environ['HOME'] + self._debugArg = '' + self._rmSource = False + self._rmBuild = False + self._doGit = True + self._doCoriolis = False + self._doAlliance = False + self._doBenchs = False + self._doSendReport = False + self._nightlyMode = False + self._dockerMode = False + self._chrootMode = False + self._logs = { 'alliance':None, 'coriolis':None, 'benchs':None } + self._fds = { 'alliance':None, 'coriolis':None, 'benchs':None } + self._ccbBin = None + self._benchsDir = None + self._masterHost = self._detectMasterHost() + self._success = False + self._rcode = 0 + + self._updateSecondaries() + return + + def __setattr__ ( self, attribute, value ): + if attribute in Configuration.SecondaryNames: + print ErrorMessage( 1, 'Attempt to write in read-only attribute <%s> in Configuration.'%attribute ) + return + + if attribute == 'masterHost' or attribute == '_masterHost': + if value == 'lepka': + print 'Never touch the Git tree when running on .' + self._rmSource = False + self._rmBuild = False + self._doGit = False + self._doSendReport = False + + if attribute[0] == '_': + self.__dict__[attribute] = value + return + + if attribute == 'homeDir': value = os.path.expanduser(value) + + self.__dict__['_'+attribute] = value + self._updateSecondaries() + return + + def __getattr__ ( self, attribute ): + if attribute[0] != '_': attribute = '_'+attribute + if not self.__dict__.has_key(attribute): + raise ErrorMessage( 1, 'Configuration has no attribute <%s>.'%attribute ) + return self.__dict__[attribute] + + def _updateSecondaries ( self ): + if self._nightlyMode: + self._rootDir = self._homeDir + '/nightly/coriolis-2.x' + else: + self._rootDir = self._homeDir + '/coriolis-2.x' + self._srcDir = self._rootDir + '/src' + self._logDir = self._srcDir + '/logs' + self._alcBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/allianceInstaller.sh' + self._ccbBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/ccb.py' + self._benchsDir = self._srcDir + '/' + GitRepository.getLocalRepository(self._benchsRepo ) + '/benchs' + return + + def _detectMasterHost ( self ): + if self._chrootMode: return 'chrooted-host' + + masterHost = 'unknown' + hostname = socket.gethostname() + hostAddr = socket.gethostbyname(hostname) + + if hostname == 'lepka' and hostAddr == '127.0.0.1': + masterHost = 'lepka' + else: + masterHost = hostname.split('.')[0] + return masterHost + + def openLog ( self, stem ): + if not os.path.isdir(self._logDir): + os.makedirs( self._logDir ) + + index = 0 + timeTag = time.strftime( "%Y.%m.%d" ) + while True: + logFile = os.path.join(self._logDir,"%s-%s-%02d.log" % (stem,timeTag,index)) + if not os.path.isfile(logFile): + print "Report log: <%s>" % logFile + break + index += 1 + fd = open( logFile, "w" ) + self._logs[stem] = logFile + self._fds [stem] = fd + return + + def closeLogs ( self ): + for fd in self._fds.values(): + if fd: fd.close() + return + + def compressLogs ( self ): + for log in self._logs.values(): + if not log: continue + + fd = open( log, 'r' ) + bzfd = bz2.BZ2File( log+'.bz2', 'w' ) + + for line in fd.readlines(): bzfd.write( line ) + + bzfd.close() + fd.close() + + os.unlink( log ) + return + + def getCommands ( self, target ): + commands = [] + + if self.doAlliance: + if not os.path.isfile( self.alcBin ): + raise ErrorMessage( 1, [ 'Cannot find , should be here:' + , ' <%s>' % self.alcBin + ] ) + commands.append( AllianceCommand( self.alcBin, fdLog=self.fds['alliance'] ) ) + + if self.doCoriolis: + if not os.path.isfile( self.ccbBin ): + raise ErrorMessage( 1, [ 'Cannot find , should be here:' + , ' <%s>' % self.ccbBin + ] ) + + otherArgs = [] + if self.debugArg: otherArgs.append( self.debugArg ) + + if target == 'SL7_64': + otherArgs.append( '--project=support' ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs , fdLog=self.fds['coriolis'] ) ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) ) + elif target == 'SL6_64' or target == 'SL6': + otherArgs.append( '--project=support' ) + otherArgs.append( '--devtoolset=8' ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 6, otherArgs , fdLog=self.fds['coriolis'] ) ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) ) + elif target == 'Ubuntu18' or target == 'Debian9': + if target == 'Ubuntu18': otherArgs.append( '--qt5' ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs, fdLog=self.fds['coriolis'] ) ) + + if self.doBenchs: + commands.append( BenchsCommand( self.benchsDir, fdLog=self.fds['benchs'] ) ) + return commands + + +class Report ( object ): + + def __init__ ( self, conf ): + self.conf = conf + + commaspace = ', ' + date = time.strftime( "%A %d %B %Y" ) + stateText = 'FAILED' + modeText = 'SoC installation' + if self.conf.success: stateText = 'SUCCESS' + if self.conf.nightlyMode: modeText = 'Nightly build' + + self.message = MIMEMultipart() + self.message['Subject'] = '[%s] Coriolis %s %s' % (stateText,modeText,date) + self.message['From' ] = self.conf.sender + self.message['To' ] = commaspace.join( self.conf.receivers ) + self.attachements = [] + + self.mainText = '\n' + self.mainText += 'Salut le Crevard,\n' + self.mainText += '\n' + if self.conf.nightlyMode: + self.mainText += 'This is the nightly build report of Coriolis.\n' + else: + self.mainText += 'SoC installer report of Coriolis.\n' + self.mainText += '%s\n' % date + self.mainText += '\n' + if self.conf.success: + self.mainText += 'Build was SUCCESSFUL\n' + else: + self.mainText += 'Build has FAILED, please have a look to the attached log file(s).\n' + self.mainText += '\n' + self.mainText += 'Complete log file(s) can be found here:\n' + return + + def attachLog ( self, logFile ): + if not logFile: return + + fd = open( logFile, 'rb' ) + try: + fd.seek( -1024*100, os.SEEK_END ) + except IOError, e: + pass + tailLines = '' + for line in fd.readlines()[1:]: + tailLines += line + fd.close() + self.mainText += ' <%s>\n' % logFile + + attachement = MIMEApplication(tailLines) + attachement.add_header( 'Content-Disposition', 'attachment', filename=os.path.basename(logFile) ) + + self.attachements.append( attachement ) + return + + def send ( self ): + self.message.attach( MIMEText(self.mainText) ) + for attachement in self.attachements: + self.message.attach( attachement ) + + print "Sending mail report to:" + for receiver in self.conf.receivers: print ' <%s>' % receiver + session = smtplib.SMTP( 'localhost' ) + session.sendmail( self.conf.sender, self.conf.receivers, self.message.as_string() ) + session.quit() + return + + +# ------------------------------------------------------------------- +# Main Part. + + +parser = optparse.OptionParser () +parser.add_option ( "--debug" , action="store_true" , dest="debug" , help="Build a aka (-g) version." ) +parser.add_option ( "--no-git" , action="store_true" , dest="noGit" , help="Do not pull/update Git repositories before building." ) +parser.add_option ( "--do-alliance" , action="store_true" , dest="doAlliance" , help="Rebuild the Alliance tools." ) +parser.add_option ( "--do-coriolis" , action="store_true" , dest="doCoriolis" , help="Rebuild the Coriolis tools." ) +parser.add_option ( "--do-report" , action="store_true" , dest="doReport" , help="Send a final report." ) +parser.add_option ( "--nightly" , action="store_true" , dest="nightly" , help="Perform a nighly build." ) +parser.add_option ( "--docker" , action="store_true" , dest="docker" , help="Perform a build inside a docker container." ) +parser.add_option ( "--chroot" , action="store_true" , dest="chroot" , help="Perform a build inside a chrooted environment." ) +parser.add_option ( "--benchs" , action="store_true" , dest="benchs" , help="Run the sanity benchs." ) +parser.add_option ( "--rm-build" , action="store_true" , dest="rmBuild" , help="Remove the build/install directories." ) +parser.add_option ( "--rm-source" , action="store_true" , dest="rmSource" , help="Remove the Git source repositories." ) +parser.add_option ( "--rm-all" , action="store_true" , dest="rmAll" , help="Remove everything (source+build+install)." ) +parser.add_option ( "--root" , action="store" , type="string", dest="rootDir" , help="The root directory (default: <~/coriolis-2.x/>)." ) +parser.add_option ( "--profile" , action="store" , type="string", dest="profile" , help="The targeted OS for the build." ) +(options, args) = parser.parse_args () + +conf = Configuration() + +try: + if options.debug: conf.debugArg = '--debug' + if options.nightly: conf.nightlyMode = True + if options.docker: conf.dockerMode = True + if options.chroot: conf.chrootMode = True + if options.noGit: conf.doGit = False + if options.doCoriolis: conf.doCoriolis = True + if options.doAlliance: conf.doAlliance = True + if options.benchs: conf.doBenchs = True + if options.doReport: conf.doSendReport = True + if options.rmSource or options.rmAll: conf.rmSource = True + if options.rmBuild or options.rmAll: conf.rmBuild = True + + if conf.doAlliance: conf.openLog( 'alliance' ) + if conf.doCoriolis: conf.openLog( 'coriolis' ) + if conf.doBenchs: conf.openLog( 'benchs' ) + + if conf.dockerMode: os.environ['USER'] = 'root' + + gitSupports = [] + for supportRepo in conf.supportRepos: + gitSupports.append( GitRepository( supportRepo, conf.srcDir+'/support' ) ) + gitCoriolis = GitRepository( conf.coriolisRepo, conf.srcDir, conf.fds['coriolis'] ) + gitBenchs = GitRepository( conf.benchsRepo , conf.srcDir, conf.fds['coriolis'] ) + + if conf.doAlliance: + gitAlliance = GitRepository( conf.allianceRepo, conf.srcDir, conf.fds['alliance'] ) + + if conf.doGit: + for gitSupport in gitSupports: + if conf.rmSource: gitSupport.removeLocalRepo() + gitSupport.clone() + #if gitSupport.url.endswith('rapidjson'): + # gitSupport.checkout( 'a1c4f32' ) + + if conf.doCoriolis: + if conf.rmSource: gitCoriolis.removeLocalRepo() + gitCoriolis.clone () + gitCoriolis.checkout( 'devel' ) + + if conf.doAlliance: + if conf.rmSource: gitAlliance.removeLocalRepo() + gitAlliance.clone () + #gitAlliance.checkout( 'devel' ) + + if conf.rmSource: gitBenchs.removeLocalRepo() + gitBenchs.clone() + + if conf.rmBuild: + for entry in os.listdir(conf.rootDir): + if entry.startswith('Linux.'): + buildDir = conf.rootDir+'/'+entry + print 'Removing OS build directory: <%s>' % buildDir + shutil.rmtree( buildDir ) + + commands = conf.getCommands( options.profile ) + for command in commands: + if command.host: + print 'Executing command on remote host <%s>:' % host + else: + print 'Executing command on *local* host:' + print ' %s' % str(command) + command.execute() + + conf.closeLogs() + + conf.success = True + +except ErrorMessage, e: + print e + conf.closeLogs() + conf.success = False + + if showTrace: + print '\nPython stack trace:' + traceback.print_tb( sys.exc_info()[2] ) + conf.rcode = e.code + +if conf.doSendReport: + report = Report( conf ) + report.attachLog( conf.logs['coriolis' ] ) + report.attachLog( conf.logs['benchs' ] ) + report.send() + +conf.compressLogs() + +sys.exit( conf.rcode ) diff --git a/bootstrap/docker/scientificlinux-7/Dockerfile.bash b/bootstrap/docker/scientificlinux-7/Dockerfile.bash new file mode 100644 index 00000000..90457286 --- /dev/null +++ b/bootstrap/docker/scientificlinux-7/Dockerfile.bash @@ -0,0 +1,6 @@ + +FROM sl7.coriolis + +COPY root/dot.bashrc /root/.bashrc + +CMD [ "/bin/bash", "-i" ] diff --git a/bootstrap/docker/scientificlinux-7/Dockerfile.coriolis b/bootstrap/docker/scientificlinux-7/Dockerfile.coriolis new file mode 100644 index 00000000..16eed04d --- /dev/null +++ b/bootstrap/docker/scientificlinux-7/Dockerfile.coriolis @@ -0,0 +1,6 @@ + +FROM sl7.system + +COPY root/socInstaller.py /root/socInstaller.py +RUN /root/socInstaller.py --docker --profile=SL7_64 --do-alliance --do-coriolis --benchs + diff --git a/bootstrap/docker/scientificlinux-7/Dockerfile.system b/bootstrap/docker/scientificlinux-7/Dockerfile.system new file mode 100644 index 00000000..afa0b087 --- /dev/null +++ b/bootstrap/docker/scientificlinux-7/Dockerfile.system @@ -0,0 +1,25 @@ + +FROM scientificlinux/sl:latest + +RUN yum -y update \ + && yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ + && yum -y install git cmake bison flex gcc-c++ libstdc++-devel \ + make binutils-devel \ + boost-devel boost-python boost-filesystem \ + boost-regex boost-wave \ + python-devel libxml2-devel bzip2-devel \ + qt-devel PyQt4 \ + \ + autoconf automake libtool \ + libX11-devel libXt-devel libXpm-devel \ + motif motif-devel \ + \ + python36-six \ + vim-x11 \ + && yum -y install http://ftp.lip6.fr/pub/linux/distributions/slsoc/soc/7/addons/x86_64/RPMS/qwt-6.1.2-4.fc23.x86_64.rpm \ + http://ftp.lip6.fr/pub/linux/distributions/slsoc/soc/7/addons/x86_64/RPMS/qwt-devel-6.1.2-4.fc23.x86_64.rpm \ + http://ftp.lip6.fr/pub/linux/distributions/slsoc/soc/7/addons/x86_64/RPMS/yosys-0.9-1.el7.soc.x86_64.rpm \ + http://ftp.lip6.fr/pub/linux/distributions/slsoc/soc/7/addons/x86_64/RPMS/python3-pyvcd-0.1.7-git2302c99.1.el7.soc.x86_64.rpm \ + http://ftp.lip6.fr/pub/linux/distributions/slsoc/soc/7/addons/x86_64/RPMS/python3-nmigen-0.1-git57d95b7.1.el7.soc.x86_64.rpm \ + && yum clean all + diff --git a/bootstrap/docker/scientificlinux-7/docker-conf.sh b/bootstrap/docker/scientificlinux-7/docker-conf.sh new file mode 100644 index 00000000..78888c38 --- /dev/null +++ b/bootstrap/docker/scientificlinux-7/docker-conf.sh @@ -0,0 +1,4 @@ + + systemImage="sl7.system" + coriolisImage="sl7.coriolis" + bashImage="sl7.bash" diff --git a/bootstrap/docker/scientificlinux-7/root/allianceInstaller.sh b/bootstrap/docker/scientificlinux-7/root/allianceInstaller.sh new file mode 100755 index 00000000..4083c207 --- /dev/null +++ b/bootstrap/docker/scientificlinux-7/root/allianceInstaller.sh @@ -0,0 +1,18 @@ +#!/bin/bash + + srcDir=${HOME}/coriolis-2.x/src/alliance/alliance/src + commonRoot=${HOME}/coriolis-2.x/Linux.el7_64/Release.Shared + buildDir=${commonRoot}/build + installDir=${commonRoot}/install + + export ALLIANCE_TOP=${installDir} + export LD_LIBRARY_PATH=${installDir}/lib:${LD_LIBRARY_PATH} + + cd ${srcDir} + sed -i 's,dirs="\$newdirs documentation",dirs="$newdirs",' ./autostuff + ./autostuff clean + ./autostuff + mkdir -p ${buildDir} + cd ${buildDir} + ${srcDir}/configure --prefix=${ALLIANCE_TOP} --enable-alc-shared + make -j1 install diff --git a/bootstrap/docker/scientificlinux-7/root/dot.bashrc b/bootstrap/docker/scientificlinux-7/root/dot.bashrc new file mode 100644 index 00000000..0e2c1e18 --- /dev/null +++ b/bootstrap/docker/scientificlinux-7/root/dot.bashrc @@ -0,0 +1,14 @@ + + echo "Running /root/.bashrc" + + for archDir in `ls /root/coriolis-2.x/`; do + if [ "$archDir" = "src" ]; then continue; fi + break + done + echo "Found Coriolis architecture directory \"${archDir}\"." + + installDir="/root/coriolis-2.x/${archDir}/Release.Shared/install" + . ${installDir}/etc/profile.d/alc_env.sh + eval `${installDir}/etc/coriolis2/coriolisEnv.py` + + export QT_X11_NO_MITSHM=1 diff --git a/bootstrap/docker/scientificlinux-7/root/socInstaller.py b/bootstrap/docker/scientificlinux-7/root/socInstaller.py new file mode 100755 index 00000000..592a562f --- /dev/null +++ b/bootstrap/docker/scientificlinux-7/root/socInstaller.py @@ -0,0 +1,631 @@ +#!/usr/bin/env python +# +# -*- mode:Python -*- +# +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2015-2018, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | C o r i o l i s I n s t a l l e r | +# | | +# | Authors : Jean-Paul Chaput | +# | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +# | =============================================================== | +# | Python : "./socInstaller.py" | +# +-----------------------------------------------------------------+ +# +# WARNING: +# This script has been designed only for internal use in the +# LIP6/CIAN department. If you want to use it you will need to +# change the hardwired configuration. + + +showTrace = True + +try: + import sys + import os.path + import shutil + import optparse + import time + import traceback + import distutils.sysconfig + import subprocess + import socket + import re + import bz2 + import smtplib + from email.mime.text import MIMEText + from email.mime.multipart import MIMEMultipart + from email.mime.application import MIMEApplication +except ImportError, e: + module = str(e).split()[-1] + + +class ErrorMessage ( Exception ): + + def __init__ ( self, code, *arguments ): + self._code = code + self._errors = [ 'Malformed call to ErrorMessage()', '%s' % str(arguments) ] + + text = None + if len(arguments) == 1: + if isinstance(arguments[0],Exception): text = str(arguments[0]).split('\n') + else: + self._errors = arguments[0] + elif len(arguments) > 1: + text = list(arguments) + + if text: + self._errors = [] + while len(text[0]) == 0: del text[0] + + lstrip = 0 + if text[0].startswith('[ERROR]'): lstrip = 8 + + for line in text: + if line[0:lstrip ] == ' '*lstrip or \ + line[0:lstrip-1] == '[ERROR]': + self._errors += [ line[lstrip:] ] + else: + self._errors += [ line.lstrip() ] + return + + def __str__ ( self ): + if not isinstance(self._errors,list): + return "[ERROR] %s" % self._errors + + formatted = "\n" + for i in range(len(self._errors)): + if i == 0: formatted += "[ERROR] %s" % self._errors[i] + else: formatted += " %s" % self._errors[i] + if i+1 < len(self._errors): formatted += "\n" + return formatted + + def addMessage ( self, message ): + if not isinstance(self._errors,list): + self._errors = [ self._errors ] + if isinstance(message,list): + for line in message: + self._errors += [ line ] + else: + self._errors += [ message ] + return + + def terminate ( self ): + print self + sys.exit(self._code) + + @property + def code ( self ): return self._code + + +class BadBinary ( ErrorMessage ): + + def __init__ ( self, binary ): + ErrorMessage.__init__( self, 1, "Binary not found: <%s>." % binary ) + return + + +class BadReturnCode ( ErrorMessage ): + + def __init__ ( self, status ): + ErrorMessage.__init__( self, 1, "Command returned status:%d." % status ) + return + + +class Command ( object ): + + def __init__ ( self, arguments, fdLog=None ): + self.arguments = arguments + self.fdLog = fdLog + + if self.fdLog != None and not isinstance(self.fdLog,file): + print '[WARNING] Command.__init__(): is neither None or a file.' + return + + def _argumentsToStr ( self, arguments ): + s = '' + for argument in arguments: + if argument.find(' ') >= 0: s += ' "' + argument + '"' + else: s += ' ' + argument + return s + + def log ( self, text ): + print text[:-1] + sys.stdout.flush() + sys.stderr.flush() + if isinstance(self.fdLog,file): + self.fdLog.write( text ) + self.fdLog.flush() + return + + def execute ( self ): + global conf + sys.stdout.flush() + sys.stderr.flush() + + homeDir = os.environ['HOME'] + workDir = os.getcwd() + if homeDir.startswith(homeDir): + workDir = '~' + workDir[ len(homeDir) : ] + user = 'root' + if os.environ.has_key('USER'): user = os.environ['USER'] + prompt = '%s@%s:%s$' % (user,conf.masterHost,workDir) + + try: + self.log( '%s%s\n' % (prompt,self._argumentsToStr(self.arguments)) ) + print self.arguments + child = subprocess.Popen( self.arguments, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) + + while True: + line = child.stdout.readline() + if not line: break + + self.log( line ) + except OSError, e: + raise BadBinary( self.arguments[0] ) + + (pid,status) = os.waitpid( child.pid, 0 ) + status >>= 8 + if status != 0: + raise BadReturnCode( status ) + + return + + +class CommandArg ( object ): + + def __init__ ( self, command, wd=None, host=None, fdLog=None ): + self.command = command + self.host = host + self.wd = wd + self.fdLog = fdLog + return + + def __str__ ( self ): + s = '' + if self.wd: s = 'cd %s && ' % self.wd + + for i in range(len(self.command)): + if i: s += ' ' + s += self.command[i] + return s + + def getArgs ( self ): + if not self.host: return self.command + return [ 'ssh', self.host, str(self) ] + + def execute ( self ): + if not self.host and self.wd: os.chdir( self.wd ) + Command( self.getArgs(), self.fdLog ).execute() + return + + +class AllianceCommand ( CommandArg ): + + def __init__ ( self, alcBin, fdLog=None ): + CommandArg.__init__ ( self, [ alcBin ], fdLog=fdLog ) + return + + +class CoriolisCommand ( CommandArg ): + + def __init__ ( self, ccbBin, rootDir, threads=1, otherArgs=[], fdLog=None ): + CommandArg.__init__ ( self, [ ccbBin + , '--root='+rootDir + , '--project=coriolis' + , '--make=-j%d install' % threads + ] + otherArgs + , fdLog=fdLog ) + return + + +class BenchsCommand ( CommandArg ): + + def __init__ ( self, benchsDir, fdLog=None ): + CommandArg.__init__ ( self, [ '../bin/go.sh' ], wd=benchsDir, fdLog=fdLog ) + return + + + +class GitRepository ( object ): + + @staticmethod + def getLocalRepository ( url ): + localRepo = url.split( '/' )[-1] + if localRepo.endswith('.git'): + localRepo = localRepo[:-4] + return localRepo + + def __init__ ( self, url, cloneDir, fdLog=None ): + self.url = url + self.cloneDir = cloneDir + self.localRepo = GitRepository.getLocalRepository( url ) + self.fdLog = fdLog + return + + @property + def localRepoDir ( self ): return self.cloneDir+'/'+self.localRepo + + def removeLocalRepo ( self ): + if os.path.isdir(self.localRepoDir): + print 'Removing Git local repository: <%s>' % self.localRepoDir + shutil.rmtree( self.localRepoDir ) + return + + def clone ( self ): + print 'Clone/pull from:', self.url + if not os.path.isdir(self.cloneDir): + os.makedirs( self.cloneDir ) + + if not os.path.isdir(self.localRepoDir): + os.chdir( self.cloneDir ) + Command( [ 'git', 'clone', self.url ], self.fdLog ).execute() + else: + os.chdir( self.localRepoDir ) + Command( [ 'git', 'pull' ], self.fdLog ).execute() + return + + def checkout ( self, branch ): + os.chdir( self.localRepoDir ) + Command( [ 'git', 'checkout', branch ], self.fdLog ).execute() + return + + +class Configuration ( object ): + + PrimaryNames = \ + [ 'sender' , 'receivers' + , 'coriolisRepo', 'benchsRepo' , 'supportRepos' + , 'homeDir' , 'masterHost' + , 'debugArg' , 'nightlyMode', 'dockerMode', 'chrootMode' + , 'rmSource' , 'rmBuild' + , 'doGit' , 'doAlliance' , 'doCoriolis', 'doBenchs', 'doSendReport' + , 'success' , 'rcode' + ] + SecondaryNames = \ + [ 'rootDir', 'srcDir', 'logDir', 'logs', 'fds', 'alcBin', 'ccbBin', 'benchsDir' + ] + + def __init__ ( self ): + self._sender = 'Jean-Paul.Chaput@soc.lip6.fr' + self._receivers = [ 'Jean-Paul.Chaput@lip6.fr', ] + self._supportRepos = [ 'http://github.com/miloyip/rapidjson' ] + self._allianceRepo = 'https://gitlab.lip6.fr/jpc/alliance.git' + self._coriolisRepo = 'https://gitlab.lip6.fr/jpc/coriolis.git' + self._benchsRepo = 'https://gitlab.lip6.fr/jpc/alliance-check-toolkit.git' + self._homeDir = os.environ['HOME'] + self._debugArg = '' + self._rmSource = False + self._rmBuild = False + self._doGit = True + self._doCoriolis = False + self._doAlliance = False + self._doBenchs = False + self._doSendReport = False + self._nightlyMode = False + self._dockerMode = False + self._chrootMode = None + self._logs = { 'alliance':None, 'coriolis':None, 'benchs':None } + self._fds = { 'alliance':None, 'coriolis':None, 'benchs':None } + self._ccbBin = None + self._benchsDir = None + self._masterHost = self._detectMasterHost() + self._success = False + self._rcode = 0 + + self._updateSecondaries() + return + + def __setattr__ ( self, attribute, value ): + if attribute in Configuration.SecondaryNames: + print ErrorMessage( 1, 'Attempt to write in read-only attribute <%s> in Configuration.'%attribute ) + return + + if attribute == 'masterHost' or attribute == '_masterHost': + if value == 'lepka': + print 'Never touch the Git tree when running on .' + self._rmSource = False + self._rmBuild = False + self._doGit = False + self._doSendReport = False + + if attribute[0] == '_': + self.__dict__[attribute] = value + return + + if attribute == 'homeDir': value = os.path.expanduser(value) + + self.__dict__['_'+attribute] = value + self._updateSecondaries() + return + + def __getattr__ ( self, attribute ): + if attribute[0] != '_': attribute = '_'+attribute + if not self.__dict__.has_key(attribute): + raise ErrorMessage( 1, 'Configuration has no attribute <%s>.'%attribute ) + return self.__dict__[attribute] + + def _updateSecondaries ( self ): + if self._nightlyMode: + self._rootDir = self._homeDir + '/nightly/coriolis-2.x' + else: + self._rootDir = self._homeDir + '/coriolis-2.x' + self._srcDir = self._rootDir + '/src' + self._logDir = self._srcDir + '/logs' + self._alcBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/allianceInstaller.sh' + self._ccbBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/ccb.py' + self._benchsDir = self._srcDir + '/' + GitRepository.getLocalRepository(self._benchsRepo ) + '/benchs' + self._masterHost = self._detectMasterHost() + return + + def _detectMasterHost ( self ): + if self._chrootMode is None: return 'unknown' + if self._chrootMode: return 'chrooted-host' + + masterHost = 'unknown' + hostname = socket.gethostname() + hostAddr = socket.gethostbyname(hostname) + + if hostname == 'lepka' and hostAddr == '127.0.0.1': + masterHost = 'lepka' + else: + masterHost = hostname.split('.')[0] + return masterHost + + def openLog ( self, stem ): + if not os.path.isdir(self._logDir): + os.makedirs( self._logDir ) + + index = 0 + timeTag = time.strftime( "%Y.%m.%d" ) + while True: + logFile = os.path.join(self._logDir,"%s-%s-%02d.log" % (stem,timeTag,index)) + if not os.path.isfile(logFile): + print "Report log: <%s>" % logFile + break + index += 1 + fd = open( logFile, "w" ) + self._logs[stem] = logFile + self._fds [stem] = fd + return + + def closeLogs ( self ): + for fd in self._fds.values(): + if fd: fd.close() + return + + def compressLogs ( self ): + for log in self._logs.values(): + if not log: continue + + fd = open( log, 'r' ) + bzfd = bz2.BZ2File( log+'.bz2', 'w' ) + + for line in fd.readlines(): bzfd.write( line ) + + bzfd.close() + fd.close() + + os.unlink( log ) + return + + def getCommands ( self, target ): + commands = [] + + if self.doAlliance: + if not os.path.isfile( self.alcBin ): + raise ErrorMessage( 1, [ 'Cannot find , should be here:' + , ' <%s>' % self.alcBin + ] ) + commands.append( AllianceCommand( self.alcBin, fdLog=self.fds['alliance'] ) ) + + if self.doCoriolis: + if not os.path.isfile( self.ccbBin ): + raise ErrorMessage( 1, [ 'Cannot find , should be here:' + , ' <%s>' % self.ccbBin + ] ) + + otherArgs = [] + if self.debugArg: otherArgs.append( self.debugArg ) + + if target == 'SL7_64': + otherArgs.append( '--project=support' ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs , fdLog=self.fds['coriolis'] ) ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) ) + elif target == 'SL6_64' or target == 'SL6': + otherArgs.append( '--project=support' ) + otherArgs.append( '--devtoolset=8' ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 6, otherArgs , fdLog=self.fds['coriolis'] ) ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) ) + elif target == 'Ubuntu18' or target == 'Debian9': + if target == 'Ubuntu18': otherArgs.append( '--qt5' ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs, fdLog=self.fds['coriolis'] ) ) + + if self.doBenchs: + commands.append( BenchsCommand( self.benchsDir, fdLog=self.fds['benchs'] ) ) + return commands + + +class Report ( object ): + + def __init__ ( self, conf ): + self.conf = conf + + commaspace = ', ' + date = time.strftime( "%A %d %B %Y" ) + stateText = 'FAILED' + modeText = 'SoC installation' + if self.conf.success: stateText = 'SUCCESS' + if self.conf.nightlyMode: modeText = 'Nightly build' + + self.message = MIMEMultipart() + self.message['Subject'] = '[%s] Coriolis %s %s' % (stateText,modeText,date) + self.message['From' ] = self.conf.sender + self.message['To' ] = commaspace.join( self.conf.receivers ) + self.attachements = [] + + self.mainText = '\n' + self.mainText += 'Salut le Crevard,\n' + self.mainText += '\n' + if self.conf.nightlyMode: + self.mainText += 'This is the nightly build report of Coriolis.\n' + else: + self.mainText += 'SoC installer report of Coriolis.\n' + self.mainText += '%s\n' % date + self.mainText += '\n' + if self.conf.success: + self.mainText += 'Build was SUCCESSFUL\n' + else: + self.mainText += 'Build has FAILED, please have a look to the attached log file(s).\n' + self.mainText += '\n' + self.mainText += 'Complete log file(s) can be found here:\n' + return + + def attachLog ( self, logFile ): + if not logFile: return + + fd = open( logFile, 'rb' ) + try: + fd.seek( -1024*100, os.SEEK_END ) + except IOError, e: + pass + tailLines = '' + for line in fd.readlines()[1:]: + tailLines += line + fd.close() + self.mainText += ' <%s>\n' % logFile + + attachement = MIMEApplication(tailLines) + attachement.add_header( 'Content-Disposition', 'attachment', filename=os.path.basename(logFile) ) + + self.attachements.append( attachement ) + return + + def send ( self ): + self.message.attach( MIMEText(self.mainText) ) + for attachement in self.attachements: + self.message.attach( attachement ) + + print "Sending mail report to:" + for receiver in self.conf.receivers: print ' <%s>' % receiver + session = smtplib.SMTP( 'localhost' ) + session.sendmail( self.conf.sender, self.conf.receivers, self.message.as_string() ) + session.quit() + return + + +# ------------------------------------------------------------------- +# Main Part. + + +parser = optparse.OptionParser () +parser.add_option ( "--debug" , action="store_true" , dest="debug" , help="Build a aka (-g) version." ) +parser.add_option ( "--no-git" , action="store_true" , dest="noGit" , help="Do not pull/update Git repositories before building." ) +parser.add_option ( "--do-alliance" , action="store_true" , dest="doAlliance" , help="Rebuild the Alliance tools." ) +parser.add_option ( "--do-coriolis" , action="store_true" , dest="doCoriolis" , help="Rebuild the Coriolis tools." ) +parser.add_option ( "--do-report" , action="store_true" , dest="doReport" , help="Send a final report." ) +parser.add_option ( "--nightly" , action="store_true" , dest="nightly" , help="Perform a nighly build." ) +parser.add_option ( "--docker" , action="store_true" , dest="docker" , help="Perform a build inside a docker container." ) +parser.add_option ( "--chroot" , action="store_true" , dest="chroot" , help="Perform a build inside a chrooted environment." ) +parser.add_option ( "--benchs" , action="store_true" , dest="benchs" , help="Run the sanity benchs." ) +parser.add_option ( "--rm-build" , action="store_true" , dest="rmBuild" , help="Remove the build/install directories." ) +parser.add_option ( "--rm-source" , action="store_true" , dest="rmSource" , help="Remove the Git source repositories." ) +parser.add_option ( "--rm-all" , action="store_true" , dest="rmAll" , help="Remove everything (source+build+install)." ) +parser.add_option ( "--root" , action="store" , type="string", dest="rootDir" , help="The root directory (default: <~/coriolis-2.x/>)." ) +parser.add_option ( "--profile" , action="store" , type="string", dest="profile" , help="The targeted OS for the build." ) +(options, args) = parser.parse_args () + + +conf = Configuration() + +try: + if options.debug: conf.debugArg = '--debug' + if options.nightly: conf.nightlyMode = True + if options.docker: conf.dockerMode = True + if options.chroot: conf.chrootMode = True + if options.noGit: conf.doGit = False + if options.doCoriolis: conf.doCoriolis = True + if options.doAlliance: conf.doAlliance = True + if options.benchs: conf.doBenchs = True + if options.doReport: conf.doSendReport = True + if options.rmSource or options.rmAll: conf.rmSource = True + if options.rmBuild or options.rmAll: conf.rmBuild = True + + + if conf.doAlliance: conf.openLog( 'alliance' ) + if conf.doCoriolis: conf.openLog( 'coriolis' ) + if conf.doBenchs: conf.openLog( 'benchs' ) + + if conf.dockerMode: os.environ['USER'] = 'root' + + gitSupports = [] + for supportRepo in conf.supportRepos: + gitSupports.append( GitRepository( supportRepo, conf.srcDir+'/support' ) ) + gitCoriolis = GitRepository( conf.coriolisRepo, conf.srcDir, conf.fds['coriolis'] ) + gitBenchs = GitRepository( conf.benchsRepo , conf.srcDir, conf.fds['coriolis'] ) + + if conf.doAlliance: + gitAlliance = GitRepository( conf.allianceRepo, conf.srcDir, conf.fds['alliance'] ) + + if conf.doGit: + for gitSupport in gitSupports: + if conf.rmSource: gitSupport.removeLocalRepo() + gitSupport.clone() + #if gitSupport.url.endswith('rapidjson'): + # gitSupport.checkout( 'a1c4f32' ) + + if conf.doCoriolis: + if conf.rmSource: gitCoriolis.removeLocalRepo() + gitCoriolis.clone () + gitCoriolis.checkout( 'devel' ) + + if conf.doAlliance: + if conf.rmSource: gitAlliance.removeLocalRepo() + gitAlliance.clone () + #gitAlliance.checkout( 'devel' ) + + if conf.rmSource: gitBenchs.removeLocalRepo() + gitBenchs.clone() + + if conf.rmBuild: + for entry in os.listdir(conf.rootDir): + if entry.startswith('Linux.'): + buildDir = conf.rootDir+'/'+entry + print 'Removing OS build directory: <%s>' % buildDir + shutil.rmtree( buildDir ) + + commands = conf.getCommands( options.profile ) + for command in commands: + if command.host: + print 'Executing command on remote host <%s>:' % host + else: + print 'Executing command on *local* host:' + print ' %s' % str(command) + command.execute() + + conf.closeLogs() + + conf.success = True + +except ErrorMessage, e: + print e + conf.closeLogs() + conf.success = False + + if showTrace: + print '\nPython stack trace:' + traceback.print_tb( sys.exc_info()[2] ) + conf.rcode = e.code + +if conf.doSendReport: + report = Report( conf ) + report.attachLog( conf.logs['coriolis' ] ) + report.attachLog( conf.logs['benchs' ] ) + report.send() + +conf.compressLogs() + +sys.exit( conf.rcode ) diff --git a/bootstrap/docker/ubuntu-18/Dockerfile.bash b/bootstrap/docker/ubuntu-18/Dockerfile.bash new file mode 100644 index 00000000..c22ec076 --- /dev/null +++ b/bootstrap/docker/ubuntu-18/Dockerfile.bash @@ -0,0 +1,6 @@ + +FROM ununtu18.coriolis + +COPY root/dot.bashrc /root/.bashrc + +CMD [ "/bin/bash", "-i" ] diff --git a/bootstrap/docker/ubuntu-18/Dockerfile.coriolis b/bootstrap/docker/ubuntu-18/Dockerfile.coriolis new file mode 100644 index 00000000..5aafa964 --- /dev/null +++ b/bootstrap/docker/ubuntu-18/Dockerfile.coriolis @@ -0,0 +1,10 @@ + +FROM ubuntu18.system + +COPY root/socInstaller.py /root/socInstaller.py +RUN mkdir -p coriolis-2.x/src \ + && git clone https://github.com/m-labs/nmigen.git \ + && cd nmigen \ + && python3 setup.py develop \ + && /root/socInstaller.py --docker --profile=Ubuntu18 --do-alliance --do-coriolis --benchs + diff --git a/bootstrap/docker/ubuntu-18/Dockerfile.system b/bootstrap/docker/ubuntu-18/Dockerfile.system new file mode 100644 index 00000000..9cd9d581 --- /dev/null +++ b/bootstrap/docker/ubuntu-18/Dockerfile.system @@ -0,0 +1,26 @@ + +FROM ubuntu:bionic + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get -y install build-essential binutils-dev \ + git cmake bison flex gcc python-dev \ + libboost-all-dev libboost-python-dev \ + zlib1g-dev libxml2-dev rapidjson-dev libbz2-dev \ + qtbase5-dev libqt5svg5-dev libqwt-qt5-dev \ + python-pyqt5 \ + \ + autotools-dev automake \ + libxt-dev libxpm-dev libmotif-dev \ + \ + yosys \ + python3-setuptools python3-pip python3-six \ + python3-wheel \ + \ + vim \ + && apt-get clean \ + && pip3 install git+https://github.com/m-labs/nmigen.git + +# For building with Qt 4 instead of Qt 5. +# qt4-dev-tools libqwt-dev python-qt4 \ diff --git a/bootstrap/docker/ubuntu-18/docker-conf.sh b/bootstrap/docker/ubuntu-18/docker-conf.sh new file mode 100644 index 00000000..564f2b54 --- /dev/null +++ b/bootstrap/docker/ubuntu-18/docker-conf.sh @@ -0,0 +1,4 @@ + + systemImage="ubuntu18.system" + coriolisImage="ubuntu18.coriolis" + bashImage="ubuntu18.bash" diff --git a/bootstrap/docker/ubuntu-18/root/allianceInstaller.sh b/bootstrap/docker/ubuntu-18/root/allianceInstaller.sh new file mode 100755 index 00000000..71f02906 --- /dev/null +++ b/bootstrap/docker/ubuntu-18/root/allianceInstaller.sh @@ -0,0 +1,19 @@ +#!/bin/bash + + srcDir=${HOME}/coriolis-2.x/src/alliance/alliance/src + commonRoot=${HOME}/coriolis-2.x/Linux.el7_64/Release.Shared + buildDir=${commonRoot}/build + installDir=${commonRoot}/install + + export ALLIANCE_TOP=${installDir} + export LD_LIBRARY_PATH=${installDir}/lib:${LD_LIBRARY_PATH} + + cd ${srcDir} + # Skip doc generation to avoid pulling TeXLive in docker images. + sed -i 's,dirs="\$newdirs documentation",dirs="$newdirs",' ./autostuff + ./autostuff clean + ./autostuff + mkdir -p ${buildDir} + cd ${buildDir} + ${srcDir}/configure --prefix=${ALLIANCE_TOP} --enable-alc-shared + make -j1 install diff --git a/bootstrap/docker/ubuntu-18/root/dot.bashrc b/bootstrap/docker/ubuntu-18/root/dot.bashrc new file mode 100644 index 00000000..0e2c1e18 --- /dev/null +++ b/bootstrap/docker/ubuntu-18/root/dot.bashrc @@ -0,0 +1,14 @@ + + echo "Running /root/.bashrc" + + for archDir in `ls /root/coriolis-2.x/`; do + if [ "$archDir" = "src" ]; then continue; fi + break + done + echo "Found Coriolis architecture directory \"${archDir}\"." + + installDir="/root/coriolis-2.x/${archDir}/Release.Shared/install" + . ${installDir}/etc/profile.d/alc_env.sh + eval `${installDir}/etc/coriolis2/coriolisEnv.py` + + export QT_X11_NO_MITSHM=1 diff --git a/bootstrap/docker/ubuntu-18/root/socInstaller.py b/bootstrap/docker/ubuntu-18/root/socInstaller.py new file mode 100755 index 00000000..592a562f --- /dev/null +++ b/bootstrap/docker/ubuntu-18/root/socInstaller.py @@ -0,0 +1,631 @@ +#!/usr/bin/env python +# +# -*- mode:Python -*- +# +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2015-2018, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | C o r i o l i s I n s t a l l e r | +# | | +# | Authors : Jean-Paul Chaput | +# | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +# | =============================================================== | +# | Python : "./socInstaller.py" | +# +-----------------------------------------------------------------+ +# +# WARNING: +# This script has been designed only for internal use in the +# LIP6/CIAN department. If you want to use it you will need to +# change the hardwired configuration. + + +showTrace = True + +try: + import sys + import os.path + import shutil + import optparse + import time + import traceback + import distutils.sysconfig + import subprocess + import socket + import re + import bz2 + import smtplib + from email.mime.text import MIMEText + from email.mime.multipart import MIMEMultipart + from email.mime.application import MIMEApplication +except ImportError, e: + module = str(e).split()[-1] + + +class ErrorMessage ( Exception ): + + def __init__ ( self, code, *arguments ): + self._code = code + self._errors = [ 'Malformed call to ErrorMessage()', '%s' % str(arguments) ] + + text = None + if len(arguments) == 1: + if isinstance(arguments[0],Exception): text = str(arguments[0]).split('\n') + else: + self._errors = arguments[0] + elif len(arguments) > 1: + text = list(arguments) + + if text: + self._errors = [] + while len(text[0]) == 0: del text[0] + + lstrip = 0 + if text[0].startswith('[ERROR]'): lstrip = 8 + + for line in text: + if line[0:lstrip ] == ' '*lstrip or \ + line[0:lstrip-1] == '[ERROR]': + self._errors += [ line[lstrip:] ] + else: + self._errors += [ line.lstrip() ] + return + + def __str__ ( self ): + if not isinstance(self._errors,list): + return "[ERROR] %s" % self._errors + + formatted = "\n" + for i in range(len(self._errors)): + if i == 0: formatted += "[ERROR] %s" % self._errors[i] + else: formatted += " %s" % self._errors[i] + if i+1 < len(self._errors): formatted += "\n" + return formatted + + def addMessage ( self, message ): + if not isinstance(self._errors,list): + self._errors = [ self._errors ] + if isinstance(message,list): + for line in message: + self._errors += [ line ] + else: + self._errors += [ message ] + return + + def terminate ( self ): + print self + sys.exit(self._code) + + @property + def code ( self ): return self._code + + +class BadBinary ( ErrorMessage ): + + def __init__ ( self, binary ): + ErrorMessage.__init__( self, 1, "Binary not found: <%s>." % binary ) + return + + +class BadReturnCode ( ErrorMessage ): + + def __init__ ( self, status ): + ErrorMessage.__init__( self, 1, "Command returned status:%d." % status ) + return + + +class Command ( object ): + + def __init__ ( self, arguments, fdLog=None ): + self.arguments = arguments + self.fdLog = fdLog + + if self.fdLog != None and not isinstance(self.fdLog,file): + print '[WARNING] Command.__init__(): is neither None or a file.' + return + + def _argumentsToStr ( self, arguments ): + s = '' + for argument in arguments: + if argument.find(' ') >= 0: s += ' "' + argument + '"' + else: s += ' ' + argument + return s + + def log ( self, text ): + print text[:-1] + sys.stdout.flush() + sys.stderr.flush() + if isinstance(self.fdLog,file): + self.fdLog.write( text ) + self.fdLog.flush() + return + + def execute ( self ): + global conf + sys.stdout.flush() + sys.stderr.flush() + + homeDir = os.environ['HOME'] + workDir = os.getcwd() + if homeDir.startswith(homeDir): + workDir = '~' + workDir[ len(homeDir) : ] + user = 'root' + if os.environ.has_key('USER'): user = os.environ['USER'] + prompt = '%s@%s:%s$' % (user,conf.masterHost,workDir) + + try: + self.log( '%s%s\n' % (prompt,self._argumentsToStr(self.arguments)) ) + print self.arguments + child = subprocess.Popen( self.arguments, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) + + while True: + line = child.stdout.readline() + if not line: break + + self.log( line ) + except OSError, e: + raise BadBinary( self.arguments[0] ) + + (pid,status) = os.waitpid( child.pid, 0 ) + status >>= 8 + if status != 0: + raise BadReturnCode( status ) + + return + + +class CommandArg ( object ): + + def __init__ ( self, command, wd=None, host=None, fdLog=None ): + self.command = command + self.host = host + self.wd = wd + self.fdLog = fdLog + return + + def __str__ ( self ): + s = '' + if self.wd: s = 'cd %s && ' % self.wd + + for i in range(len(self.command)): + if i: s += ' ' + s += self.command[i] + return s + + def getArgs ( self ): + if not self.host: return self.command + return [ 'ssh', self.host, str(self) ] + + def execute ( self ): + if not self.host and self.wd: os.chdir( self.wd ) + Command( self.getArgs(), self.fdLog ).execute() + return + + +class AllianceCommand ( CommandArg ): + + def __init__ ( self, alcBin, fdLog=None ): + CommandArg.__init__ ( self, [ alcBin ], fdLog=fdLog ) + return + + +class CoriolisCommand ( CommandArg ): + + def __init__ ( self, ccbBin, rootDir, threads=1, otherArgs=[], fdLog=None ): + CommandArg.__init__ ( self, [ ccbBin + , '--root='+rootDir + , '--project=coriolis' + , '--make=-j%d install' % threads + ] + otherArgs + , fdLog=fdLog ) + return + + +class BenchsCommand ( CommandArg ): + + def __init__ ( self, benchsDir, fdLog=None ): + CommandArg.__init__ ( self, [ '../bin/go.sh' ], wd=benchsDir, fdLog=fdLog ) + return + + + +class GitRepository ( object ): + + @staticmethod + def getLocalRepository ( url ): + localRepo = url.split( '/' )[-1] + if localRepo.endswith('.git'): + localRepo = localRepo[:-4] + return localRepo + + def __init__ ( self, url, cloneDir, fdLog=None ): + self.url = url + self.cloneDir = cloneDir + self.localRepo = GitRepository.getLocalRepository( url ) + self.fdLog = fdLog + return + + @property + def localRepoDir ( self ): return self.cloneDir+'/'+self.localRepo + + def removeLocalRepo ( self ): + if os.path.isdir(self.localRepoDir): + print 'Removing Git local repository: <%s>' % self.localRepoDir + shutil.rmtree( self.localRepoDir ) + return + + def clone ( self ): + print 'Clone/pull from:', self.url + if not os.path.isdir(self.cloneDir): + os.makedirs( self.cloneDir ) + + if not os.path.isdir(self.localRepoDir): + os.chdir( self.cloneDir ) + Command( [ 'git', 'clone', self.url ], self.fdLog ).execute() + else: + os.chdir( self.localRepoDir ) + Command( [ 'git', 'pull' ], self.fdLog ).execute() + return + + def checkout ( self, branch ): + os.chdir( self.localRepoDir ) + Command( [ 'git', 'checkout', branch ], self.fdLog ).execute() + return + + +class Configuration ( object ): + + PrimaryNames = \ + [ 'sender' , 'receivers' + , 'coriolisRepo', 'benchsRepo' , 'supportRepos' + , 'homeDir' , 'masterHost' + , 'debugArg' , 'nightlyMode', 'dockerMode', 'chrootMode' + , 'rmSource' , 'rmBuild' + , 'doGit' , 'doAlliance' , 'doCoriolis', 'doBenchs', 'doSendReport' + , 'success' , 'rcode' + ] + SecondaryNames = \ + [ 'rootDir', 'srcDir', 'logDir', 'logs', 'fds', 'alcBin', 'ccbBin', 'benchsDir' + ] + + def __init__ ( self ): + self._sender = 'Jean-Paul.Chaput@soc.lip6.fr' + self._receivers = [ 'Jean-Paul.Chaput@lip6.fr', ] + self._supportRepos = [ 'http://github.com/miloyip/rapidjson' ] + self._allianceRepo = 'https://gitlab.lip6.fr/jpc/alliance.git' + self._coriolisRepo = 'https://gitlab.lip6.fr/jpc/coriolis.git' + self._benchsRepo = 'https://gitlab.lip6.fr/jpc/alliance-check-toolkit.git' + self._homeDir = os.environ['HOME'] + self._debugArg = '' + self._rmSource = False + self._rmBuild = False + self._doGit = True + self._doCoriolis = False + self._doAlliance = False + self._doBenchs = False + self._doSendReport = False + self._nightlyMode = False + self._dockerMode = False + self._chrootMode = None + self._logs = { 'alliance':None, 'coriolis':None, 'benchs':None } + self._fds = { 'alliance':None, 'coriolis':None, 'benchs':None } + self._ccbBin = None + self._benchsDir = None + self._masterHost = self._detectMasterHost() + self._success = False + self._rcode = 0 + + self._updateSecondaries() + return + + def __setattr__ ( self, attribute, value ): + if attribute in Configuration.SecondaryNames: + print ErrorMessage( 1, 'Attempt to write in read-only attribute <%s> in Configuration.'%attribute ) + return + + if attribute == 'masterHost' or attribute == '_masterHost': + if value == 'lepka': + print 'Never touch the Git tree when running on .' + self._rmSource = False + self._rmBuild = False + self._doGit = False + self._doSendReport = False + + if attribute[0] == '_': + self.__dict__[attribute] = value + return + + if attribute == 'homeDir': value = os.path.expanduser(value) + + self.__dict__['_'+attribute] = value + self._updateSecondaries() + return + + def __getattr__ ( self, attribute ): + if attribute[0] != '_': attribute = '_'+attribute + if not self.__dict__.has_key(attribute): + raise ErrorMessage( 1, 'Configuration has no attribute <%s>.'%attribute ) + return self.__dict__[attribute] + + def _updateSecondaries ( self ): + if self._nightlyMode: + self._rootDir = self._homeDir + '/nightly/coriolis-2.x' + else: + self._rootDir = self._homeDir + '/coriolis-2.x' + self._srcDir = self._rootDir + '/src' + self._logDir = self._srcDir + '/logs' + self._alcBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/allianceInstaller.sh' + self._ccbBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/ccb.py' + self._benchsDir = self._srcDir + '/' + GitRepository.getLocalRepository(self._benchsRepo ) + '/benchs' + self._masterHost = self._detectMasterHost() + return + + def _detectMasterHost ( self ): + if self._chrootMode is None: return 'unknown' + if self._chrootMode: return 'chrooted-host' + + masterHost = 'unknown' + hostname = socket.gethostname() + hostAddr = socket.gethostbyname(hostname) + + if hostname == 'lepka' and hostAddr == '127.0.0.1': + masterHost = 'lepka' + else: + masterHost = hostname.split('.')[0] + return masterHost + + def openLog ( self, stem ): + if not os.path.isdir(self._logDir): + os.makedirs( self._logDir ) + + index = 0 + timeTag = time.strftime( "%Y.%m.%d" ) + while True: + logFile = os.path.join(self._logDir,"%s-%s-%02d.log" % (stem,timeTag,index)) + if not os.path.isfile(logFile): + print "Report log: <%s>" % logFile + break + index += 1 + fd = open( logFile, "w" ) + self._logs[stem] = logFile + self._fds [stem] = fd + return + + def closeLogs ( self ): + for fd in self._fds.values(): + if fd: fd.close() + return + + def compressLogs ( self ): + for log in self._logs.values(): + if not log: continue + + fd = open( log, 'r' ) + bzfd = bz2.BZ2File( log+'.bz2', 'w' ) + + for line in fd.readlines(): bzfd.write( line ) + + bzfd.close() + fd.close() + + os.unlink( log ) + return + + def getCommands ( self, target ): + commands = [] + + if self.doAlliance: + if not os.path.isfile( self.alcBin ): + raise ErrorMessage( 1, [ 'Cannot find , should be here:' + , ' <%s>' % self.alcBin + ] ) + commands.append( AllianceCommand( self.alcBin, fdLog=self.fds['alliance'] ) ) + + if self.doCoriolis: + if not os.path.isfile( self.ccbBin ): + raise ErrorMessage( 1, [ 'Cannot find , should be here:' + , ' <%s>' % self.ccbBin + ] ) + + otherArgs = [] + if self.debugArg: otherArgs.append( self.debugArg ) + + if target == 'SL7_64': + otherArgs.append( '--project=support' ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs , fdLog=self.fds['coriolis'] ) ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) ) + elif target == 'SL6_64' or target == 'SL6': + otherArgs.append( '--project=support' ) + otherArgs.append( '--devtoolset=8' ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 6, otherArgs , fdLog=self.fds['coriolis'] ) ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) ) + elif target == 'Ubuntu18' or target == 'Debian9': + if target == 'Ubuntu18': otherArgs.append( '--qt5' ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs, fdLog=self.fds['coriolis'] ) ) + + if self.doBenchs: + commands.append( BenchsCommand( self.benchsDir, fdLog=self.fds['benchs'] ) ) + return commands + + +class Report ( object ): + + def __init__ ( self, conf ): + self.conf = conf + + commaspace = ', ' + date = time.strftime( "%A %d %B %Y" ) + stateText = 'FAILED' + modeText = 'SoC installation' + if self.conf.success: stateText = 'SUCCESS' + if self.conf.nightlyMode: modeText = 'Nightly build' + + self.message = MIMEMultipart() + self.message['Subject'] = '[%s] Coriolis %s %s' % (stateText,modeText,date) + self.message['From' ] = self.conf.sender + self.message['To' ] = commaspace.join( self.conf.receivers ) + self.attachements = [] + + self.mainText = '\n' + self.mainText += 'Salut le Crevard,\n' + self.mainText += '\n' + if self.conf.nightlyMode: + self.mainText += 'This is the nightly build report of Coriolis.\n' + else: + self.mainText += 'SoC installer report of Coriolis.\n' + self.mainText += '%s\n' % date + self.mainText += '\n' + if self.conf.success: + self.mainText += 'Build was SUCCESSFUL\n' + else: + self.mainText += 'Build has FAILED, please have a look to the attached log file(s).\n' + self.mainText += '\n' + self.mainText += 'Complete log file(s) can be found here:\n' + return + + def attachLog ( self, logFile ): + if not logFile: return + + fd = open( logFile, 'rb' ) + try: + fd.seek( -1024*100, os.SEEK_END ) + except IOError, e: + pass + tailLines = '' + for line in fd.readlines()[1:]: + tailLines += line + fd.close() + self.mainText += ' <%s>\n' % logFile + + attachement = MIMEApplication(tailLines) + attachement.add_header( 'Content-Disposition', 'attachment', filename=os.path.basename(logFile) ) + + self.attachements.append( attachement ) + return + + def send ( self ): + self.message.attach( MIMEText(self.mainText) ) + for attachement in self.attachements: + self.message.attach( attachement ) + + print "Sending mail report to:" + for receiver in self.conf.receivers: print ' <%s>' % receiver + session = smtplib.SMTP( 'localhost' ) + session.sendmail( self.conf.sender, self.conf.receivers, self.message.as_string() ) + session.quit() + return + + +# ------------------------------------------------------------------- +# Main Part. + + +parser = optparse.OptionParser () +parser.add_option ( "--debug" , action="store_true" , dest="debug" , help="Build a aka (-g) version." ) +parser.add_option ( "--no-git" , action="store_true" , dest="noGit" , help="Do not pull/update Git repositories before building." ) +parser.add_option ( "--do-alliance" , action="store_true" , dest="doAlliance" , help="Rebuild the Alliance tools." ) +parser.add_option ( "--do-coriolis" , action="store_true" , dest="doCoriolis" , help="Rebuild the Coriolis tools." ) +parser.add_option ( "--do-report" , action="store_true" , dest="doReport" , help="Send a final report." ) +parser.add_option ( "--nightly" , action="store_true" , dest="nightly" , help="Perform a nighly build." ) +parser.add_option ( "--docker" , action="store_true" , dest="docker" , help="Perform a build inside a docker container." ) +parser.add_option ( "--chroot" , action="store_true" , dest="chroot" , help="Perform a build inside a chrooted environment." ) +parser.add_option ( "--benchs" , action="store_true" , dest="benchs" , help="Run the sanity benchs." ) +parser.add_option ( "--rm-build" , action="store_true" , dest="rmBuild" , help="Remove the build/install directories." ) +parser.add_option ( "--rm-source" , action="store_true" , dest="rmSource" , help="Remove the Git source repositories." ) +parser.add_option ( "--rm-all" , action="store_true" , dest="rmAll" , help="Remove everything (source+build+install)." ) +parser.add_option ( "--root" , action="store" , type="string", dest="rootDir" , help="The root directory (default: <~/coriolis-2.x/>)." ) +parser.add_option ( "--profile" , action="store" , type="string", dest="profile" , help="The targeted OS for the build." ) +(options, args) = parser.parse_args () + + +conf = Configuration() + +try: + if options.debug: conf.debugArg = '--debug' + if options.nightly: conf.nightlyMode = True + if options.docker: conf.dockerMode = True + if options.chroot: conf.chrootMode = True + if options.noGit: conf.doGit = False + if options.doCoriolis: conf.doCoriolis = True + if options.doAlliance: conf.doAlliance = True + if options.benchs: conf.doBenchs = True + if options.doReport: conf.doSendReport = True + if options.rmSource or options.rmAll: conf.rmSource = True + if options.rmBuild or options.rmAll: conf.rmBuild = True + + + if conf.doAlliance: conf.openLog( 'alliance' ) + if conf.doCoriolis: conf.openLog( 'coriolis' ) + if conf.doBenchs: conf.openLog( 'benchs' ) + + if conf.dockerMode: os.environ['USER'] = 'root' + + gitSupports = [] + for supportRepo in conf.supportRepos: + gitSupports.append( GitRepository( supportRepo, conf.srcDir+'/support' ) ) + gitCoriolis = GitRepository( conf.coriolisRepo, conf.srcDir, conf.fds['coriolis'] ) + gitBenchs = GitRepository( conf.benchsRepo , conf.srcDir, conf.fds['coriolis'] ) + + if conf.doAlliance: + gitAlliance = GitRepository( conf.allianceRepo, conf.srcDir, conf.fds['alliance'] ) + + if conf.doGit: + for gitSupport in gitSupports: + if conf.rmSource: gitSupport.removeLocalRepo() + gitSupport.clone() + #if gitSupport.url.endswith('rapidjson'): + # gitSupport.checkout( 'a1c4f32' ) + + if conf.doCoriolis: + if conf.rmSource: gitCoriolis.removeLocalRepo() + gitCoriolis.clone () + gitCoriolis.checkout( 'devel' ) + + if conf.doAlliance: + if conf.rmSource: gitAlliance.removeLocalRepo() + gitAlliance.clone () + #gitAlliance.checkout( 'devel' ) + + if conf.rmSource: gitBenchs.removeLocalRepo() + gitBenchs.clone() + + if conf.rmBuild: + for entry in os.listdir(conf.rootDir): + if entry.startswith('Linux.'): + buildDir = conf.rootDir+'/'+entry + print 'Removing OS build directory: <%s>' % buildDir + shutil.rmtree( buildDir ) + + commands = conf.getCommands( options.profile ) + for command in commands: + if command.host: + print 'Executing command on remote host <%s>:' % host + else: + print 'Executing command on *local* host:' + print ' %s' % str(command) + command.execute() + + conf.closeLogs() + + conf.success = True + +except ErrorMessage, e: + print e + conf.closeLogs() + conf.success = False + + if showTrace: + print '\nPython stack trace:' + traceback.print_tb( sys.exc_info()[2] ) + conf.rcode = e.code + +if conf.doSendReport: + report = Report( conf ) + report.attachLog( conf.logs['coriolis' ] ) + report.attachLog( conf.logs['benchs' ] ) + report.send() + +conf.compressLogs() + +sys.exit( conf.rcode ) diff --git a/bootstrap/dockerManager.sh b/bootstrap/dockerManager.sh new file mode 100755 index 00000000..99f4e11a --- /dev/null +++ b/bootstrap/dockerManager.sh @@ -0,0 +1,133 @@ +#!/bin/bash + + + showHelp=0 + showError=0 + doBuildSystem=0 + doBuildCoriolis=0 + doBuildBash=0 + doBuild=0 + doRun=0 + doRemove=0 + + + if [ ! -f "./docker-conf.sh" ]; then + echo "[ERROR] Missing \"./docker-conf.sh\"." + echo " (wd:\"`pwd`\")" + exit 1 + fi + . "./docker-conf.sh" + dockerImages="${systemImage},${coriolisImage},${bashImage}" + + + while [ $# -gt 0 ]; do + case $1 in + --help) showHelp=1;; + --build-system) doBuildSystem=1;; + --build-coriolis) doBuildCoriolis=1;; + --build-bash) doBuildBash=1;; + --run) doRun=1;; + --remove) doRemove=1;; + -*) NB=2; CH=`echo $1 | cut -c$NB` + while [ "$CH" != "" ]; do + case $CH in + h) showHelp=1;; + s) doBuildSystem=1;; + c) doBuildCoriolis=1;; + b) doBuildBash=1;; + r) doRun=1;; + *) showError=1; badOption="$1";; + esac + NB=`expr $NB + 1` + CH=`echo $1 | cut -c$NB` + done;; + *) showError=1; badOption="$1";; + esac + shift + done + + if [ ${showError} -ne 0 ]; then + echo "[ERROR] Unknown argument \"${badOption}\"." + exit 1 + fi + + if [ ${showHelp} -ne 0 ]; then + echo "Usage: ./manager.sh [options]" + echo "Options:" + echo " * [-h|--help]: Print this help." + echo " * [-s|--build-system]: Rebuild the whole OS image." + echo " * [-c|--build-coriolis]: Rebuild the Coriolis image. It will remove the previous" + echo " images (${dockerImages})." + echo " * [-b|--build-bash]: Rebuild the Bash (shell) image. It will remove the previous" + echo " image (${bashImage})." + echo " * [-r|--run]: Recompile Alliance, Coriolis & perform benchs." + echo " * [--remove]: Remove container(s) & image(s)." + exit 0 + fi + + + if [ ${doBuildSystem} -ne 0 ]; then + doBuildBash=1 + doBuildCoriolis=1 + doBuild=1 + doRemove=1 + fi + + if [ ${doBuildCoriolis} -ne 0 ]; then + doBuildBash=1 + doBuild=1 + doRemove=1 + fi + + if [ ${doBuildBash} -ne 0 ]; then + doBuild=1 + doRemove=1 + fi + + + if [ ${doRemove} -ne 0 ]; then + if [ ${doBuildBash} -ne 0 ]; then + echo "Removing \"${bashImage}\" docker container." + docker rm ${bashImage} + docker rmi ${bashImage} + fi + + if [ ${doBuildCoriolis} -ne 0 ]; then + echo "Removing \"${coriolisImage}\" docker image." + docker rm ${coriolisImage} + docker rmi ${coriolisImage} + fi + + if [ ${doBuildSystem} -ne 0 ]; then + echo "Removing \"${systemImage}\" docker image." + docker rm ${systemImage} + docker rmi ${systemImage} + fi + fi + + + if [ ${doBuild} -ne 0 ]; then + echo "Synching Alliance & Coriolis builder scripts." + cp ../../socInstaller.py ./root + cp ../../dot.bashrc ./root + + if [ ${doBuildSystem} -ne 0 ]; then + echo "Build \"${systemImage}\" docker image." + docker build -f Dockerfile.system -t ${systemImage} . + fi + + if [ ${doBuildCoriolis} -ne 0 ]; then + echo "Build \"${coriolisImage}\" docker image." + docker build -f Dockerfile.coriolis -t ${coriolisImage} . + fi + + if [ ${doBuildCoriolis} -ne 0 ]; then + echo "Build \"${bashImage}\" docker image." + docker build -f Dockerfile.bash -t ${bashImage} . + fi + fi + + + if [ ${doRun} -ne 0 ]; then + docker run --rm --net=host -e DISPLAY=:0 -ti --name ${bashImage} ${bashImage} + fi diff --git a/bootstrap/dot.bashrc b/bootstrap/dot.bashrc new file mode 100644 index 00000000..0e2c1e18 --- /dev/null +++ b/bootstrap/dot.bashrc @@ -0,0 +1,14 @@ + + echo "Running /root/.bashrc" + + for archDir in `ls /root/coriolis-2.x/`; do + if [ "$archDir" = "src" ]; then continue; fi + break + done + echo "Found Coriolis architecture directory \"${archDir}\"." + + installDir="/root/coriolis-2.x/${archDir}/Release.Shared/install" + . ${installDir}/etc/profile.d/alc_env.sh + eval `${installDir}/etc/coriolis2/coriolisEnv.py` + + export QT_X11_NO_MITSHM=1 diff --git a/bootstrap/socInstaller.py b/bootstrap/socInstaller.py index 98c2488f..592a562f 100755 --- a/bootstrap/socInstaller.py +++ b/bootstrap/socInstaller.py @@ -46,31 +46,31 @@ except ImportError, e: class ErrorMessage ( Exception ): def __init__ ( self, code, *arguments ): - self._code = code - self._errors = [ 'Malformed call to ErrorMessage()', '%s' % str(arguments) ] - - text = None - if len(arguments) == 1: - if isinstance(arguments[0],Exception): text = str(arguments[0]).split('\n') - else: - self._errors = arguments[0] - elif len(arguments) > 1: - text = list(arguments) - - if text: - self._errors = [] - while len(text[0]) == 0: del text[0] - - lstrip = 0 - if text[0].startswith('[ERROR]'): lstrip = 8 - - for line in text: - if line[0:lstrip ] == ' '*lstrip or \ - line[0:lstrip-1] == '[ERROR]': - self._errors += [ line[lstrip:] ] + self._code = code + self._errors = [ 'Malformed call to ErrorMessage()', '%s' % str(arguments) ] + + text = None + if len(arguments) == 1: + if isinstance(arguments[0],Exception): text = str(arguments[0]).split('\n') else: - self._errors += [ line.lstrip() ] - return + self._errors = arguments[0] + elif len(arguments) > 1: + text = list(arguments) + + if text: + self._errors = [] + while len(text[0]) == 0: del text[0] + + lstrip = 0 + if text[0].startswith('[ERROR]'): lstrip = 8 + + for line in text: + if line[0:lstrip ] == ' '*lstrip or \ + line[0:lstrip-1] == '[ERROR]': + self._errors += [ line[lstrip:] ] + else: + self._errors += [ line.lstrip() ] + return def __str__ ( self ): if not isinstance(self._errors,list): @@ -104,321 +104,417 @@ class ErrorMessage ( Exception ): class BadBinary ( ErrorMessage ): def __init__ ( self, binary ): - ErrorMessage.__init__( self, 1, "Binary not found: <%s>." % binary ) - return + ErrorMessage.__init__( self, 1, "Binary not found: <%s>." % binary ) + return class BadReturnCode ( ErrorMessage ): def __init__ ( self, status ): - ErrorMessage.__init__( self, 1, "Command returned status:%d." % status ) - return + ErrorMessage.__init__( self, 1, "Command returned status:%d." % status ) + return class Command ( object ): def __init__ ( self, arguments, fdLog=None ): - self.arguments = arguments - self.fdLog = fdLog - - if self.fdLog != None and not isinstance(self.fdLog,file): - print '[WARNING] Command.__init__(): is neither None or a file.' - return + self.arguments = arguments + self.fdLog = fdLog + + if self.fdLog != None and not isinstance(self.fdLog,file): + print '[WARNING] Command.__init__(): is neither None or a file.' + return def _argumentsToStr ( self, arguments ): - s = '' - for argument in arguments: - if argument.find(' ') >= 0: s += ' "' + argument + '"' - else: s += ' ' + argument - return s + s = '' + for argument in arguments: + if argument.find(' ') >= 0: s += ' "' + argument + '"' + else: s += ' ' + argument + return s def log ( self, text ): - print text[:-1] - sys.stdout.flush() - sys.stderr.flush() - if isinstance(self.fdLog,file): - self.fdLog.write( text ) - self.fdLog.flush() - return + print text[:-1] + sys.stdout.flush() + sys.stderr.flush() + if isinstance(self.fdLog,file): + self.fdLog.write( text ) + self.fdLog.flush() + return def execute ( self ): - global conf - sys.stdout.flush() - sys.stderr.flush() + global conf + sys.stdout.flush() + sys.stderr.flush() + + homeDir = os.environ['HOME'] + workDir = os.getcwd() + if homeDir.startswith(homeDir): + workDir = '~' + workDir[ len(homeDir) : ] + user = 'root' + if os.environ.has_key('USER'): user = os.environ['USER'] + prompt = '%s@%s:%s$' % (user,conf.masterHost,workDir) + + try: + self.log( '%s%s\n' % (prompt,self._argumentsToStr(self.arguments)) ) + print self.arguments + child = subprocess.Popen( self.arguments, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) + + while True: + line = child.stdout.readline() + if not line: break + + self.log( line ) + except OSError, e: + raise BadBinary( self.arguments[0] ) + + (pid,status) = os.waitpid( child.pid, 0 ) + status >>= 8 + if status != 0: + raise BadReturnCode( status ) + + return - homeDir = os.environ['HOME'] - workDir = os.getcwd() - if homeDir.startswith(homeDir): - workDir = '~' + workDir[ len(homeDir) : ] - prompt = '%s@%s:%s$' % (os.environ['USER'],conf.masterHost,workDir) - try: - self.log( '%s%s\n' % (prompt,self._argumentsToStr(self.arguments)) ) - child = subprocess.Popen( self.arguments, stdout=subprocess.PIPE, stderr=subprocess.STDOUT ) +class CommandArg ( object ): - while True: - line = child.stdout.readline() - if not line: break + def __init__ ( self, command, wd=None, host=None, fdLog=None ): + self.command = command + self.host = host + self.wd = wd + self.fdLog = fdLog + return - self.log( line ) - except OSError, e: - raise BadBinary( self.arguments[0] ) + def __str__ ( self ): + s = '' + if self.wd: s = 'cd %s && ' % self.wd - (pid,status) = os.waitpid( child.pid, 0 ) - status >>= 8 - if status != 0: - raise BadReturnCode( status ) + for i in range(len(self.command)): + if i: s += ' ' + s += self.command[i] + return s - return + def getArgs ( self ): + if not self.host: return self.command + return [ 'ssh', self.host, str(self) ] + + def execute ( self ): + if not self.host and self.wd: os.chdir( self.wd ) + Command( self.getArgs(), self.fdLog ).execute() + return + + +class AllianceCommand ( CommandArg ): + + def __init__ ( self, alcBin, fdLog=None ): + CommandArg.__init__ ( self, [ alcBin ], fdLog=fdLog ) + return + + +class CoriolisCommand ( CommandArg ): + + def __init__ ( self, ccbBin, rootDir, threads=1, otherArgs=[], fdLog=None ): + CommandArg.__init__ ( self, [ ccbBin + , '--root='+rootDir + , '--project=coriolis' + , '--make=-j%d install' % threads + ] + otherArgs + , fdLog=fdLog ) + return + + +class BenchsCommand ( CommandArg ): + + def __init__ ( self, benchsDir, fdLog=None ): + CommandArg.__init__ ( self, [ '../bin/go.sh' ], wd=benchsDir, fdLog=fdLog ) + return + class GitRepository ( object ): @staticmethod def getLocalRepository ( url ): - localRepo = url.split( '/' )[-1] - if localRepo.endswith('.git'): - localRepo = localRepo[:-4] - return localRepo + localRepo = url.split( '/' )[-1] + if localRepo.endswith('.git'): + localRepo = localRepo[:-4] + return localRepo def __init__ ( self, url, cloneDir, fdLog=None ): - self.url = url - self.cloneDir = cloneDir - self.localRepo = GitRepository.getLocalRepository( url ) - self.fdLog = fdLog - return + self.url = url + self.cloneDir = cloneDir + self.localRepo = GitRepository.getLocalRepository( url ) + self.fdLog = fdLog + return @property def localRepoDir ( self ): return self.cloneDir+'/'+self.localRepo def removeLocalRepo ( self ): - if os.path.isdir(self.localRepoDir): - print 'Removing Git local repository: <%s>' % self.localRepoDir - shutil.rmtree( self.localRepoDir ) - return + if os.path.isdir(self.localRepoDir): + print 'Removing Git local repository: <%s>' % self.localRepoDir + shutil.rmtree( self.localRepoDir ) + return def clone ( self ): - print 'Clone/pull from:', self.url - if not os.path.isdir(self.cloneDir): - os.makedirs( self.cloneDir ) - - if not os.path.isdir(self.localRepoDir): - os.chdir( self.cloneDir ) - Command( [ 'git', 'clone', self.url ], self.fdLog ).execute() - else: - os.chdir( self.localRepoDir ) - Command( [ 'git', 'pull' ], self.fdLog ).execute() - return + print 'Clone/pull from:', self.url + if not os.path.isdir(self.cloneDir): + os.makedirs( self.cloneDir ) + + if not os.path.isdir(self.localRepoDir): + os.chdir( self.cloneDir ) + Command( [ 'git', 'clone', self.url ], self.fdLog ).execute() + else: + os.chdir( self.localRepoDir ) + Command( [ 'git', 'pull' ], self.fdLog ).execute() + return def checkout ( self, branch ): - os.chdir( self.localRepoDir ) - Command( [ 'git', 'checkout', branch ], self.fdLog ).execute() - return + os.chdir( self.localRepoDir ) + Command( [ 'git', 'checkout', branch ], self.fdLog ).execute() + return class Configuration ( object ): PrimaryNames = \ [ 'sender' , 'receivers' - , 'coriolisRepo', 'benchsRepo', 'supportRepos' + , 'coriolisRepo', 'benchsRepo' , 'supportRepos' , 'homeDir' , 'masterHost' - , 'debugArg' , 'nightlyMode' - , 'rmSource' , 'rmBuild', 'doGit', 'doBuild', 'doBenchs', 'doSendReport' + , 'debugArg' , 'nightlyMode', 'dockerMode', 'chrootMode' + , 'rmSource' , 'rmBuild' + , 'doGit' , 'doAlliance' , 'doCoriolis', 'doBenchs', 'doSendReport' , 'success' , 'rcode' ] SecondaryNames = \ - [ 'rootDir', 'srcDir', 'logDir', 'logs', 'fds' + [ 'rootDir', 'srcDir', 'logDir', 'logs', 'fds', 'alcBin', 'ccbBin', 'benchsDir' ] def __init__ ( self ): - self._sender = 'Jean-Paul.Chaput@soc.lip6.fr' - self._receivers = [ 'Jean-Paul.Chaput@lip6.fr', ] - self._supportRepos = [ 'http://github.com/miloyip/rapidjson' ] - self._coriolisRepo = 'https://www-soc.lip6.fr/git/coriolis.git' - self._benchsRepo = 'https://www-soc.lip6.fr/git/alliance-check-toolkit.git' - self._homeDir = os.environ['HOME'] - self._debugArg = '' - self._rmSource = False - self._rmBuild = False - self._doGit = True - self._doBuild = True - self._doBenchs = False - self._doSendReport = True - self._nightlyMode = False - self._logs = { 'build':None, 'benchs':None } - self._fds = { 'build':None, 'benchs':None } - self._masterHost = self._detectMasterHost() - self._success = False - self._rcode = 0 - - self._updateSecondaries() - return + self._sender = 'Jean-Paul.Chaput@soc.lip6.fr' + self._receivers = [ 'Jean-Paul.Chaput@lip6.fr', ] + self._supportRepos = [ 'http://github.com/miloyip/rapidjson' ] + self._allianceRepo = 'https://gitlab.lip6.fr/jpc/alliance.git' + self._coriolisRepo = 'https://gitlab.lip6.fr/jpc/coriolis.git' + self._benchsRepo = 'https://gitlab.lip6.fr/jpc/alliance-check-toolkit.git' + self._homeDir = os.environ['HOME'] + self._debugArg = '' + self._rmSource = False + self._rmBuild = False + self._doGit = True + self._doCoriolis = False + self._doAlliance = False + self._doBenchs = False + self._doSendReport = False + self._nightlyMode = False + self._dockerMode = False + self._chrootMode = None + self._logs = { 'alliance':None, 'coriolis':None, 'benchs':None } + self._fds = { 'alliance':None, 'coriolis':None, 'benchs':None } + self._ccbBin = None + self._benchsDir = None + self._masterHost = self._detectMasterHost() + self._success = False + self._rcode = 0 + + self._updateSecondaries() + return def __setattr__ ( self, attribute, value ): - if attribute in Configuration.SecondaryNames: - print ErrorMessage( 1, 'Attempt to write in read-only attribute <%s> in Configuration.'%attribute ) + if attribute in Configuration.SecondaryNames: + print ErrorMessage( 1, 'Attempt to write in read-only attribute <%s> in Configuration.'%attribute ) + return + + if attribute == 'masterHost' or attribute == '_masterHost': + if value == 'lepka': + print 'Never touch the Git tree when running on .' + self._rmSource = False + self._rmBuild = False + self._doGit = False + self._doSendReport = False + + if attribute[0] == '_': + self.__dict__[attribute] = value + return + + if attribute == 'homeDir': value = os.path.expanduser(value) + + self.__dict__['_'+attribute] = value + self._updateSecondaries() return - if attribute == 'masterHost' or attribute == '_masterHost': - if value == 'lepka': - print 'Never touch the Git tree when running on .' - self._rmSource = False - self._rmBuild = False - self._doGit = False - self._doSendReport = False - self._targets = { 'SL6' :None - , 'SL6_64':None - , 'SL7_64':'lepka' - } - else: - self._targets = { 'SL6' :None - , 'SL6_64':None - , 'SL7_64':'bop' - } - - if attribute[0] == '_': - self.__dict__[attribute] = value - return - - if attribute == 'homeDir': value = os.path.expanduser(value) - - self.__dict__['_'+attribute] = value - self._updateSecondaries() - return - def __getattr__ ( self, attribute ): - if attribute[0] != '_': attribute = '_'+attribute - if not self.__dict__.has_key(attribute): - raise ErrorMessage( 1, 'Configuration has no attribute <%s>.'%attribute ) - return self.__dict__[attribute] + if attribute[0] != '_': attribute = '_'+attribute + if not self.__dict__.has_key(attribute): + raise ErrorMessage( 1, 'Configuration has no attribute <%s>.'%attribute ) + return self.__dict__[attribute] def _updateSecondaries ( self ): - if self._nightlyMode: - self._targets['SL6'] = None - self._rootDir = self._homeDir + '/nightly/coriolis-2.x' - else: - if self._masterHost != 'lepka': - self._targets['SL6'] = None - self._rootDir = self._homeDir + '/coriolis-2.x' - self._srcDir = self._rootDir + '/src' - self._logDir = self._srcDir + '/logs' - return + if self._nightlyMode: + self._rootDir = self._homeDir + '/nightly/coriolis-2.x' + else: + self._rootDir = self._homeDir + '/coriolis-2.x' + self._srcDir = self._rootDir + '/src' + self._logDir = self._srcDir + '/logs' + self._alcBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/allianceInstaller.sh' + self._ccbBin = self._srcDir + '/' + GitRepository.getLocalRepository(self._coriolisRepo) + '/bootstrap/ccb.py' + self._benchsDir = self._srcDir + '/' + GitRepository.getLocalRepository(self._benchsRepo ) + '/benchs' + self._masterHost = self._detectMasterHost() + return def _detectMasterHost ( self ): - masterHost = 'unknown' - hostname = socket.gethostname() - hostAddr = socket.gethostbyname(hostname) - - if hostname == 'lepka' and hostAddr == '127.0.0.1': - masterHost = 'lepka' - else: - masterHost = hostname.split('.')[0] - return masterHost + if self._chrootMode is None: return 'unknown' + if self._chrootMode: return 'chrooted-host' + + masterHost = 'unknown' + hostname = socket.gethostname() + hostAddr = socket.gethostbyname(hostname) + + if hostname == 'lepka' and hostAddr == '127.0.0.1': + masterHost = 'lepka' + else: + masterHost = hostname.split('.')[0] + return masterHost def openLog ( self, stem ): - if not os.path.isdir(self._logDir): - os.makedirs( self._logDir ) - - index = 0 - timeTag = time.strftime( "%Y.%m.%d" ) - while True: - logFile = os.path.join(self._logDir,"%s-%s-%02d.log" % (stem,timeTag,index)) - if not os.path.isfile(logFile): - print "Report log: <%s>" % logFile - break - index += 1 - fd = open( logFile, "w" ) - self._logs[stem] = logFile - self._fds [stem] = fd - return + if not os.path.isdir(self._logDir): + os.makedirs( self._logDir ) + + index = 0 + timeTag = time.strftime( "%Y.%m.%d" ) + while True: + logFile = os.path.join(self._logDir,"%s-%s-%02d.log" % (stem,timeTag,index)) + if not os.path.isfile(logFile): + print "Report log: <%s>" % logFile + break + index += 1 + fd = open( logFile, "w" ) + self._logs[stem] = logFile + self._fds [stem] = fd + return def closeLogs ( self ): - for fd in self._fds.values(): - if fd: fd.close() - return + for fd in self._fds.values(): + if fd: fd.close() + return def compressLogs ( self ): - for log in self._logs.values(): - if not log: continue + for log in self._logs.values(): + if not log: continue + + fd = open( log, 'r' ) + bzfd = bz2.BZ2File( log+'.bz2', 'w' ) + + for line in fd.readlines(): bzfd.write( line ) + + bzfd.close() + fd.close() + + os.unlink( log ) + return - fd = open( log, 'r' ) - bzfd = bz2.BZ2File( log+'.bz2', 'w' ) + def getCommands ( self, target ): + commands = [] - for line in fd.readlines(): bzfd.write( line ) + if self.doAlliance: + if not os.path.isfile( self.alcBin ): + raise ErrorMessage( 1, [ 'Cannot find , should be here:' + , ' <%s>' % self.alcBin + ] ) + commands.append( AllianceCommand( self.alcBin, fdLog=self.fds['alliance'] ) ) - bzfd.close() - fd.close() + if self.doCoriolis: + if not os.path.isfile( self.ccbBin ): + raise ErrorMessage( 1, [ 'Cannot find , should be here:' + , ' <%s>' % self.ccbBin + ] ) - os.unlink( log ) - return + otherArgs = [] + if self.debugArg: otherArgs.append( self.debugArg ) + + if target == 'SL7_64': + otherArgs.append( '--project=support' ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs , fdLog=self.fds['coriolis'] ) ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) ) + elif target == 'SL6_64' or target == 'SL6': + otherArgs.append( '--project=support' ) + otherArgs.append( '--devtoolset=8' ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 6, otherArgs , fdLog=self.fds['coriolis'] ) ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 1, otherArgs+['--doc'], fdLog=self.fds['coriolis'] ) ) + elif target == 'Ubuntu18' or target == 'Debian9': + if target == 'Ubuntu18': otherArgs.append( '--qt5' ) + commands.append( CoriolisCommand( self.ccbBin, self.rootDir, 3, otherArgs, fdLog=self.fds['coriolis'] ) ) + + if self.doBenchs: + commands.append( BenchsCommand( self.benchsDir, fdLog=self.fds['benchs'] ) ) + return commands class Report ( object ): def __init__ ( self, conf ): - self.conf = conf - - commaspace = ', ' - date = time.strftime( "%A %d %B %Y" ) - stateText = 'FAILED' - modeText = 'SoC installation' - if self.conf.success: stateText = 'SUCCESS' - if self.conf.nightlyMode: modeText = 'Nightly build' - - self.message = MIMEMultipart() - self.message['Subject'] = '[%s] Coriolis %s %s' % (stateText,modeText,date) - self.message['From' ] = self.conf.sender - self.message['To' ] = commaspace.join( self.conf.receivers ) - self.attachements = [] - - self.mainText = '\n' - self.mainText += 'Salut le Crevard,\n' - self.mainText += '\n' - if self.conf.nightlyMode: - self.mainText += 'This is the nightly build report of Coriolis.\n' - else: - self.mainText += 'SoC installer report of Coriolis.\n' - self.mainText += '%s\n' % date - self.mainText += '\n' - if self.conf.success: - self.mainText += 'Build was SUCCESSFUL\n' - else: - self.mainText += 'Build has FAILED, please have a look to the attached log file(s).\n' - self.mainText += '\n' - self.mainText += 'Complete log file(s) can be found here:\n' - return + self.conf = conf + + commaspace = ', ' + date = time.strftime( "%A %d %B %Y" ) + stateText = 'FAILED' + modeText = 'SoC installation' + if self.conf.success: stateText = 'SUCCESS' + if self.conf.nightlyMode: modeText = 'Nightly build' + + self.message = MIMEMultipart() + self.message['Subject'] = '[%s] Coriolis %s %s' % (stateText,modeText,date) + self.message['From' ] = self.conf.sender + self.message['To' ] = commaspace.join( self.conf.receivers ) + self.attachements = [] + + self.mainText = '\n' + self.mainText += 'Salut le Crevard,\n' + self.mainText += '\n' + if self.conf.nightlyMode: + self.mainText += 'This is the nightly build report of Coriolis.\n' + else: + self.mainText += 'SoC installer report of Coriolis.\n' + self.mainText += '%s\n' % date + self.mainText += '\n' + if self.conf.success: + self.mainText += 'Build was SUCCESSFUL\n' + else: + self.mainText += 'Build has FAILED, please have a look to the attached log file(s).\n' + self.mainText += '\n' + self.mainText += 'Complete log file(s) can be found here:\n' + return def attachLog ( self, logFile ): - if not logFile: return - - fd = open( logFile, 'rb' ) - try: - fd.seek( -1024*100, os.SEEK_END ) - except IOError, e: - pass - tailLines = '' - for line in fd.readlines()[1:]: - tailLines += line - fd.close() - self.mainText += ' <%s>\n' % logFile - - attachement = MIMEApplication(tailLines) - attachement.add_header( 'Content-Disposition', 'attachment', filename=os.path.basename(logFile) ) - - self.attachements.append( attachement ) - return + if not logFile: return + + fd = open( logFile, 'rb' ) + try: + fd.seek( -1024*100, os.SEEK_END ) + except IOError, e: + pass + tailLines = '' + for line in fd.readlines()[1:]: + tailLines += line + fd.close() + self.mainText += ' <%s>\n' % logFile + + attachement = MIMEApplication(tailLines) + attachement.add_header( 'Content-Disposition', 'attachment', filename=os.path.basename(logFile) ) + + self.attachements.append( attachement ) + return def send ( self ): - self.message.attach( MIMEText(self.mainText) ) - for attachement in self.attachements: - self.message.attach( attachement ) - - print "Sending mail report to:" - for receiver in self.conf.receivers: print ' <%s>' % receiver - session = smtplib.SMTP( 'localhost' ) - session.sendmail( self.conf.sender, self.conf.receivers, self.message.as_string() ) - session.quit() - return + self.message.attach( MIMEText(self.mainText) ) + for attachement in self.attachements: + self.message.attach( attachement ) + + print "Sending mail report to:" + for receiver in self.conf.receivers: print ' <%s>' % receiver + session = smtplib.SMTP( 'localhost' ) + session.sendmail( self.conf.sender, self.conf.receivers, self.message.as_string() ) + session.quit() + return # ------------------------------------------------------------------- @@ -428,36 +524,51 @@ class Report ( object ): parser = optparse.OptionParser () parser.add_option ( "--debug" , action="store_true" , dest="debug" , help="Build a aka (-g) version." ) parser.add_option ( "--no-git" , action="store_true" , dest="noGit" , help="Do not pull/update Git repositories before building." ) -parser.add_option ( "--no-build" , action="store_true" , dest="noBuild" , help="Do not rebuild the tools, must have already be done." ) -parser.add_option ( "--no-report" , action="store_true" , dest="noReport" , help="Do not send a final report." ) +parser.add_option ( "--do-alliance" , action="store_true" , dest="doAlliance" , help="Rebuild the Alliance tools." ) +parser.add_option ( "--do-coriolis" , action="store_true" , dest="doCoriolis" , help="Rebuild the Coriolis tools." ) +parser.add_option ( "--do-report" , action="store_true" , dest="doReport" , help="Send a final report." ) parser.add_option ( "--nightly" , action="store_true" , dest="nightly" , help="Perform a nighly build." ) +parser.add_option ( "--docker" , action="store_true" , dest="docker" , help="Perform a build inside a docker container." ) +parser.add_option ( "--chroot" , action="store_true" , dest="chroot" , help="Perform a build inside a chrooted environment." ) parser.add_option ( "--benchs" , action="store_true" , dest="benchs" , help="Run the sanity benchs." ) parser.add_option ( "--rm-build" , action="store_true" , dest="rmBuild" , help="Remove the build/install directories." ) parser.add_option ( "--rm-source" , action="store_true" , dest="rmSource" , help="Remove the Git source repositories." ) parser.add_option ( "--rm-all" , action="store_true" , dest="rmAll" , help="Remove everything (source+build+install)." ) parser.add_option ( "--root" , action="store" , type="string", dest="rootDir" , help="The root directory (default: <~/coriolis-2.x/>)." ) +parser.add_option ( "--profile" , action="store" , type="string", dest="profile" , help="The targeted OS for the build." ) (options, args) = parser.parse_args () + conf = Configuration() try: if options.debug: conf.debugArg = '--debug' if options.nightly: conf.nightlyMode = True + if options.docker: conf.dockerMode = True + if options.chroot: conf.chrootMode = True if options.noGit: conf.doGit = False - if options.noBuild: conf.doBuild = False + if options.doCoriolis: conf.doCoriolis = True + if options.doAlliance: conf.doAlliance = True if options.benchs: conf.doBenchs = True - if options.noReport: conf.doSendReport = False + if options.doReport: conf.doSendReport = True if options.rmSource or options.rmAll: conf.rmSource = True if options.rmBuild or options.rmAll: conf.rmBuild = True - if conf.doBuild: conf.openLog( 'build' ) - if conf.doBenchs: conf.openLog( 'benchs' ) + + if conf.doAlliance: conf.openLog( 'alliance' ) + if conf.doCoriolis: conf.openLog( 'coriolis' ) + if conf.doBenchs: conf.openLog( 'benchs' ) + + if conf.dockerMode: os.environ['USER'] = 'root' gitSupports = [] for supportRepo in conf.supportRepos: gitSupports.append( GitRepository( supportRepo, conf.srcDir+'/support' ) ) - gitCoriolis = GitRepository( conf.coriolisRepo, conf.srcDir, conf.fds['build'] ) - gitBenchs = GitRepository( conf.benchsRepo , conf.srcDir, conf.fds['build'] ) + gitCoriolis = GitRepository( conf.coriolisRepo, conf.srcDir, conf.fds['coriolis'] ) + gitBenchs = GitRepository( conf.benchsRepo , conf.srcDir, conf.fds['coriolis'] ) + + if conf.doAlliance: + gitAlliance = GitRepository( conf.allianceRepo, conf.srcDir, conf.fds['alliance'] ) if conf.doGit: for gitSupport in gitSupports: @@ -466,9 +577,15 @@ try: #if gitSupport.url.endswith('rapidjson'): # gitSupport.checkout( 'a1c4f32' ) - if conf.rmSource: gitCoriolis.removeLocalRepo() - gitCoriolis.clone () - gitCoriolis.checkout( 'devel_anabatic' ) + if conf.doCoriolis: + if conf.rmSource: gitCoriolis.removeLocalRepo() + gitCoriolis.clone () + gitCoriolis.checkout( 'devel' ) + + if conf.doAlliance: + if conf.rmSource: gitAlliance.removeLocalRepo() + gitAlliance.clone () + #gitAlliance.checkout( 'devel' ) if conf.rmSource: gitBenchs.removeLocalRepo() gitBenchs.clone() @@ -480,33 +597,14 @@ try: print 'Removing OS build directory: <%s>' % buildDir shutil.rmtree( buildDir ) - ccbBin = gitCoriolis.localRepoDir+'/bootstrap/ccb.py' - if not os.path.isfile( ccbBin ): - raise ErrorMessage( 1, [ 'Cannot find , should be here:' - , ' <%s>' % ccbBin - ] ) - - buildCommand = '%s --root=%s --project=support --project=coriolis --make="-j%%d install" %%s' \ - % (ccbBin,conf.rootDir) - benchsCommand = 'cd %s/benchs && ../bin/go.sh' % (gitBenchs.localRepoDir) - - commands = \ - [ ( conf.targets['SL7_64'], buildCommand % (3,conf.debugArg) , conf.fds['build' ] ) - , ( conf.targets['SL7_64'], buildCommand % (1,conf.debugArg+' --doc') , conf.fds['build' ] ) - , ( conf.targets['SL7_64'], benchsCommand , conf.fds['benchs'] ) - #, ( conf.targets['SL6_64'], buildCommand % (6,conf.debugArg+' --devtoolset-8') , conf.fds['build' ] ) - #, ( conf.targets['SL6_64'], buildCommand % (1,conf.debugArg+' --devtoolset-8 --doc'), conf.fds['build' ] ) - #, ( conf.targets['SL6_64'], benchsCommand , conf.fds['benchs'] ) - #, ( conf.targets['SL6'] , buildCommand % (2,conf.debugArg+' --devtoolset-8') , conf.fds['build' ] ) - #, ( conf.targets['SL6'] , buildCommand % (1,conf.debugArg+' --devtoolset-8 --doc'), conf.fds['build' ] ) - #, ( conf.targets['SL6'] , benchsCommand , conf.fds['benchs'] ) - ] - - for host,command,fd in commands: - if host and fd: - print 'Executing command on <%s>:' % host - print ' %s' % command - Command( [ 'ssh', host, command ], fd ).execute() + commands = conf.getCommands( options.profile ) + for command in commands: + if command.host: + print 'Executing command on remote host <%s>:' % host + else: + print 'Executing command on *local* host:' + print ' %s' % str(command) + command.execute() conf.closeLogs() @@ -524,8 +622,8 @@ except ErrorMessage, e: if conf.doSendReport: report = Report( conf ) - report.attachLog( conf.logs['build' ] ) - report.attachLog( conf.logs['benchs'] ) + report.attachLog( conf.logs['coriolis' ] ) + report.attachLog( conf.logs['benchs' ] ) report.send() conf.compressLogs() diff --git a/bora/src/CMakeLists.txt b/bora/src/CMakeLists.txt index b1146693..1f7444bc 100644 --- a/bora/src/CMakeLists.txt +++ b/bora/src/CMakeLists.txt @@ -102,7 +102,7 @@ ${PYTHON_LIBRARIES} -lutil ) - add_library( bora ${cpps} ${mocCpps} ) + add_library( bora ${cpps} ${mocCpps} ${pyCpps} ) set_target_properties( bora PROPERTIES VERSION 1.0 SOVERSION 1 ) target_link_libraries( bora ${depLibs} ) diff --git a/bora/src/HSlicingNode.cpp b/bora/src/HSlicingNode.cpp index d1c1cfc0..8f227d12 100644 --- a/bora/src/HSlicingNode.cpp +++ b/bora/src/HSlicingNode.cpp @@ -189,7 +189,10 @@ namespace Bora { { cdebug_log(535,1) << "HSlicingNode::updateGlobalsize() - " << this << endl; - for ( SlicingNode* child : _children ) child->updateGlobalSize(); + for ( SlicingNode* child : _children ) { + cdebug_log(535,0) << "child: " << child << endl; + child->updateGlobalSize(); + } if (not getMaster()) { if (getNbChild() == 1) { diff --git a/bora/src/NodeSets.cpp b/bora/src/NodeSets.cpp index 2a845c50..354e2e04 100644 --- a/bora/src/NodeSets.cpp +++ b/bora/src/NodeSets.cpp @@ -70,7 +70,8 @@ namespace Bora { TransistorFamily* device = dynamic_cast( cell ); StepParameterRange* stepRange = dynamic_cast( nodeset->getRange() ); if (device) { - //cdebug_log(536,0) << "createNodeSets for an Analog Device" << endl; + cdebug_log(535,0) << "NodeSets:create(): for a Transistor Analog Device" << endl; + if (not stepRange) { throw Error( "NodeSets::create(): Device \"%s\" must be associated with a StepParameterRange argument instead of %s." , getString(device->getName()).c_str() @@ -94,30 +95,36 @@ namespace Bora { MatrixParameterRange* matrixRange = dynamic_cast( nodeset->getRange() ); if (mcapacitor) { + cdebug_log(535,0) << "NodeSets::create(): for a Capacitor Analog Device" << endl; + if (not matrixRange) { throw Error( "NodeSets::create(): Device \"%s\" must be associated with a MatrixParameterRange argument instead of %s." , getString(mcapacitor->getName()).c_str() , getString(stepRange).c_str() ); - - matrixRange->reset(); - do { - MatrixParameter* mp = NULL; - if ( (mp = dynamic_cast(mcapacitor->getParameter("matrix"))) != NULL ) - mp->setMatrix( &matrixRange->getValue() ); - - layoutGenerator->setDevice( mcapacitor ); - layoutGenerator->drawLayout(); - - nodeset->push_back( DBoxSet::create( mcapacitor, matrixRange->getIndex(), rg ) ); - - matrixRange->progress(); - } while ( matrixRange->isValid() ); } + + matrixRange->reset(); + do { + MatrixParameter* mp = NULL; + if ( (mp = dynamic_cast(mcapacitor->getParameter("matrix"))) != NULL ) + mp->setMatrix( &matrixRange->getValue() ); + + layoutGenerator->setDevice( mcapacitor ); + layoutGenerator->drawLayout(); + + //cerr << " Create BoxSet for Capacitor " << matrixRange->getValue() << endl; + cerr << " Create BoxSet for Capacitor " << endl; + nodeset->push_back( DBoxSet::create( mcapacitor, matrixRange->getIndex(), rg ) ); + + matrixRange->progress(); + } while ( matrixRange->isValid() ); } else { ResistorFamily* device = dynamic_cast( cell ); StepParameterRange* stepRange = dynamic_cast( nodeset->getRange() ); if (device) { + cdebug_log(535,0) << "NodeSets::create(): for a Resistor Analog Device" << endl; + if (not stepRange) { throw Error( "NodeSets::create(): Device \"%s\" must be associated with a StepParameterRange argument instead of %s." , getString(device->getName()).c_str() diff --git a/bora/src/PyDSlicingNode.cpp b/bora/src/PyDSlicingNode.cpp index 3bb90deb..0a036aa5 100644 --- a/bora/src/PyDSlicingNode.cpp +++ b/bora/src/PyDSlicingNode.cpp @@ -18,6 +18,7 @@ #include "crlcore/PyRoutingGauge.h" #include "bora/PyDSlicingNode.h" #include "bora/PyStepParameterRange.h" +#include "bora/PyMatrixParameterRange.h" namespace Bora { @@ -73,8 +74,9 @@ extern "C" { PyErr_SetString( ConstructorError, "DSlicingNode.create(): Second argument *must* be of type Cell." ); return NULL; } - if (not IsPyStepParameterRange(pyParameterRange)) { - PyErr_SetString( ConstructorError, "DSlicingNode.create(): Third argument *must* be of type StepParameterRange." ); + if ( not IsPyStepParameterRange(pyParameterRange) + and not IsPyMatrixParameterRange(pyParameterRange)) { + PyErr_SetString( ConstructorError, "DSlicingNode.create(): Third argument *must* be of type StepParameterRange or MatrixParameterRange." ); return NULL; } if (pyRoutingGauge and not IsPyRoutingGauge(pyRoutingGauge)) { @@ -82,10 +84,18 @@ extern "C" { return NULL; } - Cell* cell = PYCELL_O( pyCell ); - Instance* instance = cell->getInstance( PyString_AsString(pyInstance) ); - ParameterRange* range = ParameterRangeCast( pyParameterRange ); - RoutingGauge* rg = (pyRoutingGauge) ? PYROUTINGGAUGE_O(pyRoutingGauge) : NULL; + Cell* cell = PYCELL_O( pyCell ); + Instance* instance = cell->getInstance( PyString_AsString(pyInstance) ); + if (not instance) { + ostringstream message; + message << "DSlicingNode.create(): Cell \"" << cell->getName() + << "\" has no instance named \"" << PyString_AsString(pyInstance) << "\"."; + PyErr_SetString( ConstructorError, message.str().c_str() ); + return NULL; + } + + ParameterRange* range = ParameterRangeCast( pyParameterRange ); + RoutingGauge* rg = (pyRoutingGauge) ? PYROUTINGGAUGE_O(pyRoutingGauge) : NULL; node = DSlicingNode::create( NodeSets::create( instance->getMasterCell(), range, rg ) , UnknownAlignment diff --git a/bora/src/PyParameterRange.cpp b/bora/src/PyParameterRange.cpp index 492e1a3f..2c6c0068 100644 --- a/bora/src/PyParameterRange.cpp +++ b/bora/src/PyParameterRange.cpp @@ -16,6 +16,7 @@ #include "bora/PyParameterRange.h" #include "bora/PyStepParameterRange.h" +#include "bora/PyMatrixParameterRange.h" namespace Bora { @@ -112,7 +113,8 @@ extern "C" { # if !defined(__PYTHON_MODULE__) ParameterRange* ParameterRangeCast ( PyObject* derivedObject ) { - if (IsPyStepParameterRange(derivedObject)) return PYSTEPPARAMETERRANGE_O(derivedObject); + if (IsPyStepParameterRange (derivedObject)) return PYSTEPPARAMETERRANGE_O (derivedObject); + if (IsPyMatrixParameterRange(derivedObject)) return PYMATRIXPARAMETERRANGE_O(derivedObject); return NULL; } diff --git a/bora/src/SlicingPlotWidget.cpp b/bora/src/SlicingPlotWidget.cpp index f12617a1..6de7adb7 100644 --- a/bora/src/SlicingPlotWidget.cpp +++ b/bora/src/SlicingPlotWidget.cpp @@ -396,12 +396,16 @@ namespace Bora { for( Instance* iInstance : instances ) { Cell* model = iInstance->getMasterCell(); Device* device = dynamic_cast(model); + cerr << "device:" << device << endl; if (device) { TransistorFamily* tf = dynamic_cast( device ); - if (tf) _gridLabel[i+5]->setDynamicText ( QString("%1" ).arg( tf->getNfing() ) ); + cerr << "tf:" << tf << endl; + if (tf) { + _gridLabel[i+5]->setDynamicText ( QString("%1" ).arg( tf->getNfing() ) ); + i++; + } } - i++; } } diff --git a/crlcore/doc/crlcore/CMakeLists.txt b/crlcore/doc/crlcore/CMakeLists.txt index 2b0a60ce..5e6041af 100644 --- a/crlcore/doc/crlcore/CMakeLists.txt +++ b/crlcore/doc/crlcore/CMakeLists.txt @@ -1,6 +1,6 @@ # -*- mode: CMAKE; explicit-buffer-name: # "CMakeLists.txt" -*- - set ( htmlInstallDir share/doc/coriolis2/en/html/crlcore ) + set ( htmlInstallDir share/doc/coriolis2/en/html/doc/crlcore ) set ( latexInstallDir share/doc/coriolis2/en/latex/crlcore ) set ( doxExtras closed.png open.png diff --git a/crlcore/doc/crlcore/html/AcmSigda_8h_source.html b/crlcore/doc/crlcore/html/AcmSigda_8h_source.html index 404b45ba..5e41ae70 100644 --- a/crlcore/doc/crlcore/html/AcmSigda_8h_source.html +++ b/crlcore/doc/crlcore/html/AcmSigda_8h_source.html @@ -54,7 +54,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/AllianceFramework_8h_source.html b/crlcore/doc/crlcore/html/AllianceFramework_8h_source.html index f90d5ca5..54a66354 100644 --- a/crlcore/doc/crlcore/html/AllianceFramework_8h_source.html +++ b/crlcore/doc/crlcore/html/AllianceFramework_8h_source.html @@ -92,7 +92,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/AllianceLibrary_8h_source.html b/crlcore/doc/crlcore/html/AllianceLibrary_8h_source.html index 5b0345ed..9afa6284 100644 --- a/crlcore/doc/crlcore/html/AllianceLibrary_8h_source.html +++ b/crlcore/doc/crlcore/html/AllianceLibrary_8h_source.html @@ -59,7 +59,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/Banner_8h_source.html b/crlcore/doc/crlcore/html/Banner_8h_source.html index 773b9d17..e1e4b963 100644 --- a/crlcore/doc/crlcore/html/Banner_8h_source.html +++ b/crlcore/doc/crlcore/html/Banner_8h_source.html @@ -66,7 +66,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/Catalog_8h_source.html b/crlcore/doc/crlcore/html/Catalog_8h_source.html index 05565129..67767366 100644 --- a/crlcore/doc/crlcore/html/Catalog_8h_source.html +++ b/crlcore/doc/crlcore/html/Catalog_8h_source.html @@ -123,7 +123,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/Environment_8h_source.html b/crlcore/doc/crlcore/html/Environment_8h_source.html index e151eeb7..324c333b 100644 --- a/crlcore/doc/crlcore/html/Environment_8h_source.html +++ b/crlcore/doc/crlcore/html/Environment_8h_source.html @@ -98,7 +98,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/GraphicToolEngine_8h_source.html b/crlcore/doc/crlcore/html/GraphicToolEngine_8h_source.html index feac806c..e12c61dd 100644 --- a/crlcore/doc/crlcore/html/GraphicToolEngine_8h_source.html +++ b/crlcore/doc/crlcore/html/GraphicToolEngine_8h_source.html @@ -60,7 +60,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/RoutingGauge_8h_source.html b/crlcore/doc/crlcore/html/RoutingGauge_8h_source.html index 1d2c656a..5e370ae8 100644 --- a/crlcore/doc/crlcore/html/RoutingGauge_8h_source.html +++ b/crlcore/doc/crlcore/html/RoutingGauge_8h_source.html @@ -80,7 +80,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/RoutingLayerGauge_8h_source.html b/crlcore/doc/crlcore/html/RoutingLayerGauge_8h_source.html index 46256a55..af662ada 100644 --- a/crlcore/doc/crlcore/html/RoutingLayerGauge_8h_source.html +++ b/crlcore/doc/crlcore/html/RoutingLayerGauge_8h_source.html @@ -93,7 +93,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/SearchPath_8h_source.html b/crlcore/doc/crlcore/html/SearchPath_8h_source.html index 6b3786b8..50b8064f 100644 --- a/crlcore/doc/crlcore/html/SearchPath_8h_source.html +++ b/crlcore/doc/crlcore/html/SearchPath_8h_source.html @@ -68,7 +68,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/ToolEngine_8h_source.html b/crlcore/doc/crlcore/html/ToolEngine_8h_source.html index 01ff534e..f5793e0e 100644 --- a/crlcore/doc/crlcore/html/ToolEngine_8h_source.html +++ b/crlcore/doc/crlcore/html/ToolEngine_8h_source.html @@ -44,13 +44,13 @@ $(function() {
ToolEngine.h
-
1 // -*- C++ -*-
2 //
3 // This file is part of the Coriolis Software.
4 // Copyright (c) UPMC 2008-2018, All Rights Reserved
5 //
6 // +-----------------------------------------------------------------+
7 // | C O R I O L I S |
8 // | Alliance / Hurricane Interface |
9 // | |
10 // | Author : Jean-Paul Chaput |
11 // | E-mail : Jean-Paul.Chaput@lip6.fr |
12 // | =============================================================== |
13 // | C++ Header : "./crlcore/ToolEngine.h" |
14 // +-----------------------------------------------------------------+
15 
16 
17 
18 #ifndef CRL_TOOL_ENGINE_H
19 #define CRL_TOOL_ENGINE_H
20 
21 #include <string>
22 #include <vector>
23 #include "hurricane/Commons.h"
24 #include "hurricane/Timer.h"
25 #include "hurricane/DBo.h"
26 #include "hurricane/Slot.h"
27 
28 namespace Hurricane {
29  class Name;
30  class Cell;
31 }
32 
33 #include "crlcore/ToolEngines.h"
34 
35 
36 namespace CRL {
37 
38  using std::string;
39  using std::vector;
40  using Hurricane::Timer;
41  using Hurricane::Record;
42  using Hurricane::Name;
43  using Hurricane::DBo;
44  using Hurricane::Cell;
45 
46 
47 // -------------------------------------------------------------------
48 // Class : "CRL::ToolEngine".
49 
50  class ToolEngine : public DBo {
51  public:
52  typedef DBo Super;
53  public:
54  static ToolEngines get ( const Cell* cell );
55  static ToolEngine* get ( const Cell* cell, const Name& name );
56  static void destroyAll ();
57  static bool inDestroyAll ();
58  public:
59  virtual const Name& getName () const = 0;
60  inline Cell* getCell () const;
61  bool placementModificationFlagHasChanged ();
62  bool routingModificationFlagHasChanged ();
63  inline void setInRelationDestroy ( bool );
64  inline const Timer& getTimer () const;
65  void startMeasures ();
66  void stopMeasures ();
67  void suspendMeasures ();
68  void resumeMeasures ();
69  void printMeasures () const;
70  virtual string _getTypeName () const;
71  virtual string _getString () const;
72  virtual Record* _getRecord () const;
73  private:
74  static bool _inDestroyAll;
75  protected:
76  Cell* _cell;
77  private:
78  unsigned int _placementModificationFlag;
79  unsigned int _routingModificationFlag;
80  bool _inRelationDestroy;
81  Timer _timer;
82  protected:
83  ToolEngine ( Cell* cell );
84  virtual void _postCreate ();
85  virtual void _preDestroy ();
86  protected:
87  void grabPlacementModificationFlag ();
88  void getPlacementModificationFlag ();
89  void grabRoutingModificationFlag ();
90  void getRoutingModificationFlag ();
91  };
92 
93 
94 // -------------------------------------------------------------------
95 // Inline Functions.
96 
97 
98  inline Cell* ToolEngine::getCell () const { return _cell; }
99  inline void ToolEngine::setInRelationDestroy ( bool state ) { _inRelationDestroy = state; }
100  inline const Timer& ToolEngine::getTimer () const { return _timer; }
101 
102 
103 } // CRL namespace.
104 
105 #endif // CRL_TOOL_ENGINE_H
virtual const Name & getName() const =0
+
1 // -*- C++ -*-
2 //
3 // This file is part of the Coriolis Software.
4 // Copyright (c) UPMC 2008-2018, All Rights Reserved
5 //
6 // +-----------------------------------------------------------------+
7 // | C O R I O L I S |
8 // | Alliance / Hurricane Interface |
9 // | |
10 // | Author : Jean-Paul Chaput |
11 // | E-mail : Jean-Paul.Chaput@lip6.fr |
12 // | =============================================================== |
13 // | C++ Header : "./crlcore/ToolEngine.h" |
14 // +-----------------------------------------------------------------+
15 
16 
17 
18 #ifndef CRL_TOOL_ENGINE_H
19 #define CRL_TOOL_ENGINE_H
20 
21 #include <string>
22 #include "hurricane/Commons.h"
23 #include "hurricane/Timer.h"
24 #include "hurricane/DBo.h"
25 #include "hurricane/Slot.h"
26 
27 namespace Hurricane {
28  class Name;
29  class Cell;
30 }
31 
32 #include "crlcore/Measures.h"
33 #include "crlcore/ToolEngines.h"
34 
35 
36 namespace CRL {
37 
38  using Hurricane::Timer;
39  using Hurricane::Record;
40  using Hurricane::Name;
41  using Hurricane::DBo;
42  using Hurricane::Cell;
43 
44 
45 // -------------------------------------------------------------------
46 // Class : "CRL::ToolEngine".
47 
48  class ToolEngine : public DBo {
49  public:
50  typedef DBo Super;
51  public:
52  static ToolEngines get ( const Cell* cell );
53  static ToolEngine* get ( const Cell* cell, const Name& name );
54  static void destroyAll ();
55  static bool inDestroyAll ();
56  public:
57  virtual const Name& getName () const = 0;
58  inline Cell* getCell () const;
59  inline uint32_t getPassNumber () const;
60  bool placementModificationFlagHasChanged ();
61  bool routingModificationFlagHasChanged ();
62  inline void setInRelationDestroy ( bool );
63  inline const Timer& getTimer () const;
64  inline void setPassNumber ( uint32_t );
65  inline std::string getMeasureLabel ( std::string ) const;
66  void startMeasures ();
67  void stopMeasures ();
68  void suspendMeasures ();
69  void resumeMeasures ();
70  void printMeasures () const;
71  template<typename Data>
72  inline void addMeasure ( std::string, const Data&, unsigned int width ) const;
73  template<typename Data>
74  inline void addMeasure ( std::string, const Data& ) const;
75  template<typename Data>
76  inline void addMeasure ( std::string, Data* ) const;
77  template<typename Data>
78  inline const Data& getMeasure ( std::string ) const;
79  virtual std::string _getTypeName () const;
80  virtual std::string _getString () const;
81  virtual Record* _getRecord () const;
82  private:
83  static bool _inDestroyAll;
84  protected:
85  Cell* _cell;
86  private:
87  unsigned int _placementModificationFlag;
88  unsigned int _routingModificationFlag;
89  bool _inRelationDestroy;
90  Timer _timer;
91  uint32_t _passNumber;
92  protected:
93  ToolEngine ( Cell* cell );
94  virtual void _postCreate ();
95  virtual void _preDestroy ();
96  protected:
97  void grabPlacementModificationFlag ();
98  void getPlacementModificationFlag ();
99  void grabRoutingModificationFlag ();
100  void getRoutingModificationFlag ();
101  };
102 
103 
104 // -------------------------------------------------------------------
105 // Inline Functions.
106 
107 
108  inline Cell* ToolEngine::getCell () const { return _cell; }
109  inline void ToolEngine::setInRelationDestroy ( bool state ) { _inRelationDestroy = state; }
110  inline const Timer& ToolEngine::getTimer () const { return _timer; }
111  inline uint32_t ToolEngine::getPassNumber () const { return _passNumber; }
112  inline void ToolEngine::setPassNumber ( uint32_t n ) { _passNumber = n; }
113 
114  inline std::string ToolEngine::getMeasureLabel ( std::string label ) const
115  { return _getTypeName() + "." + label; }
116 
117  template<typename Data>
118  inline void ToolEngine::addMeasure ( std::string name, const Data& data, unsigned int width ) const
119  { ::CRL::addMeasure( getCell(), getMeasureLabel(name), getPassNumber(), data, width ); }
120 
121  template<typename Data>
122  inline void ToolEngine::addMeasure ( std::string name, const Data& data ) const
123  { ::CRL::addMeasure( getCell(), getMeasureLabel(name), getPassNumber(), data ); }
124 
125  template<typename Data>
126  inline void ToolEngine::addMeasure ( std::string name, Data* data ) const
127  { ::CRL::addMeasure( getCell(), getMeasureLabel(name), getPassNumber(), data ); }
128 
129  template<typename Data>
130  inline const Data& ToolEngine::getMeasure ( std::string name ) const
131  { return ::CRL::getMeasure<Data>( getCell(), getMeasureLabel(name) )->getData( getPassNumber() ); }
132 
133 
134 } // CRL namespace.
135 
136 #endif // CRL_TOOL_ENGINE_H
virtual const Name & getName() const =0
static void destroyAll()
-
Base Class of all Coriolis Tools.
Definition: ToolEngine.h:50
+
Base Class of all Coriolis Tools.
Definition: ToolEngine.h:48
The namespace of Coriolis Core.
Definition: Environment.h:26
@@ -58,7 +58,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/ToolEngines_8h_source.html b/crlcore/doc/crlcore/html/ToolEngines_8h_source.html index cf7c6415..8733d30b 100644 --- a/crlcore/doc/crlcore/html/ToolEngines_8h_source.html +++ b/crlcore/doc/crlcore/html/ToolEngines_8h_source.html @@ -47,7 +47,7 @@ $(function() {
1 
2 
3 // This file is part of the Coriolis Project.
4 // Copyright (C) Laboratoire LIP6 - Departement ASIM
5 // Universite Pierre et Marie Curie
6 //
7 // Main contributors :
8 // Christophe Alexandre <Christophe.Alexandre@lip6.fr>
9 // Sophie Belloeil <Sophie.Belloeil@lip6.fr>
10 // Hugo Clément <Hugo.Clement@lip6.fr>
11 // Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
12 // Damien Dupuis <Damien.Dupuis@lip6.fr>
13 // Christian Masson <Christian.Masson@lip6.fr>
14 // Marek Sroka <Marek.Sroka@lip6.fr>
15 //
16 // The Coriolis Project is free software; you can redistribute it
17 // and/or modify it under the terms of the GNU General Public License
18 // as published by the Free Software Foundation; either version 2 of
19 // the License, or (at your option) any later version.
20 //
21 // The Coriolis Project is distributed in the hope that it will be
22 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
23 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 // GNU General Public License for more details.
25 //
26 // You should have received a copy of the GNU General Public License
27 // along with the Coriolis Project; if not, write to the Free Software
28 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
29 // USA
30 //
31 // License-Tag
32 // Authors-Tag
33 // ===================================================================
34 
35 
36 # ifndef __CRL_TOOL_ENGINES_H__
37 # define __CRL_TOOL_ENGINES_H__
38 
39 # include "hurricane/Collection.h"
40 
41 
42 namespace CRL {
43 
44 
48 
49 
50  class ToolEngine;
51 
52 
56 
57 # define for_each_toolengine(toolEngine, toolEngines) { \
58  ToolEngineLocator _locator = toolEngines.getLocator(); \
59  while ( _locator.isValid() ) { \
60  ToolEngine* toolEngine = _locator.getElement(); \
61  _locator.progress();
62 
63 }
64 
65 
66 #endif // __CENGINES_H
-
Base Class of all Coriolis Tools.
Definition: ToolEngine.h:50
+
Base Class of all Coriolis Tools.
Definition: ToolEngine.h:48
GenericLocator< ToolEngine * > ToolEngineLocator
Definition: ToolEngines.h:54
GenericFilter< ToolEngine * > ToolEngineFilter
Definition: ToolEngines.h:55
GenericCollection< ToolEngine * > ToolEngines
Definition: ToolEngines.h:50
@@ -57,7 +57,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/annotated.html b/crlcore/doc/crlcore/html/annotated.html index 1d7a7765..517f6247 100644 --- a/crlcore/doc/crlcore/html/annotated.html +++ b/crlcore/doc/crlcore/html/annotated.html @@ -64,7 +64,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1AcmSigda-members.html b/crlcore/doc/crlcore/html/classCRL_1_1AcmSigda-members.html index cd9fb7c6..cfb6a1d4 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1AcmSigda-members.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1AcmSigda-members.html @@ -53,7 +53,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1AcmSigda.html b/crlcore/doc/crlcore/html/classCRL_1_1AcmSigda.html index a4ab80dd..0df16205 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1AcmSigda.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1AcmSigda.html @@ -118,7 +118,7 @@ Static Public Member Functions
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1AllianceFramework-members.html b/crlcore/doc/crlcore/html/classCRL_1_1AllianceFramework-members.html index 277595bd..42119de8 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1AllianceFramework-members.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1AllianceFramework-members.html @@ -87,7 +87,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1AllianceFramework.html b/crlcore/doc/crlcore/html/classCRL_1_1AllianceFramework.html index 22278f62..28a12402 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1AllianceFramework.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1AllianceFramework.html @@ -923,7 +923,7 @@ Static Public Member Functions
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1AllianceLibrary-members.html b/crlcore/doc/crlcore/html/classCRL_1_1AllianceLibrary-members.html index bc37f3d8..a466e427 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1AllianceLibrary-members.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1AllianceLibrary-members.html @@ -56,7 +56,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1AllianceLibrary.html b/crlcore/doc/crlcore/html/classCRL_1_1AllianceLibrary.html index 15a0ba83..769089d9 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1AllianceLibrary.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1AllianceLibrary.html @@ -175,7 +175,7 @@ Public Member Functions
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1Banner-members.html b/crlcore/doc/crlcore/html/classCRL_1_1Banner-members.html index 0da11090..0ebfe08a 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1Banner-members.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1Banner-members.html @@ -67,7 +67,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1Banner.html b/crlcore/doc/crlcore/html/classCRL_1_1Banner.html index 0b71e233..d32522e5 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1Banner.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1Banner.html @@ -495,7 +495,7 @@ Public Member Functions
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1Catalog-members.html b/crlcore/doc/crlcore/html/classCRL_1_1Catalog-members.html index 18c3276e..49df5787 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1Catalog-members.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1Catalog-members.html @@ -60,7 +60,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1Catalog.html b/crlcore/doc/crlcore/html/classCRL_1_1Catalog.html index 8fddbf95..02e1e84c 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1Catalog.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1Catalog.html @@ -292,7 +292,7 @@ Public Member Functions
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1CatalogExtension-members.html b/crlcore/doc/crlcore/html/classCRL_1_1CatalogExtension-members.html index 136c6e91..e7d3f0d6 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1CatalogExtension-members.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1CatalogExtension-members.html @@ -71,7 +71,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1CatalogExtension.html b/crlcore/doc/crlcore/html/classCRL_1_1CatalogExtension.html index 3347e304..63110978 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1CatalogExtension.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1CatalogExtension.html @@ -763,7 +763,7 @@ Static Public Member Functions
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1Catalog_1_1State-members.html b/crlcore/doc/crlcore/html/classCRL_1_1Catalog_1_1State-members.html index 129f5454..e53d9490 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1Catalog_1_1State-members.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1Catalog_1_1State-members.html @@ -86,7 +86,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1Catalog_1_1State.html b/crlcore/doc/crlcore/html/classCRL_1_1Catalog_1_1State.html index e2b96dd4..8ac0a3d0 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1Catalog_1_1State.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1Catalog_1_1State.html @@ -846,7 +846,7 @@ Public Member Functions
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1Environment-members.html b/crlcore/doc/crlcore/html/classCRL_1_1Environment-members.html index 34575845..f349d7f7 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1Environment-members.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1Environment-members.html @@ -96,7 +96,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1Environment.html b/crlcore/doc/crlcore/html/classCRL_1_1Environment.html index c5616e72..a954d610 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1Environment.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1Environment.html @@ -1136,7 +1136,7 @@ Public Member Functions
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1GraphicTool-members.html b/crlcore/doc/crlcore/html/classCRL_1_1GraphicTool-members.html index d092f99c..0a6d60c2 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1GraphicTool-members.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1GraphicTool-members.html @@ -54,7 +54,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1GraphicTool.html b/crlcore/doc/crlcore/html/classCRL_1_1GraphicTool.html index d88a93c3..c5d4700e 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1GraphicTool.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1GraphicTool.html @@ -127,7 +127,7 @@ Public Member Functions
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1RoutingGauge-members.html b/crlcore/doc/crlcore/html/classCRL_1_1RoutingGauge-members.html index eb5d8fc8..fab1564e 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1RoutingGauge-members.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1RoutingGauge-members.html @@ -68,7 +68,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1RoutingGauge.html b/crlcore/doc/crlcore/html/classCRL_1_1RoutingGauge.html index 43d80c31..7192b256 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1RoutingGauge.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1RoutingGauge.html @@ -451,7 +451,7 @@ Static Public Member Functions
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1RoutingLayerGauge-members.html b/crlcore/doc/crlcore/html/classCRL_1_1RoutingLayerGauge-members.html index 847182d6..2b637832 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1RoutingLayerGauge-members.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1RoutingLayerGauge-members.html @@ -70,7 +70,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1RoutingLayerGauge.html b/crlcore/doc/crlcore/html/classCRL_1_1RoutingLayerGauge.html index 9d598d54..7bb29271 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1RoutingLayerGauge.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1RoutingLayerGauge.html @@ -682,7 +682,7 @@ Static Public Member Functions
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1SearchPath-members.html b/crlcore/doc/crlcore/html/classCRL_1_1SearchPath-members.html index e309dbaf..e7e19a66 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1SearchPath-members.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1SearchPath-members.html @@ -64,7 +64,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1SearchPath.html b/crlcore/doc/crlcore/html/classCRL_1_1SearchPath.html index ec1c0ebd..86ca0ab1 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1SearchPath.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1SearchPath.html @@ -452,7 +452,7 @@ Static Public Member Functions
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1SearchPath_1_1Element-members.html b/crlcore/doc/crlcore/html/classCRL_1_1SearchPath_1_1Element-members.html index 80d279be..0e99288a 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1SearchPath_1_1Element-members.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1SearchPath_1_1Element-members.html @@ -56,7 +56,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1SearchPath_1_1Element.html b/crlcore/doc/crlcore/html/classCRL_1_1SearchPath_1_1Element.html index db0e1e47..7e5edd38 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1SearchPath_1_1Element.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1SearchPath_1_1Element.html @@ -190,7 +190,7 @@ Public Member Functions
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1ToolEngine-members.html b/crlcore/doc/crlcore/html/classCRL_1_1ToolEngine-members.html index c670f530..79c0521b 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1ToolEngine-members.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1ToolEngine-members.html @@ -64,7 +64,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classCRL_1_1ToolEngine.html b/crlcore/doc/crlcore/html/classCRL_1_1ToolEngine.html index 4b06c43f..9da35c34 100644 --- a/crlcore/doc/crlcore/html/classCRL_1_1ToolEngine.html +++ b/crlcore/doc/crlcore/html/classCRL_1_1ToolEngine.html @@ -198,7 +198,7 @@ Static Public Member Functions
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/classes.html b/crlcore/doc/crlcore/html/classes.html index 033603f8..185e072a 100644 --- a/crlcore/doc/crlcore/html/classes.html +++ b/crlcore/doc/crlcore/html/classes.html @@ -73,7 +73,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/dir_1d3beb215ce2defdb52d6dee9d41bc7a.html b/crlcore/doc/crlcore/html/dir_1d3beb215ce2defdb52d6dee9d41bc7a.html index 748f597f..62f2f67b 100644 --- a/crlcore/doc/crlcore/html/dir_1d3beb215ce2defdb52d6dee9d41bc7a.html +++ b/crlcore/doc/crlcore/html/dir_1d3beb215ce2defdb52d6dee9d41bc7a.html @@ -53,7 +53,7 @@ Directories
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/crlcore/doc/crlcore/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 47da7ac7..d518a89b 100644 --- a/crlcore/doc/crlcore/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/crlcore/doc/crlcore/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -49,7 +49,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/dir_d23e13494685c82fafa9ef5abb5746af.html b/crlcore/doc/crlcore/html/dir_d23e13494685c82fafa9ef5abb5746af.html index 83c57205..ca89db55 100644 --- a/crlcore/doc/crlcore/html/dir_d23e13494685c82fafa9ef5abb5746af.html +++ b/crlcore/doc/crlcore/html/dir_d23e13494685c82fafa9ef5abb5746af.html @@ -49,7 +49,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/files.html b/crlcore/doc/crlcore/html/files.html index 0a3d38c7..30c9dea6 100644 --- a/crlcore/doc/crlcore/html/files.html +++ b/crlcore/doc/crlcore/html/files.html @@ -61,7 +61,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions.html b/crlcore/doc/crlcore/html/functions.html index 7a6b9275..490a860e 100644 --- a/crlcore/doc/crlcore/html/functions.html +++ b/crlcore/doc/crlcore/html/functions.html @@ -72,7 +72,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_0x7e.html b/crlcore/doc/crlcore/html/functions_0x7e.html index d78f37c8..03195a52 100644 --- a/crlcore/doc/crlcore/html/functions_0x7e.html +++ b/crlcore/doc/crlcore/html/functions_0x7e.html @@ -54,7 +54,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_b.html b/crlcore/doc/crlcore/html/functions_b.html index 3dd4f9ac..958aeb9d 100644 --- a/crlcore/doc/crlcore/html/functions_b.html +++ b/crlcore/doc/crlcore/html/functions_b.html @@ -48,7 +48,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_c.html b/crlcore/doc/crlcore/html/functions_c.html index 13b3271f..4c787429 100644 --- a/crlcore/doc/crlcore/html/functions_c.html +++ b/crlcore/doc/crlcore/html/functions_c.html @@ -68,7 +68,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_d.html b/crlcore/doc/crlcore/html/functions_d.html index 66e648bf..15473786 100644 --- a/crlcore/doc/crlcore/html/functions_d.html +++ b/crlcore/doc/crlcore/html/functions_d.html @@ -62,7 +62,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_e.html b/crlcore/doc/crlcore/html/functions_e.html index 7ec263f7..b45abcbc 100644 --- a/crlcore/doc/crlcore/html/functions_e.html +++ b/crlcore/doc/crlcore/html/functions_e.html @@ -57,7 +57,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_enum.html b/crlcore/doc/crlcore/html/functions_enum.html index 118b34ae..adf23a4d 100644 --- a/crlcore/doc/crlcore/html/functions_enum.html +++ b/crlcore/doc/crlcore/html/functions_enum.html @@ -55,7 +55,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_eval.html b/crlcore/doc/crlcore/html/functions_eval.html index c3260829..145336c1 100644 --- a/crlcore/doc/crlcore/html/functions_eval.html +++ b/crlcore/doc/crlcore/html/functions_eval.html @@ -91,7 +91,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_f.html b/crlcore/doc/crlcore/html/functions_f.html index 435c25a9..c60a0c85 100644 --- a/crlcore/doc/crlcore/html/functions_f.html +++ b/crlcore/doc/crlcore/html/functions_f.html @@ -54,7 +54,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_func.html b/crlcore/doc/crlcore/html/functions_func.html index a688890b..dd7d1b17 100644 --- a/crlcore/doc/crlcore/html/functions_func.html +++ b/crlcore/doc/crlcore/html/functions_func.html @@ -588,7 +588,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_g.html b/crlcore/doc/crlcore/html/functions_g.html index 477a10fe..407c1a40 100644 --- a/crlcore/doc/crlcore/html/functions_g.html +++ b/crlcore/doc/crlcore/html/functions_g.html @@ -258,7 +258,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_h.html b/crlcore/doc/crlcore/html/functions_h.html index e85e3036..320c5be5 100644 --- a/crlcore/doc/crlcore/html/functions_h.html +++ b/crlcore/doc/crlcore/html/functions_h.html @@ -54,7 +54,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_i.html b/crlcore/doc/crlcore/html/functions_i.html index f83b4a22..b999951d 100644 --- a/crlcore/doc/crlcore/html/functions_i.html +++ b/crlcore/doc/crlcore/html/functions_i.html @@ -100,7 +100,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_l.html b/crlcore/doc/crlcore/html/functions_l.html index 12e797cf..664eb6ff 100644 --- a/crlcore/doc/crlcore/html/functions_l.html +++ b/crlcore/doc/crlcore/html/functions_l.html @@ -63,7 +63,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_m.html b/crlcore/doc/crlcore/html/functions_m.html index 8fad1a07..db519f83 100644 --- a/crlcore/doc/crlcore/html/functions_m.html +++ b/crlcore/doc/crlcore/html/functions_m.html @@ -51,7 +51,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_o.html b/crlcore/doc/crlcore/html/functions_o.html index 22c81061..11d5158a 100644 --- a/crlcore/doc/crlcore/html/functions_o.html +++ b/crlcore/doc/crlcore/html/functions_o.html @@ -48,7 +48,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_p.html b/crlcore/doc/crlcore/html/functions_p.html index 3822d6a2..ffcd0ede 100644 --- a/crlcore/doc/crlcore/html/functions_p.html +++ b/crlcore/doc/crlcore/html/functions_p.html @@ -57,7 +57,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_r.html b/crlcore/doc/crlcore/html/functions_r.html index 831e9866..39f9aa37 100644 --- a/crlcore/doc/crlcore/html/functions_r.html +++ b/crlcore/doc/crlcore/html/functions_r.html @@ -57,7 +57,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_s.html b/crlcore/doc/crlcore/html/functions_s.html index 8382ab99..2e517d42 100644 --- a/crlcore/doc/crlcore/html/functions_s.html +++ b/crlcore/doc/crlcore/html/functions_s.html @@ -154,7 +154,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/functions_v.html b/crlcore/doc/crlcore/html/functions_v.html index 17e26697..03a6399a 100644 --- a/crlcore/doc/crlcore/html/functions_v.html +++ b/crlcore/doc/crlcore/html/functions_v.html @@ -51,7 +51,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/hierarchy.html b/crlcore/doc/crlcore/html/hierarchy.html index 889acca1..bb90ada9 100644 --- a/crlcore/doc/crlcore/html/hierarchy.html +++ b/crlcore/doc/crlcore/html/hierarchy.html @@ -64,7 +64,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/index.html b/crlcore/doc/crlcore/html/index.html index 6131375b..d7fb1f4e 100644 --- a/crlcore/doc/crlcore/html/index.html +++ b/crlcore/doc/crlcore/html/index.html @@ -45,7 +45,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/namespaceCRL.html b/crlcore/doc/crlcore/html/namespaceCRL.html index 50ee19d7..6aa5f073 100644 --- a/crlcore/doc/crlcore/html/namespaceCRL.html +++ b/crlcore/doc/crlcore/html/namespaceCRL.html @@ -149,7 +149,7 @@ Typedefs
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/namespaceConstant.html b/crlcore/doc/crlcore/html/namespaceConstant.html index dfefdd3e..8692fd97 100644 --- a/crlcore/doc/crlcore/html/namespaceConstant.html +++ b/crlcore/doc/crlcore/html/namespaceConstant.html @@ -149,7 +149,7 @@ Enumerations
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/namespacemembers.html b/crlcore/doc/crlcore/html/namespacemembers.html index d6317a5f..9b7b0feb 100644 --- a/crlcore/doc/crlcore/html/namespacemembers.html +++ b/crlcore/doc/crlcore/html/namespacemembers.html @@ -85,7 +85,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/namespacemembers_enum.html b/crlcore/doc/crlcore/html/namespacemembers_enum.html index 4462600c..ab59172b 100644 --- a/crlcore/doc/crlcore/html/namespacemembers_enum.html +++ b/crlcore/doc/crlcore/html/namespacemembers_enum.html @@ -52,7 +52,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/namespacemembers_eval.html b/crlcore/doc/crlcore/html/namespacemembers_eval.html index 0197b788..42764881 100644 --- a/crlcore/doc/crlcore/html/namespacemembers_eval.html +++ b/crlcore/doc/crlcore/html/namespacemembers_eval.html @@ -67,7 +67,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/namespacemembers_type.html b/crlcore/doc/crlcore/html/namespacemembers_type.html index f95a3662..8272536f 100644 --- a/crlcore/doc/crlcore/html/namespacemembers_type.html +++ b/crlcore/doc/crlcore/html/namespacemembers_type.html @@ -52,7 +52,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/html/namespaces.html b/crlcore/doc/crlcore/html/namespaces.html index 64263b3c..9576e5fc 100644 --- a/crlcore/doc/crlcore/html/namespaces.html +++ b/crlcore/doc/crlcore/html/namespaces.html @@ -51,7 +51,7 @@ $(function() {
- +
Generated by doxygen 1.8.14 on Mon Oct 28 2019Generated by doxygen 1.8.14 on Mon Feb 3 2020 Return to top of page
diff --git a/crlcore/doc/crlcore/latex/refman.tex b/crlcore/doc/crlcore/latex/refman.tex index ecd05070..c120b56b 100644 --- a/crlcore/doc/crlcore/latex/refman.tex +++ b/crlcore/doc/crlcore/latex/refman.tex @@ -34,7 +34,7 @@ \vspace*{1cm} {\large Generated by Doxygen 1.8.14}\\ \vspace*{0.5cm} - {\small Mon Oct 28 2019 18:06:32}\\ + {\small Mon Feb 3 2020 17:10:37}\\ \end{center} \end{titlepage} diff --git a/crlcore/etc/CMakeLists.txt b/crlcore/etc/CMakeLists.txt index fee715fc..247cc243 100644 --- a/crlcore/etc/CMakeLists.txt +++ b/crlcore/etc/CMakeLists.txt @@ -5,4 +5,5 @@ install( DIRECTORY 180 DESTINATION ${SYS_CONF_DIR}/coriolis2 ) install( DIRECTORY 45 DESTINATION ${SYS_CONF_DIR}/coriolis2 ) install( DIRECTORY node180 DESTINATION ${SYS_CONF_DIR}/coriolis2 ) + install( DIRECTORY node600 DESTINATION ${SYS_CONF_DIR}/coriolis2 ) diff --git a/crlcore/etc/common/display.py b/crlcore/etc/common/display.py index 6f38e44e..6c202ada 100644 --- a/crlcore/etc/common/display.py +++ b/crlcore/etc/common/display.py @@ -229,7 +229,7 @@ def createStyles ( scale=1.0 ): style.addDrawingStyle( group='Active Layers', name='poly2' , color=toRGB('Orange' ), pattern=toHexa('poids2.8' ), border=1, threshold=0.00*scale ) # Routing Layers. - style.addDrawingStyle( group='Routing Layers', name='metal1' , color=toRGB('Blue' ), pattern=toHexa('slash.8' ), border=1, threshold=0.00*scale ) + style.addDrawingStyle( group='Routing Layers', name='metal1' , color=toRGB('Blue' ), pattern=toHexa('slash.8' ), border=1, threshold=0.80*scale ) style.addDrawingStyle( group='Routing Layers', name='metal2' , color=toRGB('Aqua' ), pattern=toHexa('poids4.8' ), border=1, threshold=0.00*scale ) style.addDrawingStyle( group='Routing Layers', name='metcap' , color=toRGB('DarkTurquoise'), pattern=toHexa('poids2.8' ), border=2, threshold=0.00*scale ) style.addDrawingStyle( group='Routing Layers', name='metal3' , color=toRGB('LightPink' ), pattern=toHexa('poids4.8' ), border=1, threshold=0.00*scale ) diff --git a/crlcore/etc/node600/__init__.py b/crlcore/etc/node600/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/crlcore/etc/node600/phenitec/__init__.py b/crlcore/etc/node600/phenitec/__init__.py new file mode 100644 index 00000000..5ba0b2db --- /dev/null +++ b/crlcore/etc/node600/phenitec/__init__.py @@ -0,0 +1,40 @@ + +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2019-2019, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | Alliance / Hurricane Interface | +# | | +# | Author : Jean-Paul CHAPUT | +# | E-mail : Jean-Paul.Chaput@lip6.fr | +# | =============================================================== | +# | Python : "./etc/node600/phenitec/__init__.py" | +# +-----------------------------------------------------------------+ + + +import Cfg +import helpers.io +helpers.io.vprint( 1, ' o Loading "node600/phenitec" technology.' ) +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + +from Hurricane import DataBase +from CRL import System + +Cfg.Configuration.pushDefaultPriority( Cfg.Parameter.Priority.ConfigurationFile ) + +if not DataBase.getDB(): DataBase.create() +System.get() + +import node600.phenitec.misc +import node600.phenitec.technology +import node600.phenitec.display +import node600.phenitec.analog +import node600.phenitec.alliance +import node600.phenitec.etesian +import node600.phenitec.kite +import node600.phenitec.plugins +import node600.phenitec.stratus1 +import node600.phenitec.devices + +Cfg.Configuration.popDefaultPriority() diff --git a/crlcore/etc/node600/phenitec/alliance.py b/crlcore/etc/node600/phenitec/alliance.py new file mode 100644 index 00000000..1989a623 --- /dev/null +++ b/crlcore/etc/node600/phenitec/alliance.py @@ -0,0 +1,59 @@ + +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2019-2019, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | Alliance / Hurricane Interface | +# | | +# | Author : Jean-Paul CHAPUT | +# | E-mail : Jean-Paul.Chaput@lip6.fr | +# | =============================================================== | +# | Python : "./etc/node600/phenitec/alliance.py" | +# +-----------------------------------------------------------------+ + + +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + +import os +import os.path +from CRL import Environment +from CRL import AllianceFramework + + +allianceTop = None +if os.environ.has_key('ALLIANCE_TOP'): + allianceTop = os.environ['ALLIANCE_TOP'] + if not os.path.isdir(allianceTop): + allianceTop = None + +if not allianceTop: allianceTop = '/soc/alliance' + +cellsTop = None +if os.environ.has_key('CELLS_TOP'): + cellsTop = os.environ['CELLS_TOP'] + if not os.path.isdir(cellsTop): + cellsTop = None + +if not cellsTop: + cellsTop = allianceTop+'/cells' + +af = AllianceFramework.get() +env = af.getEnvironment() + +env.setSCALE_X ( 100 ) +env.setCATALOG ( 'CATAL' ) +env.setIN_LO ( 'vst' ) +env.setIN_PH ( 'ap' ) +env.setOUT_LO ( 'vst' ) +env.setOUT_PH ( 'ap' ) +env.setPOWER ( 'vdd' ) +env.setGROUND ( 'vss' ) +env.setCLOCK ( '.*ck.*|.*nck.*' ) +env.setBLOCKAGE ( 'blockage[Nn]et.*' ) +env.setPad ( '.*_sp$' ) + +env.setWORKING_LIBRARY( '.' ) +env.addSYSTEM_LIBRARY ( library=cellsTop+'/nsxlib' , mode=Environment.Append ) +env.addSYSTEM_LIBRARY ( library=cellsTop+'/phlib80', mode=Environment.Append ) diff --git a/crlcore/etc/node600/phenitec/analog.py b/crlcore/etc/node600/phenitec/analog.py new file mode 100644 index 00000000..b6b4aa78 --- /dev/null +++ b/crlcore/etc/node600/phenitec/analog.py @@ -0,0 +1,19 @@ + +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2019-2019, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | Alliance / Hurricane Interface | +# | | +# | Author : Jean-Paul CHAPUT | +# | E-mail : Jean-Paul.Chaput@lip6.fr | +# | =============================================================== | +# | Python : "./etc/node600/phenitec/analog.py" | +# +-----------------------------------------------------------------+ + + +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + +#import common.analog diff --git a/crlcore/etc/node600/phenitec/devices.py b/crlcore/etc/node600/phenitec/devices.py new file mode 100644 index 00000000..bf902acd --- /dev/null +++ b/crlcore/etc/node600/phenitec/devices.py @@ -0,0 +1,138 @@ + +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2019-2019, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | Alliance / Hurricane Interface | +# | | +# | Author : Jean-Paul CHAPUT | +# | E-mail : Jean-Paul.Chaput@lip6.fr | +# | =============================================================== | +# | Python : "./node600/phenitec/devices.py" | +# +-----------------------------------------------------------------+ + + +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + +import common.devices +from common.devices import addDevice + + +chamsDir = helpers.sysConfDir + '/share/coriolis2/' +spiceDir = chamsDir + 'spice/' + + +addDevice( name = 'DifferentialPairBulkConnected' + , spice = spiceDir+'DiffPairBulkConnected.spi' + , connectors = ( 'D1', 'D2', 'G1', 'G2', 'S' ) + , layouts = ( ('Horizontal M2' , 'DP_horizontalM2.py' ) + , ('Symmetrical' , 'DP_symmetrical.py' ) + , ('Common centroid', 'DP_2DCommonCentroid.py') + , ('Interdigitated' , 'DP_interdigitated.py' ) + , ('WIP DP' , 'WIP_DP.py' ) + ) + ) +addDevice( name = 'DifferentialPairBulkUnconnected' + , spice = spiceDir+'DiffPairBulkUnconnected.spi' + , connectors = ( 'D1', 'D2', 'G1', 'G2', 'S', 'B' ) + , layouts = ( ('Horizontal M2' , 'DP_horizontalM2.py' ) + , ('Symmetrical' , 'DP_symmetrical.py' ) + , ('Common centroid', 'DP_2DCommonCentroid.py') + , ('Interdigitated' , 'DP_interdigitated.py' ) + , ('WIP DP' , 'WIP_DP.py' ) + ) + ) +addDevice( name = 'LevelShifterBulkUnconnected' + , spice = spiceDir+'LevelShifterBulkUnconnected.spi' + , connectors = ( 'D1', 'D2', 'S1', 'S2', 'B' ) + , layouts = ( ('Horizontal M2' , 'LS_horizontalM2.py' ) + , ('Symmetrical' , 'LS_symmetrical.py' ) + , ('Common centroid', 'LS_2DCommonCentroid.py') + , ('Interdigitated' , 'LS_interdigitated.py' ) + ) + ) +addDevice( name = 'TransistorBulkConnected' + , spice = spiceDir+'TransistorBulkConnected.spi' + , connectors = ( 'D', 'G', 'S' ) + , layouts = ( ('Rotate transistor', 'Transistor_rotate.py') + , ('Common transistor', 'Transistor_common.py') + , ('WIP Transistor' , 'WIP_Transistor.py' ) + ) + ) +addDevice( name = 'TransistorBulkUnconnected' + , spice = spiceDir+'TransistorBulkUnconnected.spi' + , connectors = ( 'D', 'G', 'S', 'B' ) + , layouts = ( ('Rotate transistor', 'Transistor_rotate.py') + , ('Common transistor', 'Transistor_common.py') + , ('WIP Transistor' , 'WIP_Transistor.py' ) + ) + ) +addDevice( name = 'CrossCoupledPairBulkConnected' + , spice = spiceDir+'CCPairBulkConnected.spi' + , connectors = ( 'D1', 'D2', 'S' ) + , layouts = ( ('Horizontal M2' , 'CCP_horizontalM2.py' ) + , ('Symmetrical' , 'CCP_symmetrical.py' ) + , ('Common centroid', 'CCP_2DCommonCentroid.py') + , ('Interdigitated' , 'CCP_interdigitated.py' ) + ) + ) +addDevice( name = 'CrossCoupledPairBulkUnconnected' + , spice = spiceDir+'CCPairBulkUnconnected.spi' + , connectors = ( 'D1', 'D2', 'S', 'B' ) + , layouts = ( ('Horizontal M2' , 'CCP_horizontalM2.py' ) + , ('Symmetrical' , 'CCP_symmetrical.py' ) + , ('Common centroid', 'CCP_2DCommonCentroid.py') + , ('Interdigitated' , 'CCP_interdigitated.py' ) + ) + ) +addDevice( name = 'CommonSourcePairBulkConnected' + , spice = spiceDir+'CommonSourcePairBulkConnected.spi' + , connectors = ( 'D1', 'D2', 'S', 'G' ) + , layouts = ( ('Horizontal M2' , 'CSP_horizontalM2.py' ) + , ('Symmetrical' , 'CSP_symmetrical.py' ) + , ('Interdigitated' , 'CSP_interdigitated.py' ) + , ('WIP CSP' , 'WIP_CSP.py' ) + ) + ) +addDevice( name = 'CommonSourcePairBulkUnconnected' + , spice = spiceDir+'CommonSourcePairBulkUnconnected.spi' + , connectors = ( 'D1', 'D2', 'S', 'G', 'B' ) + , layouts = ( ('Horizontal M2' , 'CSP_horizontalM2.py' ) + , ('Symmetrical' , 'CSP_symmetrical.py' ) + , ('Interdigitated' , 'CSP_interdigitated.py' ) + , ('WIP CSP' , 'WIP_CSP.py' ) + ) + ) +addDevice( name = 'SimpleCurrentMirrorBulkConnected' + , spice = spiceDir+'CurrMirBulkConnected.spi' + , connectors = ( 'D1', 'D2', 'S' ) + , layouts = ( ('Horizontal M2' , 'SCM_horizontalM2.py' ) + , ('Symmetrical' , 'SCM_symmetrical.py' ) + , ('Common centroid', 'SCM_2DCommonCentroid.py') + , ('Interdigitated' , 'SCM_interdigitated.py' ) + ) + ) +addDevice( name = 'SimpleCurrentMirrorBulkUnconnected' + , spice = spiceDir+'CurrMirBulkUnconnected.spi' + , connectors = ( 'D1', 'D2', 'S', 'B' ) + , layouts = ( ('Horizontal M2' , 'SCM_horizontalM2.py' ) + , ('Symmetrical' , 'SCM_symmetrical.py' ) + , ('Common centroid', 'SCM_2DCommonCentroid.py') + , ('Interdigitated' , 'SCM_interdigitated.py' ) + ) + ) +addDevice( name = 'MultiCapacitor' + #, spice = spiceDir+'MIM_OneCapacitor.spi' + #, connectors = ( 'T1', 'B1' ) + , layouts = ( ('Matrix', 'CapacitorMatrix.py' ), + ) + ) +addDevice( name = 'Resistor' + #, spice = spiceDir+'MIM_OneCapacitor.spi' + , connectors = ( 'PIN1', 'PIN2' ) + , layouts = ( ('Snake', 'ResistorSnake.py' ), + ) + ) + diff --git a/crlcore/etc/node600/phenitec/display.py b/crlcore/etc/node600/phenitec/display.py new file mode 100644 index 00000000..d1ebabe0 --- /dev/null +++ b/crlcore/etc/node600/phenitec/display.py @@ -0,0 +1,22 @@ + +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2019-2019, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | Alliance / Hurricane Interface | +# | | +# | Author : Jean-Paul CHAPUT | +# | E-mail : Jean-Paul.Chaput@lip6.fr | +# | =============================================================== | +# | Python : "./etc/node600/phenitec/display.py" | +# +-----------------------------------------------------------------+ + + +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + +import common.display + + +common.display.createStyles( scale=0.5 ) diff --git a/crlcore/etc/node600/phenitec/etesian.py b/crlcore/etc/node600/phenitec/etesian.py new file mode 100644 index 00000000..291ada86 --- /dev/null +++ b/crlcore/etc/node600/phenitec/etesian.py @@ -0,0 +1,19 @@ + +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2019-2019, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | Alliance / Hurricane Interface | +# | | +# | Author : Jean-Paul CHAPUT | +# | E-mail : Jean-Paul.Chaput@lip6.fr | +# | =============================================================== | +# | Python : "./etc/node600/phenitec/etesian.py" | +# +-----------------------------------------------------------------+ + + +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + +import common.etesian diff --git a/crlcore/etc/node600/phenitec/kite.py b/crlcore/etc/node600/phenitec/kite.py new file mode 100644 index 00000000..66f1da0b --- /dev/null +++ b/crlcore/etc/node600/phenitec/kite.py @@ -0,0 +1,230 @@ + +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2019-2019, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | Alliance / Hurricane Interface | +# | | +# | Author : Jean-Paul CHAPUT | +# | E-mail : Jean-Paul.Chaput@lip6.fr | +# | =============================================================== | +# | Python : "./etc/node600/phenitec/kite.py" | +# +-----------------------------------------------------------------+ + + +import Cfg +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + +from Hurricane import DataBase +from CRL import AllianceFramework +from CRL import RoutingGauge +from CRL import RoutingLayerGauge +from CRL import CellGauge +from helpers import l, n, u +import common.kite + + +p = Cfg.getParamDouble ( 'lefImport.minTerminalWidth' ).setDouble ( 0.0 ) +p = Cfg.getParamString ( 'katabatic.routingGauge' ).setString ( 'nsxlib-3M' ) +p = Cfg.getParamInt ( "katabatic.globalLengthThreshold" ).setInt ( 1450 ) +p = Cfg.getParamPercentage( "katabatic.saturateRatio" ).setPercentage( 80 ) +p = Cfg.getParamInt ( "katabatic.saturateRp" ).setInt ( 8 ) +p = Cfg.getParamString ( 'katabatic.topRoutingLayer' ).setString ( 'METAL3' ) + + # Kite parameters. +p = Cfg.getParamInt( "kite.hTracksReservedLocal" ); p.setInt( 4 ); p.setMin( 0 ); p.setMax( 18 ) +p = Cfg.getParamInt( "kite.vTracksReservedLocal" ); p.setInt( 3 ); p.setMin( 0 ); p.setMax( 18 ) +p = Cfg.getParamInt( "kite.eventsLimit" ); p.setInt( 4000002 ) +p = Cfg.getParamInt( "kite.ripupCost" ); p.setInt( 3 ); p.setMin( 0 ) +p = Cfg.getParamInt( "kite.strapRipupLimit" ); p.setInt( 16 ); p.setMin( 1 ) +p = Cfg.getParamInt( "kite.localRipupLimit" ); p.setInt( 9 ); p.setMin( 1 ) +p = Cfg.getParamInt( "kite.globalRipupLimit" ); p.setInt( 5 ); p.setMin( 1 ) +p = Cfg.getParamInt( "kite.longGlobalRipupLimit" ); p.setInt( 5 ); p.setMin( 1 ) + +# Anabatic & Katana parameters are temporarily hosted here. +p = Cfg.getParamString ( 'anabatic.routingGauge' ); p.setString ( 'nsxlib-3M' ) +p = Cfg.getParamInt ( "anabatic.globalLengthThreshold" ); p.setInt ( 1450 ) +p = Cfg.getParamPercentage( "anabatic.saturateRatio" ); p.setPercentage( 80 ) +p = Cfg.getParamInt ( "anabatic.saturateRp" ); p.setInt ( 8 ) +p = Cfg.getParamString ( 'anabatic.topRoutingLayer' ); p.setString ( 'METAL3' ) +p = Cfg.getParamInt ( "anabatic.edgeLength" ); p.setInt ( 48 ) +p = Cfg.getParamInt ( "anabatic.edgeWidth" ); p.setInt ( 8 ) +p = Cfg.getParamDouble ( "anabatic.edgeCostH" ); p.setDouble ( 19.0 ) +p = Cfg.getParamDouble ( "anabatic.edgeCostK" ); p.setDouble ( -60.0 ) +p = Cfg.getParamDouble ( "anabatic.edgeHInc" ); p.setDouble ( 1.0 ) +p = Cfg.getParamDouble ( "anabatic.edgeHScaling" ); p.setDouble ( 1.0 ) +p = Cfg.getParamInt ( "anabatic.globalIterations" ); p.setInt ( 20 ); p.setMin(1); p.setMax(100) +p = Cfg.getParamEnumerate ( "anabatic.gcell.displayMode" ); p.setInt ( 1 ) +p.addValue( "Boundary", 1 ) +p.addValue( "Density" , 2 ) + +p = Cfg.getParamInt ( "katana.hTracksReservedLocal" ); p.setInt ( 5 ); p.setMin(0); p.setMax(20) +p = Cfg.getParamInt ( "katana.vTracksReservedLocal" ); p.setInt ( 3 ); p.setMin(0); p.setMax(20) +p = Cfg.getParamInt ( "katana.termSatReservedLocal" ); p.setInt ( 5 ) +p = Cfg.getParamInt ( "katana.termSatThreshold" ); p.setInt ( 11 ) +p = Cfg.getParamInt ( "katana.eventsLimit" ); p.setInt ( 4000002 ) +p = Cfg.getParamInt ( "katana.ripupCost" ); p.setInt ( 3 ); p.setMin(0) +p = Cfg.getParamInt ( "katana.strapRipupLimit" ); p.setInt ( 16 ); p.setMin(1) +p = Cfg.getParamInt ( "katana.localRipupLimit" ); p.setInt ( 9 ); p.setMin(1) +p = Cfg.getParamInt ( "katana.globalRipupLimit" ); p.setInt ( 5 ); p.setMin(1) +p = Cfg.getParamInt ( "katana.longGlobalRipupLimit" ); p.setInt ( 5 ); p.setMin(1) +p = Cfg.getParamString( 'chip.padCoreSide' ); p.setString( 'South' ) + + +tech = DataBase.getDB().getTechnology() +af = AllianceFramework.get() +rg = RoutingGauge.create( 'nsxlib-4M' ) + +rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL1') # metal. + , RoutingLayerGauge.Vertical # preferred routing direction. + , RoutingLayerGauge.PinOnly # layer usage. + , 0 # depth. + , 0.0 # density (deprecated). + , l(0) # track offset from AB. + , l(10) # track pitch. + , l(3) # wire width. + , l(2) # VIA side (that is VIA12). + , l(7) # obstacle dW. + ) ) + +rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL2') # metal. + , RoutingLayerGauge.Horizontal # preferred routing direction. + , RoutingLayerGauge.Default # layer usage. + , 1 # depth. + , 0.0 # density (deprecated). + , l(0) # track offset from AB. + , l(10) # track pitch. + , l(3) # wire width. + , l(2) # VIA side (that is VIA23). + , l(8) # obstacle dW. + ) ) + +rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL3') # metal. + , RoutingLayerGauge.Vertical # preferred routing direction. + , RoutingLayerGauge.Default # layer usage. + , 2 # depth. + , 0.0 # density (deprecated). + , l(0) # track offset from AB. + , l(10) # track pitch. + , l(3) # wire width. + , l(2) # VIA side (that is VIA34). + , l(8) # obstacle dW. + ) ) + +rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL4') # metal. + , RoutingLayerGauge.Horizontal # preferred routing direction. + , RoutingLayerGauge.Default # layer usage. + , 3 # depth. + , 0.0 # density (deprecated). + , l(0) # track offset from AB. + , l(15) # track pitch. + , l(6) # wire width. + , l(4) # VIA side (that is VIA23). + , l(8) # obstacle dW. + ) ) + +af.addRoutingGauge( rg ) + +rg = RoutingGauge.create( 'nsxlib-3M' ) + +rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL1') # metal. + , RoutingLayerGauge.Vertical # preferred routing direction. + , RoutingLayerGauge.PinOnly # layer usage. + , 0 # depth. + , 0.0 # density (deprecated). + , l(0) # track offset from AB. + , l(10) # track pitch. + , l(3) # wire width. + , l(2) # VIA side (that is VIA12). + , l(7) # obstacle dW. + ) ) + +rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL2') # metal. + , RoutingLayerGauge.Horizontal # preferred routing direction. + , RoutingLayerGauge.Default # layer usage. + , 1 # depth. + , 0.0 # density (deprecated). + , l(0) # track offset from AB. + , l(10) # track pitch. + , l(3) # wire width. + , l(2) # VIA side (that is VIA23). + , l(8) # obstacle dW. + ) ) + +rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL3') # metal. + , RoutingLayerGauge.Vertical # preferred routing direction. + , RoutingLayerGauge.Default # layer usage. + , 2 # depth. + , 0.0 # density (deprecated). + , l(0) # track offset from AB. + , l(10) # track pitch. + , l(3) # wire width. + , l(2) # VIA side (that is VIA34). + , l(8) # obstacle dW. + ) ) + +af.addRoutingGauge( rg ) + +rg = RoutingGauge.create( 'nsxlib-2M' ) + +rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL1') # metal. + , RoutingLayerGauge.Horizontal # preferred routing direction. + , RoutingLayerGauge.Default # layer usage. + , 0 # depth. + , 0.0 # density (deprecated). + , l(0) # track offset from AB. + , l(10) # track pitch. + , l(3) # wire width. + , l(3) # VIA side (that is VIA12). + , l(7) # obstacle dW. + ) ) + +rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL2') # metal. + , RoutingLayerGauge.Vertical # preferred routing direction. + , RoutingLayerGauge.Default # layer usage. + , 1 # depth. + , 0.0 # density (deprecated). + , l(0) # track offset from AB. + , l(10) # track pitch. + , l(3) # wire width. + , l(3) # VIA side (that is VIA23). + , l(8) # obstacle dW. + ) ) + +af.addRoutingGauge( rg ) + +af.setRoutingGauge( 'nsxlib-3M' ) + +# Gauge for standard cells. +cg = CellGauge.create( 'nsxlib-4M' + , 'metal2' # pin layer name. + , l( 10.0) # pitch. + , l(100.0) # cell slice height. + , l( 10.0) # cell slice step. + ) +af.addCellGauge( cg ) +cg = CellGauge.create( 'nsxlib-3M' + , 'metal2' # pin layer name. + , l( 10.0) # pitch. + , l(100.0) # cell slice height. + , l( 10.0) # cell slice step. + ) +af.addCellGauge( cg ) +cg = CellGauge.create( 'nsxlib-2M' + , 'metal2' # pin layer name. + , l( 10.0) # pitch. + , l(100.0) # cell slice height. + , l( 10.0) # cell slice step. + ) +af.addCellGauge( cg ) + +# Gauge for Alliance symbolic I/O pads. +cg = CellGauge.create( 'phlib80' + , 'metal2' # pin layer name. + , l( 10.0) # pitch. + , l(312.0) # cell slice height. + , l(246.0) # cell slice step. + ) +af.addCellGauge( cg ) diff --git a/crlcore/etc/node600/phenitec/misc.py b/crlcore/etc/node600/phenitec/misc.py new file mode 100644 index 00000000..160f5537 --- /dev/null +++ b/crlcore/etc/node600/phenitec/misc.py @@ -0,0 +1,19 @@ + +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2019-2019, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | Alliance / Hurricane Interface | +# | | +# | Author : Jean-Paul CHAPUT | +# | E-mail : Jean-Paul.Chaput@lip6.fr | +# | =============================================================== | +# | Python : "./etc/node600/phenitec/misc.py" | +# +-----------------------------------------------------------------+ + + +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + +import common.misc diff --git a/crlcore/etc/node600/phenitec/patterns.py b/crlcore/etc/node600/phenitec/patterns.py new file mode 100644 index 00000000..2a0006a5 --- /dev/null +++ b/crlcore/etc/node600/phenitec/patterns.py @@ -0,0 +1,19 @@ + +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2019-2019, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | Alliance / Hurricane Interface | +# | | +# | Author : Jean-Paul CHAPUT | +# | E-mail : Jean-Paul.Chaput@lip6.fr | +# | =============================================================== | +# | Python : "./etc/node600/phenitec/patterns.py" | +# +-----------------------------------------------------------------+ + + +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + +import common.patterns diff --git a/crlcore/etc/node600/phenitec/plugins.py b/crlcore/etc/node600/phenitec/plugins.py new file mode 100644 index 00000000..a494a988 --- /dev/null +++ b/crlcore/etc/node600/phenitec/plugins.py @@ -0,0 +1,29 @@ + +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2019-2019, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | Alliance / Hurricane Interface | +# | | +# | Author : Jean-Paul CHAPUT | +# | E-mail : Jean-Paul.Chaput@lip6.fr | +# | =============================================================== | +# | Python : "./etc/node600/phenitec/plugins.py" | +# +-----------------------------------------------------------------+ + + +import Cfg +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + +from helpers import l, u, n + +Cfg.getParamInt ( "chip.block.rails.count" ).setInt ( 5 ) +Cfg.getParamInt ( "chip.block.rails.hWidth" ).setInt ( l( 24) ) +Cfg.getParamInt ( "chip.block.rails.vWidth" ).setInt ( l( 24) ) +Cfg.getParamInt ( "chip.block.rails.hSpacing" ).setInt ( l( 12) ) +Cfg.getParamInt ( "chip.block.rails.vSpacing" ).setInt ( l( 12) ) +Cfg.getParamInt ( 'clockTree.minimumSide' ).setInt ( l(1200) ) +Cfg.getParamString( 'clockTree.buffer' ).setString( 'buf_x2') +Cfg.getParamString( 'clockTree.placerEngine' ).setString( 'Etesian') diff --git a/crlcore/etc/node600/phenitec/stratus1.py b/crlcore/etc/node600/phenitec/stratus1.py new file mode 100644 index 00000000..51f37e37 --- /dev/null +++ b/crlcore/etc/node600/phenitec/stratus1.py @@ -0,0 +1,24 @@ + +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2019-2019, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | Alliance / Hurricane Interface | +# | | +# | Author : Jean-Paul CHAPUT | +# | E-mail : Jean-Paul.Chaput@lip6.fr | +# | =============================================================== | +# | Python : "./etc/node600/phenitec/stratus1.py" | +# +-----------------------------------------------------------------+ + + +import Cfg +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + +import common.stratus1 + + +Cfg.getParamString( "stratus1.format" ).setString( "vst" ) +Cfg.getParamString( "stratus1.simulator" ).setString( "asimut" ) diff --git a/crlcore/etc/node600/phenitec/technology.py b/crlcore/etc/node600/phenitec/technology.py new file mode 100644 index 00000000..fc40f049 --- /dev/null +++ b/crlcore/etc/node600/phenitec/technology.py @@ -0,0 +1,183 @@ + +# This file is part of the Coriolis Software. +# Copyright (c) UPMC 2019-2019, All Rights Reserved +# +# +-----------------------------------------------------------------+ +# | C O R I O L I S | +# | Alliance / Hurricane Interface | +# | | +# | Author : Jean-Paul CHAPUT | +# | E-mail : Jean-Paul.Chaput@lip6.fr | +# | =============================================================== | +# | Python : "./etc/node600/phenitec/technology.py" | +# +-----------------------------------------------------------------+ + + +import helpers.io +helpers.io.vprint( 2, ' - "%s".' % helpers.truncPath(__file__) ) + +from helpers import l, u, n +from Hurricane import DbU +from Hurricane import DataBase +from Hurricane import Technology + + +tech = DataBase.getDB().getTechnology() +if tech: + print WarningMessage( 'cmos.technology: Technology already exists, "%s"' % tech.getName() ) +else: + tech = Technology.create( DataBase.getDB(), 'phenitec06' ) + +DbU.setPrecision ( 2 ) +DbU.setPhysicalsPerGrid ( 0.002, DbU.UnitPowerMicro ) +DbU.setGridsPerLambda ( 150 ) +DbU.setSymbolicSnapGridStep( DbU.fromLambda( 1.0) ) +DbU.setPolygonStep ( DbU.fromGrid ( 150.0) ) + + +import common +from common.technology import * + +# Redefine all size from the "cmos" common part. +NWELL.setExtentionCap( nWell, l(4.0) ) +PWELL.setExtentionCap( pWell, l(4.0) ) + +NTIE.setMinimalSize ( l( 3.0) ) +NTIE.setExtentionCap ( nWell , l( 3.0) ) +NTIE.setExtentionWidth( nWell , l( 2.0) ) +NTIE.setExtentionCap ( nImplant, l( 2.5) ) +NTIE.setExtentionWidth( nImplant, l( 1.5) ) +NTIE.setExtentionCap ( active , l( 0.5) ) +NTIE.setExtentionWidth( active , l(-0.5) ) + +PTIE.setMinimalSize ( l( 3.0) ) +PTIE.setExtentionCap ( nWell , l( 3.0) ) +PTIE.setExtentionWidth( nWell , l( 2.0) ) +PTIE.setExtentionCap ( nImplant, l( 2.5) ) +PTIE.setExtentionWidth( nImplant, l( 1.5) ) +PTIE.setExtentionCap ( active , l( 0.5) ) +PTIE.setExtentionWidth( active , l(-0.5) ) + +NDIF.setMinimalSize ( l(3.0) ) +NDIF.setExtentionCap ( nImplant, l(4.0) ) +NDIF.setExtentionWidth( nImplant, l(2.0) ) +NDIF.setExtentionCap ( active , l(2.0) ) +NDIF.setExtentionWidth( active , l(0.0) ) + +PDIF.setMinimalSize ( l(3.0) ) +PDIF.setExtentionCap ( pImplant, l(4.0) ) +PDIF.setExtentionWidth( pImplant, l(2.0) ) +PDIF.setExtentionCap ( active , l(2.0) ) +PDIF.setExtentionWidth( active , l(0.0) ) + +GATE.setMinimalSize ( l(2.0) ) +GATE.setExtentionCap ( poly , l(2.5) ) + +NTRANS.setMinimalSize ( l( 2.0) ) +NTRANS.setExtentionCap ( nImplant, l( 2.0) ) +NTRANS.setExtentionWidth( nImplant, l( 7.0) ) +NTRANS.setExtentionCap ( active , l( 0.0) ) +NTRANS.setExtentionWidth( active , l( 3.0) ) +NTRANS.setExtentionCap ( poly , l( 3.0) ) +NTRANS.setExtentionWidth( poly , l( 0.0) ) + +PTRANS.setMinimalSize ( l( 2.0) ) +PTRANS.setExtentionCap ( nWell , l( 2.5) ) +PTRANS.setExtentionWidth( nWell , l( 7.5) ) +PTRANS.setExtentionCap ( pImplant, l( 2.0) ) +PTRANS.setExtentionWidth( pImplant, l( 7.0) ) +PTRANS.setExtentionCap ( active , l( 0.0) ) +PTRANS.setExtentionWidth( active , l( 3.0) ) +PTRANS.setExtentionCap ( poly , l( 3.0) ) +PTRANS.setExtentionWidth( poly , l( 0.0) ) + +POLY .setMinimalSize ( l(2.0) ) +POLY .setExtentionCap ( poly , l(1.0) ) +POLY2.setMinimalSize ( l(2.0) ) +POLY2.setExtentionCap ( poly , l(1.0) ) + +# Routing Layers (symbolic). +METAL1 .setMinimalSize ( l( 2.0) ) +METAL1 .setExtentionCap ( metal1 , l( 2.0) ) +METAL1 .setExtentionWidth( metal1 , l( 1.0) ) +METAL1 .setMinimalSpacing( l( 6.0) ) +METAL2 .setMinimalSize ( l( 4.0) ) +METAL2 .setExtentionCap ( metal2 , l( 2.0) ) +METAL2 .setMinimalSpacing( l( 6.0) ) +METAL3 .setMinimalSize ( l( 4.0) ) +METAL3 .setExtentionCap ( metal3 , l( 2.0) ) +METAL3 .setMinimalSpacing( l( 6.0) ) +METAL4 .setMinimalSize ( l( 4.0) ) +METAL4 .setExtentionCap ( metal4 , l( 2.0) ) +METAL4 .setMinimalSpacing( l( 6.0) ) + +# Contacts (i.e. Active <--> Metal) (symbolic). +CONT_BODY_N.setMinimalSize( l( 2.0) ) +CONT_BODY_N.setEnclosure ( nWell , l( 4.0), Layer.EnclosureH|Layer.EnclosureV ) +CONT_BODY_N.setEnclosure ( nImplant, l( 3.5), Layer.EnclosureH|Layer.EnclosureV ) +CONT_BODY_N.setEnclosure ( active , l( 1.5), Layer.EnclosureH|Layer.EnclosureV ) +CONT_BODY_N.setEnclosure ( metal1 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV ) + +CONT_BODY_P.setMinimalSize( l( 2.0) ) +CONT_BODY_P.setEnclosure ( pWell , l( 4.0), Layer.EnclosureH|Layer.EnclosureV ) +CONT_BODY_P.setEnclosure ( pImplant, l( 3.5), Layer.EnclosureH|Layer.EnclosureV ) +CONT_BODY_P.setEnclosure ( active , l( 1.5), Layer.EnclosureH|Layer.EnclosureV ) +CONT_BODY_P.setEnclosure ( metal1 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV ) + +CONT_DIF_N.setMinimalSize( l( 2.0) ) +CONT_DIF_N.setEnclosure ( nImplant, l( 4.0), Layer.EnclosureH|Layer.EnclosureV ) +CONT_DIF_N.setEnclosure ( active , l( 2.0), Layer.EnclosureH|Layer.EnclosureV ) +CONT_DIF_N.setEnclosure ( metal1 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV ) + +CONT_DIF_P.setMinimalSize( l( 2.0) ) +CONT_DIF_P.setEnclosure ( pImplant, l( 4.0), Layer.EnclosureH|Layer.EnclosureV ) +CONT_DIF_P.setEnclosure ( active , l( 2.0), Layer.EnclosureH|Layer.EnclosureV ) +CONT_DIF_P.setEnclosure ( metal1 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV ) + +CONT_POLY.setMinimalSize( l( 2.0) ) +CONT_POLY.setEnclosure ( poly , l( 2.0), Layer.EnclosureH|Layer.EnclosureV ) +CONT_POLY.setEnclosure ( metal1 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV ) + +# VIAs (i.e. Metal <--> Metal) (symbolic). +VIA12 .setMinimalSize( l( 2.0) ) +VIA12 .setEnclosure ( metal1 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV ) +VIA12 .setEnclosure ( metal2 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV ) +VIA23 .setMinimalSize( l( 2.0) ) +VIA23 .setEnclosure ( metal2 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV ) +VIA23 .setEnclosure ( metal3 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV ) +VIA34 .setMinimalSize( l( 2.0) ) +VIA34 .setEnclosure ( metal3 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV ) +VIA34 .setEnclosure ( metal4 , l( 1.0), Layer.EnclosureH|Layer.EnclosureV ) + +# Blockages (symbolic). +BLOCKAGE1 .setMinimalSize ( l( 4.0) ) +BLOCKAGE1 .setExtentionCap ( blockage1 , l( 2.0) ) +BLOCKAGE1 .setExtentionWidth( blockage1 , l( 0.5) ) +BLOCKAGE2 .setMinimalSize ( l( 4.0) ) +BLOCKAGE2 .setExtentionCap ( blockage2 , l( 2.0) ) +BLOCKAGE3 .setMinimalSize ( l( 4.0) ) +BLOCKAGE3 .setExtentionCap ( blockage3 , l( 2.0) ) +BLOCKAGE4 .setMinimalSize ( l( 4.0) ) +BLOCKAGE4 .setExtentionCap ( blockage4 , l( 2.0) ) + + +gdsLayersTable = \ + [ ("pWell" , "CWN" , 41, 0) + , ("nWell" , "CWP" , 42, 0) + , ("active" , "CAA" , 43, 0) + , ("pImplant", "CSP" , 44, 0) + , ("nImplant", "CSN" , 45, 0) + , ("poly" , "CPG" , 46, 0) + , ("poly2" , "CM1" , 49, 0) # poly2 is in fact metal1. + , ("cut0" , "CCC" , 25, 0) + , ("metal1" , "CM1" , 49, 0) + , ("cut1" , "CV1" , 50, 0) + , ("metal2" , "CM2" , 51, 0) + , ("cut2" , "CV2" , 61, 0) + , ("metal3" , "CM3" , 62, 0) + , ("cut3" , "CV3" , 30, 0) + , ("metal4" , "CM4" , 31, 0) + ] + + +common.loadGdsLayers( gdsLayersTable ) diff --git a/crlcore/etc/symbolic/cmos45/kite.py b/crlcore/etc/symbolic/cmos45/kite.py index 81beda99..e9526b57 100644 --- a/crlcore/etc/symbolic/cmos45/kite.py +++ b/crlcore/etc/symbolic/cmos45/kite.py @@ -186,7 +186,7 @@ rg.addLayerGauge( RoutingLayerGauge.create( tech.getLayer('METAL3') # meta , 2 # depth. , 0.0 # density (deprecated). , l(0) # track offset from AB. - , l(10) # track pitch. + , l(8) # track pitch. , l(3) # wire width. , l(2) # VIA side (that is VIA12). , l(8) # obstacle dW. diff --git a/crlcore/etc/symbolic/phenitec06/alliance.conf b/crlcore/etc/symbolic/phenitec06/alliance.conf index b3fabad4..ef461b89 100644 --- a/crlcore/etc/symbolic/phenitec06/alliance.conf +++ b/crlcore/etc/symbolic/phenitec06/alliance.conf @@ -20,7 +20,7 @@ allianceConfig = \ ( ( 'CATALOG' , 'CATAL') , ( 'WORKING_LIBRARY' , '.') , ( 'SYSTEM_LIBRARY' , ( (cellsTop+'/nsxlib' , Environment.Append) - , (cellsTop+'/mpxlib' , Environment.Append)) ) + , (cellsTop+'/phlib80' , Environment.Append)) ) , ( 'SCALE_X' , 100) , ( 'IN_LO' , 'vst') , ( 'IN_PH' , 'ap') @@ -33,7 +33,7 @@ allianceConfig = \ , ( 'PAD' , '.*_sp$') # The following are only read by the Alliance tool wrappers. , ( 'ALLIANCE_TOP' , allianceTop) - , ( 'MBK_TARGET_LIB' , cellsTop+'/msxlib') + , ( 'MBK_TARGET_LIB' , cellsTop+'/nsxlib') , ( 'RDS_TECHNO_NAME' , allianceTop+'/etc/scn6m_deep_09.rds') , ( 'GRAAL_TECHNO_NAME' , allianceTop+'/etc/graal.rds') ) diff --git a/crlcore/python/helpers/__init__.py b/crlcore/python/helpers/__init__.py index 6f404162..d9e170bc 100644 --- a/crlcore/python/helpers/__init__.py +++ b/crlcore/python/helpers/__init__.py @@ -24,6 +24,8 @@ import os.path import re import traceback import Hurricane +import Viewer +import CRL import helpers.io quiet = False @@ -33,6 +35,7 @@ ndaDir = None techno = 'symbolic/cmos' technoDir = None moduleGlobals = globals() +confModules = [ ] def stype ( o ): return str(type(o)).split("'")[1] @@ -393,16 +396,60 @@ def netDirectionToStr ( netDir ): setSysConfDir( False ) +def unloadUserSettings (): + print ' o Unloading Python user\'s modules.' + + global confModules + for moduleName in confModules: + refcount = sys.getrefcount( sys.modules[moduleName] ) + warning = '' + if refcount > 3: + warning = '(NOTE: More than 3 refcount %d)' % refcount + #print helpers.io.WarningMessage( [ 'Configuration module "%s" has more than 3 references (%d)".' \ + # % (moduleName,refcount) + # , 'May be unable to unload it from the Python process.' + # ] ) + print ' - %-34s %-35s' % ('"%s".'%moduleName, warning) + del sys.modules[ moduleName ] + confModules = [] + return + + def loadUserSettings (): + global confModules + + rvalue = False + beforeModules = set() + for moduleName in sys.modules.keys(): beforeModules.add( moduleName ) + if os.path.isfile('./coriolis2/settings.py'): if os.path.isfile('./coriolis2/__init__.py'): sys.path.insert( 0, os.getcwd() ) import coriolis2.settings - return True + rvalue = True else: print helpers.io.WarningMessage( [ 'User\'s settings directory "%s" exists, but do not contains "__init__.py".' % './coriolis2/' , '(path:"%s")' % os.path.abspath(os.getcwd()) ] ) + else: + import symbolic.cmos - import symbolic.cmos - return False + confModules = set() + for moduleName in sys.modules.keys(): + if not (moduleName in beforeModules): + confModules.add( moduleName ) + + #print 'Configuration modules:' + #for moduleName in confModules: + # print '-', moduleName + + return rvalue + + +def resetCoriolis (): + print ' o Full reset of Coriolis/Hurricane databases.' + CRL.AllianceFramework.get().destroy() + Viewer.Graphics.get().clear() + Hurricane.DataBase.getDB().destroy() + unloadUserSettings() + return diff --git a/crlcore/python/helpers/io.py b/crlcore/python/helpers/io.py index c87b566e..f21f72ca 100644 --- a/crlcore/python/helpers/io.py +++ b/crlcore/python/helpers/io.py @@ -121,8 +121,10 @@ class ErrorWidget ( QDialog ): vLayout.addStretch( 1 ) vLayout.addLayout ( buttonLayout ) + pixmapWidth = 150 + if not Viewer.Graphics.isHighDpi(): pixmapWidth = 70 pixmap = QPixmap( ':/images/angry-birds-red.png' ) - pixmap = pixmap.scaledToWidth( 150 ) + pixmap = pixmap.scaledToWidth( pixmapWidth ) icon = QLabel() icon.setPixmap( pixmap ) diff --git a/crlcore/src/ccore/AllianceFramework.cpp b/crlcore/src/ccore/AllianceFramework.cpp index 0dda5683..cef54ead 100644 --- a/crlcore/src/ccore/AllianceFramework.cpp +++ b/crlcore/src/ccore/AllianceFramework.cpp @@ -189,6 +189,7 @@ namespace CRL { , _parsers () , _drivers () , _catalog () + , _libraries () , _parentLibrary (NULL) , _routingGauges () , _defaultRoutingGauge(NULL) @@ -203,9 +204,6 @@ namespace CRL { _parentLibrary = rootLibrary->getLibrary( _parentLibraryName ); if (not _parentLibrary ) _parentLibrary = Library::create( rootLibrary, _parentLibraryName ); - - db->put( AllianceFrameworkProperty::create(this) ); - db->_setCellLoader( bind(&AllianceFramework::cellLoader,this,_1) ); } @@ -249,7 +247,8 @@ namespace CRL { if (not _singleton) { // Triggers System singleton creation. System::get(); - _singleton = new AllianceFramework (); + AllianceFramework* af = new AllianceFramework (); + af->_postCreate(); //if (not (flags & NoPythonInit)) // System::runPythonInit(); //_singleton->bindLibraries(); @@ -263,9 +262,21 @@ namespace CRL { { return create(); } - void AllianceFramework::destroy () + void AllianceFramework::_postCreate () { - delete this; + Super::_postCreate(); + _singleton = this; + + DataBase* db = DataBase::getDB(); + db->put( AllianceFrameworkProperty::create(this) ); + db->_setCellLoader( bind(&AllianceFramework::cellLoader,this,_1) ); + } + + + void AllianceFramework::_preDestroy () + { + Super::_preDestroy(); + _singleton = NULL; } @@ -336,62 +347,68 @@ namespace CRL { Cell* AllianceFramework::getCell ( const string& name, unsigned int mode, unsigned int depth ) { bool createCell = false; - Catalog::State* state = _catalog.getState ( name ); + Catalog::State* state = _catalog.getState( name ); ParserFormatSlot* parser; - // The cell is not even in the Catalog : add an entry. - if ( state == NULL ) state = _catalog.getState ( name, true ); + if (not _libraries.empty()) { + // The cell is not even in the Catalog : add an entry. + if (state == NULL) state = _catalog.getState( name, true ); - if ( state->isFlattenLeaf() ) depth = 0; - state->setDepth ( depth ); + if (state->isFlattenLeaf()) depth = 0; + state->setDepth( depth ); - // Do not try to load. - if ( mode & Catalog::State::InMemory ) return state->getCell(); + // Do not try to load. + if (mode & Catalog::State::InMemory) return state->getCell(); - unsigned int loadMode; - for ( int i=0 ; i<2 ; i++ ) { - // Check is the view is requested for loading or already loaded. - switch ( i ) { - case 0: loadMode = mode & Catalog::State::Logical; break; - case 1: loadMode = mode & Catalog::State::Physical; break; - } - if ( loadMode == 0 ) continue; - if ( state->getFlags(loadMode) != 0 ) continue; + unsigned int loadMode; + for ( int i=0 ; i<2 ; i++ ) { + // Check is the view is requested for loading or already loaded. + switch ( i ) { + case 0: loadMode = mode & Catalog::State::Logical; break; + case 1: loadMode = mode & Catalog::State::Physical; break; + } + if (loadMode == 0) continue; + if (state->getFlags(loadMode) != 0) continue; - // Transmit all flags except thoses related to views. - loadMode |= (mode & (!Catalog::State::Views)); - parser = & ( _parsers.getParserSlot ( name, loadMode, _environment ) ); + // Transmit all flags except thoses related to views. + loadMode |= (mode & (!Catalog::State::Views)); + parser = & (_parsers.getParserSlot( name, loadMode, _environment )); - // Try to open cell file (file extention is supplied by the parser). - if ( !_readLocate(name,loadMode) ) continue; + // Try to open cell file (file extention is supplied by the parser). + if (not _readLocate(name,loadMode)) continue; - if ( state->getCell() == NULL ) { - state->setCell ( Cell::create ( _libraries[ _environment.getLIBRARIES().getIndex() ]->getLibrary() , name ) ); - state->getCell ()->put ( CatalogProperty::create(state) ); - state->getCell ()->setFlattenLeaf ( false ); - createCell = true; + if (state->getCell() == NULL) { + state->setCell ( Cell::create( _libraries[ _environment.getLIBRARIES().getIndex() ]->getLibrary() , name ) ); + state->getCell ()->put( CatalogProperty::create(state) ); + state->getCell ()->setFlattenLeaf( false ); + createCell = true; + } + + try { + // Call the parser function. + (parser->getParsCell())( _environment.getLIBRARIES().getSelected() , state->getCell() ); + } catch ( ... ) { + if (createCell) + //state->getCell()->destroy(); + throw; + } } - try { - // Call the parser function. - (parser->getParsCell())( _environment.getLIBRARIES().getSelected() , state->getCell() ); - } catch ( ... ) { - if ( createCell ) - //state->getCell()->destroy(); - throw; + // At least one view must have been loaded. + if (state->getFlags(Catalog::State::Views) != 0) { + state->setFlags( Catalog::State::InMemory, true ); + return state->getCell(); } + + // Delete the empty cell. + if (state->getCell()) state->getCell()->destroy(); + _catalog.deleteState( name ); + } else { + cerr << Warning( "AllianceFramework::getCell(): The library list is empty, while loading Cell \"%s\"." + , name.c_str() + ) << endl; } - // At least one view must have been loaded. - if ( state->getFlags(Catalog::State::Views) != 0 ) { - state->setFlags( Catalog::State::InMemory, true ); - return state->getCell(); - } - - // Delete the empty cell. - if ( state->getCell() ) state->getCell()->destroy (); - _catalog.deleteState ( name ); - // Last resort, search through all Hurricane libraries. if (mode & Catalog::State::Foreign) return DataBase::getDB()->getCell( name ); @@ -801,20 +818,20 @@ namespace CRL { } - string AllianceFramework::_getString () const - { return ""; } + string AllianceFramework::_getTypeName () const + { return "AllianceFramework"; } Record *AllianceFramework::_getRecord () const { - Record* record = new Record ( "" ); - record->add ( getSlot ( "_environment" , &_environment ) ); - record->add ( getSlot ( "_libraries" , &_libraries ) ); - record->add ( getSlot ( "_catalog" , &_catalog ) ); - record->add ( getSlot ( "_defaultRoutingGauge", _defaultRoutingGauge ) ); - record->add ( getSlot ( "_routingGauges" , &_routingGauges ) ); - record->add ( getSlot ( "_defaultCellGauge" , _defaultCellGauge ) ); - record->add ( getSlot ( "_cellGauges" , &_cellGauges ) ); + Record* record = Super::_getRecord(); + record->add( getSlot( "_environment" , &_environment ) ); + record->add( getSlot( "_libraries" , &_libraries ) ); + record->add( getSlot( "_catalog" , &_catalog ) ); + record->add( getSlot( "_defaultRoutingGauge", _defaultRoutingGauge ) ); + record->add( getSlot( "_routingGauges" , &_routingGauges ) ); + record->add( getSlot( "_defaultCellGauge" , _defaultCellGauge ) ); + record->add( getSlot( "_cellGauges" , &_cellGauges ) ); return record; } diff --git a/crlcore/src/ccore/AllianceLibrary.cpp b/crlcore/src/ccore/AllianceLibrary.cpp index 5bae869a..b9a453f0 100644 --- a/crlcore/src/ccore/AllianceLibrary.cpp +++ b/crlcore/src/ccore/AllianceLibrary.cpp @@ -70,6 +70,25 @@ namespace CRL { } + void AllianceLibrary::saveCells () const + { + cerr << "AllianceLibrary::saveCells() " << _path << " " << _library << endl; + AllianceFramework* af = AllianceFramework::get(); + for ( Cell* cell : _library->getCells() ) { + cerr << "Saving " << cell << endl; + af->saveCell( cell, Catalog::State::Physical ); + } + } + + + void AllianceLibrary::saveCATAL () const + { + Catalog* catalog = AllianceFramework::get()->getCatalog(); + string catalFile = getString(_path)+"/CATAL"; + catalog->saveToFile( catalFile, _library ); + } + + string AllianceLibrary::_getString () const { return ( "<" + _TName("AllianceLibrary") + " " + getString(_library->getName()) + ">" ); diff --git a/crlcore/src/ccore/Catalog.cpp b/crlcore/src/ccore/Catalog.cpp index 52014115..4421e4f2 100644 --- a/crlcore/src/ccore/Catalog.cpp +++ b/crlcore/src/ccore/Catalog.cpp @@ -14,7 +14,8 @@ // +-----------------------------------------------------------------+ -# include +#include +#include using namespace std; #include "hurricane/Initializer.h" @@ -295,11 +296,27 @@ namespace CRL { } + void Catalog::saveToFile ( const string& path, Library* library ) + { + ofstream of ( path, ios::out|ios::trunc ); + for ( auto entry : _states ) { + State* state = entry.second; + if (state->getLibrary() != library) continue; + + if (state->isFlattenLeaf()) of << setw(20) << left << entry.first << "C\n"; + if (state->isFeed() ) of << setw(20) << left << entry.first << "F\n"; + if (state->isGds() ) of << setw(20) << left << entry.first << "G\n"; + } + of.close(); + } + + string Catalog::_getPrint () const { map::const_iterator it; ostringstream s; + s << "Catalog contents:" << endl; for ( it=_states.begin() ; it!=_states.end() ; it++ ) { s << left << setw(30) << getString(it->first) << getString(it->second) << endl; } diff --git a/crlcore/src/ccore/ParsersDrivers.cpp b/crlcore/src/ccore/ParsersDrivers.cpp index 334851df..d69ecd56 100644 --- a/crlcore/src/ccore/ParsersDrivers.cpp +++ b/crlcore/src/ccore/ParsersDrivers.cpp @@ -91,7 +91,7 @@ namespace CRL { } - void ParserFormatSlot::registerCell ( const string& tag, CellParser_t* p, const string& ext ) + void ParserFormatSlot::registerCell ( string tag, CellParser_t* p, string ext ) { ParserSlot slot ( tag, ext, (void*)p ); ParserSlotIter it = _cells.begin(); @@ -106,7 +106,7 @@ namespace CRL { } - void ParserFormatSlot::registerLib ( const string& tag, LibraryParser_t* p, const string& ext ) + void ParserFormatSlot::registerLib ( string tag, LibraryParser_t* p, string ext ) { ParserSlot slot ( tag, ext, (void*)p ); ParserSlotIter it = _libs.begin(); @@ -123,7 +123,7 @@ namespace CRL { } - bool ParserFormatSlot::unRegisterCell ( const Name& ext ) + bool ParserFormatSlot::unRegisterCell ( string ext ) { ParserSlotIter it = _cells.begin(); @@ -140,7 +140,7 @@ namespace CRL { } - bool ParserFormatSlot::unRegisterLib ( const Name& ext ) + bool ParserFormatSlot::unRegisterLib ( string ext ) { ParserSlotIter it = _libs.begin(); @@ -163,7 +163,7 @@ namespace CRL { // Class : "ParsersMap" - ParsersMap::ParsersMap (): map() + ParsersMap::ParsersMap (): map() { // Register the Alliance default parsers. registerSlot ( "ap" , (CellParser_t*)apParser , "ap" ); @@ -177,12 +177,12 @@ namespace CRL { } - ParserFormatSlot& ParsersMap::getParserSlot ( const string& tag ) + ParserFormatSlot& ParsersMap::getParserSlot ( string tag ) { ParserFormatSlot* slot; iterator it; - if ( ( it = find(Name(tag)) ) != end() ) { + if ( ( it = find(tag) ) != end() ) { slot = & ( it->second ); } else { (*this)[tag] = ParserFormatSlot (); @@ -196,17 +196,17 @@ namespace CRL { } - ParserFormatSlot &ParsersMap::getParserSlot ( const string& name + ParserFormatSlot &ParsersMap::getParserSlot ( string name , unsigned int mode , const Environment& environment ) { // Look for the parser tag (i.e. file extention). - Name format; + string format; switch ( mode & (Catalog::State::Views) ) { case Catalog::State::Physical: format = environment.getIN_PH(); break; case Catalog::State::Logical: format = environment.getIN_LO(); break; default: - throw Error ( BadInputMode, "ParserMap::getParserSlot()", getString(name).c_str() ); + throw Error ( BadInputMode, "ParserMap::getParserSlot()", name.c_str() ); } iterator it = find ( format ); @@ -220,12 +220,12 @@ namespace CRL { } - DriverSlot &DriversMap::getDriverSlot ( const string& name + DriverSlot &DriversMap::getDriverSlot ( string name , unsigned int mode , const Environment& environment ) { // Look for the parser tag (i.e. file extention). - Name format; + string format; switch ( mode & (Catalog::State::Views) ) { case Catalog::State::Physical: format = environment.getOUT_PH(); break; case Catalog::State::Logical: format = environment.getOUT_LO(); break; @@ -244,7 +244,7 @@ namespace CRL { } - void ParsersMap::registerSlot ( const string& tag, CellParser_t* p, const string& ext ) + void ParsersMap::registerSlot ( string tag, CellParser_t* p, string ext ) { ParserFormatSlot& slot = getParserSlot ( tag ); @@ -252,7 +252,7 @@ namespace CRL { } - void ParsersMap::registerSlot ( const string& tag, LibraryParser_t* p, const string& ext ) + void ParsersMap::registerSlot ( string tag, LibraryParser_t* p, string ext ) { ParserFormatSlot& slot = getParserSlot ( tag ); @@ -260,7 +260,7 @@ namespace CRL { } - void ParsersMap::unRegisterSlot ( const Name& tag, const Name& ext, bool lib ) + void ParsersMap::unRegisterSlot ( string tag, string ext, bool lib ) { iterator it = find(tag); @@ -277,7 +277,7 @@ namespace CRL { // Class : "DriversMap" - DriversMap::DriversMap () : map() + DriversMap::DriversMap () : map() { // Register the Alliance default drivers. registerSlot ( "ap" , (CellDriver_t*)apDriver , "ap" ); @@ -288,13 +288,13 @@ namespace CRL { } - DriverSlot& DriversMap::getDriverSlot ( const string& tag ) + DriverSlot& DriversMap::getDriverSlot ( string tag ) { return (*this)[ tag ]; } - void DriversMap::registerSlot ( const string& tag, LibraryDriver_t* d, const string& ext ) + void DriversMap::registerSlot ( string tag, LibraryDriver_t* d, string ext ) { iterator it = find ( tag ); DriverSlot* p; @@ -310,7 +310,7 @@ namespace CRL { } - void DriversMap::registerSlot ( const string& tag, CellDriver_t* d, const string& ext ) + void DriversMap::registerSlot ( string tag, CellDriver_t* d, string ext ) { iterator it = find ( tag ); DriverSlot* p; @@ -326,7 +326,7 @@ namespace CRL { } - void DriversMap::unRegisterSlot ( const Name& tag ) + void DriversMap::unRegisterSlot ( string tag ) { iterator it = find ( tag ); diff --git a/crlcore/src/ccore/alliance/ap/ApParser.cpp b/crlcore/src/ccore/alliance/ap/ApParser.cpp index 535f8909..7475dbce 100644 --- a/crlcore/src/ccore/alliance/ap/ApParser.cpp +++ b/crlcore/src/ccore/alliance/ap/ApParser.cpp @@ -153,7 +153,7 @@ namespace { , DirectionLeft =DirectionHorizontal|DirectionDecrease , DirectionRight =DirectionHorizontal|DirectionIncrease }; - static LayerInformations _layerInformations; + LayerInformations _layerInformations; AllianceFramework* _framework; string _cellPath; Cell* _cell; @@ -165,7 +165,7 @@ namespace { protected: // Internal: Methods. - static LayerInformation* _getLayerInformation ( const Name& layerName ); + LayerInformation* _getLayerInformation ( const Name& layerName ); inline DbU::Unit _getUnit ( long value ); inline DbU::Unit _getUnit ( const char* value ); vector _splitString ( char* s, char separator ); @@ -187,9 +187,6 @@ namespace { }; - LayerInformations ApParser::_layerInformations; - - ApParser::ApParser ( AllianceFramework* framework ) : _framework (framework) , _cellPath () @@ -199,70 +196,68 @@ namespace { , _parserState(StateVersion) , _lineNumber (0) { - if ( _layerInformations.empty() ) { - _layerInformations.setTechnology ( DataBase::getDB()->getTechnology() ); + _layerInformations.setTechnology ( DataBase::getDB()->getTechnology() ); - _layerInformations.add ( "NWELL" , "NWELL" , false, false ); - _layerInformations.add ( "PWELL" , "PWELL" , false, false ); - _layerInformations.add ( "NTIE" , "NTIE" , false, false ); - _layerInformations.add ( "PTIE" , "PTIE" , false, false ); - _layerInformations.add ( "NDIF" , "NDIF" , false, false ); - _layerInformations.add ( "PDIF" , "PDIF" , false, false ); - _layerInformations.add ( "NTRANS" , "NTRANS" , false, false ); - _layerInformations.add ( "PTRANS" , "PTRANS" , false, false ); - _layerInformations.add ( "POLY" , "POLY" , false, false ); - _layerInformations.add ( "POLY2" , "POLY2" , false, false ); - - _layerInformations.add ( "ALU1" , "METAL1" , false, false ); - _layerInformations.add ( "ALU2" , "METAL2" , false, false ); - _layerInformations.add ( "ALU3" , "METAL3" , false, false ); - _layerInformations.add ( "ALU4" , "METAL4" , false, false ); - _layerInformations.add ( "ALU5" , "METAL5" , false, false ); - _layerInformations.add ( "ALU6" , "METAL6" , false, false ); - _layerInformations.add ( "ALU7" , "METAL7" , false, false ); - _layerInformations.add ( "ALU8" , "METAL8" , false, false ); + _layerInformations.add ( "NWELL" , "NWELL" , false, false ); + _layerInformations.add ( "PWELL" , "PWELL" , false, false ); + _layerInformations.add ( "NTIE" , "NTIE" , false, false ); + _layerInformations.add ( "PTIE" , "PTIE" , false, false ); + _layerInformations.add ( "NDIF" , "NDIF" , false, false ); + _layerInformations.add ( "PDIF" , "PDIF" , false, false ); + _layerInformations.add ( "NTRANS" , "NTRANS" , false, false ); + _layerInformations.add ( "PTRANS" , "PTRANS" , false, false ); + _layerInformations.add ( "POLY" , "POLY" , false, false ); + _layerInformations.add ( "POLY2" , "POLY2" , false, false ); + + _layerInformations.add ( "ALU1" , "METAL1" , false, false ); + _layerInformations.add ( "ALU2" , "METAL2" , false, false ); + _layerInformations.add ( "ALU3" , "METAL3" , false, false ); + _layerInformations.add ( "ALU4" , "METAL4" , false, false ); + _layerInformations.add ( "ALU5" , "METAL5" , false, false ); + _layerInformations.add ( "ALU6" , "METAL6" , false, false ); + _layerInformations.add ( "ALU7" , "METAL7" , false, false ); + _layerInformations.add ( "ALU8" , "METAL8" , false, false ); - _layerInformations.add ( "CALU1" , "METAL1" , true, false ); - _layerInformations.add ( "CALU2" , "METAL2" , true, false ); - _layerInformations.add ( "CALU3" , "METAL3" , true, false ); - _layerInformations.add ( "CALU4" , "METAL4" , true, false ); - _layerInformations.add ( "CALU5" , "METAL5" , true, false ); - _layerInformations.add ( "CALU6" , "METAL6" , true, false ); - _layerInformations.add ( "CALU7" , "METAL7" , true, false ); - _layerInformations.add ( "CALU8" , "METAL8" , true, false ); + _layerInformations.add ( "CALU1" , "METAL1" , true, false ); + _layerInformations.add ( "CALU2" , "METAL2" , true, false ); + _layerInformations.add ( "CALU3" , "METAL3" , true, false ); + _layerInformations.add ( "CALU4" , "METAL4" , true, false ); + _layerInformations.add ( "CALU5" , "METAL5" , true, false ); + _layerInformations.add ( "CALU6" , "METAL6" , true, false ); + _layerInformations.add ( "CALU7" , "METAL7" , true, false ); + _layerInformations.add ( "CALU8" , "METAL8" , true, false ); - _layerInformations.add ( "TALU1" , "BLOCKAGE1" , false, true ); - _layerInformations.add ( "TALU2" , "BLOCKAGE2" , false, true ); - _layerInformations.add ( "TALU3" , "BLOCKAGE3" , false, true ); - _layerInformations.add ( "TALU4" , "BLOCKAGE4" , false, true ); - _layerInformations.add ( "TALU5" , "BLOCKAGE5" , false, true ); - _layerInformations.add ( "TALU6" , "BLOCKAGE6" , false, true ); - _layerInformations.add ( "TALU7" , "BLOCKAGE7" , false, true ); - _layerInformations.add ( "TALU8" , "BLOCKAGE8" , false, true ); + _layerInformations.add ( "TALU1" , "BLOCKAGE1" , false, true ); + _layerInformations.add ( "TALU2" , "BLOCKAGE2" , false, true ); + _layerInformations.add ( "TALU3" , "BLOCKAGE3" , false, true ); + _layerInformations.add ( "TALU4" , "BLOCKAGE4" , false, true ); + _layerInformations.add ( "TALU5" , "BLOCKAGE5" , false, true ); + _layerInformations.add ( "TALU6" , "BLOCKAGE6" , false, true ); + _layerInformations.add ( "TALU7" , "BLOCKAGE7" , false, true ); + _layerInformations.add ( "TALU8" , "BLOCKAGE8" , false, true ); - _layerInformations.add ( "CONT_BODY_N", "CONT_BODY_N", false, false ); - _layerInformations.add ( "CONT_BODY_P", "CONT_BODY_P", false, false ); - _layerInformations.add ( "CONT_DIF_N" , "CONT_DIF_N" , false, false ); - _layerInformations.add ( "CONT_DIF_P" , "CONT_DIF_P" , false, false ); - _layerInformations.add ( "CONT_POLY" , "CONT_POLY" , false, false ); - _layerInformations.add ( "CONT_POLY2" , "CONT_POLY2" , false, false ); - _layerInformations.add ( "CONT_VIA" , "VIA12" , false, false ); - _layerInformations.add ( "CONT_VIA1" , "VIA12" , false, false ); - _layerInformations.add ( "CONT_VIA2" , "VIA23" , false, false ); - _layerInformations.add ( "CONT_VIA3" , "VIA34" , false, false ); - _layerInformations.add ( "CONT_VIA4" , "VIA45" , false, false ); - _layerInformations.add ( "CONT_VIA5" , "VIA56" , false, false ); - _layerInformations.add ( "CONT_VIA6" , "VIA67" , false, false ); - _layerInformations.add ( "CONT_VIA7" , "VIA78" , false, false ); - _layerInformations.add ( "CONT_TURN1" , "METAL1" , false, false ); - _layerInformations.add ( "CONT_TURN2" , "METAL2" , false, false ); - _layerInformations.add ( "CONT_TURN3" , "METAL3" , false, false ); - _layerInformations.add ( "CONT_TURN4" , "METAL4" , false, false ); - _layerInformations.add ( "CONT_TURN5" , "METAL5" , false, false ); - _layerInformations.add ( "CONT_TURN6" , "METAL6" , false, false ); - _layerInformations.add ( "CONT_TURN7" , "METAL7" , false, false ); - _layerInformations.add ( "CONT_TURN8" , "METAL8" , false, false ); - } + _layerInformations.add ( "CONT_BODY_N", "CONT_BODY_N", false, false ); + _layerInformations.add ( "CONT_BODY_P", "CONT_BODY_P", false, false ); + _layerInformations.add ( "CONT_DIF_N" , "CONT_DIF_N" , false, false ); + _layerInformations.add ( "CONT_DIF_P" , "CONT_DIF_P" , false, false ); + _layerInformations.add ( "CONT_POLY" , "CONT_POLY" , false, false ); + _layerInformations.add ( "CONT_POLY2" , "CONT_POLY2" , false, false ); + _layerInformations.add ( "CONT_VIA" , "VIA12" , false, false ); + _layerInformations.add ( "CONT_VIA1" , "VIA12" , false, false ); + _layerInformations.add ( "CONT_VIA2" , "VIA23" , false, false ); + _layerInformations.add ( "CONT_VIA3" , "VIA34" , false, false ); + _layerInformations.add ( "CONT_VIA4" , "VIA45" , false, false ); + _layerInformations.add ( "CONT_VIA5" , "VIA56" , false, false ); + _layerInformations.add ( "CONT_VIA6" , "VIA67" , false, false ); + _layerInformations.add ( "CONT_VIA7" , "VIA78" , false, false ); + _layerInformations.add ( "CONT_TURN1" , "METAL1" , false, false ); + _layerInformations.add ( "CONT_TURN2" , "METAL2" , false, false ); + _layerInformations.add ( "CONT_TURN3" , "METAL3" , false, false ); + _layerInformations.add ( "CONT_TURN4" , "METAL4" , false, false ); + _layerInformations.add ( "CONT_TURN5" , "METAL5" , false, false ); + _layerInformations.add ( "CONT_TURN6" , "METAL6" , false, false ); + _layerInformations.add ( "CONT_TURN7" , "METAL7" , false, false ); + _layerInformations.add ( "CONT_TURN8" , "METAL8" , false, false ); } diff --git a/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy b/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy index 2bf1f56d..d80ebb96 100644 --- a/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy +++ b/crlcore/src/ccore/alliance/vst/VstParserGrammar.yy @@ -1369,8 +1369,8 @@ void vstParser ( const string cellPath, Cell *cell ) static bool firstCall = true; if ( firstCall ) { firstCall = false; - Vst::framework = AllianceFramework::get (); } + Vst::framework = AllianceFramework::get (); Vst::states.push_back ( new Vst::YaccState(cellPath) ); diff --git a/crlcore/src/ccore/blif/BlifParser.cpp b/crlcore/src/ccore/blif/BlifParser.cpp index 77cee18b..2e34f20b 100644 --- a/crlcore/src/ccore/blif/BlifParser.cpp +++ b/crlcore/src/ccore/blif/BlifParser.cpp @@ -252,8 +252,8 @@ namespace { static bool _staticInit; static string _groundName; static string _powerName; - static Cell* _zero; - static Cell* _one; + static Cell* _zeroCell; + static Cell* _oneCell; static Net* _masterNetZero; static Net* _masterNetOne; public: @@ -270,6 +270,8 @@ namespace { Model ( Cell* ); inline ~Model (); inline Cell* getCell () const; + Net* newOne (); + Net* newZero (); inline size_t getDepth () const; inline const Subckts& getSubckts () const; Subckt* addSubckt ( string modelName ); @@ -278,9 +280,10 @@ namespace { Net* mergeNet ( string name, bool isExternal, unsigned int ); Net* mergeAlias ( string name1, string name2 ); private: - Cell* _cell; - Subckts _subckts; - size_t _depth; + Cell* _cell; + Subckts _subckts; + size_t _depth; + size_t _supplyCount; }; @@ -341,8 +344,8 @@ namespace { bool Model::_staticInit = false; string Model::_groundName = "vss"; string Model::_powerName = "vdd"; - Cell* Model::_zero = NULL; - Cell* Model::_one = NULL; + Cell* Model::_zeroCell = NULL; + Cell* Model::_oneCell = NULL; Net* Model::_masterNetZero = NULL; Net* Model::_masterNetOne = NULL; @@ -365,13 +368,13 @@ namespace { static string zeroName = Cfg::getParamString("etesian.cell.zero","zero_x0")->asString(); static string oneName = Cfg::getParamString("etesian.cell.one" , "one_x0")->asString(); - _zero = framework->getCell( zeroName, Catalog::State::Views|Catalog::State::Foreign ); - _one = framework->getCell( oneName, Catalog::State::Views|Catalog::State::Foreign ); + _zeroCell = framework->getCell( zeroName, Catalog::State::Views|Catalog::State::Foreign ); + _oneCell = framework->getCell( oneName, Catalog::State::Views|Catalog::State::Foreign ); _groundName = Cfg::getParamString("crlcore.groundName","vss")->asString(); _powerName = Cfg::getParamString("crlcore.powerName" ,"vdd")->asString(); - if (_zero) { - for ( Net* net : _zero->getNets() ) + if (_zeroCell) { + for ( Net* net : _zeroCell->getNets() ) if ( not net->isSupply () and not net->isAutomatic() and not net->isBlockage () ) { _masterNetZero = net; break; } @@ -379,8 +382,8 @@ namespace { cerr << Warning( "BlifParser::Model::connectSubckts(): The zero (tie high) cell \"%s\" has not been found." , zeroName.c_str() ) << endl; - if (_one) { - for ( Net* net : _one->getNets() ) + if (_oneCell) { + for ( Net* net : _oneCell->getNets() ) if ( not net->isSupply () and not net->isAutomatic() and not net->isBlockage () ) { _masterNetOne = net; break; } @@ -439,9 +442,10 @@ namespace { Model::Model ( Cell* cell ) - : _cell (cell) - , _subckts() - , _depth (0) + : _cell (cell) + , _subckts () + , _depth (0) + , _supplyCount (0) { if (not _staticInit) staticInit(); @@ -478,6 +482,34 @@ namespace { inline const Subckts& Model::getSubckts () const { return _subckts; } + Net* Model::newOne () + { + if (not _masterNetOne) return NULL; + + ostringstream name; name << "one_" << _supplyCount++; + Instance* oneInstance = Instance::create( _cell, name.str(), _oneCell ); + + Net* one = Net::create( _cell, name.str() ); + oneInstance->getPlug( _masterNetOne )->setNet( one ); + + return one; + } + + + Net* Model::newZero () + { + if (not _masterNetZero) return NULL; + + ostringstream name; name << "zero_" << _supplyCount++; + Instance* zeroInstance = Instance::create( _cell, name.str(), _zeroCell ); + + Net* zero = Net::create( _cell, name.str() ); + zeroInstance->getPlug( _masterNetZero )->setNet( zero ); + + return zero; + } + + Net* Model::mergeNet ( string name, bool isExternal, unsigned int direction ) { bool isClock = AllianceFramework::get()->isCLOCK( name ); @@ -488,6 +520,8 @@ namespace { net->setExternal ( isExternal ); net->setDirection( (Net::Direction::Code)direction ); if (isClock) net->setType( Net::Type::CLOCK ); + + if (_cell->getName() == "sm0") cerr << "sm0 netPlug:" << name << endl; } else { net->addAlias( name ); if (isExternal) net->setExternal( true ); @@ -495,6 +529,8 @@ namespace { direction |= net->getDirection(); net->setDirection( (Net::Direction::Code)direction ); if (isClock) net->setType( Net::Type::CLOCK ); + + if (_cell->getName() == "sm0") cerr << "sm0 netPlug:" << name << endl; } return net; } @@ -505,8 +541,45 @@ namespace { Net* net1 = _cell->getNet( name1 ); Net* net2 = _cell->getNet( name2 ); + if (_cell->getName() == "sm0") { + cerr << "Merge: " << name1 << " + " << name2 << endl; + cerr << " net1:" << net1 << " net2:" << net2 << endl; + } + if (net1 and (net1 == net2)) return net1; if (net1 and net2) { + if (net1->isSupply() and (net2->isExternal() and not net2->isSupply())) { + ostringstream message; + + if (net1->isPower()) { + message << "In model " << _cell->getName() << "\n " + << "Terminal " << net2->getName() + << " is connected to POWER " << net1->getName() + << " through the alias " << name1 << "."; + + Net* one = newOne(); + if (one) net2->merge( one ); + else + message << "\n (no tie high, connexion has been LEFT OPEN)"; + } + + if (net1->isGround()) { + message << "In model " << _cell->getName() << "\n " + << "Terminal " << net2->getName() + << " is connected to GROUND " << net1->getName() + << " through the alias " << name1 << "."; + + Net* zero = newZero(); + if (zero) net2->merge( zero ); + else + message << "\n (no tie low, connexion has been LEFT OPEN)"; + } + + if (not message.str().empty()) cerr << Warning( message.str() ) << endl; + return net2; + } + + if ( (not net1->isExternal() and net2->isExternal()) or ( net1->isExternal() and net2->isExternal() and (net1->getId() > net2->getId()) ) ) { std::swap( net1 , net2 ); @@ -514,6 +587,7 @@ namespace { } net1->merge( net2 ); return net1; } + if (net2) { std::swap( net1 , net2 ); std::swap( name1, name2 ); @@ -562,8 +636,6 @@ namespace { void Model::connectSubckts () { - unsigned int supplyCount = 0; - for ( Subckt* subckt : _subckts ) { if(not subckt->getModel()) throw Error( "No .model or cell named <%s> has been found.\n" @@ -581,8 +653,8 @@ namespace { // << "plug: <" << masterNetName << ">, " // << "external: <" << netName << ">." // << endl; - Net* net = _cell->getNet( netName ); - Net* masterNet = instance->getMasterCell()->getNet(masterNetName); + Net* net = _cell->getNet( netName ); + Net* masterNet = instance->getMasterCell()->getNet(masterNetName); if(not masterNet) { ostringstream tmes; tmes << "The master net <" << masterNetName << "> hasn't been found " @@ -593,7 +665,7 @@ namespace { throw Error(tmes.str()); } - Plug* plug = instance->getPlug( masterNet ); + Plug* plug = instance->getPlug( masterNet ); if(not plug) { ostringstream tmes; tmes << "The plug in net <" << netName << "> " @@ -620,6 +692,10 @@ namespace { else plugNet->merge( net ); } + if (subckt->getModel()->getCell()->getName() == "sm0") { + cerr << "sm0 plug:" << plug->getMasterNet()->getName() << " => net:" << net->getName() << endl; + } + if (plugNet->isSupply() and not plug->getMasterNet()->isSupply()) { ostringstream message; message << "In " << instance << "\n " @@ -629,28 +705,12 @@ namespace { << "."; if (_masterNetOne) { - if (plugNet->isPower()) { - ostringstream insName; insName << "one_" << supplyCount++; - - Instance* insOne = Instance::create( _cell, insName.str(), _one ); - Net* netOne = Net::create( _cell, insName.str() ); - - insOne->getPlug( _masterNetOne )->setNet( netOne ); - plug->setNet( netOne ); - } + if (plugNet->isPower()) plug->setNet( newOne() ); } else message << "\n (no tie high, connexion has been LEFT OPEN)"; if (_masterNetZero) { - if (plugNet->isGround()) { - ostringstream insName; insName << "zero_" << supplyCount++; - - Instance* insZero = Instance::create( _cell, insName.str(), _zero ); - Net* netZero = Net::create( _cell, insName.str() ); - - insZero->getPlug( _masterNetZero )->setNet( netZero ); - plug->setNet( netZero ); - } + if (plugNet->isGround()) plug->setNet( newZero() ); } else message << "\n (no tie low, connexion has been LEFT OPEN)"; @@ -759,13 +819,19 @@ namespace CRL { } if (tokenize.state() == Tokenize::Inputs) { - for ( size_t i=1 ; imergeNet( blifLine[i], true, Net::Direction::IN ); + if (blifModel->getCell()->getName() == "sm0") + cerr << "Blif model sm0: plug:" << blifLine[i] << endl; + } } if (tokenize.state() == Tokenize::Outputs) { - for ( size_t i=1 ; imergeNet( blifLine[i], true, Net::Direction::OUT ); + if (blifModel->getCell()->getName() == "sm0") + cerr << "Blif model sm0: plug:" << blifLine[i] << endl; + } } if (tokenize.state() & Tokenize::Names) { @@ -814,6 +880,11 @@ namespace CRL { } subckt->addConnection( make_pair(blifLine[i].substr(0,equal) ,blifLine[i].substr( equal+1)) ); + + if (subckt->getModelName() == "sm0") { + cerr << "Blif sm0 plug:" << blifLine[i].substr(0,equal) + << " net:" << blifLine[i].substr( equal+1) << endl; + } } } } diff --git a/crlcore/src/ccore/crlcore/AllianceFramework.h b/crlcore/src/ccore/crlcore/AllianceFramework.h index e98fbd14..b93c3dba 100644 --- a/crlcore/src/ccore/crlcore/AllianceFramework.h +++ b/crlcore/src/ccore/crlcore/AllianceFramework.h @@ -39,7 +39,8 @@ namespace CRL { class CellGauge; - class AllianceFramework { + class AllianceFramework : public DBo { + typedef DBo Super; public: enum FunctionsFlags { NoFlags = 0 , NoPythonInit = (1<<0) @@ -56,92 +57,90 @@ namespace CRL { , ConfigChanged = (1<<2) }; public: - // Constructors. - static AllianceFramework* create ( unsigned long flags=NoFlags ); - // Destructors. - void destroy (); + static AllianceFramework* create ( unsigned long flags=NoFlags ); + virtual void _postCreate (); + virtual void _preDestroy (); // Accessors. - static AllianceFramework* get (); - string getPrint () const; + static AllianceFramework* get (); + string getPrint () const; // Predicates. - Catalog::State* isInCatalog ( const Name& ); - Catalog::State* isInCatalog ( string ); - inline bool isPOWER ( const char* name ); - inline bool isPOWER ( const string& name ); - inline bool isPOWER ( const Name& name ); - inline bool isGROUND ( const char* name ); - inline bool isGROUND ( const string& name ); - inline bool isGROUND ( const Name& name ); - inline bool isCLOCK ( const char* name ); - inline bool isCLOCK ( const string& name ); - inline bool isCLOCK ( const Name& name ); - inline bool isBLOCKAGE ( const char* name ); - inline bool isBLOCKAGE ( const string& name ); - inline bool isBLOCKAGE ( const Name& name ); - inline bool isBLOCKAGE ( const Net* net ); - inline bool isPad ( const char* name ); - inline bool isPad ( const string& name ); - inline bool isPad ( const Name& name ); - inline bool isPad ( const Cell* ); + Catalog::State* isInCatalog ( const Name& ); + Catalog::State* isInCatalog ( string ); + inline bool isPOWER ( const char* name ); + inline bool isPOWER ( const string& name ); + inline bool isPOWER ( const Name& name ); + inline bool isGROUND ( const char* name ); + inline bool isGROUND ( const string& name ); + inline bool isGROUND ( const Name& name ); + inline bool isCLOCK ( const char* name ); + inline bool isCLOCK ( const string& name ); + inline bool isCLOCK ( const Name& name ); + inline bool isBLOCKAGE ( const char* name ); + inline bool isBLOCKAGE ( const string& name ); + inline bool isBLOCKAGE ( const Name& name ); + inline bool isBLOCKAGE ( const Net* net ); + inline bool isPad ( const char* name ); + inline bool isPad ( const string& name ); + inline bool isPad ( const Name& name ); + inline bool isPad ( const Cell* ); // Accessors. - inline Environment* getEnvironment (); - inline Catalog* getCatalog (); - inline const Name& getParentLibraryName () const; - inline Library* getParentLibrary (); - Library* getLibrary ( unsigned int index ); - Library* getLibrary ( const Name& libName ); - AllianceLibrary* getAllianceLibrary ( unsigned int index ); - AllianceLibrary* getAllianceLibrary ( const Name& libName, unsigned int flags ); - AllianceLibrary* getAllianceLibrary ( Library* ); - AllianceLibrary* createLibrary ( const string& path, unsigned int flags, string libName="" ); - inline const AllianceLibraries& getAllianceLibraries () const; - void saveLibrary ( Library* ); - void saveLibrary ( AllianceLibrary* ); - RoutingGauge* getRoutingGauge ( const Name& name="" ); - CellGauge* getCellGauge ( const Name& name="" ); - CellGauge* matchCellGauge ( DbU::Unit width, DbU::Unit height ) const; - CellGauge* matchCellGaugeByHeight ( DbU::Unit height ) const; - inline const Name getDefaultCGPinLayerName () const; + inline Environment* getEnvironment (); + inline Catalog* getCatalog (); + inline const Name& getParentLibraryName () const; + inline Library* getParentLibrary (); + Library* getLibrary ( unsigned int index ); + Library* getLibrary ( const Name& libName ); + AllianceLibrary* getAllianceLibrary ( unsigned int index ); + AllianceLibrary* getAllianceLibrary ( const Name& libName, unsigned int flags ); + AllianceLibrary* getAllianceLibrary ( Library* ); + AllianceLibrary* createLibrary ( const string& path, unsigned int flags, string libName="" ); + inline const AllianceLibraries& getAllianceLibraries () const; + void saveLibrary ( Library* ); + void saveLibrary ( AllianceLibrary* ); + RoutingGauge* getRoutingGauge ( const Name& name="" ); + CellGauge* getCellGauge ( const Name& name="" ); + CellGauge* matchCellGauge ( DbU::Unit width, DbU::Unit height ) const; + CellGauge* matchCellGaugeByHeight ( DbU::Unit height ) const; + inline const Name getDefaultCGPinLayerName () const; // Modifiers. - RoutingGauge* setRoutingGauge ( const Name& name="" ); - CellGauge* setCellGauge ( const Name& name="" ); - void addRoutingGauge ( RoutingGauge* ); - void addCellGauge ( CellGauge* ); - void addObserver ( BaseObserver* ); - void removeObserver ( BaseObserver* ); - void notify ( unsigned int flags ); + RoutingGauge* setRoutingGauge ( const Name& name="" ); + CellGauge* setCellGauge ( const Name& name="" ); + void addRoutingGauge ( RoutingGauge* ); + void addCellGauge ( CellGauge* ); + void addObserver ( BaseObserver* ); + void removeObserver ( BaseObserver* ); + void notify ( unsigned int flags ); // Cell Management. - Cell* cellLoader ( const string& rpath ); - Cell* getCell ( const string& name - , unsigned int mode - , unsigned int depth=(unsigned int)-1 ); - Cell* createCell ( const string& name, AllianceLibrary* library=NULL ); - void saveCell ( Cell* , unsigned int mode ); - void bindLibraries (); - unsigned int loadLibraryCells ( Library* ); - unsigned int loadLibraryCells ( const Name& ); - static size_t getInstancesCount ( Cell*, unsigned int flags ); + Cell* cellLoader ( const string& rpath ); + Cell* getCell ( const string& name + , unsigned int mode + , unsigned int depth=(unsigned int)-1 ); + Cell* createCell ( const string& name, AllianceLibrary* library=NULL ); + void saveCell ( Cell* , unsigned int mode ); + void bindLibraries (); + unsigned int loadLibraryCells ( Library* ); + unsigned int loadLibraryCells ( const Name& ); + static size_t getInstancesCount ( Cell*, unsigned int flags ); // Hurricane Managment. - void toJson ( JsonWriter* ) const; - inline string _getTypeName () const; - string _getString () const; - Record* _getRecord () const; + void toJson ( JsonWriter* ) const; + virtual string _getTypeName () const; + virtual Record* _getRecord () const; // Internals - Attributes. protected: - static const Name _parentLibraryName; - static AllianceFramework* _singleton; - Observable _observers; - Environment _environment; - ParsersMap _parsers; - DriversMap _drivers; - Catalog _catalog; - AllianceLibraries _libraries; - Library* _parentLibrary; - map _routingGauges; - RoutingGauge* _defaultRoutingGauge; - map _cellGauges; - CellGauge* _defaultCellGauge; + static const Name _parentLibraryName; + static AllianceFramework* _singleton; + Observable _observers; + Environment _environment; + ParsersMap _parsers; + DriversMap _drivers; + Catalog _catalog; + AllianceLibraries _libraries; + Library* _parentLibrary; + map _routingGauges; + RoutingGauge* _defaultRoutingGauge; + map _cellGauges; + CellGauge* _defaultCellGauge; // Internals - Constructors. AllianceFramework (); @@ -182,7 +181,6 @@ namespace CRL { // TEMPORARY. inline const Name AllianceFramework::getDefaultCGPinLayerName () const { return "CALU1"; } - inline string AllianceFramework::_getTypeName () const { return "AllianceFramework"; } class JsonAllianceFramework : public JsonObject { diff --git a/crlcore/src/ccore/crlcore/AllianceLibrary.h b/crlcore/src/ccore/crlcore/AllianceLibrary.h index 594dac95..aa1fee6a 100644 --- a/crlcore/src/ccore/crlcore/AllianceLibrary.h +++ b/crlcore/src/ccore/crlcore/AllianceLibrary.h @@ -44,23 +44,20 @@ namespace CRL { class AllianceLibrary { public: - // Constructors. AllianceLibrary (); AllianceLibrary ( const Name& path, Library* library=NULL ); - // Operators AllianceLibrary& operator= ( const AllianceLibrary& directory ); AllianceLibrary& operator= ( const std::string& path ); - // Accessors inline const Name& getPath () const; inline Library* getLibrary () const; - // Hurricane management. + void saveCells () const; + void saveCATAL () const; void toJson ( JsonWriter* ) const; inline std::string _getTypeName () const; std::string _getString () const; Record* _getRecord () const; protected: - // Internal - Attributes. Name _path; Library* _library; diff --git a/crlcore/src/ccore/crlcore/Catalog.h b/crlcore/src/ccore/crlcore/Catalog.h index 09329cf0..7cf3297d 100644 --- a/crlcore/src/ccore/crlcore/Catalog.h +++ b/crlcore/src/ccore/crlcore/Catalog.h @@ -65,6 +65,7 @@ namespace CRL { bool deleteState ( const Name& name ); void clear (); bool loadFromFile ( const string& path, Library* library ); + void saveToFile ( const string& path, Library* library ); inline map* getStates (); string _getPrint () const; inline string _getTypeName () const; @@ -232,7 +233,7 @@ namespace CRL { inline unsigned int Catalog::State::getDepth () const { return _depth; } inline string Catalog::State::_getTypeName () const { return _TName("Catalog::State"); } - inline Catalog::Catalog () : _states() {} + inline Catalog::Catalog () : _states() { } inline map* Catalog::getStates () { return &_states; } inline string Catalog::_getTypeName () const { return _TName("Catalog"); } diff --git a/crlcore/src/ccore/crlcore/ParsersDrivers.h b/crlcore/src/ccore/crlcore/ParsersDrivers.h index d99bf42b..8c2707dd 100644 --- a/crlcore/src/ccore/crlcore/ParsersDrivers.h +++ b/crlcore/src/ccore/crlcore/ParsersDrivers.h @@ -20,7 +20,6 @@ #include #include -#include "hurricane/Name.h" namespace Hurricane { class Library; class Cell; @@ -29,7 +28,6 @@ namespace Hurricane { namespace CRL { - using Hurricane::Name; using Hurricane::Cell; using Hurricane::Library; @@ -51,9 +49,9 @@ namespace CRL { // Struct : "CRL::ParserSlot". struct ParserSlot { - Name _tag; - Name _ext; - void* _parser; + std::string _tag; + std::string _ext; + void* _parser; ParserSlot ( const string& t, const string& e, void* p ): _tag(t),_ext(e),_parser(p) {}; }; @@ -73,15 +71,15 @@ namespace CRL { inline ParserFormatSlot (); // Accessors. inline bool loadByLib (); - inline const Name& getTag (); - inline const Name& getExt (); + inline std::string getTag (); + inline std::string getExt (); inline LibraryParser_t* getParsLib (); inline CellParser_t* getParsCell (); // Modifiers. - void registerCell ( const std::string& tag, CellParser_t* p, const std::string& ext ); - void registerLib ( const std::string& tag, LibraryParser_t* p, const std::string& ext ); - bool unRegisterCell ( const Name& ext ); - bool unRegisterLib ( const Name& ext ); + void registerCell ( std::string tag, CellParser_t* p, std::string ext ); + void registerLib ( std::string tag, LibraryParser_t* p, std::string ext ); + bool unRegisterCell ( std::string ext ); + bool unRegisterLib ( std::string ext ); // Iterators handling. inline void cbegin (); inline void lbegin (); @@ -101,8 +99,8 @@ namespace CRL { inline ParserFormatSlot::ParserFormatSlot () : _loadByLib(false), _itset(false) { }; inline bool ParserFormatSlot::loadByLib () { return ( _loadByLib ); } - inline const Name& ParserFormatSlot::getTag () { return ( _it->_tag ); } - inline const Name& ParserFormatSlot::getExt () { return ( _it->_ext ); } + inline std::string ParserFormatSlot::getTag () { return ( _it->_tag ); } + inline std::string ParserFormatSlot::getExt () { return ( _it->_ext ); } inline LibraryParser_t* ParserFormatSlot::getParsLib () { return ( (LibraryParser_t*)_it->_parser ); } inline CellParser_t* ParserFormatSlot::getParsCell () { return ( (CellParser_t* )_it->_parser ); } inline void ParserFormatSlot::cbegin () { _it = _cells.begin(); _itset = true; } @@ -112,17 +110,17 @@ namespace CRL { // ------------------------------------------------------------------- // Class : "CRL::ParsersMap". - class ParsersMap : public map { + class ParsersMap : public map { public: // Constructor. ParsersMap (); // Methods. - ParserFormatSlot& getParserSlot ( const std::string& tag ); - ParserFormatSlot& getParserSlot ( const std::string& tag, unsigned int mode, const Environment& env ); - void registerSlot ( const std::string& tag, LibraryParser_t* p, const std::string& ext ); - void registerSlot ( const std::string& tag, CellParser_t* p, const std::string& ext ); - void unRegisterSlot ( const Name& tag, const Name& ext, bool lib ); + ParserFormatSlot& getParserSlot ( std::string tag ); + ParserFormatSlot& getParserSlot ( std::string tag, unsigned int mode, const Environment& env ); + void registerSlot ( std::string tag, LibraryParser_t* p, std::string ext ); + void registerSlot ( std::string tag, CellParser_t* p, std::string ext ); + void unRegisterSlot ( std::string tag, std::string ext, bool lib ); }; @@ -135,23 +133,23 @@ namespace CRL { // Constructor. inline DriverSlot ( string tag="unknown" ); // Accessors. - inline const Name& getTag (); - inline const Name& getExtLib (); - inline const Name& getExtCell (); + inline std::string getTag (); + inline std::string getExtLib (); + inline std::string getExtCell (); inline LibraryDriver_t* getDrivLib (); inline CellDriver_t* getDrivCell (); // Modifiers. - inline void setExtLib ( const std::string &ext ); - inline void setExtCell ( const std::string &ext ); + inline void setExtLib ( std::string ext ); + inline void setExtCell ( std::string ext ); inline void setDrivLib ( LibraryDriver_t *driv ); inline void setDrivCell ( CellDriver_t *driv ); private: // Internal - Attributes. - Name _tag; - Name _extLib; - Name _extCell; + std::string _tag; + std::string _extLib; + std::string _extCell; LibraryDriver_t* _drivLib; CellDriver_t* _drivCell; }; @@ -164,13 +162,13 @@ namespace CRL { , _drivLib(NULL) , _drivCell(NULL) { } - inline const Name& DriverSlot::getTag () { return ( _tag ); } - inline const Name& DriverSlot::getExtLib () { return ( _extLib ); } - inline const Name& DriverSlot::getExtCell () { return ( _extCell ); } + inline std::string DriverSlot::getTag () { return ( _tag ); } + inline std::string DriverSlot::getExtLib () { return ( _extLib ); } + inline std::string DriverSlot::getExtCell () { return ( _extCell ); } inline LibraryDriver_t* DriverSlot::getDrivLib () { return ( _drivLib ); } inline CellDriver_t* DriverSlot::getDrivCell () { return ( _drivCell ); } - inline void DriverSlot::setExtLib ( const std::string& ext ) { _extLib = ext; } - inline void DriverSlot::setExtCell ( const std::string& ext ) { _extCell = ext; } + inline void DriverSlot::setExtLib ( std::string ext ) { _extLib = ext; } + inline void DriverSlot::setExtCell ( std::string ext ) { _extCell = ext; } inline void DriverSlot::setDrivLib ( LibraryDriver_t* driv ) { _drivLib = driv; } inline void DriverSlot::setDrivCell ( CellDriver_t* driv ) { _drivCell = driv; } @@ -180,17 +178,17 @@ namespace CRL { // ------------------------------------------------------------------- // Class : "CRL::DriversMap". - class DriversMap : public map { + class DriversMap : public map { public: // Constructor. DriversMap (); // Methods. - DriverSlot& getDriverSlot ( const std::string& tag ); - DriverSlot& getDriverSlot ( const std::string& tag, unsigned int mode, const Environment& env ); - void registerSlot ( const std::string& tag, CellDriver_t *d, const std::string& ext ); - void registerSlot ( const std::string& tag, LibraryDriver_t *d, const std::string& ext ); - void unRegisterSlot ( const Name& tag ); + DriverSlot& getDriverSlot ( std::string tag ); + DriverSlot& getDriverSlot ( std::string tag, unsigned int mode, const Environment& env ); + void registerSlot ( std::string tag, CellDriver_t *d, std::string ext ); + void registerSlot ( std::string tag, LibraryDriver_t *d, std::string ext ); + void unRegisterSlot ( std::string tag ); }; diff --git a/crlcore/src/ccore/lefdef/LefImport.cpp b/crlcore/src/ccore/lefdef/LefImport.cpp index e9cf6257..6ae66891 100644 --- a/crlcore/src/ccore/lefdef/LefImport.cpp +++ b/crlcore/src/ccore/lefdef/LefImport.cpp @@ -887,7 +887,11 @@ namespace CRL { void LefImport::reset () - { LefParser::reset(); } + { +#if defined(HAVE_LEFDEF) + LefParser::reset(); +#endif + } } // End of CRL namespace. diff --git a/crlcore/src/pyCRL/PyAllianceFramework.cpp b/crlcore/src/pyCRL/PyAllianceFramework.cpp index fc77e22c..b017eac4 100644 --- a/crlcore/src/pyCRL/PyAllianceFramework.cpp +++ b/crlcore/src/pyCRL/PyAllianceFramework.cpp @@ -70,25 +70,18 @@ extern "C" { { cdebug_log(30,0) << "PyAllianceFramework_create()" << endl; - AllianceFramework* af = NULL; - PyAllianceFramework* pyAf = NULL; - unsigned long flags = AllianceFramework::NoFlags; + AllianceFramework* af = NULL; + unsigned long flags = AllianceFramework::NoFlags; HTRY - PyObject* arg0; - if (ParseOneArg("AllianceFramework.create()", args, INT_ARG, &arg0)) { - flags = PyInt_AsUnsignedLongMask(arg0); - } - - af = AllianceFramework::create( flags ); - - pyAf = PyObject_NEW( PyAllianceFramework, &PyTypeAllianceFramework ); - if (pyAf == NULL) return NULL; - - pyAf->_object = af; + PyObject* arg0; + if (ParseOneArg("AllianceFramework.create()", args, INT_ARG, &arg0)) { + flags = PyInt_AsUnsignedLongMask(arg0); + } + af = AllianceFramework::create( flags ); HCATCH - return (PyObject*)pyAf; + return PyAllianceFramework_Link( af ); } @@ -96,19 +89,11 @@ extern "C" { { cdebug_log(30,0) << "PyAllianceFramework_get()" << endl; - AllianceFramework* af = NULL; - PyAllianceFramework* pyAf = NULL; - + AllianceFramework* af = NULL; HTRY - af = AllianceFramework::get(); - - pyAf = PyObject_NEW( PyAllianceFramework, &PyTypeAllianceFramework ); - if (pyAf == NULL) return NULL; - - pyAf->_object = af; + af = AllianceFramework::get(); HCATCH - - return (PyObject*)pyAf; + return PyAllianceFramework_Link( af ); } @@ -520,7 +505,7 @@ extern "C" { // Standart Destroy (Attribute). - // DBoDestroyAttribute(PyAllianceFramework_destroy,PyAllianceFramework) + DBoDestroyAttribute(PyAllianceFramework_destroy,PyAllianceFramework) PyMethodDef PyAllianceFramework_Methods[] = @@ -562,13 +547,13 @@ extern "C" { , "Get a routing gauge (without a name, return the default)." } , { "setRoutingGauge" , (PyCFunction)PyAllianceFramework_setRoutingGauge , METH_VARARGS , "Select the default routing gauge." } - //, { "destroy" , (PyCFunction)PyAllianceFramework_destroy , METH_NOARGS - // , "Destroy the associated hurricane object. The python object remains." } + , { "destroy" , (PyCFunction)PyAllianceFramework_destroy , METH_NOARGS + , "Destroy the Framework, Hurricane-level objects remains." } , {NULL, NULL, 0, NULL} /* sentinel */ }; - PythonOnlyDeleteMethod(AllianceFramework) + DBoDeleteMethod(AllianceFramework) PyTypeObjectLinkPyType(AllianceFramework) @@ -579,8 +564,8 @@ extern "C" { // | "PyAllianceFramework" Shared Library Code Part | // x=================================================================x - // Link/Creation Method. + DBoLinkCreateMethod(AllianceFramework) PyTypeObjectDefinitions(AllianceFramework) diff --git a/crlcore/src/pyCRL/PyAllianceLibrary.cpp b/crlcore/src/pyCRL/PyAllianceLibrary.cpp index 62228546..cc35a6b9 100644 --- a/crlcore/src/pyCRL/PyAllianceLibrary.cpp +++ b/crlcore/src/pyCRL/PyAllianceLibrary.cpp @@ -58,34 +58,52 @@ extern "C" { // +=================================================================+ - static PyObject* PyAllianceLibrary_getLibrary ( PyAllianceLibrary* self, PyObject* args ) + static PyObject* PyAllianceLibrary_getLibrary ( PyAllianceLibrary* self, PyObject* ) { cdebug_log(30,0) << "PyAllianceLibrary_getLibrary()" << endl; Library* lib = NULL; - HTRY - METHOD_HEAD("AllianceLibrary.getLibrary()") - lib = alib->getLibrary(); + METHOD_HEAD("AllianceLibrary.getLibrary()") + lib = alib->getLibrary(); HCATCH - return PyLibrary_Link(lib); } - static PyObject* PyAllianceLibrary_getPath ( PyAllianceLibrary* self, PyObject* args ) + static PyObject* PyAllianceLibrary_getPath ( PyAllianceLibrary* self, PyObject* ) { cdebug_log(30,0) << "PyAllianceLibrary_getPath()" << endl; - HTRY - METHOD_HEAD("AllianceLibrary.getPath()") - return PyString_FromString( getString(alib->getPath()).c_str() ); + METHOD_HEAD("AllianceLibrary.getPath()") + return PyString_FromString( getString(alib->getPath()).c_str() ); HCATCH - return NULL; } + static PyObject* PyAllianceLibrary_saveCells ( PyAllianceLibrary* self, PyObject* ) + { + cdebug_log(30,0) << "PyAllianceLibrary_saveCells()" << endl; + HTRY + METHOD_HEAD("AllianceLibrary.saveCells()") + alib->saveCells(); + HCATCH + Py_RETURN_NONE; + } + + + static PyObject* PyAllianceLibrary_saveCATAL ( PyAllianceLibrary* self, PyObject* ) + { + cdebug_log(30,0) << "PyAllianceLibrary_saveCATAL()" << endl; + HTRY + METHOD_HEAD("AllianceLibrary.saveCATAL()") + alib->saveCATAL(); + HCATCH + Py_RETURN_NONE; + } + + static PyObject* PyAllianceLibrary_Repr ( PyAllianceLibrary* self ) { if ( self->ACCESS_OBJECT == NULL ) @@ -105,6 +123,10 @@ extern "C" { , "Return the complete path of the library." } , { "getLibrary" , (PyCFunction)PyAllianceLibrary_getLibrary , METH_NOARGS , "Returns the associated Hurricane library." } + , { "saveCells" , (PyCFunction)PyAllianceLibrary_saveCells , METH_NOARGS + , "Save all the library cells." } + , { "saveCATAL" , (PyCFunction)PyAllianceLibrary_saveCATAL , METH_NOARGS + , "Rewrite the library CATAL file." } //, { "destroy" , (PyCFunction)PyAllianceLibrary_destroy , METH_VARARGS // , "Destroy the associated hurricane object. The python object remains." } , {NULL, NULL, 0, NULL} /* sentinel */ diff --git a/crlcore/src/pyCRL/PyEnvironment.cpp b/crlcore/src/pyCRL/PyEnvironment.cpp index 45c80d19..4b79cf45 100644 --- a/crlcore/src/pyCRL/PyEnvironment.cpp +++ b/crlcore/src/pyCRL/PyEnvironment.cpp @@ -138,8 +138,9 @@ extern "C" { if ( self->ACCESS_OBJECT == NULL ) return PyString_FromString(""); - string s = ""; - return PyString_FromString(s.c_str()); + ostringstream s; + s << "ACCESS_OBJECT << ">"; + return PyString_FromString(s.str().c_str()); } diff --git a/cumulus/src/plugins/ConductorPlugin.py b/cumulus/src/plugins/ConductorPlugin.py index f4325681..62b43bd6 100644 --- a/cumulus/src/plugins/ConductorPlugin.py +++ b/cumulus/src/plugins/ConductorPlugin.py @@ -20,6 +20,7 @@ try: import math import Cfg import Hurricane + from Hurricane import DbU from Hurricane import Breakpoint from Hurricane import UpdateSession import Viewer @@ -66,9 +67,24 @@ def ScriptMain ( **kw ): stopLevel = Cfg.getParamInt('conductor.stopLevel').asInt() Breakpoint.setStopLevel( stopLevel ) - maxPlaceIteration = 2 + Cfg.Configuration.pushDefaultPriority( Cfg.Parameter.Priority.Interactive ) + + grIterations = 10 + if Cfg.hasParameter('anabatic.globalIterations'): + grIterations = Cfg.getParamInt('anabatic.globalIterations').asInt() + + grIterationsEstimate = 7 + if Cfg.hasParameter('anabatic.globalIterationsEstimate'): + grIterationsEstimate = Cfg.getParamInt('anabatic.globalIterationsEstimate').asInt() + Cfg.getParamInt('anabatic.globalIterations').setInt( grIterationsEstimate ) + + maxPlaceIterations = 2 if Cfg.hasParameter('conductor.maxPlaceIterations'): - maxPlaceIteration = Cgf.getParamInt('conductor.maxPlaceIterations') + maxPlaceIterations = Cfg.getParamInt('conductor.maxPlaceIterations').asInt() + + useFixedAbHeight = False + if Cfg.hasParameter('conductor.useFixedAbHeight'): + useFixedAbHeight = Cfg.getParamBool('conductor.useFixedAbHeight').asBool() cell = None if kw.has_key('cell') and kw['cell']: @@ -78,6 +94,7 @@ def ScriptMain ( **kw ): if kw.has_key('editor') and kw['editor']: editor = kw['editor'] print ' o Editor found, running in graphic mode.' + editor.setLayerVisible( 'rubber', False ) if cell == None: cell = editor.getCell() if cell == None: @@ -88,8 +105,8 @@ def ScriptMain ( **kw ): katana = None iteration = 0 - while iteration < maxPlaceIteration: - print '\n o P&R Conductor iteration: %d' % iteration + while iteration < maxPlaceIterations: + print '\n o P&R Conductor iteration: %d (max:%s)' % (iteration,maxPlaceIterations) if not (katana is None): print ' o Global routing has failed, re-place design.' @@ -102,7 +119,11 @@ def ScriptMain ( **kw ): etesian = Etesian.EtesianEngine.create( cell ) etesian.setPassNumber( iteration ) if editor: etesian.setViewer( editor ) - if iteration: etesian.resetPlacement() + if iteration: + if useFixedAbHeight and iteration == 1: + etesian.setFixedAbHeight( cell.getAbutmentBox().getHeight() ) + print 'etesian.setFixedAbHeight():', DbU.getValueString(cell.getAbutmentBox().getHeight()) + etesian.resetPlacement() etesian.place() etesian.destroy() etesian = None @@ -110,12 +131,21 @@ def ScriptMain ( **kw ): editor.refresh() editor.fit() + if iteration+1 == maxPlaceIterations: + Cfg.getParamInt('anabatic.globalIterations').setInt( grIterations ) + katana = Katana.KatanaEngine.create( cell ) katana.setPassNumber( iteration ) if editor: katana.setViewer( editor ) katana.digitalInit () - katana.runGlobalRouter( Katana.Flags.ShowBloatedInstances ) + katana.runGlobalRouter( Katana.Flags.ShowBloatedInstances + | Katana.Flags.ShowOverloadedEdges + | Katana.Flags.ShowOverloadedGCells + ) + #| Katana.Flags.ShowFailedNets Breakpoint.stop( 1, 'After routing iteration %d' % iteration ) + if editor: + editor.setShowSelection( False ) if katana.isGlobalRoutingSuccess(): break iteration += 1 @@ -134,6 +164,8 @@ def ScriptMain ( **kw ): #plugins.RSavePlugin.ScriptMain( **kw ) + Cfg.Configuration.popDefaultPriority() + except Exception, e: catch( e ) diff --git a/cumulus/src/plugins/chip/Chip.py b/cumulus/src/plugins/chip/Chip.py index 1c793096..7bff91c2 100644 --- a/cumulus/src/plugins/chip/Chip.py +++ b/cumulus/src/plugins/chip/Chip.py @@ -237,7 +237,7 @@ class PlaceRoute ( object ): katana.loadGlobalRouting ( Anabatic.EngineLoadGrByNet ) katana.layerAssign ( Anabatic.EngineNoNetLayerAssign ) katana.runNegociate ( Katana.Flags.NoFlags ) - success = katana.getToolSuccess() + success = katana.getSuccessState() katana.finalizeLayout() katana.destroy() diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt index 23815537..4661bb16 100644 --- a/documentation/CMakeLists.txt +++ b/documentation/CMakeLists.txt @@ -11,128 +11,201 @@ list(INSERT CMAKE_MODULE_PATH 0 "${DESTDIR}$ENV{CORIOLIS_TOP}/share/cmake/Modules/") find_package(Bootstrap REQUIRED) - find_package(Sphinx) +#find_package(Sphinx) + find_package(Pelican) setup_project_paths(CORIOLIS) set_cmake_policies() add_subdirectory(examples) - set( htmlInstallDir share/doc/coriolis2/en/html/main ) - set( pdfInstallDir share/doc/coriolis2/en/pdf/main ) + set( htmlInstallDir share/doc/coriolis2/en/html ) if(BUILD_DOC) - if(SPHINX_EXECUTABLE) - message(STATUS "Sphinx has been found, generate the documentation...") - set ( pythonCppRst PythonCpp/pdfHeader.rst - PythonCpp/Introduction.rst - PythonCpp/Configuration.rst - PythonCpp/DBoStandalone.rst - PythonCpp/DBoHierarchy.rst - PythonCpp/NonDBo.rst - PythonCpp/DbU.rst - PythonCpp/Name.rst ) + if(PELICAN_EXECUTABLE) + message(STATUS "Pelican has been found, generate the documentation...") - set ( pythonTutorialRst PythonTutorial/pdfHeader.rst - PythonTutorial/Introduction.rst - PythonTutorial/Environment.rst - PythonTutorial/CellNetComponent.rst - PythonTutorial/Collections.rst - PythonTutorial/CgtScript.rst - PythonTutorial/Netlist.rst - PythonTutorial/RealDesigns.rst - PythonTutorial/ToolEngines.rst - PythonTutorial/AdvancedTopics.rst ) - - set ( usersGuideRst UsersGuide/pdfHeader.rst - UsersGuide/LicenseCredits.rst - UsersGuide/Releases.rst - UsersGuide/DesignFlow.rst - UsersGuide/Installation.rst - UsersGuide/Configuration.rst - UsersGuide/ViewerTools.rst - UsersGuide/ScriptsPlugins.rst ) + set ( pythonCppRst content/pages/python-cpp/PythonCpp_HTML.rst + content/pages/python-cpp/Introduction.rst + content/pages/python-cpp/Configuration.rst + content/pages/python-cpp/DBoStandalone.rst + content/pages/python-cpp/DBoHierarchy.rst + content/pages/python-cpp/NonDBo.rst + content/pages/python-cpp/DbU.rst + content/pages/python-cpp/Name.rst ) - set ( confTechnoRst ConfigurationTechnology/pdfHeader.rst - ConfigurationTechnology/Architecture.rst ) - - set ( rdsRst RDS/pdfHeader.rst - RDS/RDSpage.rst ) + set ( pythonTutorialRst content/pages/python-tutorial/PythonTutorial_HTML.rst + content/pages/python-tutorial/Introduction.rst + content/pages/python-tutorial/Environment.rst + content/pages/python-tutorial/CellNetComponent.rst + content/pages/python-tutorial/Collections.rst + content/pages/python-tutorial/CgtScript.rst + content/pages/python-tutorial/Netlist.rst + content/pages/python-tutorial/RealDesigns.rst + content/pages/python-tutorial/ToolEngines.rst + content/pages/python-tutorial/AdvancedTopics.rst ) + + set ( usersGuideRst content/pages/users-guide/UsersGuide_HTML.rst + content/pages/users-guide/LicenseCredits.rst + content/pages/users-guide/Releases.rst + content/pages/users-guide/DesignFlow.rst + content/pages/users-guide/Installation.rst + content/pages/users-guide/Configuration.rst + content/pages/users-guide/ViewerTools.rst + content/pages/users-guide/ScriptsPlugins.rst ) - set (stratusRst Stratus/pdfHeader.rst - Stratus/Developper.rst - Stratus/Language.rst - Stratus/DpGen.rst - Stratus/Patterns.rst ) - - add_custom_target ( doc_HTML ALL - cd ${DOCUMENTATION_SOURCE_DIR} - && rm -rf _build - && sphinx-build -b html -d _build/doctrees . _build/html - DEPENDS etc/definitions.rst - _static/SoC.css - _static/www-SoC.css - _static/SoC-ReST.css - _static/pygments.css - CrlCore/CrlCore.rst - Hurricane/Hurricane.rst - Unicorn/Unicorn.rst - Viewer/Viewer.rst - ${usersGuideRst} UsersGuide/index.rst - ${pythonTutorialRst} PythonTutorial/index.rst - ${pythonCppRst} PythonCpp/index.rst - ${rdsRst} RDS/index.rst - ${stratusRst} Stratus/index.rst - ) - - add_custom_target ( pdf_UsersGuide ALL - cd ${DOCUMENTATION_SOURCE_DIR}/UsersGuide - && ../etc/doPdf.sh ${usersGuideRst} UsersGuide.rst - DEPENDS etc/definitions.rst - etc/SoC-ReST.tex - ${usersGuideRst} ) - - add_custom_target ( pdf_PythonTutorial ALL - cd ${DOCUMENTATION_SOURCE_DIR}/PythonTutorial - && ../etc/doPdf.sh ${pythonTutorialRst} PythonTutorial.rst - DEPENDS etc/definitions.rst - etc/SoC-ReST.tex - PythonTutorial/definitions.rst - ${pythonTutorialRst} ) - - add_custom_target ( pdf_Stratus ALL - cd ${DOCUMENTATION_SOURCE_DIR}/Stratus - && ../etc/doPdf.sh ${stratusRst} Stratus.rst - DEPENDS etc/definitions.rst - etc/SoC-ReST.tex - ${stratusRst} ) - - add_custom_target ( pdf_PythonCpp ALL - cd ${DOCUMENTATION_SOURCE_DIR}/PythonCpp - && ../etc/doPdf.sh ${pythonCppRst} PythonCpp.rst - DEPENDS etc/definitions.rst - etc/SoC-ReST.tex - ${pythonCppRst} ) + set ( rdsRst content/pages/rds/RDS_HTML.rst + content/pages/rds/RDSpage.rst ) + + set ( stratusRst content/pages/stratus/Stratus_HTML.rst + content/pages/stratus/Developper.rst + content/pages/stratus/Language.rst + content/pages/stratus/DpGen.rst + content/pages/stratus/Patterns.rst ) + + add_custom_target ( doc_HTML ALL + cd ${DOCUMENTATION_SOURCE_DIR} + && rm -rf output + && ./build.py --pdfs --pelican + DEPENDS etc/definitions.rst + themes/nest-coriolis/static/css/nest.css + themes/nest-coriolis/static/css/pygment.css + themes/nest-coriolis/static/css/coriolis.css + content/pages/documentation.rst + content/pages/gitlab.rst + content/pages/homepage.rst + content/pages/symbolic-layout.rst + ${usersGuideRst} + ${pythonTutorialRst} + ${pythonCppRst} + ${rdsRst} + ${stratusRst} + ) + + else(PELICAN_EXECUTABLE) + message(STATUS "Pelican has *not* been found, use the git supplied documentation.") + endif(PELICAN_EXECUTABLE) + endif(BUILD_DOC) + install( DIRECTORY output/ DESTINATION ${htmlInstallDir} ) + + +# Old part for Sphinx, keep it for now. +#set( htmlInstallDir share/doc/coriolis2/en/html/main ) +#set( pdfInstallDir share/doc/coriolis2/en/pdf/main ) + +#if(BUILD_DOC) +# if(SPHINX_EXECUTABLE) +# message(STATUS "Sphinx has been found, generate the documentation...") +# set ( pythonCppRst PythonCpp/pdfHeader.rst +# PythonCpp/Introduction.rst +# PythonCpp/Configuration.rst +# PythonCpp/DBoStandalone.rst +# PythonCpp/DBoHierarchy.rst +# PythonCpp/NonDBo.rst +# PythonCpp/DbU.rst +# PythonCpp/Name.rst ) +# +# set ( pythonTutorialRst PythonTutorial/pdfHeader.rst +# PythonTutorial/Introduction.rst +# PythonTutorial/Environment.rst +# PythonTutorial/CellNetComponent.rst +# PythonTutorial/Collections.rst +# PythonTutorial/CgtScript.rst +# PythonTutorial/Netlist.rst +# PythonTutorial/RealDesigns.rst +# PythonTutorial/ToolEngines.rst +# PythonTutorial/AdvancedTopics.rst ) +# +# set ( usersGuideRst UsersGuide/pdfHeader.rst +# UsersGuide/LicenseCredits.rst +# UsersGuide/Releases.rst +# UsersGuide/DesignFlow.rst +# UsersGuide/Installation.rst +# UsersGuide/Configuration.rst +# UsersGuide/ViewerTools.rst +# UsersGuide/ScriptsPlugins.rst ) +# +# set ( confTechnoRst ConfigurationTechnology/pdfHeader.rst +# ConfigurationTechnology/Architecture.rst ) +# +# set ( rdsRst RDS/pdfHeader.rst +# RDS/RDSpage.rst ) +# +# set (stratusRst Stratus/pdfHeader.rst +# Stratus/Developper.rst +# Stratus/Language.rst +# Stratus/DpGen.rst +# Stratus/Patterns.rst ) +# +# add_custom_target ( doc_HTML ALL +# cd ${DOCUMENTATION_SOURCE_DIR} +# && rm -rf _build +# && sphinx-build -b html -d _build/doctrees . _build/html +# DEPENDS etc/definitions.rst +# _static/SoC.css +# _static/www-SoC.css +# _static/SoC-ReST.css +# _static/pygments.css +# CrlCore/CrlCore.rst +# Hurricane/Hurricane.rst +# Unicorn/Unicorn.rst +# Viewer/Viewer.rst +# ${usersGuideRst} UsersGuide/index.rst +# ${pythonTutorialRst} PythonTutorial/index.rst +# ${pythonCppRst} PythonCpp/index.rst +# ${rdsRst} RDS/index.rst +# ${stratusRst} Stratus/index.rst +# ) +# +# add_custom_target ( pdf_UsersGuide ALL +# cd ${DOCUMENTATION_SOURCE_DIR}/UsersGuide +# && ../etc/doPdf.sh ${usersGuideRst} UsersGuide.rst +# DEPENDS etc/definitions.rst +# etc/SoC-ReST.tex +# ${usersGuideRst} ) +# +# add_custom_target ( pdf_PythonTutorial ALL +# cd ${DOCUMENTATION_SOURCE_DIR}/PythonTutorial +# && ../etc/doPdf.sh ${pythonTutorialRst} PythonTutorial.rst +# DEPENDS etc/definitions.rst +# etc/SoC-ReST.tex +# PythonTutorial/definitions.rst +# ${pythonTutorialRst} ) +# +# add_custom_target ( pdf_Stratus ALL +# cd ${DOCUMENTATION_SOURCE_DIR}/Stratus +# && ../etc/doPdf.sh ${stratusRst} Stratus.rst +# DEPENDS etc/definitions.rst +# etc/SoC-ReST.tex +# ${stratusRst} ) +# +# add_custom_target ( pdf_PythonCpp ALL +# cd ${DOCUMENTATION_SOURCE_DIR}/PythonCpp +# && ../etc/doPdf.sh ${pythonCppRst} PythonCpp.rst +# DEPENDS etc/definitions.rst +# etc/SoC-ReST.tex +# ${pythonCppRst} ) +# # add_custom_target ( pdf_ConfTechno ALL # cd ${DOCUMENTATION_SOURCE_DIR}/ConfigurationTechnology # && ../etc/doPdf.sh ${confTechnoRst} ConfigurationTechnology.rst # DEPENDS etc/definitions.rst # etc/SoC-ReST.tex # ${confTechnoRst} ) - - add_custom_target ( pdf_RDS ALL - cd ${DOCUMENTATION_SOURCE_DIR}/RDS - && ../etc/doPdf.sh ${rdsRst} RDS.rst - DEPENDS etc/definitions.rst - etc/SoC-ReST.tex - ${rdsRst} ) - else(SPHINX_EXECUTABLE) - message(STATUS "Sphinx has *not* been found, use the git supplied documentation.") - endif(SPHINX_EXECUTABLE) - endif(BUILD_DOC) - - install( DIRECTORY _build/html/ DESTINATION ${htmlInstallDir} ) - install( FILES RDS/RDS.pdf - PythonTutorial/PythonTutorial.pdf - PythonCpp/PythonCpp.pdf - UsersGuide/UsersGuide.pdf DESTINATION ${pdfInstallDir} ) +# +# add_custom_target ( pdf_RDS ALL +# cd ${DOCUMENTATION_SOURCE_DIR}/RDS +# && ../etc/doPdf.sh ${rdsRst} RDS.rst +# DEPENDS etc/definitions.rst +# etc/SoC-ReST.tex +# ${rdsRst} ) +# else(SPHINX_EXECUTABLE) +# message(STATUS "Sphinx has *not* been found, use the git supplied documentation.") +# endif(SPHINX_EXECUTABLE) +#endif(BUILD_DOC) +# +#install( DIRECTORY _build/html/ DESTINATION ${htmlInstallDir} ) +#install( FILES RDS/RDS.pdf +# PythonTutorial/PythonTutorial.pdf +# PythonCpp/PythonCpp.pdf +# UsersGuide/UsersGuide.pdf DESTINATION ${pdfInstallDir} ) diff --git a/documentation/PythonCpp/pdfHeader.rst b/documentation/PythonCpp/pdfHeader.rst deleted file mode 100644 index 29cdbf2b..00000000 --- a/documentation/PythonCpp/pdfHeader.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -=================================== -Hurricane Python/C++ API Tutorial -=================================== - -|pagestylefancy| - - -.. contents:: - -|newpage| diff --git a/documentation/PythonTutorial/pdfHeader.rst b/documentation/PythonTutorial/pdfHeader.rst deleted file mode 100644 index ff8969b7..00000000 --- a/documentation/PythonTutorial/pdfHeader.rst +++ /dev/null @@ -1,55 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst -.. include:: ./definitions.rst - - - -.. raw:: latex - - \newpage - - \pagestyle{empty} - - \begin{center} - - \hfill \includegraphics[height=2.0cm]{../etc/images/Logo-LIP6-bleugris} - \hfill \includegraphics[height=1.8cm]{../etc/images/Logo-SU} - \hfill \includegraphics[height=2.0cm]{../etc/images/Logo-CNRS} - \hfill - \\*[2cm] - - \huge \textsc{Sorbonne Université} \\*[1cm] - - \huge {\textsc{lip6} Laboratory} \\*[3cm] - - \Huge \textbf{\textsc{Hurricane+Python Tutorial}} \\*[1cm] - - \huge {Jean-Paul \textsc{Chaput}} \\ - \Large\href{mailto:Jean-Paul.Chaput@lip6.fr}{Jean-Paul.Chaput@lip6.fr}\\*[4cm] - - \includegraphics[scale=1.0]{../etc/images/logoCC.pdf} - - \normalsize - This work is licensed under a \\ - Creative Commons Attribution-NonCommercial-ShareALike 4.0 International License. \\ - Creative Commons License \href{https://creativecommons.org/licenses/by-nc-sa/4.0/}{creativecommons.org/licenses/by-nc-sa/4.0/} - - \end{center} - - - \newpage - \pagestyle{fancy} - - -|noindent| -**First, a small disclaimer.** This tutorial assumes that you are already familiar -with the concepts of |VLSI| designs, such as *netlist*, *layout*, *instances* -and hierarchical design. - -|pagestylefancy| - - -.. contents:: - -|newpage| diff --git a/documentation/RDS/pdfHeader.rst b/documentation/RDS/pdfHeader.rst deleted file mode 100644 index 4cce0e35..00000000 --- a/documentation/RDS/pdfHeader.rst +++ /dev/null @@ -1,27 +0,0 @@ -.. -*- mode: rst; explicit-buffer-name: "pdfHeader.rst" -*- - -.. include:: ../etc/definitions.rst - - -:Date: 26, september 2014 -:Authors: Jean-Paul Chaput -:Contact: -:Version: 0.2 - -|medskip| - -**Disclaimer:** This document is still far from complete. - -|medskip| - - -========================================= -Symbolic To Real Conversion in Alliance -========================================= - -|pagestylefancy| - - -.. contents:: - -|newpage| diff --git a/documentation/Stratus/Stratus.pdf b/documentation/Stratus/Stratus.pdf deleted file mode 100644 index f83cd31b..00000000 Binary files a/documentation/Stratus/Stratus.pdf and /dev/null differ diff --git a/documentation/Stratus/pdfHeader.rst b/documentation/Stratus/pdfHeader.rst deleted file mode 100644 index cde3ea09..00000000 --- a/documentation/Stratus/pdfHeader.rst +++ /dev/null @@ -1,15 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -======================= -Stratus User's Guide -======================= - -|pagestylefancy| - - -.. contents:: - -|newpage| diff --git a/documentation/UsersGuide/LicenseCredits.rst b/documentation/UsersGuide/LicenseCredits.rst deleted file mode 100644 index ad99e298..00000000 --- a/documentation/UsersGuide/LicenseCredits.rst +++ /dev/null @@ -1,55 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -Credits & License -================= - -.. raw:: html - -

Hurricane - Rémy Escassut & - Christian Masson

-
-

Etesian - Gabriel Gouvine

-
-

Stratus - Sophie Belloeil

-
-

Katana (global) - Damien Dupuis

-
-

Katana (detailed), - Unicorn - Jean-Paul Chaput

-
- - -.. raw:: latex - - \begin{center}\begin{minipage}[t]{.8\textwidth} - \noindent\DUrole{sc}{Hurricane} \dotfill Rémy \DUrole{sc}{Escassut} \& - Christian \DUrole{sc}{Masson} \\ - \noindent\DUrole{sc}{Etesian} \dotfill Gabriel \DUrole{sc}{Gouvine} \\ - \noindent\DUrole{sc}{Stratus} \dotfill Sophie \DUrole{sc}{Belloeil} \\ - \noindent\DUrole{sc}{Katana} (global) \dotfill Damien \DUrole{sc}{Dupuis} \\ - \noindent\DUrole{sc}{Katana} (detailed), - \DUrole{sc}{Unicorn} \dotfill Jean-Paul \DUrole{sc}{Chaput} \\ - \end{minipage}\end{center} - - -|medskip| - -The |Hurricane| data-base is copyright© |Bull| 2000-2019 and is -released under the terms of the |LGPL| license. All other tools are -copyright© |UPMC| 2008-2018, |SorbonneUniversite| 2018-2019 -and released under the |GPL| license. - -Others important contributors to |Coriolis| are Christophe |Alexandre|, -Roselyne |Chotin|, Hugo |Clement|, Marek |Sroka| and Wu |Yifei|. - -The |Katana| router makes use of the |Flute| software, which is -copyright© Chris C. N. |Chu| from the Iowa State University -(http://home.eng.iastate.edu/~cnchu/). diff --git a/documentation/UsersGuide/images/Coriolis-logo.fig b/documentation/UsersGuide/images/Coriolis-logo.fig deleted file mode 100644 index 92a5da03..00000000 --- a/documentation/UsersGuide/images/Coriolis-logo.fig +++ /dev/null @@ -1,24 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.7a -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 6 0 7 50 -1 -1 0.000 0 2 -1 0 0 2 - 3510 1080 3690 1080 -2 1 0 6 0 7 50 -1 -1 0.000 0 2 -1 0 0 2 - 3330 1350 3330 1170 -2 2 0 6 0 7 50 -1 -1 0.000 0 2 -1 0 0 5 - 3420 1170 3690 1170 3690 1440 3420 1440 3420 1170 -2 1 0 6 0 7 50 -1 -1 0.000 0 2 -1 0 0 2 - 3780 1440 3780 1260 -2 1 0 6 0 7 50 -1 -1 0.000 0 2 -1 0 0 2 - 3420 1530 3600 1530 -2 1 0 3 0 7 50 -1 -1 0.000 0 2 -1 0 0 2 - 3960 900 3960 1710 -2 2 0 3 0 7 50 -1 -1 0.000 0 2 -1 0 0 5 - 3150 900 6570 900 6570 1710 3150 1710 3150 900 -4 0 0 50 -1 18 36 0.0000 4 465 2250 4140 1530 Coriolis\001 diff --git a/documentation/UsersGuide/images/Coriolis-logo.png b/documentation/UsersGuide/images/Coriolis-logo.png deleted file mode 100644 index 5c52d9b7..00000000 Binary files a/documentation/UsersGuide/images/Coriolis-logo.png and /dev/null differ diff --git a/documentation/UsersGuide/pdfHeader.rst b/documentation/UsersGuide/pdfHeader.rst deleted file mode 100644 index 6a57cacd..00000000 --- a/documentation/UsersGuide/pdfHeader.rst +++ /dev/null @@ -1,49 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - - -.. raw:: latex - - \newpage - - \pagestyle{empty} - - \begin{center} - - \hfill \includegraphics[height=2.0cm]{../etc/images/Logo-LIP6-bleugris} - \hfill \includegraphics[height=1.8cm]{../etc/images/Logo-SU} - \hfill \includegraphics[height=2.0cm]{../etc/images/Logo-CNRS} - \hfill - \\*[2cm] - - \huge \textsc{Sorbonne Université} \\*[1cm] - - \huge {\textsc{lip6} Laboratory} \\*[3cm] - - \Huge \textbf{\textsc{Coriolis}} \\*[1cm] - \Huge \textbf{User's Guide} \\*[1cm] - - \huge {Jean-Paul \textsc{Chaput}} \\ - \Large\href{mailto:Jean-Paul.Chaput@lip6.fr}{Jean-Paul.Chaput@lip6.fr}\\*[4cm] - - \includegraphics[scale=1.0]{../etc/images/logoCC.pdf} - - \normalsize - This work is licensed under a \\ - Creative Commons Attribution-NonCommercial-ShareALike 4.0 International License. \\ - Creative Commons License \href{https://creativecommons.org/licenses/by-nc-sa/4.0/}{creativecommons.org/licenses/by-nc-sa/4.0/} - - \end{center} - - \newpage - \pagestyle{fancy} - -|pagestylefancy| - - - -.. contents:: - -|newpage| diff --git a/documentation/_build/doctrees/Analog/Analog.doctree b/documentation/_build/doctrees/Analog/Analog.doctree deleted file mode 100644 index b7b56913..00000000 Binary files a/documentation/_build/doctrees/Analog/Analog.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/Contents.doctree b/documentation/_build/doctrees/Contents.doctree deleted file mode 100644 index 0a149a0f..00000000 Binary files a/documentation/_build/doctrees/Contents.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/CrlCore/CrlCore.doctree b/documentation/_build/doctrees/CrlCore/CrlCore.doctree deleted file mode 100644 index 28d2850b..00000000 Binary files a/documentation/_build/doctrees/CrlCore/CrlCore.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/Hurricane/Hurricane.doctree b/documentation/_build/doctrees/Hurricane/Hurricane.doctree deleted file mode 100644 index ef5c983a..00000000 Binary files a/documentation/_build/doctrees/Hurricane/Hurricane.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/Katabatic/Katabatic.doctree b/documentation/_build/doctrees/Katabatic/Katabatic.doctree deleted file mode 100644 index bf1cb88b..00000000 Binary files a/documentation/_build/doctrees/Katabatic/Katabatic.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/Kite/Kite.doctree b/documentation/_build/doctrees/Kite/Kite.doctree deleted file mode 100644 index ffa2e6f7..00000000 Binary files a/documentation/_build/doctrees/Kite/Kite.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/Oroshi/Oroshi.doctree b/documentation/_build/doctrees/Oroshi/Oroshi.doctree deleted file mode 100644 index cd37e33f..00000000 Binary files a/documentation/_build/doctrees/Oroshi/Oroshi.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonCpp/Configuration.doctree b/documentation/_build/doctrees/PythonCpp/Configuration.doctree deleted file mode 100644 index 3b611b12..00000000 Binary files a/documentation/_build/doctrees/PythonCpp/Configuration.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonCpp/DBoHierarchy.doctree b/documentation/_build/doctrees/PythonCpp/DBoHierarchy.doctree deleted file mode 100644 index 64d36194..00000000 Binary files a/documentation/_build/doctrees/PythonCpp/DBoHierarchy.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonCpp/DBoStandalone.doctree b/documentation/_build/doctrees/PythonCpp/DBoStandalone.doctree deleted file mode 100644 index 2bef33b1..00000000 Binary files a/documentation/_build/doctrees/PythonCpp/DBoStandalone.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonCpp/DbU.doctree b/documentation/_build/doctrees/PythonCpp/DbU.doctree deleted file mode 100644 index cc824d5e..00000000 Binary files a/documentation/_build/doctrees/PythonCpp/DbU.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonCpp/Introduction.doctree b/documentation/_build/doctrees/PythonCpp/Introduction.doctree deleted file mode 100644 index b651da13..00000000 Binary files a/documentation/_build/doctrees/PythonCpp/Introduction.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonCpp/Name.doctree b/documentation/_build/doctrees/PythonCpp/Name.doctree deleted file mode 100644 index aa32162a..00000000 Binary files a/documentation/_build/doctrees/PythonCpp/Name.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonCpp/NonDBo.doctree b/documentation/_build/doctrees/PythonCpp/NonDBo.doctree deleted file mode 100644 index ef3b47d9..00000000 Binary files a/documentation/_build/doctrees/PythonCpp/NonDBo.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonCpp/index.doctree b/documentation/_build/doctrees/PythonCpp/index.doctree deleted file mode 100644 index f92cd4b5..00000000 Binary files a/documentation/_build/doctrees/PythonCpp/index.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonTutorial/AdvancedTopics.doctree b/documentation/_build/doctrees/PythonTutorial/AdvancedTopics.doctree deleted file mode 100644 index 246d3d06..00000000 Binary files a/documentation/_build/doctrees/PythonTutorial/AdvancedTopics.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonTutorial/CellNetComponent.doctree b/documentation/_build/doctrees/PythonTutorial/CellNetComponent.doctree deleted file mode 100644 index 96c22c73..00000000 Binary files a/documentation/_build/doctrees/PythonTutorial/CellNetComponent.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonTutorial/CgtScript.doctree b/documentation/_build/doctrees/PythonTutorial/CgtScript.doctree deleted file mode 100644 index d79bd978..00000000 Binary files a/documentation/_build/doctrees/PythonTutorial/CgtScript.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonTutorial/Collections.doctree b/documentation/_build/doctrees/PythonTutorial/Collections.doctree deleted file mode 100644 index 777bc497..00000000 Binary files a/documentation/_build/doctrees/PythonTutorial/Collections.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonTutorial/Environment.doctree b/documentation/_build/doctrees/PythonTutorial/Environment.doctree deleted file mode 100644 index 16a06806..00000000 Binary files a/documentation/_build/doctrees/PythonTutorial/Environment.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonTutorial/Introduction.doctree b/documentation/_build/doctrees/PythonTutorial/Introduction.doctree deleted file mode 100644 index 077e6fe6..00000000 Binary files a/documentation/_build/doctrees/PythonTutorial/Introduction.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonTutorial/Netlist.doctree b/documentation/_build/doctrees/PythonTutorial/Netlist.doctree deleted file mode 100644 index df1c87da..00000000 Binary files a/documentation/_build/doctrees/PythonTutorial/Netlist.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonTutorial/RealDesigns.doctree b/documentation/_build/doctrees/PythonTutorial/RealDesigns.doctree deleted file mode 100644 index 9f35a540..00000000 Binary files a/documentation/_build/doctrees/PythonTutorial/RealDesigns.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonTutorial/ToolEngines.doctree b/documentation/_build/doctrees/PythonTutorial/ToolEngines.doctree deleted file mode 100644 index 00b6adde..00000000 Binary files a/documentation/_build/doctrees/PythonTutorial/ToolEngines.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonTutorial/definitions.doctree b/documentation/_build/doctrees/PythonTutorial/definitions.doctree deleted file mode 100644 index ab2e7faf..00000000 Binary files a/documentation/_build/doctrees/PythonTutorial/definitions.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonTutorial/index.doctree b/documentation/_build/doctrees/PythonTutorial/index.doctree deleted file mode 100644 index f1bf3d6e..00000000 Binary files a/documentation/_build/doctrees/PythonTutorial/index.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/PythonTutorial/pdfHeader.doctree b/documentation/_build/doctrees/PythonTutorial/pdfHeader.doctree deleted file mode 100644 index f1a83806..00000000 Binary files a/documentation/_build/doctrees/PythonTutorial/pdfHeader.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/RDS/RDSpage.doctree b/documentation/_build/doctrees/RDS/RDSpage.doctree deleted file mode 100644 index a18c0936..00000000 Binary files a/documentation/_build/doctrees/RDS/RDSpage.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/RDS/index.doctree b/documentation/_build/doctrees/RDS/index.doctree deleted file mode 100644 index 239c441f..00000000 Binary files a/documentation/_build/doctrees/RDS/index.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/Stratus/Developper.doctree b/documentation/_build/doctrees/Stratus/Developper.doctree deleted file mode 100644 index 3347db78..00000000 Binary files a/documentation/_build/doctrees/Stratus/Developper.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/Stratus/DpGen.doctree b/documentation/_build/doctrees/Stratus/DpGen.doctree deleted file mode 100644 index 9f13f9e2..00000000 Binary files a/documentation/_build/doctrees/Stratus/DpGen.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/Stratus/Language.doctree b/documentation/_build/doctrees/Stratus/Language.doctree deleted file mode 100644 index bf73d975..00000000 Binary files a/documentation/_build/doctrees/Stratus/Language.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/Stratus/Patterns.doctree b/documentation/_build/doctrees/Stratus/Patterns.doctree deleted file mode 100644 index 5b4882a5..00000000 Binary files a/documentation/_build/doctrees/Stratus/Patterns.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/Stratus/index.doctree b/documentation/_build/doctrees/Stratus/index.doctree deleted file mode 100644 index 29c1e780..00000000 Binary files a/documentation/_build/doctrees/Stratus/index.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/Unicorn/Unicorn.doctree b/documentation/_build/doctrees/Unicorn/Unicorn.doctree deleted file mode 100644 index 6f8972b0..00000000 Binary files a/documentation/_build/doctrees/Unicorn/Unicorn.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/UsersGuide/Configuration.doctree b/documentation/_build/doctrees/UsersGuide/Configuration.doctree deleted file mode 100644 index bfa5d8bd..00000000 Binary files a/documentation/_build/doctrees/UsersGuide/Configuration.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/UsersGuide/DesignFlow.doctree b/documentation/_build/doctrees/UsersGuide/DesignFlow.doctree deleted file mode 100644 index 60f8fd29..00000000 Binary files a/documentation/_build/doctrees/UsersGuide/DesignFlow.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/UsersGuide/Installation.doctree b/documentation/_build/doctrees/UsersGuide/Installation.doctree deleted file mode 100644 index 6d5d1775..00000000 Binary files a/documentation/_build/doctrees/UsersGuide/Installation.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/UsersGuide/LicenseCredits.doctree b/documentation/_build/doctrees/UsersGuide/LicenseCredits.doctree deleted file mode 100644 index d0d0b1d4..00000000 Binary files a/documentation/_build/doctrees/UsersGuide/LicenseCredits.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/UsersGuide/Releases.doctree b/documentation/_build/doctrees/UsersGuide/Releases.doctree deleted file mode 100644 index d76acf76..00000000 Binary files a/documentation/_build/doctrees/UsersGuide/Releases.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/UsersGuide/ScriptsPlugins.doctree b/documentation/_build/doctrees/UsersGuide/ScriptsPlugins.doctree deleted file mode 100644 index 8f29ca3d..00000000 Binary files a/documentation/_build/doctrees/UsersGuide/ScriptsPlugins.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/UsersGuide/ViewerTools.doctree b/documentation/_build/doctrees/UsersGuide/ViewerTools.doctree deleted file mode 100644 index d8e44b12..00000000 Binary files a/documentation/_build/doctrees/UsersGuide/ViewerTools.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/UsersGuide/index.doctree b/documentation/_build/doctrees/UsersGuide/index.doctree deleted file mode 100644 index c131f5a8..00000000 Binary files a/documentation/_build/doctrees/UsersGuide/index.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/Viewer/Viewer.doctree b/documentation/_build/doctrees/Viewer/Viewer.doctree deleted file mode 100644 index c0117cc1..00000000 Binary files a/documentation/_build/doctrees/Viewer/Viewer.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/defapi/defapi.doctree b/documentation/_build/doctrees/defapi/defapi.doctree deleted file mode 100644 index 42243118..00000000 Binary files a/documentation/_build/doctrees/defapi/defapi.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/environment.pickle b/documentation/_build/doctrees/environment.pickle deleted file mode 100644 index cfb943ee..00000000 Binary files a/documentation/_build/doctrees/environment.pickle and /dev/null differ diff --git a/documentation/_build/doctrees/etc/definitions.doctree b/documentation/_build/doctrees/etc/definitions.doctree deleted file mode 100644 index 1484e094..00000000 Binary files a/documentation/_build/doctrees/etc/definitions.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/index.doctree b/documentation/_build/doctrees/index.doctree deleted file mode 100644 index ef5f45cf..00000000 Binary files a/documentation/_build/doctrees/index.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/lefapi/lefapi.doctree b/documentation/_build/doctrees/lefapi/lefapi.doctree deleted file mode 100644 index 7d691d38..00000000 Binary files a/documentation/_build/doctrees/lefapi/lefapi.doctree and /dev/null differ diff --git a/documentation/_build/doctrees/lefdef/lefdef.doctree b/documentation/_build/doctrees/lefdef/lefdef.doctree deleted file mode 100644 index 74694e26..00000000 Binary files a/documentation/_build/doctrees/lefdef/lefdef.doctree and /dev/null differ diff --git a/documentation/_build/html/.buildinfo b/documentation/_build/html/.buildinfo deleted file mode 100644 index 56c7723e..00000000 --- a/documentation/_build/html/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 79af611b2f6590661a62e75020d49856 -tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/documentation/_build/html/Analog/Analog.html b/documentation/_build/html/Analog/Analog.html deleted file mode 100644 index 27f93390..00000000 --- a/documentation/_build/html/Analog/Analog.html +++ /dev/null @@ -1,585 +0,0 @@ - - - - - - - - - - - Hurricane/Analog Reference — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
-
    -
  • Docs »
  • - -
  • Hurricane/Analog Reference
  • -
  • - - - -
  • -
-
-
-
- -
-

Hurricane/Analog Reference¶

-

The Viewer C++ API reference is generated by Doxygen and is -available here: Hurricane/Analog

-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/Contents.html b/documentation/_build/html/Contents.html deleted file mode 100644 index 90df9bbd..00000000 --- a/documentation/_build/html/Contents.html +++ /dev/null @@ -1,1182 +0,0 @@ - - - - - - - - - - - Comprenhensive Table of Contents — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
-
    -
  • Docs »
  • - -
  • Comprenhensive Table of Contents
  • -
  • - - - -
  • -
-
-
-
- -
-

Comprenhensive Table of Contents¶

-
- -
-
- - -
-
- - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/CrlCore/CrlCore.html b/documentation/_build/html/CrlCore/CrlCore.html deleted file mode 100644 index 53d317ac..00000000 --- a/documentation/_build/html/CrlCore/CrlCore.html +++ /dev/null @@ -1,585 +0,0 @@ - - - - - - - - - - - CRL Core Reference — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
-
    -
  • Docs »
  • - -
  • CRL Core Reference
  • -
  • - - - -
  • -
-
-
-
- -
-

CRL Core Reference¶

-

The CRL Core C++ API reference is generated by Doxygen and is -available here: CRL Core

-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/Hurricane/Hurricane.html b/documentation/_build/html/Hurricane/Hurricane.html deleted file mode 100644 index a0182b3a..00000000 --- a/documentation/_build/html/Hurricane/Hurricane.html +++ /dev/null @@ -1,585 +0,0 @@ - - - - - - - - - - - Hurricane Reference — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
-
    -
  • Docs »
  • - -
  • Hurricane Reference
  • -
  • - - - -
  • -
-
-
-
- -
-

Hurricane Reference¶

-

The Hurricane C++ API reference is generated by Doxygen and is -available here: Hurricane

-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/Katabatic/Katabatic.html b/documentation/_build/html/Katabatic/Katabatic.html deleted file mode 100644 index a5785cfc..00000000 --- a/documentation/_build/html/Katabatic/Katabatic.html +++ /dev/null @@ -1,590 +0,0 @@ - - - - - - - - - - - Katabatic Reference — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
-
    -
  • Docs »
  • - -
  • Katabatic Reference
  • -
  • - - - -
  • -
-
-
-
- -
-

Katabatic Reference¶

-

The Katabatic C++ API reference is generated by Doxygen and is -available here: Katana

-
-

Note

-

The Katabatic API has served as a base for it’s -mixed signal conterpart Anabatic.

-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/Kite/Kite.html b/documentation/_build/html/Kite/Kite.html deleted file mode 100644 index 9e3c163a..00000000 --- a/documentation/_build/html/Kite/Kite.html +++ /dev/null @@ -1,590 +0,0 @@ - - - - - - - - - - - Kite Reference — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
-
    -
  • Docs »
  • - -
  • Kite Reference
  • -
  • - - - -
  • -
-
-
-
- -
-

Kite Reference¶

-

The Kite C++ API reference is generated by Doxygen and is -available here: Kite

-
-

Note

-

The Kite API has also served has a base for it’s -mixed-signal conterpart Katana (Kit[e]-Ana[logic]).

-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/Oroshi/Oroshi.html b/documentation/_build/html/Oroshi/Oroshi.html deleted file mode 100644 index 60ef6c2f..00000000 --- a/documentation/_build/html/Oroshi/Oroshi.html +++ /dev/null @@ -1,585 +0,0 @@ - - - - - - - - - - - Oroshi Reference — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
-
    -
  • Docs »
  • - -
  • Oroshi Reference
  • -
  • - - - -
  • -
-
-
-
- -
-

Oroshi Reference¶

-

The Oroshi Python API reference is generated by Doxygen and is -available here: Oroshi

-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonCpp/Configuration.html b/documentation/_build/html/PythonCpp/Configuration.html deleted file mode 100644 index 65749967..00000000 --- a/documentation/_build/html/PythonCpp/Configuration.html +++ /dev/null @@ -1,618 +0,0 @@ - - - - - - - - - - - 2. Basic File Structure and CMake configuration — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

2. Basic File Structure and CMake configuration¶

-

As a first example we will consider the Hurrican::Library -class. To export a class into Python, we must create three files:

-
    -
  1. PyLibrary.h, defines the PyLibrary C-Struct and the functions -needed outside the module istself (mostly for PyHurricane.cpp).
  2. -
  3. PyLibrary.cpp, contains the complete wrapping of the class and -the Python type definition (PyTypeLibrary).
  4. -
  5. PyHurricane.cpp, the definition of the Python module into which -the classes are registered. The module act as a namespace in -Python so it is good practice to give it the same name as it’s -associated C++ namespace.
  6. -
-

-

To build a Python module in cmake, use the following macro:

-
-
              set( pyCpps      PyLibrary.cpp
-                               PyHurricane.cpp )
-              set( pyIncludes  hurricane/isobar/PyLibrary.h
-
-add_python_module( "${pyCpps}"
-                   "${pyIncludes}"
-                   "isobar;1.0;1"     # Name & version of the supporting
-                                      # shared library.
-                   Hurricane          # Name of the Python module will give:
-                                      #   Hurricane.so
-                   "${depLibs}"       # List of dependency libraries.
-                   include/coriolis2/hurricane/isobar
-                                      # Where to install the include files.
-                 )
-
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonCpp/DBoHierarchy.html b/documentation/_build/html/PythonCpp/DBoHierarchy.html deleted file mode 100644 index 14cd7ed7..00000000 --- a/documentation/_build/html/PythonCpp/DBoHierarchy.html +++ /dev/null @@ -1,990 +0,0 @@ - - - - - - - - - - - 4. Case 2 - Hierarchy of DBo Derived Classes — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -

-
-

4. Case 2 - Hierarchy of DBo Derived Classes¶

-

Now we want to export the following C++ class hierarchy into Python:

-
PyEntity <-- PyComponent <-+- PyContact
-                           +- PySegment <-+- PyHorizontal
-                                          +- PyVertical
-
-
-
-

4.1 Base Class Header¶

-

Remark: this is only a partial description of the tree for the sake of -clarity.

-

One important fact to remember is that PyEntity and PyComponent -being related to C++ abstract classes, no objects of those types will be -created, only PyContact, PyHorizontal or PyVertical will.

-

The consequence is that there is no PyEntity_Link() like in 3.1 Class Associated Header File -but instead two functions:

-
    -
  1. PyEntity_NEW() which create the relevant PyEntity derived -object from the Entity one. For example, if the Entity* given -as argument is in fact a Horizontal*, then the function will -return a PyHorizontal*.
  2. -
  3. EntityCast() do the reverse of PyEntity_NEW() that is, from -a PyEntity, return the C++ derived object. Again, if the -PyEntity* is a PyHorizontal*, the function will cast it as -a Horizontal* then return it as an Entity*.
  4. -
-
#ifndef ISOBAR_PY_ENTITY_H
-#define ISOBAR_PY_ENTITY_H
-
-#include "hurricane/isobar/PyHurricane.h"
-#include "hurricane/Entity.h"
-
-namespace  Isobar {
-  extern "C" {
-
-    typedef struct {
-        PyObject_HEAD
-        Hurricane::Entity* _object;
-    } PyEntity;
-
-    extern  PyObject*     PyEntity_NEW        ( Hurricane::Entity* entity );
-    extern  void          PyEntity_LinkPyType ();
-    extern  PyTypeObject  PyTypeEntity;
-    extern  PyMethodDef   PyEntity_Methods[];
-
-
-#define IsPyEntity(v)    ( (v)->ob_type == &PyTypeEntity )
-#define PYENTITY(v)      ( (PyEntity*)(v) )
-#define PYENTITY_O(v)    ( PYENTITY(v)->_object )
-
-  }  // extern "C".
-
-  Hurricane::Entity*  EntityCast ( PyObject* derivedObject );
-
-}  // Isobar namespace.
-
-#endif  // ISOBAR_PY_ENTITY_H
-
-
-

-
-
-

4.2 Base Class File¶

-

Changes from 3.2 Class Associated File are:

-
    -
  1. No call to DBoLinkCreateMethod() because there must be no PyEntity_Link(), -but the definitions of PyEntity_NEW() and EntityCast.
  2. -
  3. For defining the PyTypeEntity Python type, we call a different -macro: PyTypeRootObjectDefinitions, dedicated to base classes.
  4. -
-
#include "hurricane/isobar/PyCell.h"
-#include "hurricane/isobar/PyHorizontal.h"
-#include "hurricane/isobar/PyVertical.h"
-#include "hurricane/isobar/PyContact.h"
-
-namespace Isobar {
-  using namespace Hurricane;
-
-  extern "C" {
-
-#if defined(__PYTHON_MODULE__)
-
-#define  METHOD_HEAD(function)   GENERIC_METHOD_HEAD(Entity,entity,function)
-
-    DBoDestroyAttribute(PyEntity_destroy ,PyEntity)
-
-    static PyObject* PyEntity_getCell ( PyEntity *self )
-    {
-      Cell* cell = NULL;
-      HTRY
-        METHOD_HEAD( "Entity.getCell()" )
-        cell = entity->getCell();
-      HCATCH
-      return PyCell_Link( cell );
-    }
-
-    PyMethodDef PyEntity_Methods[] =
-      { { "getCell", (PyCFunction)PyEntity_getCell, METH_NOARGS
-                   , "Returns the entity cell." }
-      , { "destroy", (PyCFunction)PyEntity_destroy, METH_NOARGS
-                   , "Destroy associated hurricane object, the python object remains." }
-      , {NULL, NULL, 0, NULL}  /* sentinel */
-      };
-
-
-    DBoDeleteMethod(Entity)
-    PyTypeObjectLinkPyType(Entity)
-
-#else  // End of Python Module Code Part.
-
-    PyObject* PyEntity_NEW ( Entity* entity )
-    {
-      if (not entity) {
-        PyErr_SetString ( HurricaneError, "Invalid Entity (bad occurrence)" );
-        return NULL;
-      }
-
-      Horizontal* horizontal = dynamic_cast<Horizontal*>(entity);
-      if (horizontal) return PyHorizontal_Link( horizontal );
-
-      Vertical* vertical = dynamic_cast<Vertical*>(entity);
-      if (vertical) return PyVertical_Link( vertical );
-
-      Contact* contact = dynamic_cast<Contact*>(entity);
-      if (contact) return PyContact_Link( contact );
-
-      Py_RETURN_NONE;
-    }
-
-    PyTypeRootObjectDefinitions(Entity)
-
-#endif  // Shared Library Code Part (1).
-
-}  // extern "C".
-
-
-#if !defined(__PYTHON_MODULE__)
-
-Hurricane::Entity* EntityCast ( PyObject* derivedObject ) {
-  if (IsPyHorizontal(derivedObject)) return PYHORIZONTAL_O(derivedObject);
-  if (IsPyVertical  (derivedObject)) return PYVERTICAL_O(derivedObject);
-  if (IsPyContact   (derivedObject)) return PYCONTACT_O(derivedObject);
-  return NULL;
-}
-
-#endif  // Shared Library Code Part (2).
-
-}  // Isobar namespace.
-
-
-

-
-
-

4.3 Intermediate Class Header¶

-

Changes from 3.1 Class Associated Header File are:

-
    -
  1. As for PyEntity, and because this is still an abstract class, -there is no PyComponent_Link() function.
  2. -
  3. The definition of the PyComponent struct is differs. There is -no PyObject_HEAD (it is a Python derived class). The only -field is of the base class type PyEntity and for use with -Coriolis macros, it must be named _baseObject (note that -this is not a pointer but a whole object).
  4. -
-
#ifndef ISOBAR_PY_COMPONENT_H
-#define ISOBAR_PY_COMPONENT_H
-
-#include "hurricane/isobar/PyEntity.h"
-#include "hurricane/Component.h"
-
-namespace  Isobar {
-  extern "C" {
-
-    typedef struct {
-        PyEntity  _baseObject;
-    } PyComponent;
-
-    extern  PyTypeObject  PyTypeComponent;
-    extern  PyMethodDef   PyComponent_Methods[];
-    extern  void          PyComponent_LinkPyType ();
-
-#define IsPyComponent(v) ((v)->ob_type == &PyTypeComponent)
-#define PYCOMPONENT(v)   ((PyComponent*)(v))
-#define PYCOMPONENT_O(v) (static_cast<Component*>(PYCOMPONENT(v)->_baseObject._object))
-
-  }  // extern "C".
-}  // Isobar namespace.
-
-#endif
-
-
-
-
-

4.4 Intermediate Class File¶

-

Changes from 3.2 Class Associated File are:

-
    -
  1. Redefinition of the default macros ACCESS_OBJECT and ACCESS_CLASS.
      -
    • The pointer to the C++ encapsulated object (attribute _object) is hold -by the base class PyEntity. The ACCESS_OBJECT macro which is tasked -to give access to that attribute is then _baseObject._object as -PyComponent is a direct derived class of PyEntity.
    • -
    • ACCESS_CLASS is similar to ACCESS_OBJECT for accessing the base -class, that is a pointer to PyEntity.
    • -
    -
  2. -
-

-
    -
  1. For defining the PyTypeComponent Python type, we call a yet different -macro: PyTypeInheritedObjectDefinitions(), dedicated to derived classes. -For this this macro we need to give as argument the derived class and the -base class.
  2. -
-
#include "hurricane/isobar/PyComponent.h"
-#include "hurricane/isobar/PyNet.h"
-
-namespace  Isobar {
-  using namespace Hurricane;
-
-  extern "C" {
-
-#undef   ACCESS_OBJECT
-#undef   ACCESS_CLASS
-#define  ACCESS_OBJECT           _baseObject._object
-#define  ACCESS_CLASS(_pyObject)  &(_pyObject->_baseObject)
-#define  METHOD_HEAD(function)   GENERIC_METHOD_HEAD(Component,component,function)
-
-#if defined(__PYTHON_MODULE__)
-
-    DirectGetLongAttribute(PyComponent_getX,getX,PyComponent,Component)
-    DirectGetLongAttribute(PyComponent_getY,getY,PyComponent,Component)
-    DBoDestroyAttribute(PyComponent_destroy,PyComponent)
-
-    static PyObject* PyComponent_getNet ( PyComponent *self )
-    {
-      Net* net = NULL;
-      HTRY
-        METHOD_HEAD( "Component.getNet()" )
-        net = component->getNet( );
-      HCATCH
-      return PyNet_Link( net );
-    }
-
-    PyMethodDef PyComponent_Methods[] =
-      { { "getX"   , (PyCFunction)PyComponent_getX   , METH_NOARGS
-                   , "Return the Component X value." }
-      , { "getY"   , (PyCFunction)PyComponent_getY   , METH_NOARGS
-                   , "Return the Component Y value." }
-      , { "getNet" , (PyCFunction)PyComponent_getNet , METH_NOARGS
-                   , "Returns the net owning the component." }
-      , { "destroy", (PyCFunction)PyComponent_destroy, METH_NOARGS
-                   , "destroy associated hurricane object, the python object remains." }
-      , {NULL, NULL, 0, NULL}    /* sentinel */
-      };
-
-    DBoDeleteMethod(Component)
-    PyTypeObjectLinkPyType(Component)
-
-#else  // Python Module Code Part.
-
-    PyTypeInheritedObjectDefinitions(Component, Entity)
-
-#endif  // Shared Library Code Part.
-
-  }  // extern "C".
-}  // Isobar namespace.
-
-
-
-
-

4.5 Terminal Class Header¶

-

The contents of this file is almost identical to 4.3 Intermediate Class Header, -save for the presence of a PyContact_Link() function. She is present -at this level because the class is a concrete one and can be instanciated.

-
#ifndef ISOBAR_PY_CONTACT_H
-#define ISOBAR_PY_CONTACT_H
-
-#include "hurricane/isobar/PyComponent.h"
-#include "hurricane/Contact.h"
-
-namespace  Isobar {
-  extern "C" {
-
-    typedef struct {
-      PyComponent _baseObject;
-    } PyContact;
-
-    extern PyTypeObject  PyTypeContact;
-    extern PyMethodDef   PyContact_Methods[];
-    extern PyObject*     PyContact_Link       ( Hurricane::Contact* object );
-    extern void          PyContact_LinkPyType ();
-
-#define IsPyContact(v)    ( (v)->ob_type == &PyTypeContact )
-#define PYCONTACT(v)      ( (PyContact*)(v) )
-#define PYCONTACT_O(v)    ( PYCONTACT(v)->_baseObject._baseObject._object )
-
-  }  // extern "C".
-}  // Isobar namespace.
-
-#endif  // ISOBAR_PY_CONTACT_H
-
-
-
-
-

4.6 Terminal Class File¶

-

Changes from 4.4 Intermediate Class File are:

-
    -
  1. As previously, we have to redefine the macros ACCESS_OBJECT and ACCESS_CLASS. -But, as we are one level deeper into the hierarchy, one more level of -indirection using _baseObject must be used.
      -
    • ACCESS_OBJECT becomes _baseObject._baseObject._object.
    • -
    • ACCESS_CLASS becomes &(_pyObject->_baseObject._baseObject).
    • -
    -
  2. -
  3. For defining the PyTypeContact Python type, we call again -PyTypeInheritedObjectDefinitions(). It is the same whether the class is -terminal or not.
  4. -
  5. And, this time, as the Python class is concrete, we call the macro -DBoLinkCreateMethod() to create the PyContact_Link() function.
  6. -
-
#include "hurricane/isobar/PyContact.h"
-
-namespace  Isobar {
-  using namespace Hurricane;
-
-  extern "C" {
-
-#undef  ACCESS_OBJECT
-#undef  ACCESS_CLASS
-#define ACCESS_OBJECT           _baseObject._baseObject._object
-#define ACCESS_CLASS(_pyObject) &(_pyObject->_baseObject._baseObject)
-#define METHOD_HEAD(function)   GENERIC_METHOD_HEAD(Contact,contact,function)
-
-#if defined(__PYTHON_MODULE__)
-
-    DirectGetLongAttribute(PyContact_getWidth , getWidth , PyContact,Contact)
-    DirectGetLongAttribute(PyContact_getHeight, getHeight, PyContact,Contact)
-    DBoDestroyAttribute(PyContact_destroy, PyContact)
-
-    static PyObject* PyContact_create ( PyObject*, PyObject *args )
-    {
-      Contact* contact = NULL;
-      HTRY
-        // Usual signature then arguments parsing.
-      HCATCH
-      return PyContact_Link(contact);
-    }
-
-    PyMethodDef PyContact_Methods[] =
-      { { "create"   , (PyCFunction)PyContact_create   , METH_VARARGS|METH_STATIC
-                     , "Create a new Contact." }
-      , { "destroy"  , (PyCFunction)PyContact_destroy  , METH_NOARGS
-                     , "Destroy associated hurricane object, the python object remains." }
-      , { "getWidth" , (PyCFunction)PyContact_getWidth , METH_NOARGS
-                     , "Return the contact width." }
-      , { "getHeight", (PyCFunction)PyContact_getHeight, METH_NOARGS
-                     , "Return the contact height." }
-      , {NULL, NULL, 0, NULL}  /* sentinel */
-      };
-
-    DBoDeleteMethod(Contact)
-    PyTypeObjectLinkPyType(Contact)
-
-#else  // Python Module Code Part.
-
-    DBoLinkCreateMethod(Contact)
-    PyTypeInheritedObjectDefinitions(Contact, Component)
-
-#endif  // Shared Library Code Part.
-
-  }  // extern "C".
-}  // Isobar namespace.
-
-
-
-
-

4.8 Python Module¶

-
DL_EXPORT(void) initHurricane ()
-{
-  PyEntity_LinkPyType();  // step 1.
-  PyComponent_LinkPyType();
-  PyContact_LinkPyType();
-
-  PYTYPE_READY( Entity )  // step 2.
-  PYTYPE_READY_SUB( Component, Entity )
-  PYTYPE_READY_SUB( Contact  , Component )
-
-  __cs.addType( "ent"    , &PyTypeEntity   , "<Entity>"   , false ); // step 3.
-  __cs.addType( "comp"   , &PyTypeComponent, "<Component>", false, "ent"  );
-  __cs.addType( "contact", &PyTypeContact  , "<Contact>"  , false, "comp" );
-
-  PyObject* module = Py_InitModule( "Hurricane", PyHurricane_Methods );
-  if (module == NULL) {
-    cerr << "[ERROR]\n"
-         << "  Failed to initialize Hurricane module." << endl;
-    return;
-  }
-
-  Py_INCREF( &PyTypeContact );                                        // step 4.
-  PyModule_AddObject( module, "Contact", (PyObject*)&PyTypeContact ); // step 4.
-}
-
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonCpp/DBoStandalone.html b/documentation/_build/html/PythonCpp/DBoStandalone.html deleted file mode 100644 index 8f749de1..00000000 --- a/documentation/_build/html/PythonCpp/DBoStandalone.html +++ /dev/null @@ -1,920 +0,0 @@ - - - - - - - - - - - 3. Case 1 - DBo Derived, Standalone — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

3. Case 1 - DBo Derived, Standalone¶

-

As example, we take Library. This a DBo derived class, but we -choose not to export the parent classes. From Python, it will appear -as a base class.

-
-

3.1 Class Associated Header File¶

-

Here is the typical content of a header file (for PyLibrary):

-
#ifndef  PY_LIBRARY_H
-#define  PY_LIBRARY_H
-
-#include "hurricane/isobar/PyHurricane.h"
-#include "hurricane/Library.h"
-
-namespace  Isobar {
-  using namespace Hurricane;
-
-  extern "C" {
-
-    typedef struct {
-        PyObject_HEAD
-        Library* _object;
-    } PyLibrary;
-
-    extern  PyTypeObject  PyTypeLibrary;
-    extern  PyMethodDef   PyLibrary_Methods[];
-    extern  PyObject*     PyLibrary_Link       ( Hurricane::Library* lib );
-    extern  void          PyLibrary_LinkPyType ();
-
-
-#define IsPyLibrary(v) ( (v)->ob_type == &PyTypeLibrary )
-#define PYLIBRARY(v)   ( (PyLibrary*)(v) )
-#define PYLIBRARY_O(v) ( PYLIBRARY(v)->_object )
-
-  }  // extern "C".
-}  // Isobar namespace.
-
-#endif  // PY_LIBRARY_H
-
-
-

The code is organized as follow:

-
    -
  1. It must have, as the first include PyHurricane.h, which provides -the complete bunch of macros needed to build the module. Then the include -of the C++ class we want to wrap (Library.h).

    -
  2. -
  3. As Python is written in C, all the wrapper code has to be but inside -an extern "C" namespace.

    -
  4. -
  5. Definition of the wrapped struct, PyLibrary. It is standard Python here.

    -
    -

    Note

    -

    For our set of macros to work, the name of the pointer to the -C++ class must always be _object, and the various functions and -macros defined here must take the name of the class (either in -lowercase, camel case or capitals).

    -
    -
  6. -
  7. Declaration of the Python type PyTypeLibrary (standard).

    -
  8. -
  9. Declaration of the Python type table of methods PyLibrary_Methods (standard).

    -
  10. -
-
    -
  1. Declaration of PyLibrary_Link(), helper to convert a C++ Lybrary into -a PyLibrary (put in the support shared library).
  2. -
  3. Declaration of PyLibrary_LinkPyType(), this function setup the class-level -function of the new Python type (here, PyTypeLibrary).
  4. -
  5. And, lastly, three macros to:
      -
    • IsPylibrary(), know if a Python object is a PyLibrary
    • -
    • PYLIBRARY(), force cast (C style) of a PyObject into a PyLibrary.
    • -
    • PYLIBRARY_O(), extract the C++ object (Library*) from the Python -object (PyLibrary).
    • -
    -
  6. -
-
-
-

3.2 Class Associated File¶

-
-

3.2.1 Head of the file¶

-
#include "hurricane/isobar/PyLibrary.h"
-#include "hurricane/isobar/PyDataBase.h"
-#include "hurricane/isobar/PyCell.h"
-
-namespace Isobar {
-  using namespace Hurricane;
-
-  extern "C" {
-
-#define  METHOD_HEAD(function)   GENERIC_METHOD_HEAD(Library,lib,function)
-
-
-

As for the header, all the code must be put inside a extern "C" namespace.

-

A convenience macro METHOD_HEAD() must be defined, by refining -GENERIC_METHOD_HEAD(). This macro will be used in the method wrappers -below to cast the _object field of the Python object into the -appropriate C++ class, this is done using a C-style cast. -The parameters of that macro are:

-
    -
  1. The C++ encapsulated class (Library).
  2. -
  3. The name of the variable that will be used to store a pointer -to the C++ working object.
  4. -
  5. The name of the C++ method which is to be wrapped.
  6. -
-
-
-

3.2.2 The Python Module Part¶

-

First, we have to build all the wrappers to the C++ methods of -the class. For common predicates, accessors, and mutators macros -are supplied.

-

Wrapping of the Library::getCell() method:

-
static PyObject* PyLibrary_getCell ( PyLibrary* self, PyObject* args )
-{
-  Cell* cell = NULL;
-
-  HTRY
-    METHOD_HEAD( "Library.getCell()" )
-    char* name = NULL;
-    if (PyArg_ParseTuple(args,"s:Library.getCell", &name)) {
-      cell = lib->getCell( Name(name) );
-    } else {
-      PyErr_SetString( ConstructorError
-                     , "invalid number of parameters for Library::getCell." );
-      return NULL;
-    }
-  HCATCH
-
-  return PyCell_Link(cell);
-}
-
-
-

Key points about this method wrapper:

-
    -
  1. The HTRY / HCATCH macros provides an insulation from the C++ -exceptions. If one is emitted, it will be catched and transformed in -a Python one. This way, the Python program will be cleanly interrupted -and the usual stack trace displayed.
  2. -
  3. The returned value of this method is of type Cell*, we have to -transform it into a Python one. This is done with PyCell_Link(). -This macro is supplied by the PyCell.h header and this is why -it must be included.
  4. -
-

-

Wrapping of the Library::create() method:

-
static PyObject* PyLibrary_create( PyObject*, PyObject* args )
-{
-  PyObject* arg0;
-  PyObject* arg1;
-  Library* library = NULL;
-
-  HTRY
-    __cs.init( "Library.create" );                          // Step (1).
-    if (not PyArg_ParseTuple( args, "O&O&:Library.create"
-                            , Converter, &arg0
-                            , Converter, &arg1 )) {         // Step (2).
-      PyErr_SetString( ConstructorError
-                     , "invalid number of parameters for Library constructor." );
-      return NULL;
-    }
-    if (__cs.getObjectIds() == ":db:string") {              // Step (3.a)
-      DataBase* db = PYDATABASE_O(arg0);
-      library = Library::create( db, Name(PyString_AsString(arg1)) );
-    } else if (__cs.getObjectIds() == ":library:string") {  // Step (3.b)
-      Library* masterLibrary = PYLIBRARY_O(arg0);
-      library = Library::create( masterLibrary, Name(PyString_AsString(arg1)) );
-    } else {
-      PyErr_SetString( ConstructorError
-                     , "invalid number of parameters for Library constructor." );
-      return NULL;
-    }
-  HCATCH
-
-  return PyLibrary_Link( library );
-}
-
-
-

Key point about this constructor:

-
    -
  1. We want the Python interface to mimic as closely as possible the -C++ API. As such, Python object will be created using a static -.create() method. So we do not use the usual Python allocation -mechanism.
  2. -
  3. As it is a static method, there is no first argument.
  4. -
  5. Python do not allow function overload like C++. To emulate that -behavior we use the __cs object (which is a global variable).
      -
    1. Init/reset the __cs object: see step (1).
    2. -
    3. Call PyArg_ParseTuple(), read every mandatory or optional -argument as a Python object ("O&") and use Converter -on each one. Converter will determine the real type of -the Python object given as argument by looking at the -encapsulated C++ class. It then update the __cs object. -Done in step (2)
    4. -
    5. After the call to PyArg_ParseTuple(), the function -__cs.getObjectIds() will return the signature of -the various arguments. In our case, the valid signatures -will be ":db:string" (step (3.a)*a) and ``”:library:string”`` -(*step (3.b)).
    6. -
    7. Call the C++ method after extracting the C++ objects from -the Python arguments. Note the use of the PYLIBRARY_O() -and PYDATABSE_O() macros to perform the conversion.
    8. -
    -
  6. -
  7. Return the result, encapsulated through a call to PyLibrary_Link().
  8. -
-

-

Wrapping of the Library::destroy() method:

-
DBoDestroyAttribute(PyLibrary_destroy, PyLibrary)
-
-
-

For C++ classes that are derived from DBo, the destroy method -wrapper must be defined using the macro DBoDestroyAttribute(). -This macro implements the bi-directional communication mechanism -using Hurricane::Property. It must not be used for -non DBo derived classes.

-

Defining the method table of the PyLibrary type:

-
PyMethodDef PyLibrary_Methods[] =
-  { { "create"    , (PyCFunction)PyLibrary_create , METH_VARARGS|METH_STATIC
-                  , "Creates a new library." }
-  , { "getCell"   , (PyCFunction)PyLibrary_getCell, METH_VARARGS
-                  , "Get the cell of name <name>" }
-  , { "destroy"   , (PyCFunction)PyLibrary_destroy, METH_NOARGS
-                  , "Destroy associated hurricane object The python object remains." }
-  , {NULL, NULL, 0, NULL}           /* sentinel */
-  };
-
-
-

This is standard Python/C API. The name of the PyMethodDef table must be -named from the class: PyLibrary_Methods.

-
-
-

3.2.3 Python Type Linking¶

-

Defining the PyTypeLibrary class methods and the type linking function.

-

Those are the functions for the Python object itself to work, not the -wrapped method from the C++ class.

-
-

Note

-

At this point we do not define the PyTypeLibrary itself. -Only it’s functions and a function to set them up once the -type will be defined.

-
-
DBoDeleteMethod(Library)
-PyTypeObjectLinkPyType(Library)
-
-
-

The macro DBoDeleteMethod() define the function to delete a -PyLibrary Python object. Again, do not mistake it for the deletion -of the C++ class (implemented by DBoDestroyAttribute()). -Here again, DBoDeleteMethod() is specially tailored for -DBo derived classes.

-

To define PyLibrary_LinkPyType(), use the PyTypeObjectLinkPyType() -macro. This macro is specific for DBo derived classes that are seen as -base classes under Python (i.e. we don’t bother exposing the base -class under Python). PyLibrary_LinkPyType() setup the class functions -in the PyTypeLibrary type object, it must be called in the -Python module this class is part of (in this case: PyHurricane.cpp). -This particular flavor of the macro will define and setup the -following class functions:

-
    -
  • PyTypeLibrary.tp_compare (defined by the macro).
  • -
  • PyTypeLibrary.tp_repr (defined by the macro).
  • -
  • PyTypeLibrary.tp_str (defined by the macro).
  • -
  • PyTypeLibrary.tp_hash (defined by the macro).
  • -
  • PyTypeLibrary.tp_methods sets to the previously defined PyLibrary_Methods table.
  • -
  • PyTypeLibrary.tp_dealloc is set to a function that must be named PyLibrary_DeAlloc, -this is what DBoDeleteMethod does. It is not done by PyTypeObjectLinkPyType.
  • -
-

Defining the PyTypeLibrary type:

-
-
-

3.2.4 The Shared Library Part¶

-

This part will be put in a separate supporting shared library, allowing -other Python module to link against it (and make use of its symbols).

-
DBoLinkCreateMethod(Library)
-PyTypeObjectDefinitions(Library)
-
-
-

To define PyTypeLibrary, use the PyTypeObjectDefinitions() macro. -This macro is specific for classes that, as exposed by Python, -are neither derived classes nor base classes for others. -That is, they are standalone from the inheritance point of view.

-

The DBoLinkCreateMethod() macro will define the PyLibrary_Link() -function which is responsible for encapsulating a C++ Library object -into a Python PyLibrary one.

-
-
-
-

3.3 Python Module (C++ namespace)¶

-

We use the Python module to replicate the C++ namespace. Thus, for the -Hurricane namespace we create a Python Hurricane module which is -defined in the PyHurricane.cpp file, then we add into that module -dictionary all the Python types encapsulating the C++ classes of that -namespace.

-
DL_EXPORT(void) initHurricane ()
-{
-  PyLibrary_LinkPyType();  // step 1.
-
-  PYTYPE_READY( Library )  // step 2.
-
-  __cs.addType( "library", &PyTypeLibrary, "<Library>", false ); // step 3.
-
-  PyObject* module = Py_InitModule( "Hurricane", PyHurricane_Methods );
-  if (module == NULL) {
-    cerr << "[ERROR]\n"
-         << "  Failed to initialize Hurricane module." << endl;
-    return;
-  }
-
-  Py_INCREF( &PyTypeLibrary );                                        // step 4.
-  PyModule_AddObject( module, "Library", (PyObject*)&PyTypeLibrary ); // step 4.
-}
-
-
-

The initHurricane() initialisation function shown above has -been scrubbed of everything not relevant to the PyLibrary class. -The integration of the PyLibrary class into the module needs -four steps:

-
    -
  1. A call to PyLibrary_LinkPyType() to hook the Python type functions -in the Python type object.

    -
  2. -
  3. A call to the PYTYPE_READY() macro (standard Python).

    -
  4. -
  5. Registering the type into the __cs object, with addType(). -The arguments are self explanatory, save for the last which is a -boolean to tell if this is a derived class or not.

    -
  6. -
  7. Adding the type object (PyTypeLibrary) into the dictionnary of -the module itself. This allow to mimic closely the C++ syntax:

    -
    import Hurricane
    -lib = Hurricane.Library.create( db, 'root' )
    -
    -
    -
  8. -
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonCpp/DbU.html b/documentation/_build/html/PythonCpp/DbU.html deleted file mode 100644 index 310c5148..00000000 --- a/documentation/_build/html/PythonCpp/DbU.html +++ /dev/null @@ -1,634 +0,0 @@ - - - - - - - - - - - 6. Encapsulating DbU — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

6. Encapsulating DbU¶

-

While Hurricane::DbU is a class, the Hurricane::DbU::Unit is only -a typedef over uint64_t. The DbU class only provides a set of -static methods to manipulate and convert to and from other units. -At Python level, DbU::Unit will be stored in plain long long.

-

When a DbU::Unit argument is expected in a Python functions, just use -the DbU::Unit  PyAny_AsLong( PyObject* ) function to convert it.

-

For example, if we explicit the expension of:

-
DirectSetLongAttribute(PyPoint_SetX,setX,PyPoint,Point)
-
-
-

-

We would get:

-
static PyObject* PyPoint_setX ( PyPoint *self, PyObject* args )
-{
-  Point* cobject = static_cast<Point*>( self->_object );
-  if (cobject == NULL) {
-    PyErr_SetString( ProxyError
-                   , "Attempt to call Point.setX() on an unbound Hurricane object" );
-    return NULL;
-  }
-
-  HTRY
-    PyObject* arg0 = NULL;
-    if (not PyArg_ParseTuple( args, "O:Point.setX()", &arg0 ))
-      return ( NULL );
-    cobject->setX( Isobar::PyAny_AsLong(arg0) );
-  HCATCH
-  Py_RETURN_NONE;
-}
-
-
-

For the other way around, use PyObject* PyDbU_FromLong( DbU::Unit ).

-
DirectGetLongAttribute(PyPoint_GetX,getX,PyPoint,Point)
-
-
-

We would get:

-
static PyObject* PyPoint_GetX ( PyPoint *self, PyObject* args )
-{
-  Point* cobject = static_cast<Point*>( self->_object );
-  if (cobject == NULL) {
-    PyErr_SetString( ProxyError
-                   , "Attempt to call Point.getX() on an unbound Hurricane object" );
-    return NULL;
-  }
-  return Isobar::PyDbU_FromLong(cobject->getX());
-}
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonCpp/Introduction.html b/documentation/_build/html/PythonCpp/Introduction.html deleted file mode 100644 index 1e7338fd..00000000 --- a/documentation/_build/html/PythonCpp/Introduction.html +++ /dev/null @@ -1,748 +0,0 @@ - - - - - - - - - - - 1. Introduction — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

1. Introduction¶

-
    -
  • This document is written for people already familiar with the -Python/C API Reference Manual.
  • -
  • The macros provided by the Hurricane Python/C API are written using -the standard Python C/API. That is, you may not use them and write -directly your functions with the original API or any mix between. -You only have to respect some naming convention.
  • -
  • Coriolis is build against Python 2.7.
  • -
-
-

1.1 First, A Disclaimer¶

-

The Hurricane Python/C++ API has been written about ten years ago, at a time -my mastering of template programming was less than complete. This is why this -interface is build with old fashioned C macro instead of C++ template.

-

It is my hope that at some point in the future I will have time to completly -rewrite it, borrowing the interface from boost::python.

-
-
-

1.2 About Technical Choices¶

-

Some would say, why not use off the shelf wrappers like swig -or boost::python, here are some clues.

-
    -
  1. Partial exposure of the C++ class tree. We expose at Python level -C++ base classes, only if they provides common methods that we want -to see. Otherwise, we just show them as base classes under Python. -For instance Library is derived from DBo, but we won’t see -it under Python.

    -
  2. -
  3. Bi-directional communication. When a Python object is deleted, the -wrapper obviously has a pointer toward the underlying C++ object and -is able to delete it. But, the reverse case can occurs, meaning that -you have a C++ object wrapped in Python and the database delete the -underlying object. The wrapped Python object must be informed that -it no longer refer a valid C++ one. Moreover, as we do not control -when Python objects gets deleteds (that is, when their reference count -reaches zero), we can have valid Python object with a dangling -C++ pointer. So our Python objects can be warned by the C++ objects -that they are no longer valid and any other operation than the -deletion should result in a severe non-blocking error.

    -

    To be precise, this apply to persistent object in the C++ database, -like Cell, Net, Instance or Component. Short lived -objects like Box or Point retains the classic Python behavior.

    -

    Another aspect is that, for all derived DBo objects, one and only -one Python object is associated. For one given Instance object we -will always return the same PyInstance object, thanks to the -bi-directional link. Obviously, the reference count of the -PyInstance is managed accordingly. This mechanism is implemented -by the PyInstance_Link() function.

    -
  4. -
  5. Linking accross modules. As far as I understand, the wrappers -are for monolithic libraries. That is, you wrap the entire library -in one go. But Hurricane has a modular design, the core database -then various tools. We do not, and cannot, have one gigantic wrapper -that would encompass all the libraries in one go. We do one Python -module for one C++ library.

    -

    This brings another issue, at Python level this time. The Python -modules for the libraries have to share some functions. Python -provides a mechanism to pass C function pointers accross modules, -but I did found it cumbersome. Instead, all our modules are split -in two:

    -
      -
    • The first part contains the classic Python module code.
    • -
    • The second part is to be put in a separate dynamic library that -will hold the shared functions. The Python module is dynamically linked -against that library like any other. And any other Python module -requiring the functions will link against the associated shared -library.
    • -
    -

    Each module file will be compiled twice, once to build the Python -module (__PYTHON_MODULE is defined) and once to build the supporting -shared library (__PYTHON_MODULE__ not defined). This tricky -double compilation is taken care of though the add_python_module -cmake macro.

    -

    For the core Hurricane library we will have:

    -
      -
    • Hurricane.so the Python module (use with: import Hurricane).
    • -
    • libisobar.so.1.0 the supporting shared library.
    • -
    -

    The PyLibrary.cpp file will have the following structure:

    -
    #include "hurricane/isobar/PyLibrary.h"
    -
    -namespace  Isobar {
    -
    -  extern "C" {
    -
    -#if defined(__PYTHON_MODULE__)
    -
    -  // +=================================================================+
    -  // |               "PyLibrary" Python Module Code Part               |
    -  // +=================================================================+
    -  //
    -  // The classic part of a Python module. Goes into Hurricane.so.
    -
    -
    -#else  // End of Python Module Code Part.
    -
    -  // x=================================================================x
    -  // |              "PyLibrary" Shared Library Code Part               |
    -  // x=================================================================x
    -  //
    -  // Functions here will be part of the associated shared library and
    -  // made available to all other Python modules. Goes into libisobar.so.1.0
    -
    -
    -# endif  // Shared Library Code Part.
    -
    -  }  // extern "C".
    -
    -}  // Isobar namespace.
    -
    -
    -

    This way, we do not rely upon a pointer transmission through Python -modules, but directly uses linker capabilities.

    -
  6. -
-
-
-

1.3 Botched Design¶

-

The mechanism to compute the signature of a call to a Python function, -the __cs object, is much too complex and, in fact, not needed. -At some point I may root it out, but it is used in so many places...

-

What I should have used the "O!" capablity of PyArg_ParseTuple(), -like in the code below:

-

-
static PyObject* PyContact_create ( PyObject*, PyObject *args )
-{
-  Contact* contact = NULL;
-  HTRY
-    PyNet*       pyNet       = NULL;
-    PyLayer*     pyLayer     = NULL;
-    PyComponent* pyComponent = NULL;
-    DbU::Unit    x           = 0;
-    DbU::Unit    y           = 0;
-    DbU::Unit    width       = 0;
-    DbU::Unit    height      = 0;
-
-    if (PyArg_ParseTuple( args, "O!O!ll|ll:Contact.create"
-                        , &PyTypeNet  , &pyNet
-                        , &PyTypeLayer, &pyLayer
-                        , &x, &y, &width, &height)) {
-      contact = Contact::create( PYNET_O(pyNet), PYLAYER_O(pyLayer)
-                               , x, y, width, height );
-    } else {
-      PyErr_Clear();
-      if (PyArg_ParseTuple( args, "O!O!ll|ll:Contact.create"
-                          , &PyTypeComponent, &pyComponent
-                          , &PyTypeLayer    , &pyLayer
-                          , &x, &y, &width, &height)) {
-        contact = Contact::create( PYCOMPONENT_O(pyComponent), PYLAYER_O(pyLayer)
-                                 , x, y, width, height );
-      } else {
-        PyErr_SetString( ConstructorError
-                       , "invalid number of parameters for Contact constructor." );
-        return NULL;
-      }
-    }
-  HCATCH
-  return PyContact_Link( contact );
-}
-
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonCpp/Name.html b/documentation/_build/html/PythonCpp/Name.html deleted file mode 100644 index 66032b4a..00000000 --- a/documentation/_build/html/PythonCpp/Name.html +++ /dev/null @@ -1,587 +0,0 @@ - - - - - - - - - - - 7. No C++ Hurricane::Name encapsulation — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

7. No C++ Hurricane::Name encapsulation¶

-

To be written.

-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonCpp/NonDBo.html b/documentation/_build/html/PythonCpp/NonDBo.html deleted file mode 100644 index 9cf38d59..00000000 --- a/documentation/_build/html/PythonCpp/NonDBo.html +++ /dev/null @@ -1,737 +0,0 @@ - - - - - - - - - - - 5. Case 3 - Non-DBo Standalone Classe — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

5. Case 3 - Non-DBo Standalone Classe¶

-

Let’s have a look at the encapsulation of Hurricane::Point.

-

Non-BDo derived classes do not support the bi-directionnal communication. -So each Python object is associated with one C++ object. The C++ object -is created and deleted along with the Python one. This behavior implies -that the C++ object is copy constructible (which should be the case).

-
-

5.1 Class Header¶

-

Changes from 3.1 Class Associated Header File:

-
    -
  • There is no PyPoint_Link() function, as it’s related to the -bi-directional communication mechanism.
  • -
-
-

Note

-

About the _object attribute of the PyPoint. As the C++ object life span -(Point) is linked to the Python (PyPoint) one, we may have used a -value instead of a pointer. It is best to keep a pointer as the macros -written for DBo derived classes will remain usables.

-
-
#ifndef ISOBAR_PY_POINT_H
-#define ISOBAR_PY_POINT_H
-
-#include "hurricane/isobar/PyHurricane.h"
-#include "hurricane/Point.h"
-
-namespace  Isobar {
-  extern "C" {
-
-    typedef struct {
-        PyObject_HEAD
-        Hurricane::Point* _object;
-    } PyPoint;
-
-    extern  PyTypeObject  PyTypePoint;
-    extern  PyMethodDef   PyPoint_Methods[];
-    extern  void          PyPoint_LinkPyType();
-
-#define IsPyPoint(v)    ( (v)->ob_type == &PyTypePoint )
-#define PYPOINT(v)      ( (PyPoint*)(v) )
-#define PYPOINT_O(v)    ( PYPOINT(v)->_object )
-
-  }  // extern "C".
-}  // Isobar namespace.
-
-#endif  // ISOBAR_PY_POINT_H
-
-
-

-
-
-

5.2 Class File¶

-

Changes from 3.2 Class Associated File:

-
    -
  • As there is no PyPoint_Link() function, there is no call to any -flavor of the DBoLinkcreatemethod() macro (obvious as it’s not -a DBo).
  • -
  • To use the standard Python constructor, we have to define PyPoint_NEW() -and PyPoint_Init() functions, I’m not absolutely certain that the later -needs to be defined (that part is still not clear to me from the Python doc).
  • -
  • As it’s not a DBo there is no destroy() method, so no call to -DirectDestroyMethod()
  • -
  • Lastly, as this object has a PyPoint_NEW() (field tp_new) and -a PyPoint_Init() (field tp_init) we have to use the macro -PyTypeObjectLinkPyTypeNewInit() to define PyPoint_LinkPyType().
  • -
-
#include "hurricane/isobar/PyPoint.h"
-
-namespace Isobar {
-  using namespace Hurricane;
-
-  extern "C" {
-
-#define METHOD_HEAD(function)   GENERIC_METHOD_HEAD(Point,point,function)
-
-#if defined(__PYTHON_MODULE__)
-
-    static PyObject* PyPoint_NEW ( PyObject* module, PyObject *args )
-    {
-      Point* point = NULL;
-      HTRY
-        PyObject* arg0 = NULL;
-        PyObject* arg1 = NULL;
-
-        __cs.init( "Point.Point" );
-        if (not PyArg_ParseTuple( args,"|O&O&:Point.Point"
-                                , Converter,&arg0
-                                , Converter,&arg1 )) {
-          PyErr_SetString ( ConstructorError
-                          , "invalid number of parameters for Point constructor." );
-          return NULL;
-        }
-
-        if      (__cs.getObjectIds() == "")
-                { point = new Point()); }
-        else if (__cs.getObjectIds() == ":point")
-                { point = new Point( *PYPOINT_O(arg0) ); }
-        else if (__cs.getObjectIds() == ":int:int")
-                { point = new Point( PyAny_AsLong(arg0), PyAny_AsLong(arg1) ); }
-        else {
-          PyErr_SetString ( ConstructorError
-                          , "invalid number of parameters for Point constructor." );
-          return NULL;
-        }
-
-        PyPoint* pyPoint = PyObject_NEW( PyPoint, &PyTypePoint );
-        if (pyPoint == NULL) { delete point; return NULL; }
-        pyPoint->_object = point;
-      HCATCH
-
-      return (PyObject*)pyPoint;
-    }
-
-    static int  PyPoint_Init ( PyPoint* self, PyObject* args, PyObject* kwargs )
-    { return 0; }
-
-    DirectGetLongAttribute(PyPoint_getX,getX,PyPoint,Point)
-    DirectGetLongAttribute(PyPoint_getY,getY,PyPoint,Point)
-    DirectSetLongAttribute(PyPoint_SetX,setX,PyPoint,Point)
-    DirectSetLongAttribute(PyPoint_SetY,setY,PyPoint,Point)
-
-    PyMethodDef PyPoint_Methods[] =
-      { { "getX"   , (PyCFunction)PyPoint_getX     , METH_NOARGS
-                   , "Return the Point X value." }
-      , { "getY"   , (PyCFunction)PyPoint_getY     , METH_NOARGS
-                   , "Return the Point Y value." }
-      , { "setX"   , (PyCFunction)PyPoint_SetX     , METH_VARARGS
-                   , "Modify the Point X value." }
-      , { "setY"   , (PyCFunction)PyPoint_SetY     , METH_VARARGS
-                   , "Modify the Point Y value." }
-      , {NULL, NULL, 0, NULL}  /* sentinel */
-      };
-
-    DirectDeleteMethod(PyPoint_DeAlloc,PyPoint)
-    PyTypeObjectLinkPyTypeNewInit(Point)
-
-#else  // Python Module Code Part.
-
-    PyTypeObjectDefinitions(Point)
-
-#endif  // Shared Library Code Part.
-
-  }  // extern "C".
-}  // Isobar namespace.
-
-
-
-
-

5.2 Class File¶

-

To put it bluntly, there is no difference in the Python module for -a standalone DBo class and a non-DBo class.

-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonCpp/index.html b/documentation/_build/html/PythonCpp/index.html deleted file mode 100644 index 58dd1aff..00000000 --- a/documentation/_build/html/PythonCpp/index.html +++ /dev/null @@ -1,619 +0,0 @@ - - - - - - - - - - - Hurricane Python/C++ API Tutorial — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonTutorial/AdvancedTopics.html b/documentation/_build/html/PythonTutorial/AdvancedTopics.html deleted file mode 100644 index 33b367ea..00000000 --- a/documentation/_build/html/PythonTutorial/AdvancedTopics.html +++ /dev/null @@ -1,606 +0,0 @@ - - - - - - - - - - - 9. Advanced Topics — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

9. Advanced Topics¶

-

This is a place holder as well as a reminder to myself to write this part of -the documentation.

-
-

9.1 Occurrence¶

-

The trans-hierarchical workhorse.

-
-
-

9.2 RoutingPads¶

-

Unlike the Plugs that only make connections between two adjacent -hierarchical levels, RoutingPads can refer to a deeply buried terminal.

-
-
-

9.3 HyperNets¶

-

This class is part of the virtual flattening mechanism, it allows to -go through all the components of a trans-hierarchical net.

-
-
-

9.4 Miscellaeous trans-hierarchical functions¶

-

For a starter, how to get all the leaf cells...

-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonTutorial/CellNetComponent.html b/documentation/_build/html/PythonTutorial/CellNetComponent.html deleted file mode 100644 index 2dea5482..00000000 --- a/documentation/_build/html/PythonTutorial/CellNetComponent.html +++ /dev/null @@ -1,897 +0,0 @@ - - - - - - - - - - - 3. Making a Standard Cell – Layout — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

3. Making a Standard Cell – Layout¶

-

In this part, we will show how to create and save a terminal Cell, -that is, a cell without instances (the end point of a hierarchical -design). To illustrate the case we will draw the layout of a -standard cell.

-

We will introduce the following classes : Cell, Net, Component -and its derived classes.

-
-

3.1 The AllianceFramework (CRL Core)¶

-

The Hurricane database only manages objects in memory. To load or save -something from the outside, we need to use a framework. As of today, only -one is available : the Alliance framework. It allows Coriolis to handle -Alliance libraries and cells in the exact same way.

-
-

Note

-

To see how the AllianceFramework is configured for your -installation, please have a look to alliance.conf in the -etc/coriolis2 directory. It must contains the same settings -as the various MBK_ variables used for Alliance.

-
-
-
-

3.2 Session Mechanism (Hurricane)¶

-

In the Hurricane database, all modifications must take place inside -an UpdateSession. At the closing of a session, created or modificated -objects are fully inserted in the database. This is especially true for -the visualisation, a created component will be visible only only after -the session close.

-
-

Note

-

See QuadTree and Query.

-
-
-
-

3.3 Creating a new Cell (CRL Core)¶

-

The creation of a new Cell occurs through the AllianceFramework, -and, as stated above, inside a UpdateSession. The AllianceFramework -environment is provided by the crl module.

-
from Hurricane import *
-from CRL       import *
-
-af = AllianceFramework.get()
-UpdateSession.open()
-
-cell = af.createCell( 'my_inv' )
-
-# Build then save the Cell.
-
-UpdateSession.close()
-
-
-

This is the simplest call to createCell(), and in that case, the newly -created Cell will be saved in the working library (usually, the current -directory). You may supply a second argument telling into which library -you want the Cell to be created.

-

In the Hurricane Cell object, there is no concept of view, it contains -completly fused logical (netlist) and physical (layout) views.

-
-
-

3.4 The DbU Measurement Unit¶

-

All coordinates in the Hurricane database are expressed in DbU -(for Database Unit) which are integer numbers of foundry grid. -To be more precise, they are fixed points numbers expressed in -hundredth of foundry grid (to allow transient non-integer -computation).

-

To work with symbolic layout, that is, using lambda based lengths, -two conversion functions are provided:

-
    -
  • unit = DbU.fromLambda( lbd ) convert a lambda lbd into a DbU.
  • -
  • lbd = DbU.toLambda( unit ) convert a DbU into a lambda lbd.
  • -
-

In the weakly typed Python world, lbd is float while unit -is integer.

-
-
-

3.5 Setting up the Abutment Box¶

-

To setup the abutment box, we use a Box which defines a box from -the coordinates of the lower left corner (x1,y1) and upper left -corner (x2,y2).

-
b = Box( DbU.fromLambda( 0.0)    # x1
-       , DbU.fromLambda( 0.0)    # y1
-       , DbU.fromLambda(15.0)    # x2
-       , DbU.fromLambda(50.0) )  # y2
-cell.setAbutmentBox( b )
-
-
-

Or more simply:

-
cell.setAbutmentBox( Box( DbU.fromLambda( 0.0)
-                        , DbU.fromLambda( 0.0)
-                        , DbU.fromLambda(15.0)
-                        , DbU.fromLambda(50.0) ) )
-
-
-
-
-

3.6 Adding Nets and Components¶

-

In the Hurricane terminology, a component is any kind of physical object -among:

- -

Components cannot be created alone. They must be part of a Net.

-
-

3.6.1 Getting a Layer¶

-

As physical elements, Components are created using a Layer. So prior to -their creation, we must get one from the database. Layers are stored in the -Technology, which in turn, is stored in the DataBase. So, to get a -Layer:

-
layer = DataBase.getDB().getTechnology().getLayer( 'METAL1' )
-
-
-
-

Note

-

Convention for layer names. As the database can manage both real layers -and symbolic ones we adopt the following convention:

-
    -
  • Real layers are named in lowercase (metal1, nwell).
  • -
  • Symbolic layers are named in uppercase (METAL1, NWELL).
  • -
-
-
-
-

3.6.2 Creating a Net¶

-

As said above, prior to creating any Component, we must create the Net it -will belong to. In that example we also make it an external net, that is, -a part of the interface. Do not mistake the name of the net given as a string -argument ‘i’ and the name of the variable i holding the Net object. -For the sake of clarity we try to give the variable a close name, but this is -not mandatory.

-
i = Net.create( cell, 'i' )
-i.setExternal( True )
-
-
-
-

Note

-

Unlike some other database models, in Hurricane, -there is no explicit terminal object, you only need to make the -net external. For more information about how to connect to an -external net, see 6.2 Creating Nets and connecting to Instances.

-
-
-
-

3.6.3 Creating a Component¶

-

Finally, we get ready to create a Component, we will make a Vertical segment -of METAL1.

-
segment = Vertical.create( i                         # The owner Net.
-                         , layer                     # The layer.
-                         , DbU.fromLambda(  5.0 )    # The X coordinate.
-                         , DbU.fromLambda(  2.0 )    # The width.
-                         , DbU.fromLambda( 10.0 )    # The Y source coordinate.
-                         , DbU.fromLambda( 40.0 ) )  # The Y target coordinate.
-
-
-

With this overload of the Vertical.create() function the segment is created at an -absolute position. There is a second overload for creating a relatively placed -segment, see articulated layout.

-

If the net is external, that is, part of the interface of the cell, you may have -to declare some of its components as physical connectors usable by the router. -This is done by calling the NetExternalComponents class:

-
NetExternalComponents.setExternal( segment )
-
-
-
-
-
-

3.7 Saving to Disk (CRL Core)¶

-

Once you have finished to build your cell, you have to save it on disk. -Using the AllianceFramework you can save it as a pair of file:

- ----- - - - - - - - - - - - - - - - - -
ViewFlagFile extension
Logical / NetlistCatalog.State.Logical.vst
Physical / LayoutCatalog.State.Physical.ap
-

To save both views, use the Catalog.State.Views flag. The files -will be written in the Alliance WORK_DIR.

-
af.saveCell( cell, Catalog.State.Views )
-
-
-
-
-

3.8 The Complete Example File¶

-

The example files can be found in the share/doc/coriolis2/examples/scripts/ -directory (under the the root of the Coriolis installation).

-

The code needed to run it through the cgt viewer has been added. For the -explanation of that part of the code, refer to 5. Make a script runnable through cgt.

-
#!/usr/bin/python
-
-import sys
-from   Hurricane import *
-from   CRL       import *
-
-
-def toDbU ( l ): return DbU.fromLambda(l)
-
-
-def doBreak ( level, message ):
-    UpdateSession.close()
-    Breakpoint.stop( level, message )
-    UpdateSession.open()
-
-
-def buildInvertor ( editor ):
-    UpdateSession.open()
-
-    cell = AllianceFramework.get().createCell( 'invertor' )
-    cell.setTerminal( True )
-
-    cell.setAbutmentBox( Box( toDbU(0.0), toDbU(0.0), toDbU(15.0), toDbU(50.0) ) )
-
-    if editor:
-      UpdateSession.close()
-      editor.setCell( cell )
-      editor.fit()
-      UpdateSession.open()
-
-    technology = DataBase.getDB().getTechnology()
-    metal1     = technology.getLayer( "METAL1"     )
-    poly       = technology.getLayer( "POLY"       )
-    ptrans     = technology.getLayer( "PTRANS"     )
-    ntrans     = technology.getLayer( "NTRANS"     )
-    pdif       = technology.getLayer( "PDIF"       )
-    ndif       = technology.getLayer( "NDIF"       )
-    contdifn   = technology.getLayer( "CONT_DIF_N" )
-    contdifp   = technology.getLayer( "CONT_DIF_P" )
-    nwell      = technology.getLayer( "NWELL"      )
-    contpoly   = technology.getLayer( "CONT_POLY"  )
-    ntie       = technology.getLayer( "NTIE"       )
-
-    net = Net.create( cell, "nwell" )
-    Vertical.create( net, nwell, toDbU(7.5), toDbU(15.0), toDbU(27.0), toDbU(51.0) )
-
-    vdd = Net.create( cell, "vdd" )
-    vdd.setExternal( True )
-    vdd.setGlobal  ( True )
-    h = Horizontal.create(vdd, metal1, toDbU(47.0), toDbU(6.0), toDbU(0.0), toDbU(15.0) )
-    NetExternalComponents.setExternal( h )
-    Contact.create ( vdd, contdifn, toDbU(10.0), toDbU(47.0), toDbU( 1.0), toDbU( 1.0) )
-    Contact.create ( vdd, contdifp, toDbU( 4.0), toDbU(45.0), toDbU( 1.0), toDbU( 1.0) )
-    Vertical.create( vdd, pdif    , toDbU( 3.5), toDbU( 4.0), toDbU(28.0), toDbU(46.0) )
-    Vertical.create( vdd, ntie    , toDbU(10.0), toDbU( 3.0), toDbU(43.0), toDbU(48.0) )
-    doBreak( 1, 'Done building vdd.' )
-
-    vss = Net.create( cell, "vss" )
-    vss.setExternal( True )
-    vss.setGlobal  ( True )
-    h = Horizontal.create(vss, metal1, toDbU(3.0), toDbU(6.0), toDbU(0.0), toDbU(15.0))
-    NetExternalComponents.setExternal( h )
-    Vertical.create( vss, ndif    , toDbU(3.5), toDbU(4.0), toDbU(4.0), toDbU(12.0) )
-    Contact.create ( vss, contdifn, toDbU(4.0), toDbU(5.0), toDbU(1.0), toDbU( 1.0) )
-    doBreak( 1, 'Done building vss.' )
-
-    i = Net.create( cell, "i" )
-    i.setExternal( True )
-    v = Vertical.create ( i, metal1, toDbU(5.0), toDbU(2.0), toDbU(10.0), toDbU(40.0) )
-    NetExternalComponents.setExternal( v )
-    Vertical.create  ( i, ptrans  , toDbU( 7.0), toDbU( 1.0), toDbU(26.0), toDbU(39.0) )
-    Vertical.create  ( i, ntrans  , toDbU( 7.0), toDbU( 1.0), toDbU( 6.0), toDbU(14.0) )
-    Vertical.create  ( i, poly    , toDbU( 7.0), toDbU( 1.0), toDbU(14.0), toDbU(26.0) )
-    Horizontal.create( i, poly    , toDbU(20.0), toDbU( 3.0), toDbU( 4.0), toDbU( 7.0) )
-    Contact.create   ( i, contpoly, toDbU( 5.0), toDbU(20.0), toDbU( 1.0), toDbU( 1.0) )
-    doBreak( 1, 'Done building i.' )
-
-    nq = Net.create ( cell, "nq" )
-    nq.setExternal( True )
-    v = Vertical.create( nq, metal1, toDbU(10.0), toDbU(2.0), toDbU(10.0), toDbU(40.0) )
-    NetExternalComponents.setExternal( v )
-    Vertical.create( nq, pdif    , toDbU(10.0), toDbU( 3.0), toDbU(28.0), toDbU(37.0) )
-    Vertical.create( nq, ndif    , toDbU(10.0), toDbU( 3.0), toDbU( 8.0), toDbU(12.0) )
-    Contact.create ( nq, contdifp, toDbU(10.0), toDbU(35.0), toDbU( 1.0), toDbU( 1.0) )
-    Contact.create ( nq, contdifp, toDbU(10.0), toDbU(30.5), toDbU( 1.0), toDbU( 1.0) )
-    Contact.create ( nq, contdifn, toDbU(10.0), toDbU(10.0), toDbU( 1.0), toDbU( 1.0) )
-    doBreak( 1, 'Done building q.' )
-
-    UpdateSession.close()
-    AllianceFramework.get().saveCell( cell, Catalog.State.Views )
-
-    return
-
-
-def ScriptMain ( **kw ):
-    editor = None
-    if kw.has_key('editor') and kw['editor']:
-      editor = kw['editor']
-
-    buildInvertor( editor )
-    return True
-
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonTutorial/CgtScript.html b/documentation/_build/html/PythonTutorial/CgtScript.html deleted file mode 100644 index 401a9b74..00000000 --- a/documentation/_build/html/PythonTutorial/CgtScript.html +++ /dev/null @@ -1,656 +0,0 @@ - - - - - - - - - - - 5. Make a script runnable through cgt — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

5. Make a script runnable through cgt¶

-

To use your script you may run it directly like any other Python script. -But, for debugging purpose it may be helpful to run it through the -interactive layout viewer cgt.

-

For cgt to be able to run your script, you must add to your script -file a function named ScriptMain(), which takes a dictionary -as sole argument (**kw). The kw dictionary contains, in -particular, the CellViewer object we are running under with the -keyword editor. You can then load your cell into the viewer -using the menu:

-
    -
  • Tools \rightarrow Python Script. The script -file name must be given without the .py extension.
  • -
-
-

Note

-

If you use breakpoints and want to see the progress of your -script in the viewer, do not use the --script option of -cgt.

-
ego@home:~> cgt -V --script=invertor
-
-
-

Because the script is run before the viewer is launched, -you will only see the end result of your script.

-
-
def buildInvertor ( editor ):
-    UpdateSession.open()
-
-    cell = AllianceFramework.get().createCell( 'invertor' )
-    cell.setTerminal( True )
-
-    cell.setAbutmentBox( Box( toDbU(0.0), toDbU(0.0), toDbU(15.0), toDbU(50.0) ) )
-
-    if editor:
-      UpdateSession.close()
-      editor.setCell( cell )
-      editor.fit()
-      UpdateSession.open()
-
-    # The rest of the script...
-
-    return
-
-
-def ScriptMain ( **kw ):
-    editor = None
-    if kw.has_key('editor') and kw['editor']:
-      editor = kw['editor']
-
-    buildInvertor( editor )
-    return True
-
-
-
-

5.1 Using Breakpoints¶

-

It is possible to add breakpoints inside a script by calling the Breakpoint.stop() -function. To be able to see exactly what has just been mofied, we must close the -UpdateSession just before calling the breakpoint and reopen it just after. -The Breakpoint.stop() function takes two arguments:

-
    -
  1. The level above which it will be active.
  2. -
  3. An informative message about the purpose of the breakpoint.
  4. -
-

We can create a little function to ease the work:

-
def doBreak ( level, message ):
-    UpdateSession.close()
-    Breakpoint.stop( level, message )
-    UpdateSession.open()
-
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonTutorial/Collections.html b/documentation/_build/html/PythonTutorial/Collections.html deleted file mode 100644 index dd78e2b9..00000000 --- a/documentation/_build/html/PythonTutorial/Collections.html +++ /dev/null @@ -1,657 +0,0 @@ - - - - - - - - - - - 4. Manipulating Cells, Nets and Components — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

4. Manipulating Cells, Nets and Components¶

-

In this part, we will show how to navigate through the Nets and Components of a Cell.

-
-

4.1 Hurricane Collections¶

-

In Hurricane all kind of set of objects, whether organized in a real container -like a map<> (dictionary / dict) or a vector<> (table / list) or -an algorithmic walkthrough of the database can be accessed through a Collection.

-

C++ Collections objects are exposed in Python through the iterable protocol, -allowing to simply write:

-
for net in cell.getNets():
-  print 'Components of', net
-  for component in net.getComponents():
-    print '|', component
-
-
-

In C++ we would have written:

-
for ( Net* net : cell->getNets() ) {
-  cout << "Components of " << net << endl;
-  for ( Component* component : net->getComponents() ) {
-    cout << "| " << component << endl,
-  }
-}
-
-
-
-

4.1.1 Restrictions about using Collections¶

-

Never delete or create an element while you are iterating over a Collection.

-

Results can be unpredictable, you may just end up with a core dump, but more -subtly, some element of the Collection may be skipped or processed twice. -If you want to create or delete an element, do it outside the collection -loop. For example:

-
cellNets = []
-for net in cell.getNets():
-  cellNets.append( net )
-
-# Remove all the anonymous nets.
-for net in cellNets:
-   if net.getName().endswith('nymous_'):
-     print 'Destroy', net
-     net.destroy()
-
-
-
-
-
-

4.2 Loading a Cell with AllianceFramework¶

-

As presented in 2.1 The Alliance Framework, the Cell that will be returned by -the getCell() call wil be:

-
    -
  1. If a Cell of that name is already loaded into memory, it will be returned.

    -
    -

    Note

    -

    It means that it shadows any modifications that could have been on -disk since it was first loaded. Conversely, if the Cell has been -modified in memory, you will get those modifications.

    -
    -
  2. -
  3. Search, in the ordered list of libraries, the first Cell that matches the -requested name.

    -
    -

    Note

    -

    It means that if cells with the same name exist in different -libraries, only the one in the first library will be ever used. -Be also aware that cell files that may remain in the WORK_LIB, -may unexpectedly shadow cells from the libraries.

    -
    -
  4. -
-
cell = af.getCell( 'inv_x1', Catalog.State.Views )
-
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonTutorial/Environment.html b/documentation/_build/html/PythonTutorial/Environment.html deleted file mode 100644 index 0b584330..00000000 --- a/documentation/_build/html/PythonTutorial/Environment.html +++ /dev/null @@ -1,662 +0,0 @@ - - - - - - - - - - - 2. Setting up the Environment — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

2. Setting up the Environment¶

-
-

2.1 Setting up the Paths¶

-

To simplify the tedious task of configuring your environment, a helper is provided. -It will setup or modify the PATH, LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH -under Darwin), PYTHONPATH and CORIOLIS_TOP variables. -It should automatically adapt to your kind of shell (Bourne like -or C-Shell like).

-
<CORIOLIS_INSTALL>/etc/coriolis2/coriolisEnv.py
-
-
-

Use it like this (don’t forget the eval and the backquotes):

-
dummy@lepka:~> eval `<CORIOLIS_INSTALL>/etc/coriolis2/coriolisEnv.py`
-
-
-
-

Note

-

Do not call that script in your environment initialisation. -When used under rhel6 or clones, it needs to be run in the devtoolset -environment. The script then launches a new shell, which may cause an -infinite loop if it’s called again in, say ~/.bashrc.

-

Instead you may want to create an alias:

-
alias c2r='eval "`<CORIOLIS_INSTALL>/etc/coriolis2/coriolisEnv.py`"'
-
-
-
-
-
-

2.2 User’s Configurations File¶

-

You may create, in the directory you are lanching Coriolis tools, a special -sub-directory .coriolis2/ that can contain two configuration files:

-
    -
  • techno.py tells which technology to use.
  • -
  • settings.py can override almost any default configuration setting.
  • -
-

Those two files are optional, if they do not exist the default settings -will be used and the technology is symbolic/cmos (i.e. purely symbolic).

-
-

Note

-

Those two files will by processed by the Python interpreter, -so they can contain any code in addition to the mandatory -variables.

-
-
-

2.2.1 The techno.py File¶

-

Must provide one variable named technology which values the path towards -the technology file. The available technologies are installed under -<CORIOLIS_INSTALL>/etc/coriolis2. For example, to use the 45nm FreeDPK -which is in:

-
<CORIOLIS_INSTALL>/etc/coriolis2/45/freepdk_45/
-
-
-

The techno.py file must contain:

-
technology = '45/freepdk_45'
-
-
-
-
-

2.2.2 The settings.py File¶

-

The entries of the parametersTable and their definitions are detailed -in CGT - The Graphical Interface.

-

Example of file:

-
defaultStyle = 'Alliance.Classic [black]'
-
-parametersTable = \
-    ( ('misc.catchCore'           , TypeBool      , False   )
-    , ('misc.info'                , TypeBool      , False   )
-    , ('misc.paranoid'            , TypeBool      , False   )
-    , ('misc.bug'                 , TypeBool      , False   )
-    , ('misc.logMode'             , TypeBool      , False   )
-    , ('misc.verboseLevel1'       , TypeBool      , False   )
-    , ('misc.verboseLevel2'       , TypeBool      , True    )
-    )
-
-
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonTutorial/Introduction.html b/documentation/_build/html/PythonTutorial/Introduction.html deleted file mode 100644 index 1de8e66e..00000000 --- a/documentation/_build/html/PythonTutorial/Introduction.html +++ /dev/null @@ -1,719 +0,0 @@ - - - - - - - - - - - 1. Introduction — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

1. Introduction¶

-

This tutorial is aimed at two goals :

-
    -
  • Presenting how to use Python scripts to control Coriolis.
  • -
  • Make a basic introduction about the Hurricane database and its -concepts.
  • -
-

While this tutorial is aimed at presenting the Hurricane database, -do not feel limited by it. You can use Hurricane objects as attributes -of Python objects or use Python containers to store them. -The only limitation is that you may not use Hurricane classes as base -classes in Python.

-

All Hurricane objects implements the Python __str__() function, -they print the result of C++ ::getString().

-
-

1.1 Terminology¶

-

In the Hurricane database, the logical (netlist) and physical (layout) -views are fused. As the main goal of the database is to support place & route -tools, we usually starts with a pure netlist which is progessively enriched -to become a layout. Cell, in particular, is able to be in any intermediate -state. Many of our objects have self-explanatory names, but some -don’t. Thus we summarize below the more important ones:

- ---- - - - - - - - - - - - - - - - - - - - - - - -
ClassMeaning
CellThe model. A Cell does not have terminals, only nets -flagged as external
InstanceAn instance of a model
NetA grouping of electrically connected components
PlugA terminal of an instance
RoutingPadA physical connexion (pin) to an instance
-
-
-

1.2 Generalities¶

-

The C++ API has been exported in Python as closely as possible. Meaning -that, save for a slight change in syntax, any code written in Python -could be easily transformed into C++ code. There is no specific documentation -written for the Python interface, you may directly use the C++ one.

-

Mostly:

-
    -
  • C++ namespaces are exported as Python modules.
  • -
  • The scope resolution operator :: converts into ..
  • -
  • C++ blocks (between braces {}) are replaced by indentations.
  • -
  • In C++, names are managed through a dedicated Name class. -It has not been exported to the Python interface, you only have -to use string.
  • -
  • Coordinates are expressed in DbU which are long with a special -semantic (see ??).
  • -
-

In hurricane/Session.h header we have:

-
namespace Hurricane {
-
-   class UpdateSession {
-     public:
-       static void  open  ();
-       static void  close ();
-   };
-
-}
-
-
-

So we can use it the following way in C++:

-
#include "hurricane/Session.h"
-
-using namespace Hurricane;
-
-void  doSomething ()
-{
-  UpdateSession::open();
-  // Something...
-  UpdateSession::close();
-}
-
-
-

The equivalent Python code will be:

-
from Hurricane import *
-
-def doSomething ():
-    UpdateSession.open()
-   # Something...
-    UpdateSession.close()
-
-
-
-
-

1.3 Various Kinds of Constructors¶

-

Regarding the memory allocation, the Hurricane database contains two kind of objects.

-
    -
  1. Objects that are linked to others in the database and whose creation or deletion -implies coherency operations. This is the case for Net or Horizontal. -They must be created using the static create() method of their class -and destroyed with their destroy() method.

    -

    And, of course, they cannot be copied (the copy constructor has been disabled).

    -
    net = Net.create( cell, 'tmp' )  # Call the static Net.create() function.
    -                                 # Work with this net.
    -                                 # ...
    -net.destroy()                    # Call the dynamic destroy() method.
    -
    -
    -
  2. -
  3. Objects that are standalone, like Point or Box, uses the usual construction -methods. They also use the Python garbage collector mechanism and do not need -to be explicitly deleted.

    -
    def myfunc():
    -  bb = Box( DbU.fromLambda( 0.0)
    -          , DbU.fromLambda( 0.0)
    -          , DbU.fromLambda(15.0)
    -          , DbU.fromLambda(50.0) )
    -  return                            # bb will be freed at that point.
    -
    -
    -
  4. -
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonTutorial/Netlist.html b/documentation/_build/html/PythonTutorial/Netlist.html deleted file mode 100644 index 3bbbab69..00000000 --- a/documentation/_build/html/PythonTutorial/Netlist.html +++ /dev/null @@ -1,945 +0,0 @@ - - - - - - - - - - - 6. Making a hierarchical Cell – Netlist — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

6. Making a hierarchical Cell – Netlist¶

-

To illustrate the topic, we will build the netlist of a fulladder from -standard cell.

-

The fulladder netlist

-
-

6.1 Creating an Instance¶

-

Creating an Instance is straigthforward, the constructor needs only three -parameters:

-
    -
  1. The Cell into which the instance is to be created.
  2. -
  3. The name of the instance.
  4. -
  5. The master cell, the Cell model it refers to. The master cell -will be part of the hierarchical level just below the fulladder -cell.
  6. -
-
-

Note

-

Do not confuse the cell the instance is create into (fulladder) -and the cells it refers to (the master cell xr2_x2).

-
-
af     = AllianceFramework.get()
-xr2_x2 = af.getCell( 'xr2_x1', Catalog.State.Views )
-
-fulladder = af.createCell( 'fulladder' )
-xr2_1     = Instance.create( fulladder, 'xr2_1', xr2_x2 )
-
-
-
-
-

6.2 Creating Nets and connecting to Instances¶

-

An Instance has one Plug for each external net of the master cell. -The plug allows to create a logical connection bewteen a Net of -fulladder and a net from an Instance master cell.

-

A plug is somewhat equivalent to an instance terminal in other -well known databases.

-

Therefore, a plug is related to two nets:

-
    -
  1. The net of the master cell it is linked to. Obviously that -net cannot be changed. You can access the master net with the -function plug.getMasterNet().
  2. -
  3. The net of fulladder the plug is connected to. This can -be set, it is how we build the netlist. To set the net, use -the function plug.setNet( net ). If the argument is None, -the plug is disconnected.
  4. -
-

To find the plug of an instance associated to a given net in -the master cell, use instance.getPlug( masterNet ). -The masterNet argument being an object of class net (not -its name).

-

Building the a net of fulladder:

-
a = Net.create( fulladder, "a" )
-a.setExternal( True )
-xr2_1.getPlug( xr2_x2.getNet("i0") ).setNet( a )
-a2_1 .getPlug(  a2_x2.getNet("i0") ).setNet( a )
-
-
-
-

Note

-

Limitation of Hurricane Netlists. There is no explicit -terminal object in the Hurricane database. Plugs are -generated on the fly for each external net of the -instance. One important consequence is that a net -cannot appear on the interface as two differently named -terminals (sometimes referred as weekly connected -terminals). There is a strict bijection between external -nets and plugs.

-

While it may be restrictive, it enforces cleaner designs -and make it possible for the HyperNet concept/class.

-
-
-
-

6.3 Power supplies special case¶

-

For supplies, it may be tedious to connect the Plugs of each cell one by one -(and create a lot of unneeded objects). To avoid that, we may use Named -connections. If a signal in fulladder is set to global, then it will -be considered as connected to any signal with the same name and global in -the master cell of the instances.

-
vdd = Net.create( fulladder, "vdd" )
-vdd.setExternal( True )
-vdd.setGlobal  ( True )  # Will be connected to all the instances.
-
-
-
-
-

6.4 Creating the physical view of a Cell netlist¶

-

Even if loaded in the viewer, an Instance will not be displayed -until it is placed.

-
-

6.4.1 Transformation¶

-

To place an Instance, we apply a Transformation to the coordinate system -of the master cell. A transformation is composed of two operations:

-
    -
  1. An Orientation, which can be a symmetry or a rotation (or a combination -of those two). The Orientation is applied first to the coordinate -system of the master cell. The complete list of Orientation and their -codes are given on the Orientation documentation page.
  2. -
  3. A Translation, applied in second. Translation are represented by -Points.
  4. -
-

The transformation is a change of coordinate system, be aware that if the -abutment box lower left corner of the master cell is not at (0,0) -the result of the Transformation may not be what you expect. To simplify -the computation of the transformation of an instance, always place the -lower left corner of the abutment box at (0,0)

-
-
-

6.4.2 Placing an Instance¶

-

Assuming that we want to place the cells of the fulladder into two rows, -that the abutment box lower left corner is at (0,0) (same for the -xr2_x2 master cell layout). Here is the code to place the xr2_1 -instance to left of the second row.

-

Setting the translation on an Instance is not enough to make it be displayed, -we also must set its placement status to Instance.PlacementStatus.PLACED.

-
xr2_1.setTransformation( Transformation( DbU.fromLambda(  0.0)
-                                       , DbU.fromLambda(100.0)
-                                       , Transformation.Orientation.MY ) )
-xr2_1.setPlacementStatus( Instance.PlacementStatus.PLACED )
-
-
-
-
-

6.4.3 Nets – From Plugs to RoutingPads¶

-

As was stated before, Plugs represent a logical connection between two -levels of hierarchy. To make the physical connection to the master net -in the instance, we now must create, in the fulladder, a special -component which is a kind of reference to a component of the -master net (in the master cell).

-

The so called special component is a RoutingPad.

-

The RoutingPad can be considered as an equivalent to pin in other -well known databases.

-
rp = RoutingPad.create( a
-                      , Occurrence( xr2_1.getPlug( xr2_x2.getNet("i0")) )
-                      , RoutingPad.BiggestArea )
-
-
-

For the second parameter, we must pass an Occurrence. Occurrence objects will -be explained in detail later, for now, let say that we must construct the -Occurrence object with one parameter : the Plug for which we want to create a -physical connection.

-

The RoutingPad rp will be a component of the a net.

-

The third argument ask the constructor of the RoutingPad to select in the -master net, the component which has the biggest area.

-
-

Note

-

Component selection. Not all the components of a net can be -selected for connection through a RoutingPad. The candidates must -have been flagged with the NetExternalComponents class.

-

See 3.6.3 Creating a Component.

-
-
-
-

6.4.4 Nets – Regular wiring¶

-

After the creation of the RoutingPads, the wiring is to be created with -ordinary layout components (Horizontal, Vertical and Contact possibly -articulated). Here is the complete code for net a. We made an articulated -layout where contacts are created over RoutingPads then segments over -contacts.

-
# Build wiring for a.
-# Create RoutingPads first.
- rp1      = RoutingPad.create( a
-                             , Occurrence( xr2_1.getPlug( xr2_x2.getNet("i0")) )
-                             , RoutingPad.BiggestArea )
- rp2      = RoutingPad.create( a
-                             , Occurrence(  a2_1.getPlug(  a2_x2.getNet("i0")) )
-                             , RoutingPad.BiggestArea )
-
-# Then regular wiring.
- contact1 = Contact.create( rp1, via12, toDbU( 0.0), toDbU(-15.0) )
- contact2 = Contact.create( rp2, via12, toDbU( 0.0), toDbU( 10.0) )
- turn     = Contact.create( a  , via23, toDbU(10.0), toDbU( 35.0) )
- Horizontal.create( contact2, turn     , metal2, toDbU(35.0), toDbU(2.0) )
- Vertical  .create( turn    , contact1 , metal3, toDbU(10.0), toDbU(2.0) )
-
-
-
-

Note

-

In order to better see the layout of the wiring only, open the -Controller and in the Filter tab, uncheck -Process Terminal Cells.

-
-
-
-
-

6.5 The Complete Example File¶

-

The example file fulladder.py can be found in the share/doc/coriolis2/examples/scripts/ -directory (under the the root of the Coriolis installation).

-
#!/usr/bin/python
-
-import sys
-from   Hurricane import *
-from   CRL       import *
-
-
-def toDbU ( l ): return DbU.fromLambda(l)
-
-
-def doBreak ( level, message ):
-    UpdateSession.close()
-    Breakpoint.stop( level, message )
-    UpdateSession.open()
-
-
-def buildFulladder ( editor ):
-
-   # Get the Framework and all the master cells.
-    af     = AllianceFramework.get()
-    xr2_x2 = af.getCell( 'xr2_x1', Catalog.State.Views )
-    a2_x2  = af.getCell( 'a2_x2' , Catalog.State.Views )
-    o2_x2  = af.getCell( 'o2_x2' , Catalog.State.Views )
-
-    UpdateSession.open()
-
-    fulladder = af.createCell( 'fulladder' )
-    fulladder.setAbutmentBox( Box( toDbU(0.0), toDbU(0.0), toDbU(90.0), toDbU(100.0) ) )
-
-    if editor:
-      UpdateSession.close()
-      editor.setCell( fulladder )
-      editor.fit()
-      UpdateSession.open()
-
-   # Create Instances.
-    a2_1  = Instance.create( fulladder,  'a2_1',  a2_x2 )
-    a2_2  = Instance.create( fulladder,  'a2_2',  a2_x2 )
-    xr2_1 = Instance.create( fulladder, 'xr2_1', xr2_x2 )
-    xr2_2 = Instance.create( fulladder, 'xr2_2', xr2_x2 )
-    o2_1  = Instance.create( fulladder,  'o2_1',  o2_x2 )
-
-   # Create Nets.
-    vss = Net.create( fulladder, "vss" )
-    vss.setExternal( True )
-    vss.setGlobal  ( True )
-
-    vdd = Net.create( fulladder, "vdd" )
-    vdd.setExternal( True )
-    vdd.setGlobal  ( True )
-
-    cin = Net.create( fulladder, "cin" )
-    cin.setExternal( True )
-    xr2_2.getPlug( xr2_x2.getNet('i0') ).setNet( cin )
-    a2_2 .getPlug(  a2_x2.getNet('i0') ).setNet( cin )
-
-    a = Net.create( fulladder, 'a' )
-    a.setExternal( True )
-    xr2_1.getPlug( xr2_x2.getNet('i0') ).setNet( a )
-    a2_1 .getPlug(  a2_x2.getNet('i0') ).setNet( a )
-
-    b = Net.create( fulladder, 'b' )
-    b.setExternal( True )
-    xr2_1.getPlug( xr2_x2.getNet('i1') ).setNet( b )
-    a2_1 .getPlug(  a2_x2.getNet('i1') ).setNet( b )
-
-    sout_1 = Net.create( fulladder, 'sout_1' )
-    xr2_1.getPlug( xr2_x2.getNet('q' ) ).setNet( sout_1 )
-    xr2_2.getPlug( xr2_x2.getNet('i1') ).setNet( sout_1 )
-    a2_2 .getPlug(  a2_x2.getNet('i1') ).setNet( sout_1 )
-
-    carry_1 = Net.create( fulladder, 'carry_1' )
-    a2_1.getPlug( a2_x2.getNet('q' ) ).setNet( carry_1 )
-    o2_1.getPlug( o2_x2.getNet('i1') ).setNet( carry_1 )
-
-    carry_2 = Net.create( fulladder, 'carry_2' )
-    a2_2.getPlug( a2_x2.getNet('q' ) ).setNet( carry_2 )
-    o2_1.getPlug( o2_x2.getNet('i0') ).setNet( carry_2 )
-
-    sout = Net.create( fulladder, 'sout' )
-    sout.setExternal( True )
-    xr2_2.getPlug( xr2_x2.getNet('q') ).setNet( sout )
-
-    cout = Net.create( fulladder, 'cout' )
-    cout.setExternal( True )
-    o2_1.getPlug( o2_x2.getNet('q') ).setNet( cout )
-
-   # Instances placement.
-    a2_1.setTransformation( Transformation( toDbU(0.0)
-                                          , toDbU(0.0)
-                                          , Transformation.Orientation.ID ) )
-    a2_1.setPlacementStatus( Instance.PlacementStatus.PLACED )
-    doBreak( 1, 'Placed a2_1' )
-
-    xr2_1.setTransformation( Transformation( toDbU(  0.0)
-                                           , toDbU(100.0)
-                                           , Transformation.Orientation.MY ) )
-    xr2_1.setPlacementStatus( Instance.PlacementStatus.PLACED )
-    doBreak( 1, 'Placed xr2_1' )
-
-    a2_2.setTransformation( Transformation( toDbU(25.0)
-                                          , toDbU( 0.0)
-                                          , Transformation.Orientation.ID ) )
-    a2_2.setPlacementStatus( Instance.PlacementStatus.PLACED )
-    doBreak( 1, 'Placed a2_2' )
-
-    xr2_2.setTransformation( Transformation( toDbU( 45.0)
-                                           , toDbU(100.0)
-                                           , Transformation.Orientation.MY ) )
-    xr2_2.setPlacementStatus( Instance.PlacementStatus.PLACED )
-    doBreak( 1, 'Placed xr2_2' )
-
-    o2_1.setTransformation( Transformation( toDbU(65.0)
-                                          , toDbU( 0.0)
-                                          , Transformation.Orientation.ID ) )
-    o2_1.setPlacementStatus( Instance.PlacementStatus.PLACED )
-    doBreak( 1, 'Placed o2_1' )
-
-   # Add filler cells.
-    tie_x0    = af.getCell(    'tie_x0', Catalog.State.Views )
-    rowend_x0 = af.getCell( 'rowend_x0', Catalog.State.Views )
-    filler_1  = Instance.create( fulladder, 'filler_1',    tie_x0 )
-    filler_2  = Instance.create( fulladder, 'filler_2', rowend_x0 )
-
-    filler_1.setTransformation( Transformation( toDbU(50.0)
-                                              , toDbU( 0.0)
-                                              , Transformation.Orientation.ID ) )
-    filler_1.setPlacementStatus( Instance.PlacementStatus.PLACED )
-
-    filler_2.setTransformation( Transformation( toDbU(60.0)
-                                              , toDbU( 0.0)
-                                              , Transformation.Orientation.ID ) )
-    filler_2.setPlacementStatus( Instance.PlacementStatus.PLACED )
-    doBreak( 1, 'Filler cell placeds' )
-
-   # Getting the layers.
-    technology = DataBase.getDB().getTechnology()
-    metal2     = technology.getLayer( "METAL2" )
-    metal3     = technology.getLayer( "METAL3" )
-    via12      = technology.getLayer( "VIA12"  )
-    via23      = technology.getLayer( "VIA23"  )
-
-   # Build wiring for a.
-   # Create RoutingPads first.
-    rp1      = RoutingPad.create( a
-                                , Occurrence( xr2_1.getPlug( xr2_x2.getNet("i0")) )
-                                , RoutingPad.BiggestArea )
-    rp2      = RoutingPad.create( a
-                                , Occurrence(  a2_1.getPlug(  a2_x2.getNet("i0")) )
-                                , RoutingPad.BiggestArea )
-
-   # Then regular wiring.
-    contact1 = Contact.create( rp1, via12, toDbU( 0.0), toDbU(-15.0) )
-    contact2 = Contact.create( rp2, via12, toDbU( 0.0), toDbU( 10.0) )
-    turn     = Contact.create( a  , via23, toDbU(10.0), toDbU( 35.0) )
-    Horizontal.create( contact2, turn     , metal2, toDbU(35.0), toDbU(2.0) )
-    Vertical  .create( turn    , contact1 , metal3, toDbU(10.0), toDbU(2.0) )
-
-    UpdateSession.close()
-
-    af.saveCell( fulladder, Catalog.State.Views )
-    return
-
-
-def ScriptMain ( **kw ):
-    editor = None
-    if kw.has_key('editor') and kw['editor']:
-      editor = kw['editor']
-
-    buildFulladder( editor )
-    return True
-
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonTutorial/RealDesigns.html b/documentation/_build/html/PythonTutorial/RealDesigns.html deleted file mode 100644 index c262c231..00000000 --- a/documentation/_build/html/PythonTutorial/RealDesigns.html +++ /dev/null @@ -1,623 +0,0 @@ - - - - - - - - - - - 7. Working in real mode — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

7. Working in real mode¶

-

The AllianceFramework only manages symbolic layout as Alliance does. -But Coriolis is also able to work directly in real mode, meaning -that distances will be expressed in microns instead of lambdas.

-

The real mode will be illustrated by working with the FreePDK45.

-

We will assume that the FreePDK45 archives is installed under:

-
/home/dks/
-
-
-
-

7.1 Loading a lef file¶

-

Importing a lef file is simple, you just call the static function -LefImport.load(). Multiple lef file can be imported one after -another.

-
# You must set "DKsdir" to where you did install the NCSU FreePDK 45nm DK.
-DKsdir  = '/home/dks'
-
-library = LefImport.load( DKsdir + '/FreePDK45/osu_soc/lib/files/gscl45nm.lef' )
-
-
-
-

Note

-

Technology checking. The first imported lef file must contain the -technology. The technology described in the lef file will be checked -against the one configured in the running instance of Coriolis to look -for any discrepencies.

-
-
-
-

7.2 Loading a blif file – Yosys¶

-

The blif format is generated by the Yosys logic synthetizer. Here again, it is -pretty straightforward: call the static function Blif.load(). If you made -your synthesis on a cell library not managed by AllianceFramework, for example -the one of the FreePDK45, you must load it prior to calling the blif loader.

-
cell = Blif.load( 'snx' ) # load "snx.blif" in the working directory.
-
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonTutorial/ToolEngines.html b/documentation/_build/html/PythonTutorial/ToolEngines.html deleted file mode 100644 index f50f8517..00000000 --- a/documentation/_build/html/PythonTutorial/ToolEngines.html +++ /dev/null @@ -1,786 +0,0 @@ - - - - - - - - - - - 8. Tool Engines (CRL Core) — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

8. Tool Engines (CRL Core)¶

-

The ToolEngine class is the base class for all tools developped in -Coriolis. In the rest of the tutorial we will use the names tool -or engine as synonyms.

-
-

8.1 Placer – Etesian¶

-

To run the placer, create the Etesian engine, then call the place() -function.

-
import Etesian
-
-# [...]
-
-etesian = Etesian.EtesianEngine.create(cell)
-etesian.place()
-
-
-

You can configure the placer in two ways:

-
    -
  1. Prior to the creation of the engine, setup an abutment for the cell. -The placer will fit the cells into that area. If the area is too -small, it will issue an error.

    -
  2. -
  3. Setup Etesian parameters through the settings.py configuration -file. For example:

    -
    parametersTable = \
    -    ( ("etesian.effort"           , TypeEnumerate , 2       )
    -    , ('etesian.uniformDensity'   , TypeBool      , True    )
    -    , ('etesian.spaceMargin'      , TypePercentage, 3.0     )
    -    , ('etesian.aspectRatio'      , TypePercentage, 100.0   )
    -    )
    -
    -
    -

    With this setup, the cells will be spread uniformally over the -area (etesian.uniformDensity), with 3.0% of free space -added and an aspect ratio of 100% (square shape).

    -
  4. -
-
-
-

8.1 Router – Katana¶

-

Like for Etesian, you have to create the engine on the cell then call -the sequence of functions detailed below.

-
-

Note

-

Kite vs. Katana. There are currently two routers in Coriolis, -Kite is the old one and digital only. Katana is a re-implementation -with support for mixed routing (digital and analog). -Until Katana is fully implemented we keep both of them.

-
-
import Anabatic
-import Katana
-
-# [...]
-
-katana = Katana.KatanaEngine.create(cell)
-katana.digitalInit      ()
-katana.runGlobalRouter  ()
-katana.loadGlobalRouting( Anabatic.EngineLoadGrByNet )
-katana.layerAssign      ( Anabatic.EngineNoNetLayerAssign )
-katana.runNegociate     ( Katana.Flags.NoFlags )
-
-
-
-
-

8.2 A Complete Example¶

-

The example file toolengines.py can be found in the share/doc/coriolis2/examples/scripts/ -directory (under the the root of the Coriolis installation).

-

This script automatically places and routes the fulladder netlist as seen -previously. The call to the ToolEngines is made inside the new function -placeAndRoute().

-
-

Note

-

As the ToolEngine take care of opening and closing UpdateSession, we -do not need the wrapper function doBreak() around the breakpoints. -We directly call Breakpoint.

-
-
-

Note

-

The space margin for this example is very high (30%), it’s only -because it’s too small for the placer to run correctly. For normal -case it is around 3%.

-
-
#!/usr/bin/python
-
-import sys
-from   Hurricane import *
-from   CRL       import *
-import Etesian
-import Anabatic
-import Katana
-
-# Everybody needs it.
-af = AllianceFramework.get()
-
-
-def toDbU ( l ): return DbU.fromLambda(l)
-
-
-def buildFulladder ( editor ):
-
-   # Get the Framework and all the master cells.
-    xr2_x2 = af.getCell( 'xr2_x1', Catalog.State.Views )
-    a2_x2  = af.getCell( 'a2_x2' , Catalog.State.Views )
-    o2_x2  = af.getCell( 'o2_x2' , Catalog.State.Views )
-
-    UpdateSession.open()
-
-    fulladder = af.createCell( 'fulladder' )
-
-   # Create Instances.
-    a2_1  = Instance.create( fulladder,  'a2_1',  a2_x2 )
-    a2_2  = Instance.create( fulladder,  'a2_2',  a2_x2 )
-    xr2_1 = Instance.create( fulladder, 'xr2_1', xr2_x2 )
-    xr2_2 = Instance.create( fulladder, 'xr2_2', xr2_x2 )
-    o2_1  = Instance.create( fulladder,  'o2_1',  o2_x2 )
-
-   # Create Nets.
-    vss = Net.create( fulladder, "vss" )
-    vss.setExternal( True )
-    vss.setGlobal  ( True )
-
-    vdd = Net.create( fulladder, "vdd" )
-    vdd.setExternal( True )
-    vdd.setGlobal  ( True )
-
-    cin = Net.create( fulladder, "cin" )
-    cin.setExternal( True )
-    xr2_2.getPlug( xr2_x2.getNet('i0') ).setNet( cin )
-    a2_2 .getPlug(  a2_x2.getNet('i0') ).setNet( cin )
-
-    a = Net.create( fulladder, 'a' )
-    a.setExternal( True )
-    xr2_1.getPlug( xr2_x2.getNet('i0') ).setNet( a )
-    a2_1 .getPlug(  a2_x2.getNet('i0') ).setNet( a )
-
-    b = Net.create( fulladder, 'b' )
-    b.setExternal( True )
-    xr2_1.getPlug( xr2_x2.getNet('i1') ).setNet( b )
-    a2_1 .getPlug(  a2_x2.getNet('i1') ).setNet( b )
-
-    sout_1 = Net.create( fulladder, 'sout_1' )
-    xr2_1.getPlug( xr2_x2.getNet('q' ) ).setNet( sout_1 )
-    xr2_2.getPlug( xr2_x2.getNet('i1') ).setNet( sout_1 )
-    a2_2 .getPlug(  a2_x2.getNet('i1') ).setNet( sout_1 )
-
-    carry_1 = Net.create( fulladder, 'carry_1' )
-    a2_1.getPlug( a2_x2.getNet('q' ) ).setNet( carry_1 )
-    o2_1.getPlug( o2_x2.getNet('i1') ).setNet( carry_1 )
-
-    carry_2 = Net.create( fulladder, 'carry_2' )
-    a2_2.getPlug( a2_x2.getNet('q' ) ).setNet( carry_2 )
-    o2_1.getPlug( o2_x2.getNet('i0') ).setNet( carry_2 )
-
-    sout = Net.create( fulladder, 'sout' )
-    sout.setExternal( True )
-    xr2_2.getPlug( xr2_x2.getNet('q') ).setNet( sout )
-
-    cout = Net.create( fulladder, 'cout' )
-    cout.setExternal( True )
-    o2_1.getPlug( o2_x2.getNet('q') ).setNet( cout )
-
-    UpdateSession.close()
-
-    af.saveCell( fulladder, Catalog.State.Views )
-    return fulladder
-
-
-def placeAndRoute ( editor, cell ):
-   # Run the placer.
-    etesian = Etesian.EtesianEngine.create(cell)
-    etesian.place()
-
-    if editor:
-      editor.setCell( cell )
-      editor.fit()
-
-    Breakpoint.stop( 1, 'After placement' )
-
-   # Run the router.
-    katana = Katana.KatanaEngine.create(cell)
-    katana.digitalInit      ()
-    katana.runGlobalRouter  ()
-    katana.loadGlobalRouting( Anabatic.EngineLoadGrByNet )
-    katana.layerAssign      ( Anabatic.EngineNoNetLayerAssign )
-    katana.runNegociate     ( Katana.Flags.NoFlags )
-
-    af.saveCell( cell, Catalog.State.Views )
-    return
-
-
-def ScriptMain ( **kw ):
-    editor = None
-    if kw.has_key('editor') and kw['editor']:
-      editor = kw['editor']
-
-    fulladder = buildFulladder( editor )
-    placeAndRoute( editor, fulladder )
-    return True
-
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonTutorial/definitions.html b/documentation/_build/html/PythonTutorial/definitions.html deleted file mode 100644 index 971d7c66..00000000 --- a/documentation/_build/html/PythonTutorial/definitions.html +++ /dev/null @@ -1,569 +0,0 @@ - - - - - - - - - - - <no title> — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
-
    -
  • Docs »
  • - -
  • <no title>
  • -
  • - - - -
  • -
-
-
-
- - - -
-
- - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonTutorial/index.html b/documentation/_build/html/PythonTutorial/index.html deleted file mode 100644 index cf1becf1..00000000 --- a/documentation/_build/html/PythonTutorial/index.html +++ /dev/null @@ -1,648 +0,0 @@ - - - - - - - - - - - Hurricane+Python Tutorial — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
-
    -
  • Docs »
  • - -
  • Hurricane+Python Tutorial
  • -
  • - - - -
  • -
-
-
-
- - - - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/PythonTutorial/pdfHeader.html b/documentation/_build/html/PythonTutorial/pdfHeader.html deleted file mode 100644 index e3d71758..00000000 --- a/documentation/_build/html/PythonTutorial/pdfHeader.html +++ /dev/null @@ -1,575 +0,0 @@ - - - - - - - - - - - <no title> — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
-
    -
  • Docs »
  • - -
  • <no title>
  • -
  • - - - -
  • -
-
-
-
- -

-First, a small disclaimer. This tutorial assumes that you are already familiar -with the concepts of vlsi designs, such as netlist, layout, instances -and hierarchical design.

-

-

- - -
-
- - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/RDS/RDSpage.html b/documentation/_build/html/RDS/RDSpage.html deleted file mode 100644 index bb1310c7..00000000 --- a/documentation/_build/html/RDS/RDSpage.html +++ /dev/null @@ -1,1044 +0,0 @@ - - - - - - - - - - - Symbolic Layout — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -

-
-

Symbolic Layout¶

-
-

Symbolic Components¶

-

A symbolic layout is, in practice, made of only of three objects:

- ----- - - - - - - - - - - - - - - - - - - - - -
ObjectmbkExplanation
SegmentsphsegOriented segments with a width and an orientation.
VIAs & contactsphviaBoils down to just a point.
Big VIAs & Big ContactsphviaPoint with a width and a height -That is a rectangle of width by height centered -on the VIA coordinates.
-

Each of thoses objects is associated to a symbolic layer which will -control how the object is translated in many real rectangles.

- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
mbkLayer NameUsable ByUsage
phsegnwellSegmentN Well
PWELLSegmentP Well
NDIFSegmentN Diffusion
PDIFSegmentP Diffusion
NTIESegmentN Tie
PTIESegmentP Tie
NTRANSSegmentN transistor, in Alliance, a transistor -is represented as a segment (it’s grid).
PTRANSSegmentP transistor
POLYSegmentPolysilicium
ALUxSegmentMetal level x
CALUxSegmentMetal level x, that can be used by the -upper hierarchical level as a connector. -From the layout point of view it is the -same as ALUx.
TALUxSegmentBlockage for metal level x. Will -diseappear in the real layout as it is an -information for the P&R tools only.
phviaCONT_BODY_NVIA, BIGVIAContact to N Well
CONT_BODY_PVIA, BIGVIAContact to P Well
CONT_DIF_NVIA, BIGVIAContact to N Diffusion
CONT_DIF_PVIA, BIGVIAContact to P Diffusion
CONT_POLYVIA, BIGVIAContact to polysilicium
CONT_VIAVIA, BIGVIAContact between metal1 and metal2
CONT_VIAxVIA, BIGVIAContact between metal x and metal x+1. -The index is the the one of the bottom -metal of the VIA.
C_X_NVIAN transistor corner, to build transistor -bend. Not used anymore in recent technos
C_X_PVIAP transistor corner, to build transistor -bend. Not used anymore in recent technos
-
-

Note

-

Not all association of object and symbolic layers are meaningful. -For instance you cannot associate a contact to a NTRANS layer.

-
-
-

Note

-

The symbolic layer associated with blockages is prefixed by a T, -for transparency, which may seems silly. It is for historical reasons, -it started as a true transparency, but at some point we had to invert -the meaning (blockage) with the rise of over-the-cell routing, but the -name stuck...

-
-
-
-

Symbolic Segments¶

-

In Alliance, segments are oriented (up, down, left, right). This disambiguate -the left or right side when using the LCW and RCW rules in the rds file. -It allows to generate, if needed, asymetric object in the real layout file.

-

Symbolic Segment Orientations

-

-
-
-
-

The RDS File¶

-

The RDS file control how a symbolic layout is transformed into it’s real -conterpart.

-
-

Note

-

Unit used inside the RDS file: all units are expressed in micrometers.

-
-

Alliance tools relying on the RDS file, and what layers are active for them:

- ----- - - - - - - - - - - - - - - - - - - - - - - - - -
ToolNameRDS Flags
Layout editorgraalALL
Design Rule CheckerdrucALL, DRC
Electrical extractorcougarALL, EXT
The symbolic to real layout translators2rALL
-
-

Physical Grid & Lambda Value¶

-

RDS file:

-
DEFINE  PHYSICAL_GRID  0.005
-DEFINE  LAMBDA         0.09
-
-
-

Tells that the physical grid (founder grid) step is 0.005µm and the lambda has -a value of 0.09µm. That is, one lambda is 18 grid steps.

-

We can distinguish two kind of rds files:

-
    -
  • The 1µm kind, odd segment widths and coordinates are allowed, but the LAMBDA -value must represent an even number of foundry grid step.
  • -
  • The 2µm kind, segments widths and coordinates must all be even. And in that case -the LAMBDA value can be any multiple of the foundry grid.
  • -
-
-
-

The MBK_TO_RDS_SEGMENT table¶

-

The MBK_TO_RDS_SEGMENT table control the way segments are translated into -real rectangles. Be aware that we are translating segments and not rectangles. -Segments are defined by their axis (source & target points) and their width. -The geometrical transformations are described according to that model. -Obviously, they are either horizontal or vertical.

-

The translation method of a symbolic segment is as follow:

-
    -
  1. The segment is translated into one or more physical rectangles. -The generated rectangles depends on the tool which is actually -using rds and the flag for the considered real layer. -For instance, real layers flagged with DRC will be generated -for s2r (for the cif or gds) and druc, but will not -be shown under graal.

    -
  2. -
  3. Translation into one real layer. First the source & target coordinates and width -of the symbolic segment are multiplied by the LAMBDA value to obtain a real -segment. Then one of the VW, LCW or RCW transformation is applied to -that segment to get the final real rectangle.

    -
      -
    • VW for Variable Width, expand the real layer staying centered from the -original one. In those rules, the third number is not used, it is only here -to make the life easier for the parser...

      -

      RDS Variable Width Rule

      -
    • -
    • LCW or RCW for Left/Right Constant Width, create an off-center rectangle -of fixed width relatively to the real segment. Note that the SP number -is the distance between the edge of the real segment and the edge of the -generated real rectangle (not from the axis). It is often zero.

      -

      RDS Left Constant Width Rule

      -
    • -
    -
  4. -
-

-

Examples:

-
TABLE MBK_TO_RDS_SEGMENT
-
-    # (Case 1)
-    ALU1       RDS_ALU1   VW  0.18  0.09  0.0  ALL
-
-    # (Case 2)
-    NDIF       RDS_NDIF   VW  0.18  0.0   0.0  ALL \
-               RDS_ACTIV  VW  0.18  0.0   0.0  DRC \
-               RDS_NIMP   VW  0.36  0.36  0.0  DRC
-
-    # (Case 3)
-    NTRANS     RDS_POLY   VW  0.27  0.00  0.0  ALL \
-               RDS_GATE   VW  0.27  0.00  0.0  DRC \
-               RDS_NDIF  LCW  0.0   0.27  0.0  EXT \
-               RDS_NDIF  RCW  0.0   0.27  0.0  EXT \
-               RDS_NDIF   VW  0.0   0.72  0.0  DRC \
-               RDS_ACTIV  VW  0.0   0.72  0.0  ALL \
-               RDS_NIMP   VW  0.18  1.26  0.0  DRC
-
-END
-
-
-

Case 1 the ALU1 is translated in exacltly one real rectangle of -RDS_ALU1, both ends are extended by 0.18µm and it’s width is increased -by 0.09µm.

-

Case 2 the NDIF will be translated into only one segment -under graal, for symbolic visualization. And into three real rectangles -for s2r and druc.

-

Case 3 the NTRANS, associated to a transistor is a little bit -more complex, the generated shapes are different for the extractor cougar -in one hand, and for both druc & s2r in the other hand.

-
    -
  • For the extractor (EXT & ALL flags) there will be four rectangles -generateds:

    -
      -
    1. The gate (RDS_GATE)
    2. -
    3. The left diffusion of the transistor (source or drain) (RDS_NDIF).
    4. -
    5. The right diffusion of the transistor (drain or source) (RDS_NDIF).
    6. -
    7. The active area (RDS_ACTIV).
    8. -
    -

    As the extractor must kept separate the source and the drain of the transistor, -they are generated as two offset rectangles, using the LCW and RCW directives.

    -
  • -
  • For s2r and druc (DRC and ALL), five rectangles are generateds:

    -
      -
    1. The poly (RDS_POLY).
    2. -
    3. The gate (RDS_GATE).
    4. -
    5. The diffusion, as one rectangle that covers both the LCW and the RCW (RDS_NDIF).
    6. -
    7. The active area (RDS_ACTIV).
    8. -
    9. The N implantation (RDS_NIMP).
    10. -
    -

    In the layout send to the foundry, the source & drain are draw as one rectangle -across the gate area (the transistor being defined by the intersection of both -rectangles).

    -
  • -
-

-
-
-

The MBK_TO_RDS_VIA table¶

-

This table is to translate default VIAs into real via. In the symbolic layout -the default VIA is simply a point and a set of layers. All layers are converted -in squares shapes centered on the VIA coordinate. The one dimension given is the -size of the side of that square.

-

Note that although we are refering to VIAs, which for the purists are between two -metal layers, this table also describe contacts.

-

Example:

-
TABLE MBK_TO_RDS_VIA
-
-    CONT_DIF_P RDS_PDIF  0.54 ALL \
-               RDS_CONT  0.18 ALL \
-               RDS_ALU1  0.36 ALL \
-               RDS_ACTIV 0.54 DRC \
-               RDS_PIMP  0.90 DRC
-
-    CONT_POLY  RDS_POLY  0.54 ALL \
-               RDS_CONT  0.18 ALL \
-               RDS_ALU1  0.36 ALL
-
-    CONT_VIA   RDS_ALU1  0.45 ALL \
-               RDS_VIA1  0.27 ALL \
-               RDS_ALU2  0.45 ALL
-
-END
-
-
-
-

Note

-

In CONT_DIF_P you may see that only three layers will be shown under -graal, but five will be generated in the gds layout.

-
-
-
-

The MBK_TO_RDS_BIGVIA_HOLE table¶

-

In s2r, when generating BIGVIAs, the matrix of holes they contains is -not draw relative to the position of the BIGVIA itself, but on a grid which -is common througout all the design real layout. This is to allow overlap -between two BIGVIA without risking the holes matrix to be not exactly overlapping. -As a consequence, when visualizing the gds file, the holes may not be centerend -inside one individual BIGVIA.

-

The MBK_TO_RDS_BIGVIA_HOLE table define the global hole matrix for the whole -design. The first number is the individual hole side and the second the grid step -(edge to edge). The figure below show the hole generation.

-

BIGVIA holes

-

Example of BIGVIA overlap:

-

BIGVIA holes overlap

-

Example:

-
TABLE MBK_TO_RDS_BIGVIA_HOLE
-
-    CONT_VIA   RDS_VIA1 0.27 0.27 ALL
-    CONT_VIA2  RDS_VIA2 0.27 0.27 ALL
-    CONT_VIA3  RDS_VIA3 0.27 0.27 ALL
-    CONT_VIA4  RDS_VIA4 0.27 0.27 ALL
-    CONT_VIA5  RDS_VIA5 0.36 0.36 ALL
-
-END
-
-
-
-

Note

-

BIGVIA demotion. If the size of the bigvia is too small, there is -a possibility that no hole from the global matrix will be under it. -To avoid that case, if the either side of the BIGVIA is less than -1.5 * step, the BIGVIA is demoted to a simple VIA.

-
-
-
-

The MBK_TO_RDS_BIGVIA_METAL table¶

-

This table describe how the metal part of a BIGVIA is expanded (for the hole -part, see the previous table MBK_TO_RDS_BIGVIA_HOLE). The rule give for each -metal:

-
    -
  1. The delta-with (have to ask Franck).
  2. -
  3. The overhang, the length the real rectangle is expanded on each side from -the symbolic rectange.
  4. -
-

Example:

-
TABLE MBK_TO_RDS_BIGVIA_METAL
-
-    CONT_VIA  RDS_ALU1 0.0 0.09  ALL \
-              RDS_ALU2 0.0 0.09  ALL
-
-    CONT_VIA2 RDS_ALU2 0.0 0.09  ALL \
-              RDS_ALU3 0.0 0.09  ALL
-
-    CONT_VIA3 RDS_ALU3 0.0 0.09  ALL \
-              RDS_ALU4 0.0 0.09  ALL
-
-    CONT_VIA4 RDS_ALU4 0.0 0.09  ALL \
-              RDS_ALU5 0.0 0.09  ALL
-
-    CONT_VIA5 RDS_ALU5 0.0 0.09  ALL \
-              RDS_ALU6 0.0 0.18  ALL
-END
-
-
-
-
-

The MBK_WIRESETTING table¶

-

From a strict standpoint this table shouldn’t be here but put in a separate -configuration file, because it contains informations only used by the symbolic -layout tools (ocp, nero, ring).

-

This table defines the cell gauge the routing pitch and minimal (symbolic) -wire width and minimal spacing for the routers. They are patly redundant.

-

Example:

-
TABLE MBK_WIRESETTING
-
-    X_GRID             10
-    Y_GRID             10
-    Y_SLICE           100
-    WIDTH_VDD          12
-    WIDTH_VSS          12
-    TRACK_WIDTH_ALU8    0
-    TRACK_WIDTH_ALU7    4
-    TRACK_WIDTH_ALU6    4
-    TRACK_WIDTH_ALU5    4
-    TRACK_WIDTH_ALU4    3
-    TRACK_WIDTH_ALU3    3
-    TRACK_WIDTH_ALU2    3
-    TRACK_WIDTH_ALU1    3
-    TRACK_SPACING_ALU8  0
-    TRACK_SPACING_ALU7  4
-    TRACK_SPACING_ALU6  4
-    TRACK_SPACING_ALU5  4
-    TRACK_SPACING_ALU4  4
-    TRACK_SPACING_ALU3  4
-    TRACK_SPACING_ALU2  4
-    TRACK_SPACING_ALU1  3
-
-END
-
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/RDS/index.html b/documentation/_build/html/RDS/index.html deleted file mode 100644 index f2c9a60d..00000000 --- a/documentation/_build/html/RDS/index.html +++ /dev/null @@ -1,603 +0,0 @@ - - - - - - - - - - - RDS – Symbolic to Real Conversion in Alliance — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
-
    -
  • Docs »
  • - -
  • RDS – Symbolic to Real Conversion in Alliance
  • -
  • - - - -
  • -
-
-
-
- -

Disclaimer: This document is still far from complete.

- - - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/Stratus/Developper.html b/documentation/_build/html/Stratus/Developper.html deleted file mode 100644 index 63d45df2..00000000 --- a/documentation/_build/html/Stratus/Developper.html +++ /dev/null @@ -1,854 +0,0 @@ - - - - - - - - - - - Stratus Developper’s Guide — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

Stratus Developper’s Guide¶

-

Sophie Belloeil

-
-

Class Model¶

-
-

Synopsys¶

-
class myClass ( Model ) :
-    ...
-
-exemple = myClass ( name, param )
-
-
-
-
-

Description¶

-

Every cell made is a class herited from class Model. -Some methods have to be created, like Interface, Netlist ... -Some methods are inherited from the class Model.

-
-
-

Parameters¶

-
    -
  • name : The name of the cell (which is the name of the files which -will be created)
  • -
  • param : A dictionnary which gives all the parameters useful in -order to create the cell
  • -
-
-
-

Attributes¶

-
    -
  • _name : Name of the cell
  • -
  • _st_insts : List of all the instances of the cell
  • -
  • _st_ports : List of all the external nets of the cell (except for -alimentations and clock)
  • -
  • _st_sigs : List of all the internal nets of the cell
  • -
  • _st_vdds, _st_vsss : Two tabs of the nets which are -instancied as VddIn and VssIn
  • -
  • _st_cks : List of all the nets which are instancied as CkIn
  • -
  • _st_merge : List of all the internal nets which have to be merged
  • -
  • _param : The map given as argument at the creation of the cell
  • -
  • _underCells : List of all the instances which are cells that have -to be created
  • -
  • _and, _or, _xor, _not, _buff, _mux, _reg, -_shift, _comp, _add, _mult, _div : tells which -generator to use when using overloard
  • -
  • _NB_INST : The number of instances of the cell (useful in order -to automatically give a name to the instances)
  • -
  • _TAB_NETS_OUT and _TAB_NETS_CAT : Lists of all the nets -automatically created
  • -
  • _insref : The reference instance (for placement)
  • -
-

And, in connection with Hurricane :

-
    -
  • _hur_cell : The hurricane cell (None by default)
  • -
  • _db : The database
  • -
  • _lib0 : self._db.Get_CATA_LIB ( 0 )
  • -
  • _nb_alims_verticales, _nb_pins, _nb_vdd_pins, -_nb_vss_pins, standard_instances_list, pad_north, -pad_south, pad_east, pad_west : all place and route -stuffs ...
  • -
-
-
-

Methods¶

-

Methods of class Model are listed below :

-
    -
  • HurricanePlug : Creates the Hurricane cell thanks to the -stratus cell. -Before calling this method, only the stratus cell is created, after -this method, both cells are created. This method has to be called -before View and Save, and before Layout.
  • -
  • View : Opens/Refreshes the editor in order to see the created -layout
  • -
  • Quit : Finishes a cell without saving
  • -
  • Save : Saves the created cell -If several cells have been created, they are all going to be saved -in separated files
  • -
-

Some of those methods have to be defined in order to create a new cell :

-
    -
  • Interface : Description of the external ports of the cell
  • -
  • Netlist : Description of the netlist of the cell
  • -
  • Layout : Description of the layout of the cell
  • -
  • Vbe : Description of the behavior of the cell
  • -
  • Pattern : Description of the patterns in order to test the cell
  • -
-
-
-
-

Nets¶

-
-

Synopsys¶

-
netInput = LogicIn ( name, arity )
-
-
-
-
-

Description¶

-

Instanciation of net. Differents kind of nets are listed below :

-
    -
  • LogicIn : Creation of an input port
  • -
  • LogicOut : Creation of an output port
  • -
  • LogicInOut : Creation of an inout port
  • -
  • LogicUnknown : Creation of an input/output port which direction -is not defined
  • -
  • TriState : Creation of a tristate port
  • -
  • CkIn : Creation of a clock port
  • -
  • VddIn : Creation of the vdd alimentation
  • -
  • VssIn : Creation of the vss alimentation
  • -
  • Signal : Creation of an internal net
  • -
-
-
-

Parameters¶

-
    -
  • name : Name of the net (mandatory argument)
  • -
  • arity : Arity of the net (mandatory argument)
  • -
  • indice : For buses only : the LSB bit (optional argument : set -to 0 by default)
  • -
-

Only CkIn, ``\ ``VddIn and VssIn do not have the same parameters: there is only the name parameter (they are 1 bit nets).

-
-
-

Attributes¶

-
    -
  • _name : Name of the net

    -
  • -
  • _arity : Arity of the net (by default set to 0)

    -
  • -
  • _ind : LSB of the net

    -
  • -
  • _ext : Tells if the net is external or not (True/False)

    -
  • -
  • _direct : If the net is external, tells the direction (“INâ€, -“OUTâ€, “INOUTâ€, “TRISTATEâ€, “UNKNOWNâ€)

    -
  • -
  • _h_type : If the net is an alimentation or a clock, tells the -type (“POWERâ€, “GROUNDâ€, “CLOCKâ€)

    -
  • -
  • _type : The arithmetic type of the net ( “nr†)

    -
  • -
  • _st_cell : The stratus cell which the net is instanciated in

    -
  • -
  • _real_net : If the net is a part of a net (Sig) it is the real -net corresponding

    -
  • -
  • _alias : [] by default. When the net has an alias, it’s a tab. -Each element of the tab correspond to a bit of the net (from the LSB -to the MSB), it’a a dictionnary : the only key is the net which this -net is an alias from, the value is the bit of the net

    -
  • -
  • _to_merge : [] by default. The same as _alias

    -
  • -
  • -
    _to_cat : [] by default. The same as _alias
    -
    -
  • -
-

And, in connection with Hurricane :

-
    -
  • _hur_net : A tab with all the hurricane nets corresponding to the -stratus net ; From the LSB to the MSB (for example, with a 1 bit net, -one gets the hurricane net by doing : net._hur_net[0] ).
  • -
-
-
-

Methods¶

-
    -
  • Buffer : Instanciation of a Buffer

    -
  • -
  • Shift : Instanciation of a shifter

    -
  • -
  • Mux : Instanciation of a multiplexor

    -
  • -
  • Reg : Instanciation of a register

    -
  • -
  • Eq/Ne : Instanciation of comparison generator

    -
  • -
  • Extend : A net is extended

    -
  • -
  • Alias : A net is an alias of another net

    -
  • -
  • -
    Delete : Deletion of the Hurricane nets
    -
    -
  • -
-

And the overloards :

-
    -
  • __init__ : Initialisation of nets
  • -
  • __le__ : initialisation of a net thanks to <= notation
  • -
  • __getitem__, __geslice__ : Creation of “Sig†nets : which are -part of nets (use of [] and [:])
  • -
  • __and__, __or__, __xor__, __invert__ : boolean -operation with &, |, ^ ,
  • -
  • __add__, __mul__, __div__ : arithmetic operators with +, -* and /
  • -
-
-
-
-

Instances¶

-
-

Synopsys¶

-
Inst ( model
-     , name
-     , param = myParam
-     , map = myMap
-     )
-
-
-
-
-

Description¶

-

Instantiation of an instance. The type of the instance is given by the -model parameter. The connexions are made thanks to the map -parameters.

-
-
-

Parameters¶

-
    -
  • model : Name of the mastercell of the instance to create -(mandatory argument)
  • -
  • name : Name of the instance (optional) -When this argument is not defined, the instance has a name created -by default. This argument is usefull when one wants to create a -layout as well. Indeed, the placement of the instances is much easier -when the conceptor has chosen himself the name f the instances.
  • -
  • param : Dictionnary for parameters of the mastercell (optional : -only for mastercells which require it)
  • -
  • map : Dictionnary for connexions in order to make the netlist
  • -
-
-
-

Attributes¶

-
    -
  • _name : Name of the instance (the name given as parameter if -there’s one, a name created otherwise)
  • -
  • _model : Name of the model given as argument
  • -
  • _real_model : Name of the model created thanks to _model and -all the parameters
  • -
  • _map : Dictionnary map given at the instanciation
  • -
  • _param : Dictionnary param given at the instanciation
  • -
  • _st_cell : The stratus cell which the instance is instanciated in
  • -
  • _st_masterCell : The stratus master cell of the instance
  • -
-

For placement :

-
    -
  • _plac : tells if the instance is placed or not (UNPLACED by -default)
  • -
  • _x, _y : the coordinates of the instance (only for placed -instances)
  • -
  • _sym : the symetry of the instance (only for placed instances)
  • -
-

And, in connection with Hurricane :

-
    -
  • _hur_instance : The hurricane instance (None by default)
  • -
  • _hur_masterCell : The Hurricane master cell of the instance (None -by default)
  • -
-
-
-

Methods¶

-
    -
  • Delete : Deletion of the Hurricane instance
  • -
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/Stratus/DpGen.html b/documentation/_build/html/Stratus/DpGen.html deleted file mode 100644 index 5a6013b0..00000000 --- a/documentation/_build/html/Stratus/DpGen.html +++ /dev/null @@ -1,3861 +0,0 @@ - - - - - - - - - - - DpGen generators manual — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

DpGen generators manual¶

-

Sophie Belloeil

-
-

DpgenInv¶

-
    -
  • Name : DpgenInv – Inverter Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenInv', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits inverter with an output -power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • nq : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 1, 2, 4 or 8
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= not ( i0 )
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_inv ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.i = SignalIn  ( "i", 54 )
    -    self.o = SignalOut ( "o", 54 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenInv', 'inv_54'
    -             , param = { 'nbit'     : 54
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'inv_54', 'inst'
    -                  , map = { 'i0'  : self.i
    -                          , 'nq'  : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenBuff¶

-
    -
  • Name : DpgenBuff – Buffer Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenBuff', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits inverter with an output -power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • q : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 2, 4 or 8
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= i0
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_buff ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.i = SignalIn  ( "i", 32 )
    -    self.o = SignalOut ( "o", 32 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenBuff', 'buff_32'
    -             , param = { 'nbit'     : 32
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'buff_32', 'inst'
    -                  , map = { 'i0'  : self.i
    -                          , 'q'   : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenNand2¶

-
    -
  • Name : DpgenNand2 – Nand2 Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenNand2', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits two inputs NAND with an -output power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • i1 : input (n bits)
    • -
    • nq : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 1 or 4
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= not ( i0 and i1 )
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_nand2 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  ( "in1", 8 )
    -    self.in2 = SignalIn  ( "in2", 8 )
    -    self.o   = SignalOut (   "o", 8 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenNand2', 'nand2_8'
    -             , param = { 'nbit'     : 8
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'nand2_8', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'nq'  : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenNand3¶

-
    -
  • Name : DpgenNand3 – Nand3 Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenNand3', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits three inputs NAND with an -output power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • i1 : input (n bits)
    • -
    • i2 : input (n bits)
    • -
    • nq : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 1 or 4
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= not ( i0 and i1 and i2 )
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_nand3 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  ( "in1", 20 )
    -    self.in2 = SignalIn  ( "in2", 20 )
    -    self.in3 = SignalIn  ( "in3", 20 )
    -    self.o   = SignalOut (   "o", 20 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenNand3', 'nand3_20'
    -             , param = { 'nbit'     : 20
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'nand3_20', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'i2'  : self.in3
    -                          , 'nq'  : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

Dpgennand4¶

-
    -
  • Name : DpgenNand4 – Nand4 Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenNand4', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits four inputs NAND with an -output power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • i1 : input (n bits)
    • -
    • i2 : input (n bits)
    • -
    • i3 : input (n bits)
    • -
    • nq : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 1 or 4
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= not ( i0 and i1 and i2 and i3 )
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_nand4 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  ( "in1", 9 )
    -    self.in2 = SignalIn  ( "in2", 9 )
    -    self.in3 = SignalIn  ( "in3", 9 )
    -    self.in4 = SignalIn  ( "in4", 9 )
    -    self.o   = SignalOut (   "o", 9 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenNand4', 'nand4_9'
    -             , param = { 'nbit'     : 9
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'nand4_9', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'i2'  : self.in3
    -                          , 'i3'  : self.in4
    -                          , 'nq'  : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenAnd2¶

-
    -
  • Name : DpgenAnd2 – And2 Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenAnd2', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits two inputs AND with an -output power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • i1 : input (n bits)
    • -
    • q : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 2 or 4
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= i0 and i1
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_and2 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  ( "in1", 8 )
    -    self.in2 = SignalIn  ( "in2", 8 )
    -    self.out = SignalOut (   "o", 8 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenAnd2', 'and2_8'
    -             , param = { 'nbit'     : 8
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'and2_8', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'q'   : self.out
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenAnd3¶

-
    -
  • Name : DpgenAnd3 – And3 Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenAnd3', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits three inputs AND with an -output power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • i1 : input (n bits)
    • -
    • i2 : input (n bits)
    • -
    • q : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional): Defines the output power of the gates
        -
      • Valid drive are : 2 or 4
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False): In order to -generate a layout
    • -
    • behavioral (optional, default value : False): In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= i0 and i1 and i2
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_and3 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  ( "in1", 16 )
    -    self.in2 = SignalIn  ( "in2", 16 )
    -    self.in3 = SignalIn  ( "in3", 16 )
    -    self.out = SignalOut (   "o", 16 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenAnd3', "and3_16"
    -             , param = { 'nbit'     : 16
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'and3_16', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'i2'  : self.in3
    -                          , 'q'   : self.out
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref (0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenAnd4¶

-
    -
  • Name : DpgenAnd4 – And4 Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenAnd4', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits four inputs AND with an -output power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • i1 : input (n bits)
    • -
    • i2 : input (n bits)
    • -
    • i3 : input (n bits)
    • -
    • q : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 2 or 4
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= i0 and i1 and i2 and i3
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_and4 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1   = SignalIn  ( "in1", 2 )
    -    self.in2   = SignalIn  ( "in2", 2 )
    -    self.in3   = SignalIn  ( "in3", 2 )
    -    self.in4   = SignalIn  ( "in4", 2 )
    -    self.out   = SignalOut (   "o", 2 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenAnd4', 'and4_2'
    -             , param = { 'nbit'     : 2
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'and4_2', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'i2'  : self.in3
    -                          , 'i3'  : self.in4
    -                          , 'q'   : self.out
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenNor2¶

-
    -
  • Name : DpgenNor2 – Nor2 Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenNor2', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits two inputs NOR with an -output power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • i1 : input (n bits)
    • -
    • nq : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 1 or 4
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= not ( i0 or i1 )
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_nor2 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  ( "in1", 8 )
    -    self.in2 = SignalIn  ( "in2", 8 )
    -    self.o   = SignalOut (   "o", 8 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenNor2', 'nor2_8'
    -             , param = { 'nbit'     : 8
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'nor2_8', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'nq'  : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenNor3¶

-
    -
  • Name : DpgenNor3 – Nor3 Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenNor3', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits three inputs NOR with an -output power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • i1 : input (n bits)
    • -
    • i2 : input (n bits)
    • -
    • nq : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 1 or 4
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= not ( i0 or i1 or i2 )
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_nor3 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  ( "in1", 3 )
    -    self.in2 = SignalIn  ( "in2", 3 )
    -    self.in3 = SignalIn  ( "in3", 3 )
    -    self.o   = SignalOut ( "out", 3 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenNor3', 'nor3_3'
    -             , param = { 'nbit'     : 3
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'nor3_3', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'i2'  : self.in3
    -                          , 'nq'  : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenNor4¶

-
    -
  • Name : DpgenNor4 – Nor4 Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenNor4', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits four inputs NOR with an -output power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • i1 : input (n bits)
    • -
    • i2 : input (n bits)
    • -
    • i3 : input (n bits)
    • -
    • nq : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 1 or 4
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= not ( i0 or i1 or i2 or i3 )
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_nor4 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  ( "in1", 15 )
    -    self.in2 = SignalIn  ( "in2", 15 )
    -    self.in3 = SignalIn  ( "in3", 15 )
    -    self.in4 = SignalIn  ( "in4", 15 )
    -    self.out = SignalOut (   "o", 15 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenNor4', 'nor4_15'
    -             , param = { 'nbit'     : 15
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'nor4_15', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'i2'  : self.in3
    -                          , 'i3'  : self.in4
    -                          , 'nq'  : self.out
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenOr2¶

-
    -
  • Name : DpgenOr2 – Or2 Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenOr2', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits two inputs OR with an output -power of drive named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • i1 : input (n bits)
    • -
    • q : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the a map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 2 or 4
      • -
      • If this parameter is not defined, the drive is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= i0 or i1
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_or2 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  ( "in1", 8 )
    -    self.in2 = SignalIn  ( "in2", 8 )
    -    self.o   = SignalOut (   "o", 8 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenOr2', 'or2_8'
    -             , param = { 'nbit'     : 8
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'or2_8', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'q'   : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenOr3¶

-
    -
  • Name : DpgenOr3 – Or3 Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenOr3', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits three inputs OR with an -output power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • i1 : input (n bits)
    • -
    • i2 : input (n bits)
    • -
    • q : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 2 or 4
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= i0 or i1 or i2
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_or3 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  ( "in1", 5 )
    -    self.in2 = SignalIn  ( "in2", 5 )
    -    self.in3 = SignalIn  ( "in3", 5 )
    -    self.o   = SignalOut (   "o", 5 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenOr3', 'or3_5'
    -             , param = { 'nbit'     : 5
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'or3_5', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'i2'  : self.in3
    -                          , 'q'   : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenOr4¶

-
    -
  • Name : DpgenOr4 – Or4 Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenOr4', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits four inputs OR with an -output power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • i1 : input (n bits)
    • -
    • i2 : input (n bits)
    • -
    • i3 : input (n bits)
    • -
    • q : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 2 or 4
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= i0 or i1 or i2 or i3
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_or4 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  ( "in1", 16 )
    -    self.in2 = SignalIn  ( "in2", 16 )
    -    self.in3 = SignalIn  ( "in3", 16 )
    -    self.in4 = SignalIn  ( "in4", 16 )
    -    self.out = SignalOut (   "o", 16 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenOr4', 'or4_16'
    -             , param = { 'nbit'     : 16
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'or4_16', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'i2'  : self.in3
    -                          , 'i3'  : self.in4
    -                          , 'q'   : self.out
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenXor2¶

-
    -
  • Name : DpgenXor2 – Xor2 Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenXor2', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits two inputs XOR with an -output power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • i1 : input (n bits)
    • -
    • q : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 2 or 4
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optionnal, default value : False) : In order to -generate a layout
    • -
    • behavioral (optionnal, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= i0 xor i1
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_xor2 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  ( "in1", 8 )
    -    self.in2 = SignalIn  ( "in2", 8 )
    -    self.o   = SignalOut (   "o", 8 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenXor2', 'xor2_8'
    -             , param = { 'nbit' : 8
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'xor2_8', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'q'   : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenXnor2¶

-
    -
  • Name : DpgenXnor2 – Xnor2 Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenXnor2', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits two inputs XNOR with an -output power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : input (n bits)
    • -
    • i1 : input (n bits)
    • -
    • nq : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 1 or 4
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= not ( i0 xor i1 )
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_xnor2 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  ( "in1", 8 )
    -    self.in2 = SignalIn  ( "in2", 8 )
    -    self.o   = SignalOut (   "o", 8 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenXnor2', 'xnor2_8'
    -             , param = { 'nbit'     : 8
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'xnor2_8', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'nq'  : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenNmux2¶

-
    -
  • Name : DpgenNmux2 – Multiplexer Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenNmux2', modelname
    -         , param = { 'nbit'       : n
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits two inputs multiplexer named -modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • cmd : select ( 1 bit )
    • -
    • i0 : input ( n bits )
    • -
    • i1 : input ( n bits )
    • -
    • nq : output ( n bits )
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= WITH cmd SELECT not i0 WHEN '0',
    -                      not i1 WHEN '1';
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_nmux2 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  (  "in1", 5 )
    -    self.in2 = SignalIn  (  "in2", 5 )
    -    self.cmd = SignalIn  (  "cmd", 1 )
    -    self.o   = SignalOut (    "o", 5 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenNmux2', 'nmux2_5'
    -             , param = { 'nbit'     : 5
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'nmux2_5', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'cmd' : self.cmd
    -                          , 'nq'  : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenMux2¶

-
    -
  • Name : DpgenMux2 – Multiplexer Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenMux2', modelname
    -         , param = { 'nbit'       : n
    -                   , 'drive'      : d
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits two inputs multiplexer with -an output power of d named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • cmd : select ( 1 bit )
    • -
    • i0 : input ( n bits )
    • -
    • i1 : input ( n bits )
    • -
    • q : output ( n bits )
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • nbit_cmd (mandatory) : Defines the size of the generator
    • -
    • drive (optional) : Defines the output power of the gates
        -
      • Valid drive are : 2 or 4
      • -
      • If this parameter is not defined, it’s value is the smallest -one permitted
      • -
      -
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nq <= WITH cmd SELECT i0 WHEN '0',
    -                      i1 WHEN '1';
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_mux2 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1  = SignalIn  ( "in1", 8 )
    -    self.in2  = SignalIn  ( "in2", 8 )
    -    self.cmd  = SignalIn  ( "cmd", 1 )
    -    self.o    = SignalOut (   "o", 8 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenMux2', 'mux2_8'
    -             , param = { 'nbit'     : 8
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'mux2_8', 'inst'
    -                  , map = { 'i0'  : self.in1
    -                          , 'i1'  : self.in2
    -                          , 'cmd' : self.cmd
    -                          , 'q'   : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenNbuse¶

-
    -
  • Name : DpgenNbuse – Tristate Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenNbuse', modelname
    -         , param = { 'nbit'       : n
    -                   , 'physical'   : true
    -                   , 'behavioral' : true
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits tristate with an -complemented output named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • cmd : select ( 1 bit )
    • -
    • i0 : input ( n bits )
    • -
    • nq : output ( n bits )
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nts:BLOCK(cmd = '1') BEGIN
    -    nq <= GUARDED not(i0);
    -END
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_nbuse ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.i   = SignalIn  (   "i", 29 )
    -    self.cmd = SignalIn  ( "cmd", 1  )
    -    self.o   = SignalOut (   "o", 29 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenNbuse', 'nbuse29'
    -             , param = { 'nbit'     : 29
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'nbuse29', 'inst'
    -                  , map = { 'i0'  : self.i
    -                          , 'cmd' : self.cmd
    -                          , 'nq'  : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenBuse¶

-
    -
  • Name : DpgenBuse – Tristate Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenBuse', modelname
    -         , param = { 'nbit'       : n
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits tristate named -modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • cmd : select ( 1 bit )
    • -
    • i0 : input ( n bits )
    • -
    • q : output ( n bits )
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    nts:BLOCK(cmd = '1') BEGIN
    -    q <= GUARDED i0;
    -END
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_buse ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.i   = SignalIn  (   "i", 8 )
    -    self.cmd = SignalIn  ( "cmd", 1 )
    -    self.o   = SignalOut (   "o", 8 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenBuse', 'buse_8'
    -             , param = { 'nbit'     : 8
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'buse_8', 'inst'
    -                  , map = { 'i0'  : self.i
    -                          , 'cmd' : self.cmd
    -                          , 'q'   : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenNand2mask¶

-
    -
  • Name : DpgenNand2mask – Programmable Mask Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenNand2mask', modelname
    -         , param = { 'nbit'       : n
    -                   , 'const'      : constVal
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits conditionnal NAND mask named -modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • cmd : mask control ( 1 bit )
    • -
    • i0 : input ( n bits )
    • -
    • nq : output ( n bits )
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • const (mandatory) : Defines the constant (string beginning -with 0b, 0x or 0o functions of the basis)
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • How it works :

    -
      -
    • If the cmd signal is set to zero, the mask is NOT applied, -so the whole operator behaves like an inverter.
    • -
    • If the cmd signal is set to one, the mask is applied, the -output is the complemented result of the input value ANDed -with the mask (suplied by constVal).
    • -
    • The constant constVal is given to the macro-generator call, -therefore the value cannot be changed afterward : it’s hard wired -in the operator.
    • -
    • A common error is to give a real constant for the constVal -argument. Be aware that it is a character string.
    • -
    -
  • -
  • Behavior :

    -
    nq <= WITH cmd SELECT not(i0)              WHEN '0',
    -                      not(i0 and constVal) WHEN '1';
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_nand2mask ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.i   = SignalIn  (   "i", 32 )
    -    self.cmd = SignalIn  ( "cmd",  1 )
    -    self.o   = SignalOut (   "o", 32 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenNand2mask', 'nand2mask_0x0000ffff'
    -             , param = { 'nbit'     : 32
    -                       , 'const'    : "0x0000FFFF"
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'nand2mask_0x0000ffff', 'inst'
    -                  , map = { 'i0'  : self.i
    -                          , 'cmd' : self.cmd
    -                          , 'nq'  : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenNor2mask¶

-
    -
  • Name : DpgenNor2mask – Programmable Mask Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenNor2mask', modelname
    -         , param = { 'nbit'       : n
    -                   , 'const'      : constVal
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits conditionnal NOR mask named -modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • cmd : mask control ( 1 bit )
    • -
    • i0 : input ( n bits )
    • -
    • nq : output ( n bits )
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • const (mandatory) : Defines the constant (string beginning -with 0b, 0x or 0o functions of the basis)
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • How it works :

    -
      -
    • If the cmd signal is set to zero, the mask is NOT applied, -so the whole operator behaves like an inverter.
    • -
    • If the cmd signal is set to one, the mask is applied, the -output is the complemented result of the input value ORed with -the mask (suplied by constVal).
    • -
    • The constant constVal is given to the macro-generator call, -therefore the value cannot be changed afterward : it’s hard wired -in the operator.
    • -
    • A common error is to give a real constant for the constVal -argument. Be aware that it is a character string.
    • -
    -
  • -
  • Behavior :

    -
    nq <= WITH cmd SELECT not(i0)             WHEN '0',
    -                      not(i0 or constVal) WHEN '1';
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_nor2mask ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.i   = SignalIn  (   "i", 8 )
    -    self.cmd = SignalIn  ( "cmd", 1 )
    -    self.o   = SignalOut (   "o", 8 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenNor2mask', 'nor2mask_000111'
    -             , param = { 'nbit'     : 8
    -                       , 'const'    : "0b000111"
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'nor2mask_000111', 'inst'
    -                  , map = { 'i0'  : self.i
    -                          , 'cmd' : self.cmd
    -                          , 'nq'  : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenXnor2mask¶

-
    -
  • Name : DpgenXnor2mask – Programmable Mask Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenXnor2mask', modelname
    -         , param = { 'nbit'       : n
    -                   , 'const'      : constVal
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits conditionnal XNOR mask named -modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • cmd : mask control ( 1 bit )
    • -
    • i0 : input ( n bits )
    • -
    • nq : output ( n bits )
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • const (mandatory) : Defines the constant (string beginning -with 0b, 0x or 0o functions of the basis)
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • How it works :

    -
      -
    • If the cmd signal is set to zero, the mask is NOT applied, -so the whole operator behaves like an inverter.
    • -
    • If the cmd signal is set to one, the mask is applied, the -output is the complemented result of the input value XORed -with the mask (suplied by constVal).
    • -
    • The constant constVal is given to the macro-generator call, -therefore the value cannot be changed afterward : it’s hard wired -in the operator.
    • -
    • A common error is to give a real constant for the constVal -argument. Be aware that it is a character string.
    • -
    -
  • -
  • Behavior :

    -
    nq <= WITH cmd SELECT not(i0)              WHEN '0',
    -                      not(i0 xor constVal) WHEN '1';
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_xnor2mask ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.i   = SignalIn  (   "i", 8 )
    -    self.cmd = SignalIn  ( "cmd", 1 )
    -    self.o   = SignalOut (   "o", 8 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenXnor2mask', 'xnor2mask_0b000111'
    -             , param = { 'nbit'     : 8
    -                       , 'const'    : "0b000111"
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'xnor2mask_0b000111', 'inst'
    -                  , map = { 'i0'  : self.i
    -                          , 'cmd' : self.cmd
    -                          , 'nq'  : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenAdsb2f¶

-
    -
  • Name : DpgenAdsb2f – Adder/Substractor Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenAdsb2f', modelname
    -         , param = { 'nbit'       : n
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits adder/substractor named -modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : First operand (input, n bits)
    • -
    • i1 : Second operand (input, n bits)
    • -
    • q : Output operand (ouput, n bits)
    • -
    • add_sub : Select addition or substraction (input, 1 bit)
    • -
    • c31 : Sarry out. In unsigned mode, this is the overflow -(output, 1 bit)
    • -
    • c30 : Used to compute overflow in signed mode : -overflow = c31 xor c30 (output, 1 bit)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • How it works :

    -
      -
    • If the add_sub signal is set to zero, an addition is -performed, otherwise it’s a substraction.
    • -
    • Operation can be either signed or unsigned. In unsigned mode -c31 is the overflow ; in signed mode you have to compute -overflow by XORing c31 and c30
    • -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_ADSB2F ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.in1 = SignalIn  ( "in1", 8 )
    -    self.in2 = SignalIn  ( "in2", 8 )
    -    self.out = SignalOut (   "o", 8 )
    -    self.as  = SignalIn  (  "as", 1 )
    -    self.c0  = SignalOut (  "c0", 1 )
    -    self.c1  = SignalOut (  "c1", 1 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenAdsb2f', 'adder_8'
    -             , param = { 'nbit'     : 8
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'adder_8', 'inst'
    -                  , map = { 'i0'      : self.in1
    -                          , 'i1'      : self.in2
    -                          , 'add_sub' : self.as
    -                          , 'q'       : self.out
    -                          , 'c30'     : self.c0
    -                          , 'c31'     : self.c1
    -                          , 'vdd'     : self.vdd
    -                          , 'vss'     : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenShift¶

-
    -
  • Name : DpgenShift – Shifter Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenShift', modelname
    -         , param = { 'nbit'     : n
    -                   , 'physical' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits shifter named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • op : select the kind of shift (input, 2 bits)
    • -
    • shamt : the shift amount (input, Y bits)
    • -
    • i : value to shift (input, n bits)
    • -
    • o : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    -
  • -
  • How it works :

    -
      -
    • If the op[0] signal is set to one, performs a right shift, -performs a left shift otherwise.
    • -
    • If the op[1] signal is set to one, performs an arithmetic -shift (only meaningful in case of a right shift).
    • -
    • shamt : specifies the shift amount. The width of this signal -(Y) is computed from the operator’s width : Y = ceil(log2(n)) - 1
    • -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_shifter ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.instop    = SignalIn  (    "instop", 2 )
    -    self.instshamt = SignalIn  ( "instshamt", 2 )
    -    self.insti     = SignalIn  (     "insti", 4 )
    -    self.insto     = SignalOut (     "insto", 4 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenShifter', 'shifter_4'
    -             , param = { 'nbit'     : 4
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'shifter_4', 'inst'
    -                  , map = { 'op'    : self.instop
    -                          , 'shamt' : self.instshamt
    -                          , 'i'     : self.insti
    -                          , 'o'     : self.insto
    -                          , 'vdd'   : self.vdd
    -                          , 'vss'   : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenShrot¶

-
    -
  • Name : DpgenShrot – Shift/Rotation Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenShrot', modelname
    -         , param = { 'nbit'     : n
    -                   , 'physical' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits shift/rotation operator -named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • op : select the kind of shift/rotation (input, 3 bits)
    • -
    • shamt : the shift amount (input, Y bits)
    • -
    • i : value to shift (input, n bits)
    • -
    • o : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    -
  • -
  • How it works :

    -
      -
    • If the op[0] signal is set to one, performs a right -shift/rotation , otherwise left shift/rotation occurs.
    • -
    • If the op[1] signal is set to one, performs an arithmetic -shift (only meaningful in case of a right shift).
    • -
    • If the op[2] signal is set to one, performs a rotation, -otherwise performs a shift..
    • -
    • shamt specifies the shift amount. The width of this signal -(Y) is computed from the operator’s width : -Y = ceil(log2(n)) - 1
    • -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_shrot ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.rotop     = SignalIn  (     "rotop", 3 )
    -    self.instshamt = SignalIn  ( "instshamt", 2 )
    -    self.insti     = SignalIn  (     "insti", 4 )
    -    self.insto     = SignalOut (     "insto", 4 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenShrot', 'shrot_4'
    -             , param = { 'nbit'     : 4
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'shrot_4', 'inst'
    -                  , map = { 'op'    : self.rotop
    -                          , 'shamt' : self.instshamt
    -                          , 'i'     : self.insti
    -                          , 'o'     : self.insto
    -                          , 'vdd'   : self.vdd
    -                          , 'vss'   : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenNul¶

-
    -
  • Name : DpgenNul – Zero Detector Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenNul', modelname
    -         , param = { 'nbit'     : n
    -                   , 'physical' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits zero detector named -modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • i0 : value to check (input, n bits)
    • -
    • q : null flag (1 bit)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    -
  • -
  • Behavior :

    -
    q <= '1' WHEN ( i0 = X"00000000" ) ELSE '0';
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_nul ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.i = SignalIn  ( "i", 4 )
    -    self.o = SignalOut ( "o", 1 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenNul', 'nul_4'
    -             , param = { 'nbit'     : 4
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'nul_4', 'inst'
    -                   , map = { 'i0'  : self.i
    -                           , 'nul' : self.o
    -                           , 'vdd' : self.vdd
    -                           , 'vss' : self.vss
    -                           }
    -                   )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenConst¶

-
    -
  • Name : DpgenConst – Constant Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenConst', modelname
    -         , param = { 'nbit'       : n
    -                   , 'const'      : constVal
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits constant named -modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • q : the constant (output, n bit)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • const (mandatory) : Defines the constant (string beginning -with 0b, 0x or 0o functions of the basis)
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • Behavior :

    -
    q <= constVal
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_const ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.o = SignalOut ( "o", 32 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenConst', 'const_0x0000ffff'
    -             , param = { 'nbit'     : 32
    -                       , 'const'    : "0x0000FFFF"
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'const_0x0000ffff', 'inst'
    -                  , map = { 'q'   : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenRom2¶

-
    -
  • Name : DpgenRom2 – 2 words ROM Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenRom2', modelname
    -         , param = { 'nbit'     : n
    -                   , 'val0'     : constVal0
    -                   , 'val1'     : constVal1
    -                   , 'physical' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits 2 words optimized ROM named -modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • sel0 : address of the value (input, 1 bit)
    • -
    • q : the selected word (output, n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • val0 (mandatory) : Defines the first word
    • -
    • val1 (mandatory) : Defines the second word
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    -
  • -
  • Behavior :

    -
    q <= WITH sel0 SELECT
    -     constVal0  WHEN B"0",
    -     constVal1  WHEN B"1";
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_rom2 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.sel0 = SignalIn  (    "sel0", 1 )
    -    self.q    = SignalOut ( "dataout", 4 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenRom2', 'rom2_0b1010_0b1100'
    -             , param = { 'nbit'     : 4
    -                       , 'val0'     : "0b1010"
    -                       , 'val1'     : "0b1100"
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'rom2_0b1010_0b1100', 'inst'
    -                  , map = { 'sel0' : self.sel0
    -                          , 'q'    : self.q
    -                          , 'vdd'  : self.vdd
    -                          , 'vss'  : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenRom4¶

-
    -
  • Name : DpgenRom4 – 4 words ROM Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenRom4', modelname
    -         , param = { 'nbit'     : n
    -                   , 'val0'     : constVal0
    -                   , 'val1'     : constVal1
    -                   , 'val2'     : constVal2
    -                   , 'val3'     : constVal3
    -                   , 'physical' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits 4 words optimized ROM named -modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • sel1 : upper bit of the address of the value (input, 1 bit)
    • -
    • sel0 : lower bit of the address of the value (input, 1 bit)
    • -
    • q : the selected word (output, n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • val0 (mandatory) : Defines the first word
    • -
    • val1 (mandatory) : Defines the second word
    • -
    • val2 (mandatory) : Defines the third word
    • -
    • val3 (mandatory) : Defines the fourth word
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    -
  • -
  • Behavior :

    -
    q <= WITH sel1 & sel0 SELECT constVal0  WHEN B"00",
    -                             constVal1  WHEN B"01",
    -                             constVal2  WHEN B"10",
    -                             constVal3  WHEN B"11";
    -
    -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_rom4 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.sel0 = SignalIn  (    "sel0", 1 )
    -    self.sel1 = SignalIn  (    "sel1", 1 )
    -    self.q    = SignalOut ( "dataout", 4 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenRom4', 'rom4_0b1010_0b1100_0b1111_0b0001'
    -             , param = { 'nbit'     : 4
    -                       , 'val0'     : "0b1010"
    -                       , 'val1'     : "0b1100"
    -                       , 'val2'     : "0b1111"
    -                       , 'val3'     : "0b0001"
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'rom4_0b1010_0b1100_0b1111_0b0001', 'inst'
    -                  , map = { 'sel0' : self.sel0
    -                          , 'sel1' : self.sel1
    -                          , 'q'    : self.q
    -                          , 'vdd'  : self.vdd
    -                          , 'vss'  : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenRam¶

-
    -
  • Name : DpgenRam – RAM Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenRam', modelname
    -         , param = { 'nbit'     : n
    -                   , 'nword'    : regNumber
    -                   , 'physical' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a RAM of regNumber words of n -bits named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • ck : clock signal (input, 1 bit)
    • -
    • w : write requested (input, 1 bit)
    • -
    • selram : select the write bus (input, 1 bit)
    • -
    • ad : the address (input, Y bits)
    • -
    • datain : write bus (input, n bits)
    • -
    • dataout : read bus (output, n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • nword (mandatory) : Defines the size of the words
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_ram ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.ck      = SignalIn  (      "ck",  1 )
    -    self.w       = SignalIn  (       "w",  1 )
    -    self.selram  = SignalIn  (  "selram",  1 )
    -    self.ad      = SignalIn  (      "ad",  5 )
    -    self.datain  = SignalIn  (  "datain", 32 )
    -    self.dataout = TriState ( "dataout", 32 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenRam', 'ram_32_32'
    -             , param = { 'nbit'     : 32
    -                       , 'nword'    : 32
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'ram_32_32', 'inst'
    -                  , map = { 'ck'      : self.ck
    -                          , 'w'       : self.w
    -                          , 'selram'  : self.selram
    -                          , 'ad'      : self.ad
    -                          , 'datain'  : self.datain
    -                          , 'dataout' : self.dataout
    -                          , 'vdd'     : self.vdd
    -                          , 'vss'     : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenRf1¶

-
    -
  • Name : DpgenRf1, DpgenRf1r0 – Register File Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenRf1', modelname
    -         , param = { 'nbit'     : n
    -                   , 'nword'    : regNumber
    -                   , 'physical' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a register file of regNumber words of -n bits without decoder named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • ckok : clock signal (input, 1 bit)
    • -
    • sel : select the write bus (input, 1 bit)
    • -
    • selr : the decoded read address (input, regNumber bits)
    • -
    • selw : the decoded write address (input, regNumber bits)
    • -
    • datain0 : first write bus (input, n bits)
    • -
    • datain1 : second write bus (input, n bits)
    • -
    • dataout : read bus (output, n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the words (even, -between 2 and 64)
    • -
    • nword (mandatory) : Defines the number of the words (even, -between 4 and 32)
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    -
  • -
  • How it works :

    -
      -
    • datain0 and datain1 are the two write busses. Only one is used to -actually write the register word, it is selected by the sel -signal.
    • -
    • When sel is set to zero datain0 is used to write the register -word, otherwise it will be datain1
    • -
    • selr, selw : this register file have no decoder, so selr have a -bus width equal to regNumber. One bit for each word
    • -
    • The DpgenRf1r0 variant differs from the DpgenRf1 in that the -register of address zero is stuck to zero. You can write into it, -it will not change the value. When read, it will always return -zero
    • -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_rf1 ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.ck      = SignalIn    (       "ck",  1 )
    -    self.sel     = SignalIn    (      "sel",  1 )
    -    self.selr    = SignalIn    (     "selr", 16 )
    -    self.selw    = SignalIn    (     "selw", 16 )
    -    self.datain0 = SignalIn    (  "datain0",  4 )
    -    self.datain1 = SignalIn    (  "datain1",  4 )
    -    self.dataout = SignalOut   (  "dataout",  4 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenRf1', 'rf1_4_16'
    -             , param = { 'nbit'     : 4
    -                       , 'nword'    : 16
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'rf1_4_16', 'inst'
    -                  , map =  { 'ck'      : self.ck
    -                           , 'sel'     : self.sel
    -                           , 'selr'    : self.selr
    -                           , 'selw'    : self.selw
    -                           , 'datain0' : self.datain0
    -                           , 'datain1' : self.datain1
    -                           , 'dataout' : self.dataout
    -                           , 'vdd'     : self.vdd
    -                           , 'vss'     : self.vss
    -                           }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenRf1d¶

-
    -
  • Name : DpgenRf1d, DpgenRf1dr0 – Register File with Decoder -Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenRf1d', modelname
    -         , param = { 'nbit'     : n
    -                   , 'nword'    : regNumber
    -                   , 'physical' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a register file of regNumber words of -n bits with decoder named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • ck : clock signal (input, 1 bit)
    • -
    • sel : select the write bus (input, 1 bit)
    • -
    • wen : write enable (input, 1 bit)
    • -
    • ren : read enable (input, 1 bit)
    • -
    • adr : the read address (input, Y bits)
    • -
    • adw : the write address (input, Y bits)
    • -
    • datain0 : first write bus (input, n bits)
    • -
    • datain1 : second write bus (input, n bits)
    • -
    • dataout : read bus (output, n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the words (even, -between 2 and 64)
    • -
    • nword (mandatory) : Defines the number of the words (even, -between 6 and 32)
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    -
  • -
  • How it works :

    -
      -
    • datain0 and datain1 are the two write busses. Only one is used to -actually write the register word, it is selected by the sel -signal.
    • -
    • When sel is set to zero datain0 is used to write the register -word, otherwise it will be datain1
    • -
    • adr, adw : the width (Y) of those signals is computed from -regNumber : Y = log2(regNumber)
    • -
    • wen and ren : write enable and read enable, allows reading and -writing when sets to one
    • -
    • The DpgenRf1dr0 variant differs from the DpgenRf1d in that the -register of address zero is stuck to zero. You can write into it, -it will not change the value. When read, it will always return -zero
    • -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_rf1d ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.ck      = SignalIn  (       "ck", 1 )
    -    self.sel     = SignalIn  (      "sel", 1 )
    -    self.wen     = SignalIn  (      "wen", 1 )
    -    self.ren     = SignalIn  (      "ren", 1 )
    -    self.adr     = SignalIn  (      "adr", 4 )
    -    self.adw     = SignalIn  (      "adw", 4 )
    -    self.datain0 = SignalIn  (  "datain0", 4 )
    -    self.datain1 = SignalIn  (  "datain1", 4 )
    -    self.dataout = SignalOut (  "dataout", 4 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenRf1d', 'rf1d_4_16'
    -             , param = { 'nbit'     : 4
    -                       , 'nword'    : 16
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'rf1d_4_16', 'inst'
    -                  , map = { 'ck'      : self.ck
    -                          , 'sel'     : self.sel
    -                          , 'wen'     : self.wen
    -                          , 'ren'     : self.ren
    -                          , 'adr'     : self.adr
    -                          , 'adw'     : self.adw
    -                          , 'datain0' : self.datain0
    -                          , 'datain1' : self.datain1
    -                          , 'dataout' : self.dataout
    -                          , 'vdd'     : self.vdd
    -                          , 'vss'     : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenFifo¶

-
    -
  • Name : DpgenFifo – Fifo Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenFifo', modelname
    -         , param = { 'nbit'       : n
    -                   , 'nword'      : regNumber
    -                   , 'physical'   : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a FIFO of regNumber words of n -bits named modelname.

    -
  • -
  • Terminal Names :

    -
      -
    • ck : clock signal (input, 1 bit)
    • -
    • reset : reset signal (input, 1 bit)
    • -
    • r : read requested (input, 1 bit)
    • -
    • w : write requested (input, 1 bit)
    • -
    • rok : read acknowledge (output, 1 bit)
    • -
    • wok : write acknowledge (output, 1 bit)
    • -
    • sel : select the write bus (input, 1 bit)
    • -
    • datain0 : first write bus (input, n bits)
    • -
    • datain1 : second write bus (input, n bits)
    • -
    • dataout : read bus (output, n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the words (even, -between 2 and 64)
    • -
    • nword (mandatory) : Defines the number of words (even, between -4 and 32)
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    -
  • -
  • How it works :

    -
      -
    • datain0 and datain1 : the two write busses. Only one is used to -actually write the FIFO, it is selected by the sel signal.
    • -
    • sel : when set to zero the datain0 is used to write the -register word, otherwise it will be datain1.
    • -
    • r, rok : set r when a word is requested, rok tells that a word has -effectively been popped (rok == not empty).
    • -
    • w, wok : set w when a word is pushed, wok tells that the word has -effectively been pushed (wok == not full).
    • -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_fifo ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.ck      = SignalIn    (       "ck", 1 )
    -    self.reset   = SignalIn    (    "reset", 1 )
    -    self.r       = SignalIn    (        "r", 1 )
    -    self.w       = SignalIn    (        "w", 1 )
    -    self.rok     = SignalInOut (      "rok", 1 )
    -    self.wok     = SignalInOut (      "wok", 1 )
    -    self.sel     = SignalIn    (      "sel", 1 )
    -    self.datain0 = SignalIn    (  "datain0", 4 )
    -    self.datain1 = SignalIn    (  "datain1", 4 )
    -    self.dataout = SignalOut   (  "dataout", 4 )
    -
    -    self.vdd   = VddIn ( "vdd" )
    -    self.vss   = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenFifo', 'fifo_4_16'
    -             , param = { 'nbit'     : 4
    -                       , 'nword'    : 16
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'fifo_4_16', 'inst'
    -                  , map = { 'ck'      : self.ck
    -                          , 'reset'   : self.reset
    -                          , 'r'       : self.r
    -                          , 'w'       : self.w
    -                          , 'rok'     : self.rok
    -                          , 'wok'     : self.wok
    -                          , 'sel'     : self.sel
    -                          , 'datain0' : self.datain0
    -                          , 'datain1' : self.datain1
    -                          , 'dataout' : self.dataout
    -                          , 'vdd'     : self.vdd
    -                          , 'vss'     : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenDff¶

-
    -
  • Name : DpgenDff – Dynamic Flip-Flop Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenDff', modelname
    -         , param = { 'nbit'       : n
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits dynamic flip-flop named -modelname. The two latches of this flip-flop are dynamic, i.e. -the data is stored in a capacitor.

    -
  • -
  • Terminal Names :

    -
      -
    • wen : write enable (1 bit)
    • -
    • ck : clock signal (1 bit)
    • -
    • i0 : data input (n bits)
    • -
    • q : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • How it works :

    -
      -
    • When wen is set to one, enables the writing of the flip-flop
    • -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_dff ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.ck  = SignalIn  (  "ck", 1 )
    -    self.wen = SignalIn  ( "wen", 1 )
    -    self.i   = SignalIn  (   "i", 4 )
    -    self.o   = SignalOut (   "o", 4 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenDff', 'dff_4'
    -             , param = { 'nbit'     : 4
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'dff_4', 'inst'
    -                  , map = { "wen" : self.wen
    -                          , "ck"  : self.ck
    -                          , "i0"  : self.i
    -                          ,  "q"  : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenDfft¶

-
    -
  • Name : DpgenDfft – Dynamic Flip-Flop with Scan-Path -Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenDfft', modelname
    -         , param = { 'nbit'       : n
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits dynamic flip-flop with scan-path -named modelname. The two latches of this flip-flop are dynamic, -i.e. the data is stored in a capacitor.

    -
  • -
  • Terminal Names :

    -
      -
    • scan : scan-path mode (input, 1 bit)
    • -
    • scin : scan path in (input, 1 bit)
    • -
    • wen : write enable (1 bit)
    • -
    • ck : clock signal (1 bit)
    • -
    • i0 : data input (n bits)
    • -
    • q : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • How it works :

    -
      -
    • When scan is set to one, it enables the scan-path mode. Note -that in scan-path mode, the wen signal is not effective
    • -
    • scin is the input of the scan-path. This terminal is different -from i0[0]. The scout is q[N-1] (in the following example this -is q[31])
    • -
    • When wen is set to one enables the writing of the flip-flop
    • -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_dfft ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.scan = SignalIn  ( "scin", 1 )
    -    self.scin = SignalIn  ( "scan", 1 )
    -    self.ck   = SignalIn  (   "ck", 1 )
    -    self.wen  = SignalIn  (  "wen", 1 )
    -    self.i    = SignalIn  (    "i", 4 )
    -    self.o    = SignalOut (    "o", 4 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenDfft', 'dfft_4'
    -             , param = { 'nbit' : 4
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'dfft_4', 'inst'
    -                  , map = { "wen"  : self.wen
    -                          , "ck"   : self.ck
    -                          , "scan" : self.scan
    -                          , "scin" : self.scin
    -                          , "i0"   : self.i
    -                          ,  "q"   : self.o
    -                          , 'vdd'  : self.vdd
    -                          , 'vss'  : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenSff¶

-
    -
  • Name : DpgenSff – Static Flip-Flop Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenSff', modelname
    -         , param = { 'nbit'       : n
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits static flip-flop named -modelname. The two latches of this flip-flop are static, i.e. -each one is made of two interters looped together.

    -
  • -
  • Terminal Names :

    -
      -
    • wen : write enable (1 bit)
    • -
    • ck : clock signal (1 bit)
    • -
    • i0 : data input (n bits)
    • -
    • q : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • How it works :

    -
      -
    • When wen is set to one, enables the writing of the flip-flop
    • -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_sff ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.ck  = SignalIn  (  "ck", 1 )
    -    self.wen = SignalIn  ( "wen", 1 )
    -    self.i   = SignalIn  (   "i", 4 )
    -    self.o   = SignalOut (   "o", 4 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenSff', 'sff_4'
    -             , param = { 'nbit'     : 4
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'sff_4', 'inst'
    -                  , map = { "wen" : self.wen
    -                          , "ck"  : self.ck
    -                          , "i0"  : self.i
    -                          ,  "q"  : self.o
    -                          , 'vdd' : self.vdd
    -                          , 'vss' : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
-

DpgenSfft¶

-
    -
  • Name : DpgenSfft – Static Flip-Flop with Scan-Path -Macro-Generator

    -
  • -
  • Synopsys :

    -
    Generate ( 'DpgenSfft', modelname
    -         , param = { 'nbit'       : n
    -                   , 'physical'   : True
    -                   , 'behavioral' : True
    -                   }
    -         )
    -
    -
    -
  • -
  • Description : Generates a n bits static flip-flop with scan-path -named modelname. The two latches of this flip-flop are static -i.e. each one is made of two interters looped togethers.

    -
  • -
  • Terminal Names :

    -
      -
    • scan : scan-path mode (input, 1 bit)
    • -
    • scin : scan path in (input, 1 bit)
    • -
    • wen : write enable (1 bit)
    • -
    • ck : clock signal (1 bit)
    • -
    • i0 : data input (n bits)
    • -
    • q : output (n bits)
    • -
    • vdd : power
    • -
    • vss : ground
    • -
    -
  • -
  • Parameters : Parameters are given in the a map param.

    -
      -
    • nbit (mandatory) : Defines the size of the generator
    • -
    • physical (optional, default value : False) : In order to -generate a layout
    • -
    • behavioral (optional, default value : False) : In order to -generate a behavior
    • -
    -
  • -
  • How it works :

    -
      -
    • When scan is set to one, it enables the scan-path mode. Note -that in scan-path mode, the wen signal is not effective
    • -
    • scin : the input of the scan-path. This terminal is different from -i0[0]. The scout is q[N-1] (in the following example -this is q[3])
    • -
    • When wen is set to one, it enables the writing of the -flip-flop
    • -
    -
  • -
  • Example :

    -
    from stratus import *
    -
    -class inst_sfft ( Model ) :
    -
    -  def Interface ( self ) :
    -    self.scan = SignalIn  ( "scin", 1 )
    -    self.scin = SignalIn  ( "scan", 1 )
    -    self.ck   = SignalIn  (   "ck", 1 )
    -    self.wen  = SignalIn  (  "wen", 1 )
    -    self.i    = SignalIn  (   "in", 4 )
    -    self.o    = SignalOut (  "out", 4 )
    -
    -    self.vdd = VddIn ( "vdd" )
    -    self.vss = VssIn ( "vss" )
    -
    -  def Netlist ( self ) :
    -    Generate ( 'DpgenSfft', 'sfft_4'
    -             , param = { 'nbit'     : 4
    -                       , 'physical' : True
    -                       }
    -             )
    -    self.I = Inst ( 'sfft_4', 'inst'
    -                  , map = { "wen"  : self.wen
    -                          , "ck"   : self.ck
    -                          , "scan" : self.scan
    -                          , "scin" : self.scin
    -                          , "i0"   : self.i
    -                          ,  "q"   : self.o
    -                          , 'vdd'  : self.vdd
    -                          , 'vss'  : self.vss
    -                          }
    -                  )
    -
    -  def Layout ( self ) :
    -    Place ( self.I, NOSYM, Ref(0, 0) )
    -
    -
    -
  • -
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/Stratus/Language.html b/documentation/_build/html/Stratus/Language.html deleted file mode 100644 index fa995035..00000000 --- a/documentation/_build/html/Stratus/Language.html +++ /dev/null @@ -1,3000 +0,0 @@ - - - - - - - - - - - Stratus User’s Guide — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

Stratus User’s Guide¶

-

Sophie Belloeil

-
-

Introduction¶

-
-

Stratus¶

-
-

Name¶

-

Stratus – Procedural design language based upon Python

-
-
-

Description¶

-

Stratus is a set of Python methods/functions dedicated to -procedural generation purposes. From a user point of view, Stratus is -a circuit’s description language that allows Python programming flow -control, variable use, and specialized functions in order to handle vlsi -objects.

-

Based upon the Hurricane data structures, the Stratus language gives -the user the ability to describe netlist and layout views.

-
-
-

Configuration¶

-

A configuration file can be used to direct the generation process of -Stratus. With this file, the user can choose the output format (vst, -vhdl...), the simulator (asimut, ghdl...), the standard cell library... -This configuration file named .st_config.py must be placed either in -the HOME directory or in the current directory. This file contains a set -of variables used in the process generation of Stratus, as for example :

-
format = 'vhdl'
-simulator = 'ghdl'
-
-
-

The default configuration of Stratus uses the Alliance CAD system, ie -'vst' as format and 'asimut' as simulator.

-
-
-

Description of a cell¶

-

A cell is a hierachical structural description of a circuit in terms -of ports (I/Os), signals (nets) and instances.

-

The description of a cell is done by creating a new class, derivating -for class Model, with different methods :

-
    -
  • Method Interface : Description of the external ports of the cell -:
      -
    • SignalIn, SignalOut, ...
    • -
    -
  • -
  • Method Netlist : Description of the netlist of the cell :
      -
    • Inst, Signal
    • -
    -
  • -
  • Method Layout : Description of the layout of the cell :
      -
    • Place, PlaceTop, PlaceBottom, PlaceRight, PlaceLeft ...
    • -
    -
  • -
  • Method Stimuli : Description of the simulation stimuli of the -cell :
      -
    • affect, addd ...
    • -
    -
  • -
-
-
-

Creation of the cell¶

-

After the description of a cell as a sub-class of Model, the cell -has to be instantiated. The different methods described before have to -be called.

-

Then different methods are provided :

-
    -
  • Method View : Opens/Refreshes the editor in order to see the -created layout
  • -
  • Method Save : Saves the created cell in the desired format thanks -to the configuration file
      -
    • no argument : creation of a netlist file
    • -
    • PHYSICAL : creation of a netlist file AND a layout file
    • -
    • STRATUS : creation of a python/stratus file
        -
      • FileName : optionnal argument when using Save(STRATUS) in order -to choose the name of the file to be generated
      • -
      • Be careful : if one wants to create a stratus file AND a -netlist, always use Save(STRATUS) before Save() !
      • -
      -
    • -
    -
  • -
  • Method Testbench : Creates the testbench of the cell using the -Stimuli method to compute the stimuli. The output format depends -of the format variable given in the configuration file
  • -
  • Method Simul : Runs the simulation using the simulator named in -the configuration file
  • -
-
-
-

Syntax¶

-

A Stratus file must have a .py extension and must begin as follow :

-
#!/usr/bin/env python
-
-from stratus import *
-
-
-

The description of a cell as a sub-class of Model is done as follow -:

-
class myClass ( Model ) :
-    ...
-
-
-

The creation of the cell is done by instantiating the previous class as -follow :

-
exemple = myClass ( name, param )
-
-
-

After the different methods can be called as follow :

-
exemple.Interface()
-exemple.Netlist()
-exemple.Save()
-    ...
-
-
-

In order to execute a Stratus file (named file for example), one -has two choices :

-
python file.py
-
-
-

Or :

-
chmod u+x file.py
-./file.py
-
-
-

The names used in Stratus, as arguments to Stratus functions, -should be alphanumerical, including the underscore. The arguments of -Stratus are case sensitive, so VDD is not equivalent to vdd.

-
-
Vectorized connectors or signal can be used using the [n:m] construct.
-
-
-
-

Syntax highlighting¶

-

When using vi, it’s possible to have the right syntax highlighting :

-
    -
  • Commands to do when you want to change once the coloration of your -file :
  • -
-
:syntax off
-:source /asim/coriolis/share/etc/stratus.vim
-
-
-
    -
  • Modification of your .vimrc in order to have the syntax highlighting -each time you open a file :
  • -
-
syntax off
-autocmd BufRead,BufNewfile *.py so /asim/coriolis/share/etc/stratus.vim
-syntax on
-
-
-
-
-
-

Example¶

-
-

The addaccu circuit¶

-

add1

-
-
-

The data-path¶

-

add2

-
-
-

Description of the circuit with Stratus : file addaccu.py¶

-

addaccu

-
-
-

Creation of the circuit : file test.py¶

-

test

-
-
-

How to execute the file¶

-
python test.py -n 4
-
-
-

or :

-
chmod u+x test.py
-./test -n 4
-
-
-
-
-

The editor¶

-

The method View permits to open an editor in which one can see the -cell being created as shown in the picture below.

-

editor

-
-
-

Function Param¶

-

This function allows the user to give parameters when creating a cell. -When one wants to give values to two parameters, one can type on the -shell :

-
python test.py -n 4 -w 8
-
-
-

The file test.py has then to contain :

-
nbit, nword = Param ( "n", "w" )
-
-
-

The letters typed on the shell must be the ones given as parameters of -function Param.

-
-
-

How to instanciate your generator in another generator¶

-

One can create a generator and instantiate it in another generator. -To do that, the model name of the generator must have the form : -“file_name.class_nameâ€. -Note that if the two generators are not in the same directory, the -directory of the generator to be instantiated has to be added in the -CRL_CATA_LIB environment variable.

-

For example, in order to instanciate the addaccu created above in a cell -:

-
n = 4
-Generate ( "addaccu.addaccu", "my_addaccu_%dbits" % n
-         , param = { 'nbit' : n } )
-
-Inst ( "my_addaccu_%dbits" % n
-     , map = { 'a'    : self.netA
-             , 'b'    : self.netB
-             , 'c'    : self.netC
-             , 'v'    : self.netV
-             , 'cmd'  : self.netCmd
-             , 'cout' : self.netCout
-             , 's'    : self.netS
-             , 'vdd'  : self.vdd
-             , 'vss'  : self.vss
-             }
-     )
-
-
-
-
-
-
-

Description of a netlist¶

-
-

Nets¶

-
-

Name¶

-

SignalIn, SignalOut ... – Creation of nets

-
-
-

Synopsys¶

-
netA = SignalIn ( "a", 4 )
-
-
-
-
-

Description¶

-

How to create and use nets.

-
-
-

Nets¶

-

Differents kind of nets are listed below :

-
    -
  • SignalIn : Creation of an input port
  • -
  • SignalOut : Creation of an output port
  • -
  • SignalInOut : Creation of an inout port
  • -
  • SignalUnknown : Creation of an input/output port which direction -is not defined
  • -
  • TriState : Creation of a tristate port
  • -
  • CkIn : Creation of a clock port
  • -
  • VddIn : Creation of the vdd alimentation
  • -
  • VssIn : Creation of the vss alimentation
  • -
  • Signal : Creation of an internal net
  • -
-
-
-

Parameters¶

-

All kind of constructors have the same parameters :

-
    -
  • name : the name of the net (mandatory argument)
  • -
  • arity : the arity of the net (mandatory argument)
  • -
  • indice : for bit vectors only : the LSB bit (optional argument : -set to 0 by default)
  • -
-

Only CkIn, VddIn and VssIn do not have the same parameters : -there is only the name parameter (they are 1 bit nets).

-
-
-

Functions and methods¶

-

Some functions/methods are provided in order to handle nets :

-
    -
  • function Cat : Concatenation of nets, beginning with the MSB

    -
    Inst ( 'DpgenInv'
    -     , map = { 'i0'  : Cat ( A, B )
    -             , 'nq'  : S
    -             , 'vdd' : vdd
    -             , 'vss' : vss
    -             }
    -     )
    -
    -
    -

    Or :

    -
    tab = []
    -tab.append ( A )
    -tab.append ( B )
    -
    -Inst ( 'DpgenInv'
    -     , map = { 'i0'  : Cat ( tab )
    -             , 'nq'  : S
    -             , 'vdd' : vdd
    -             , 'vss' : vss
    -             }
    -     )
    -
    -
    -

    If A and B are 2 bits nets, the net myNet will be such as :

    -
    myNet[3] = A[1]
    -myNet[2] = A[0]
    -myNet[1] = B[1]
    -myNet[0] = B[0]
    -
    -
    -
  • -
  • function Extend : Creation of a net which is an extension of the -net which it is applied to

    -
    temp    = Signal (     "temp", 5 )
    -tempExt = Signal ( "temp_ext", 8 )
    -
    -tempExt <= temp.Extand ( 8, 'one' )
    -
    -
    -
  • -
  • method Alias : Creation of an alias name for a net

    -
    cin.Alias  ( c_temp[0] )
    -cout.Alias ( c_temp[4] )
    -for i in range ( 4 ) :
    -  Inst ( "Fulladder"
    -       , map = { 'a'    : a[i]
    -               , 'b'    : b[i]
    -               , 'cin'  : c_temp[i]
    -               , 'sout' : sout[i]
    -               , 'cout' : c_temp[i+1]
    -               , 'vdd'  : vdd
    -               , 'vss'  : vss
    -               }
    -       )
    -
    -
    -
  • -
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • -
    Error in SignalIn :
    -
    the lenght of the net must be a positive value.
    -
    One can not create a net with a negative lenght.
    -
    -
  • -
-
-
-
-

Instances¶

-
-

Name¶

-

Inst – Creation of instances

-
-
-

Synopsys¶

-
Inst ( model
-     , name
-     , map = connectmap
-     )
-
-
-
-
-

Description¶

-

Instantiation of an instance. The type of the instance is given by the -model parameter. The connexions are made thanks to the -connectmap parameters.

-
-
-

Parameters¶

-
    -
  • Model : Name of the mastercell of the instance to create -(mandatory argument)
  • -
  • name : Name of the instance (optional) -When this argument is not defined, the instance has a name created -by default. This argument is usefull when one wants to create a -layout as well. Indeed, the placement of the instances is much easier -when the conceptor has chosen himself the name f the -instances.</para>
  • -
  • connectmap : Connexions in order to make the netlist
  • -
-

param and map are dictionnaries as shown in the example below.

-
-
-

Example¶

-
Inst ( 'a2_x2'
-     , map = { 'i0'  : in0
-             , 'i1'  : in1
-             , 'q'   : out
-             , 'vdd' : vdd
-             , 'vss' : vss
-             }
-     )
-
-
-

You can see a concrete example at :

-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • Error in Inst : the model Model does not exist. -Check CRL_CATA_LIB. -Either one has made a mistake in the name of the model, either the -environment variable is not correct.
  • -
  • Error in Inst : port does not exist in model Model. -One port in map is not correct.
  • -
  • Error in Inst : one input net is not dimensionned. -The size of the output nets is automatically calculated bus the -input nets must be dimensionned before being connected.
  • -
-
-
-
-

Generators¶

-
-

Name¶

-

Generate – Interface with the generators

-
-
-

Synopsys¶

-
Generate ( model, modelname, param = dict )
-
-
-
-
-

Description¶

-

The Generate function call is the generic interface to all -generators.

-
-
-

Arguments¶

-
    -
  • model : Specifies which generator is to be invoked
      -
    • If the generator belongs to the Dpgen library provided by Stratus, -the model name of the generator is simply the name of the class of -the generator.
    • -
    • If the generator is created by the user, the model name of the -generator must have the form : “file_name.class_nameâ€. (Note -that if the the generator is not in the working directory, the -directory of the generator to be instantiated has to be added in -the CRL_CATA_LIB environment variable)
    • -
    -
  • -
  • modelname : Specifies the name of the model to be generated
  • -
  • dict : Specifies the parameters of the generator
  • -
-
-
-

Parameters¶

-

Every generator has it’s own parameters. They must be described in the -map dict. -Every generator provides a netlist view. Two other views can be -generated, if they are provided by the generator. Two parameters have to -be given, in order to choose those views :

-
    -
  • ’physical’ : True/False, generation of the physical view (optionnal, -False by default)
  • -
  • ’behavioral’ : True/False, generation of the behavioral view -(optionnal, False by default)
  • -
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] Generate : the model must be described in a string.
  • -
-
-
-
-
-

Description of a layout¶

-
-

Place¶

-
-

Name¶

-

Place – Places an instance

-
-
-

Synopsys¶

-
Place ( ins, sym, point )
-
-
-
-
-

Description¶

-

Placement of an instance. -The instance has to be instantiated in the method Netlist, in -order to use the Place function.

-
-
-

Parameters¶

-
    -
  • ins : Instance to place.
  • -
  • sym : Geometrical operation to be performed on the instance -before beeing placed. -The sym argument can take eight legal values :
      -
    • NOSYM : no geometrical operation is performed
    • -
    • SYM_Y : Y becomes -Y, that means toward X axe symetry
    • -
    • SYM_X : X becomes -X, that means toward Y axe symetry
    • -
    • SYMXY : X becomes -X, Y becomes -Y
    • -
    • ROT_P : a positive 90 degrees rotation takes place
    • -
    • ROT_M : a negative 90 degrees rotation takes place
    • -
    • SY_RP : Y becomes -Y, and then a positive 90 degrees rotation -takes place
    • -
    • SY_RM : Y becomes -Y, and then a negative 90 degrees rotation -takes place
    • -
    -
  • -
  • point : coordinates of the lower left corner of the abutment box -of the instance in the current figure.
  • -
-
-
-

Example¶

-
Place ( myInst, NOSYM, XY ( 0, 0 ) )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • -
    [Stratus ERROR] Placement : the instance doesn't exist.
    -
    The instance must be instanciated in order to be placed.
    -
    -
  • -
  • [Stratus ERROR] Placement : the first argument is not an instance.

    -
  • -
  • -
    [Stratus ERROR] Placement : the instance is already placed.
    -
    One can not place an instance twice
    -
    -
  • -
  • -
    [Stratus ERROR] Place : wrong argument for placement type.
    -
    The symetry given as argument is not correct.
    -
    -
  • -
  • -
    [Stratus ERROR] Place : wrong argument for placement,
    -
    `` the coordinates must be put in a XY object.``
    -
    The coordinates are not descrobed the bood way.
    -
    -
  • -
-
-
-
-

PlaceTop¶

-
-

Name¶

-

PlaceTop – Places an instance at the top of the “reference instanceâ€

-
-
-

Synopsys¶

-
PlaceTop ( ins, sym, offsetX, offsetY )
-
-
-
-
-

Description¶

-

Placement of an instance. -The instance has to be instantiated in the method Netlist in order -to use the PlaceTop function.

-

The bottom left corner of the abutment box of the instance is placed, -after beeing symetrized and/or rotated, toward the top left corner of -the abutment box of the “reference instanceâ€. The newly placed instance -becomes the “reference instanceâ€.

-
-
-

Parameters¶

-
    -
  • ins : Instance to place.
  • -
  • sym : Geometrical operation to be performed on the instance -before beeing placed. -The sym argument can take eight legal values :
      -
    • NOSYM : no geometrical operation is performed
    • -
    • SYM_Y : Y becomes -Y, that means toward X axe symetry
    • -
    • SYM_X : X becomes -X, that means toward Y axe symetry
    • -
    • SYMXY : X becomes -X, Y becomes -Y
    • -
    • ROT_P : a positive 90 degrees rotation takes place
    • -
    • ROT_M : a negative 90 degrees rotation takes place
    • -
    • SY_RP : Y becomes -Y, and then a positive 90 degrees rotation -takes place
    • -
    • SY_RM : Y becomes -Y, and then a negative 90 degrees rotation -takes place
    • -
    -
  • -
  • offsetX (optionnal) : An offset is put horizontally. The value -given as argument must be a multiple of PITCH
  • -
  • offsetY (optionnal) : An offset is put vertically. The value -given as argument must be a multiple of SLICE
  • -
-
-
-

Example¶

-
Place    ( myInst1, NOSYM, 0, 0 )
-PlaceTop ( myInst2, SYM_Y )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] Placement : the instance doesn't exist. -The instance must be instanciated in order to be placed.
  • -
  • [Stratus ERROR] Placement : the first argument is not an instance.
  • -
  • [Stratus ERROR] Placement : the instance is already placed. -One can not place an instance twice
  • -
  • [Stratus ERROR] PlaceTop : no previous instance. -One can use PlaceTop only if a reference instance exist. Use a -Place call before.
  • -
  • [Stratus ERROR] PlaceTop : wrong argument for placement type. -The symetry given as argument is not correct.
  • -
-
-
-
-

PlaceBottom¶

-
-

Name¶

-

PlaceBottom – Places an instance below the “reference instanceâ€

-
-
-

Synopsys¶

-
PlaceBottom ( ins, sym, offsetX, offsetY )
-
-
-
-
-

Description¶

-

Placement of an instance. -The instance has to be instantiated in the method Netlist in order -to use the PlaceTop function.

-

The top left corner of the abutment box of the instance is placed, after -beeing symetrized and/or rotated, toward the bottom left corner of the -abutment box of the “reference instanceâ€. The newly placed instance -becomes the “reference instanceâ€.

-
-
-

Parameters¶

-
    -
  • ins : Instance to place.
  • -
  • sym : Geometrical operation to be performed on the instance -before beeing placed. -The sym argument can take eight legal values :
      -
    • NOSYM : no geometrical operation is performed
    • -
    • SYM_Y : Y becomes -Y, that means toward X axe symetry
    • -
    • SYM_X : X becomes -X, that means toward Y axe symetry
    • -
    • SYMXY : X becomes -X, Y becomes -Y
    • -
    • ROT_P : a positive 90 degrees rotation takes place
    • -
    • ROT_M : a negative 90 degrees rotation takes place
    • -
    • SY_RP : Y becomes -Y, and then a positive 90 degrees rotation -takes place
    • -
    • SY_RM : Y becomes -Y, and then a negative 90 degrees rotation -takes place
    • -
    -
  • -
  • offsetX (optionnal) : An offset is put horizontally. The value -given as argument must be a multiple of PITCH
  • -
  • offsetY (optionnal) : An offset is put vertically. The value -given as argument must be a multiple of SLICE
  • -
-
-
-

Example¶

-
Place       ( myInst1, NOSYM, 0, 0 )
-PlaceBottom ( myInst2, SYM_Y       )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] Placement : the instance doesn't exist. -The instance must be instanciated in order to be placed.
  • -
  • [Stratus ERROR] Placement : the first argument is not an instance.
  • -
  • [Stratus ERROR] Placement : the instance is already placed. -One can not place an instance twice
  • -
  • [Stratus ERROR] PlaceBottom : no previous instance. -One can use PlaceBottom only if a reference instance exist. Use -a Place call before.
  • -
  • [Stratus ERROR] PlaceBottom : wrong argument for placement type. -The symetry given as argument is not correct.
  • -
-
-
-
-

PlaceRight¶

-
-

Name¶

-

PlaceRight – Places an instance at the right of the “reference instanceâ€

-
-
-

Synopsys¶

-
PlaceRight ( ins, sym, offsetX, offsetY )
-
-
-
-
-

Description¶

-

Placement of an instance. -The instance has to be instantiated in the method Netlist in order -to use the PlaceTop function.

-

The bottom left corner of the abutment box of the instance is placed, -after beeing symetrized and/or rotated, toward the bottom right corner -of the abutment box of the “reference instanceâ€. The newly placed -instance becomes the “reference instanceâ€.

-
-
-

Parameters¶

-
    -
  • ins : Instance to place.
  • -
  • sym : Geometrical operation to be performed on the instance -before beeing placed. -The sym argument can take eight legal values :
      -
    • NOSYM : no geometrical operation is performed
    • -
    • SYM_Y : Y becomes -Y, that means toward X axe symetry
    • -
    • SYM_X : X becomes -X, that means toward Y axe symetry
    • -
    • SYMXY : X becomes -X, Y becomes -Y
    • -
    • ROT_P : a positive 90 degrees rotation takes place
    • -
    • ROT_M : a negative 90 degrees rotation takes place
    • -
    • SY_RP : Y becomes -Y, and then a positive 90 degrees rotation -takes place
    • -
    • SY_RM : Y becomes -Y, and then a negative 90 degrees rotation -takes place
    • -
    -
  • -
  • offsetX (optionnal) : An offset is put horizontally. The value -given as argument must be a multiple of PITCH
  • -
  • offsetY (optionnal) : An offset is put vertically. The value -given as argument must be a multiple of SLICE
  • -
-
-
-

Example¶

-
Place      ( myInst1, NOSYM, 0, 0 )
-PlaceRight ( myInst2, NOSYM )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] Placement : the instance doesn't exist. -The instance must be instanciated in order to be placed.
  • -
  • [Stratus ERROR] Placement : the first argument is not an instance.
  • -
  • [Stratus ERROR] Placement : the instance is already placed. -One can not place an instance twice
  • -
  • [Stratus ERROR] PlaceRight : no previous instance. -One can use PlaceRight only if a reference instance exist. Use -a Place call before.
  • -
  • [Stratus ERROR] PlaceRight : wrong argument for placement type. -The symetry given as argument is not correct.
  • -
-
-
-
-

PlaceLeft¶

-
-

Name¶

-

PlaceLeft – Places an instance at the left of the “reference instanceâ€

-
-
-

Synopsys¶

-
PlaceLeft ( ins, sym, offsetX, offsetY )
-
-
-
-
-

Description¶

-

Placement of an instance. -The instance has to be instantiated in the method Netlist in order -to use the PlaceTop function.

-

The bottom right corner of the abutment box of the instance is placed, -after beeing symetrized and/or rotated, toward the bottom left corner of -the abutment box of the “reference instanceâ€. The newly placed instance -becomes the “reference instanceâ€.

-
-
-

Parameters¶

-
    -
  • ins : Instance to place.
  • -
  • sym : Geometrical operation to be performed on the instance -before beeing placed. -The sym argument can take eight legal values :
      -
    • NOSYM : no geometrical operation is performed
    • -
    • SYM_Y : Y becomes -Y, that means toward X axe symetry
    • -
    • SYM_X : X becomes -X, that means toward Y axe symetry
    • -
    • SYMXY : X becomes -X, Y becomes -Y
    • -
    • ROT_P : a positive 90 degrees rotation takes place
    • -
    • ROT_M : a negative 90 degrees rotation takes place
    • -
    • SY_RP : Y becomes -Y, and then a positive 90 degrees rotation -takes place
    • -
    • SY_RM : Y becomes -Y, and then a negative 90 degrees rotation -takes place
    • -
    -
  • -
  • offsetX (optionnal) : An offset is put horizontally. The value -given as argument must be a multiple of PITCH
  • -
  • offsetY (optionnal) : An offset is put vertically. The value -given as argument must be a multiple of SLICE
  • -
-
-
-

Example¶

-
Place     ( myInst1, NOSYM, 0, 0 )
-PlaceLeft ( myInst2, NOSYM )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] Placement : the instance doesn't exist. -The instance must be instanciated in order to be placed.
  • -
  • [Stratus ERROR] Placement : the first argument is not an instance.
  • -
  • [Stratus ERROR] Placement : the instance is already placed. -One can not place an instance twice
  • -
  • [Stratus ERROR] PlaceLeft : no previous instance. -One can use PlaceLeft only if a reference instance exist. Use a -Place call before.
  • -
  • [Stratus ERROR] PlaceLeft : wrong argument for placement type. -The symetry given as argument is not correct.
  • -
-
-
-
-

SetRefIns¶

-
-

Name¶

-

SetRefIns – Defines the new “reference instance†for placement

-
-
-

Synopsys¶

-
SetRefIns ( ins )
-
-
-
-
-

Description¶

-

This function defines the new “reference instanceâ€, used as starting -point in the relative placement functions. -It’s regarding the abutmentbox of the instance ins that the next -instance is going to be placed, if using the appropriate functions.

-

Note that the more recently placed instance becomes automaticaly the -“reference instanceâ€, if SetRefIns isn’t called.

-
-
-

Parameters¶

-
    -
  • ins : defines the new “reference instanceâ€
  • -
-
-
-

Example¶

-
Place      ( myInst1, NOSYM, 0, 0 )
-PlaceRight ( myInst2, NOSYM       )
-
-SetRefIns  ( myInst1 )
-PlaceTop   ( myInst3, SYM_Y       )
-
-
-

myInst3 is on top of myInst1 instead of myInst2.

-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] SetRefIns : the instance doesn't exist. -If the instance has not been instanciated, it is impossible do to -any placement from it.
  • -
  • [Stratus ERROR] SetRefIns : the instance ...is not placed. -If the instance has not been placed, it is impossible do to any -placement from it.
  • -
-
-
-
-

DefAb¶

-
-

Name¶

-

DefAb – Creates the abutment box of the current cell

-
-
-

Synopsys¶

-
DefAb ( point1, point2 )
-
-
-
-
-

Description¶

-

This function creates the abutment box of the current cell.

-

Note that one does not have to call this function before saving in order -to create the abutment box. The abutment box is created nevertheless -(given to placed instances). This function is usefull if one wants to -create an abutment before placing the instances.

-
-
-

Parameters¶

-
    -
  • point1 : coordinates of the bottom left corner of the created -abutment box.
  • -
  • point2 : coordinates of the top right corner of the created -abutment box.
  • -
-
-
-

Example¶

-
DefAb ( XY(0, 0), XY(500, 100) )
-
-Place ( self.inst, NOSYM, XY(0, 0) )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] DefAb : an abutment box already exists. -`` Maybe you should use ResizeAb function.`` -One has called DefAb but the current cell already has an abutment -box. -In order to modify the current abutment box, the function to call -is ResizeAb.
  • -
  • [Stratus ERROR] DefAb : wrong argument, -`` the coordinates must be put in a XY object.`` -The type of one of the arguments is not correct. Coordinates must -be put in a XY object.
  • -
  • [Stratus ERROR] DefAb : -Coordinates of an abutment Box in y must be multiple of the slice. -Coordinates of an abutment Box in x must be multiple of the pitch. -One has called DefAb with non authorized values.
  • -
-
-
-
-

ResizeAb¶

-
-

Name¶

-

ResizeAb – Modifies the abutment box of the current cell

-
-
-

Synopsys¶

-
ResizeAb ( dx1, dy1, dx2, dy2 )
-
-
-
-
-

Description¶

-

This function modifies the abutment box of the current cell. -The coordinates of the abutment box are the coordinates of the envelop -of the abutment boxes of each instance plus the delta values given as -argument.

-

Note that one can not call this function in order to create the abutment -box. This fonction only modifies the already created abutment box.

-
-
-

Parameters¶

-
    -
  • (dx1, dy1) : Values to be substracted to the lower left corner of -the previous abutment box.
  • -
  • (dx2, dy2) : Values to be added to the upper right corner of the -previous abutment box.
  • -
-

The Values are used as follow :

-

resize

-
-
-

Example¶

-
% Expansion of the abutment box at the top and the bottom
-ResizeAb ( 0, 100, 0, 100 )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • `` [Stratus ERROR] ResizeAb :`` -Coordinates of an abutment Box in y must be multiple of the slice. -Coordinates of an abutment Box in x must be multiple of the pitch. -One has called ResizeAb with non authorized values
  • -
  • `` [Stratus ERROR] ResizeAb :`` -one of the values of dx1 or dx2 (dy1 or dy2)  is incompatible with -the size of the abutment box. -Coordinates of an abutment Box in x must be multiple of the pitch. -One has called ResizeAb with a value which deteriorates the -abtument box
  • -
-
-
-
-
-

Patterns generation extension¶

-
-

Description of the stimuli¶

-

The stimuli used for the simulation are described in a Stimuli -method. This method is a Python function generator that is automatically -called by the Testbench method to generate all the stimuli. As a -Python function generator, the yield instruction have to be used at -the end of each stimuli computation.

-
-

Affect value to signals¶

-

The method affect permits to affect a value to a given signal as -follow

-
self._stim.affect(self.Ck,0)
-
-
-
-
-

Add stimuli¶

-

The method add permits to finish a step of simulation by add all the -values to the current stimuli

-
self._stim.add()
-
-
-
-
-
-
-

Place and Route¶

-
-

PlaceSegment¶

-
-

Name¶

-

PlaceSegment – Places a segment

-
-
-

Synopsys¶

-
PlaceSegment ( net, layer, point1, point2, width )
-
-
-
-
-

Description¶

-

Placement of a segment. -The segment is created between point1 and point2 on the layer -layer and with width width. It belongs to the net net. -Note that the segment must be horizontal or vertival.

-
-
-

Parameters¶

-
    -
  • net : Net which the segment belongs to
  • -
  • layer : Layer of the segment. -The layer argument is a string wich can take different values, -thanks to the technology (file described in HUR_TECHNO_NAME)
      -
    • NWELL, PWELL, ptie, ntie, pdif, ndif, ntrans, ptrans, poly, ALU1, -ALU2, ALU3, ALU4, ALU5, ALU6, VIA1, VIA2, VIA3, VIA4, VIA5, TEXT, -UNDEF, SPL1, TALU1, TALU2, TALU3, TALU4, TALU5, TALU6, POLY, NTIE, -PTIE, NDIF, PDIF, PTRANS, NTRANS, CALU1, CALU2, CALU3, CALU4, -CALU5, CALU6, CONT_POLY, CONT_DIF_N, CONT_DIF_P, -CONT_BODY_N, CONT_BODY_P, via12, via23, via34, via45, via56, -via24, via25, via26, via35, via36, via46, CONT_TURN1, -CONT_TURN2, CONT_TURN3, CONT_TURN4, CONT_TURN5, CONT_TURN6
    • -
    -
  • -
  • point1, point2 : The segment is created between those two -points
  • -
-
-
-

Example¶

-
PlaceSegment ( myNet, "ALU3", XY (10, 0), XY (10, 100), 2 )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] PlaceSegment : Argument layer must be a string.
  • -
  • [Stratus ERROR] PlaceSegment : Wrong argument, -the coordinates of the segment must be put in XY objects.
  • -
  • [Stratus ERROR] PlaceSegment : Segments are vertical or horizontal. -The two references given as argument do not describe a vertical or -horizontal segment. Wether coordinate x or y of the references must -be identical.
  • -
-

]*CopyUpSegment*CopyUpSegmentseccopy

-
-
-
-

PlaceContact¶

-
-

Name¶

-

PlaceContact – Places a contact

-
-
-

Synopsys¶

-
PlaceContact ( net, layer, point, width, height )
-
-
-
-
-

Description¶

-

Placement of a contact. -The contact is located at the coodinates of point, on the layer -layer and has a size of 1 per 1. It belongs to the net net. -Note that the segment must be horizontal or vertival.

-
-
-

Parameters¶

-
    -
  • net : Net which the contact belongs to
  • -
  • layer : Layer of the segment. -The layer argument is a string wich can take different values, -thanks to the technology (file described in HUR_TECHNO_NAME)
      -
    • NWELL, PWELL, ptie, ntie, pdif, ndif, ntrans, ptrans, poly, ALU1, -ALU2, ALU3, ALU4, ALU5, ALU6, VIA1, VIA2, VIA3, VIA4, VIA5, TEXT, -UNDEF, SPL1, TALU1, TALU2, TALU3, TALU4, TALU5, TALU6, POLY, NTIE, -PTIE, NDIF, PDIF, PTRANS, NTRANS, CALU1, CALU2, CALU3, CALU4, -CALU5, CALU6, CONT_POLY, CONT_DIF_N, CONT_DIF_P, -CONT_BODY_N, CONT_BODY_P, via12, via23, via34, via45, via56, -via24, via25, via26, via35, via36, via46, CONT_TURN1, -CONT_TURN2, CONT_TURN3, CONT_TURN4, CONT_TURN5, CONT_TURN6
    • -
    -
  • -
  • point : Coodinates of the contact
  • -
  • width : Width of the contact
  • -
  • height : Height of the contact
  • -
-
-
-

Example¶

-
PlaceContact ( myNet, "ALU2", XY (10, 0), 2, 2 )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] PlaceContact : Argument layer must be a string.
  • -
  • [Stratus ERROR] PlaceContact : Wrong argument, -the coordinates of the contact must be put in a XY object.
  • -
-
-
-
-

PlacePin¶

-
-

Name¶

-

PlacePin – Places a pin

-
-
-

Synopsys¶

-
PlacePin ( net, layer, direction, point, width, height )
-
-
-
-
-

Description¶

-

Placement of a pin. -The pin is located at the coodinates of point, on the layer -layer, has a a direction of direction and size of 1 per 1. It -belongs to the net net.

-
-
-

Parameters¶

-
    -
  • net : Net which the pin belongs to
  • -
  • layer : Layer of the segment. -The layer argument is a string wich can take different values, -thanks to the technology (file described in HUR_TECHNO_NAME)
      -
    • NWELL, PWELL, ptie, ntie, pdif, ndif, ntrans, ptrans, poly, ALU1, -ALU2, ALU3, ALU4, ALU5, ALU6, VIA1, VIA2, VIA3, VIA4, VIA5, TEXT, -UNDEF, SPL1, TALU1, TALU2, TALU3, TALU4, TALU5, TALU6, POLY, NTIE, -PTIE, NDIF, PDIF, PTRANS, NTRANS, CALU1, CALU2, CALU3, CALU4, -CALU5, CALU6, CONT_POLY, CONT_DIF_N, CONT_DIF_P, -CONT_BODY_N, CONT_BODY_P, via12, via23, via34, via45, via56, -via24, via25, via26, via35, via36, via46, CONT_TURN1, -CONT_TURN2, CONT_TURN3, CONT_TURN4, CONT_TURN5, CONT_TURN6
    • -
    -
  • -
  • direction : Direction of the pin
      -
    • UNDEFINED, NORTH, SOUTH, EAST, WEST
    • -
    -
  • -
  • point : Coodinates of the pin
  • -
  • width : Width of the pin
  • -
  • height : Height of the pin
  • -
-
-
-

Example¶

-
PlacePin ( myNet, "ALU2", NORTH, XY (10, 0), 2, 2 )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] PlacePin : Argument layer must be a string.
  • -
  • [Stratus ERROR] PlacePin : Illegal pin access direction. -The values are : UNDEFINED, NORTH, SOUTH, EAST, WEST.
  • -
  • [Stratus ERROR] PlacePin : Wrong argument, -the coordinates of the pin must be put in a XY object.
  • -
-
-
-
-

PlaceRef¶

-
-

Name¶

-

PlaceRef – Places a reference

-
-
-

Synopsys¶

-
PlaceRef ( point, name )
-
-
-
-
-

Description¶

-

Placement of a reference. -The reference is located at the coordinates of point, with name -name.

-
-
-

Parameters¶

-
    -
  • point : Coodinates of the reference
  • -
  • name : Name of the reference
  • -
-
-
-

Example¶

-
PlaceRef ( XY (10, 0), "myref" )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] PlaceRef : Wrong argument, -the coordinates of the reference must be put in a XY object.
  • -
  • [Stratus ERROR] PlaceRef : Argument layer must be a string.
  • -
-
-
-
-

GetRefXY¶

-
-

Name¶

-

GetRefXY – Returns the coordinates of a reference

-
-
-

Synopsys¶

-
GetRefXY ( pathname, refname )
-
-
-
-
-

Description¶

-

Computation of coordinates. -The point returned (object XY) represents the location of the -reference of name refname within the coodinates system of the top -cell. The reference refname is instanciated in an instance found -thanks to pathname which represents an ordered sequence of instances -through the hierarchy.

-
-
-

Parameters¶

-
    -
  • pathname : The path in order to obtain, from the top cell, the -instance the reference refname belongs to
  • -
  • refname : The name of the reference
  • -
-
-
-

Example¶

-

The cell which is being created (the top cell), instanciates a generator -with instance name “my_dpgen_and2â€. This generator instanciates an -instance called “cell_1†which the reference “i0_20†belongs to.

-
GetRefXY ( "my_dpgen_and2.cell_1", "i0_20" )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] GetRefXY : -The instance's path must be put with a string.
  • -
  • [Stratus ERROR] GetRefXY : -The reference must be done with it's name : a string.
  • -
  • [Stratus ERROR] GetRefXY : -No reference found with name ... in masterCell ...
  • -
-
-
-
-

CopyUpSegment¶

-
-

Name¶

-

CopyUpSegment – Copies the segment of an instance in the current cell

-
-
-

Synopsys¶

-
CopyUpSegment ( pathname, netname, newnet  )
-
-
-
-
-

Description¶

-

Duplication of a segment. -The segment is created with the same cordinates and layer as the -segment corresponding to the net netname in the instance found -thanks to pathname. It belongs to the net newnet. -Note that if several segments correspond to the net, they are all -going to be copied.

-
-
-

Parameters¶

-
    -
  • pathname : The path in order to obtain, from the top cell, the -instance the net netname belongs to
  • -
  • netname : The name of the net which the segment belongs to
  • -
  • net : The net which the top cell segment os going to belong to
  • -
-
-
-

Example¶

-
CopuUpSegment ( "my_dpgen_and2.cell_1", "i0", myNet )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] CopyUpSegment : -The instance's path must be put with a string.
  • -
  • [Stratus ERROR] CopyUpSegment : -The segment must be done with it's name : a string.
  • -
  • [Stratus ERROR] CopyUpSegment : -No net found with name ... in masterCell ... -There is no net with name netname in the instance found thanks -to the path pathname.
  • -
  • [Stratus ERROR] CopyUpSegment : -No segment found with net ... in masterCell ... -The net with name netname has no segment. So the copy of -segment can not be done.
  • -
  • [Stratus ERROR] CopyUpSegment : -the segment of net ... are not of type CALU. -In other words, the net is not an external net. The copy can be -done only with external nets.
  • -
-
-
-
-

PlaceCentric¶

-
-

Name¶

-

PlaceCentric – Placement of an instance in the middle of an abutment box

-
-
-

Synopsys¶

-
PlaceCentric ( ins )
-
-
-
-
-

Description¶

-

This function places an instance in the middle of and abutment box. -The instance has to be instantiated in the method Netlist in order -to use this function.

-
-
-

Parameters¶

-
    -
  • ins : Instance to place
  • -
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] PlaceCentric: the instance does not exist. -The instance must be instanciated in order to be placed.
  • -
  • [Stratus ERROR] PlaceCentric : -the instance's size is greater than this model. -The instance must fit in the abutment box. The abutment box may not -be big enough.
  • -
-
-
-
-

PlaceGlu¶

-
-

Name¶

-

PlaceGlue – Automatic placement of non placed instances

-
-
-

Synopsys¶

-
PlaceGlue ( cell )
-
-
-
-
-

Description¶

-

This function places, thanks to the automatic placer Mistral of -Coriolis, all the non placed instances of the cell.

-
-
-

Parameters¶

-
    -
  • cell : the cell which the fonction is applied to
  • -
-
-
-
-

FillCell¶

-
-

Name¶

-

FillCell – Automatic placement of ties.

-
-
-

Synopsys¶

-
FillCell ( cell )
-
-
-
-
-

Description¶

-

This function places automatically ties.

-
-
-

Parameters¶

-
    -
  • cell : the cell which the fonction is applied to
  • -
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] FillCell : Given cell doesn't exist. -The argument is wrong. Check if one has created the cell correctly.
  • -
-
-
-
-

Pads¶

-
-

Name¶

-

PadNorth, PadSouth, PadEast, PasWest – Placement of pads at the -periphery of the cell

-
-
-

Synopsys¶

-
PadNorth ( args )
-
-
-
-
-

Description¶

-

These functions place the pads given as arguments at the given side of -the cell (PadNorth : up north, PadSouth : down south ...). Pads are -placed from bottom to top for PadNorth and PadSouth and from left to -right for PadWest and PasEast.

-
-
-

Parameters¶

-
    -
  • args : List of pads to be placed
  • -
-
-
-

Example¶

-
PadSouth ( self.p_cin, self.p_np, self.p_ng, self.p_vssick0
-         , self.p_vddeck0, self.p_vsseck1, self.p_vddeck1, self.p_cout
-         , self.p_y[0], self.p_y[1], self.p_y[2]
-         )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] PadNorth : not enough space for all pads. -The abutment box is not big enough in order to place all the pads. -Maybe one could put pads on other faces of the cell.
  • -
  • [Stratus ERROR] PadNorth : one instance doesn't exist. -One of the pads given as arguments does not exist
  • -
  • [Stratus ERROR] PadNorth : one argument is not an instance. -One of the pads is not one of the pads of the cell.
  • -
  • [Stratus ERROR] PadNorth : the instance ins is already placed. -One is trying to place a pad twice.
  • -
  • [Stratus ERROR] PadNorth : pad ins must be closer to the center. -The pad name ins must be put closer to the center in order to route -the cell
  • -
-
-
-
-

Alimentation rails¶

-
-

Name¶

-

AlimVerticalRail, AlimHorizontalRail – Placement of a -vertical/horizontal alimentation call back

-
-
-

Synopsys¶

-
AlimVerticalRail ( nb )
-
-
-
-
-

Description¶

-

These functions place a vertical/horizontal alimentation call back. It’s -position is given by the parameter given.

-
-
-

Parameters¶

-
    -
  • nb : coordinate of the rail
      -
    • For AlimVerticalRail, nb is in pitches i.e. 5 lambdas
    • -
    • For AlimHorizontalRail, nb is in slices i.e. 50 lambdas
    • -
    -
  • -
-
-
-

Example¶

-
AlimVerticalRail   (  50 )
-AlimVerticalRail   ( 150 )
-
-AlimHorizontalRail (  10 )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] AlimHorizontalRail : -Illegal argument y, y must be between ... and ... -The argument given is wrong : the call back would not be in the -abutment box.
  • -
  • [Stratus ERROR] Placement of cells : -please check your file of layout with DRUC. -The placement of the cell needs to be correct in order to place a -call back. Check the errors of placement.
  • -
-
-
-
-

Alimentation connectors¶

-
-

Name¶

-

AlimConnectors – Creation of connectors at the periphery of the core of -a circuit

-
-
-

Synopsys¶

-
AlimConnectors()
-
-
-
-
-

Description¶

-

This function creates the connectors in Alu 1 at the periphery of the -core.

-
-
-
-

PowerRing¶

-
-

Name¶

-

PowerRing – Placement of power rings.

-
-
-

Synopsys¶

-
PowerRing ( nb )
-
-
-
-
-

Description¶

-

This function places power rings around the core and around the plots.

-
-
-

Parameters¶

-
    -
  • nb : Number of pair of rings vdd/vss
  • -
-
-
-

Example¶

-
PowerRing ( 3 )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] PowerRing : Pads in the north haven't been placed. -The pads of the 4 sides of the chip must be placed before calling -function PowerRing.
  • -
  • [Stratus ERROR] PowerRing : too many rings, not enough space. -Wether The argument of PowerRing is to big, or the abutment box of -the chip is to small. There’s no space to put the rings.
  • -
-
-
-
-

RouteCk¶

-
-

Name¶

-

RouteCk – Routing of signal Ck to standard cells

-
-
-

Synopsys¶

-
RouteCk ( net )
-
-
-
-
-

Description¶

-

This function routes signal Ck to standard cells.

-
-
-

Parameters¶

-
    -
  • net : the net which the fonction is applied to
  • -
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] RouteCk : Pads in the north haven't been placed -The pads must be placed before calling RoutageCk.
  • -
-
-
-
-
-

Instanciation facilities¶

-
-

Buffer¶

-
-

Name¶

-

Buffer – Easy way to instantiate a buffer

-
-
-

Synopsys¶

-
netOut <= netIn.Buffer()
-
-
-
-
-

Description¶

-

This method is a method of net. The net which this method is applied -to is the input net of the buffer. The method returns a net : the output -net. -Note that it is possible to change the generator instanciated with the -SetBuff method.

-
-
-

Example¶

-
class essai ( Model ) :
-
-  def Interface ( self ) :
-    self.A = SignalIn  ( "a", 4 )
-
-    self.S = SignalOut ( "s", 4 )
-
-    self.Vdd = VddIn  ( "vdd" )
-    self.Vss = VssIn  ( "vss" )
-
-  def Netlist ( self ) :
-
-    self.S <= self.A.Buffer()
-
-
-
-
-
-

Multiplexor¶

-
-

Name¶

-

Mux – Easy way to instantiate a multiplexor

-
-
-

Synopsys¶

-
netOut <= netCmd.Mux ( arg )
-
-
-
-
-

Description¶

-

This method is a method of net. The net which this method is applied -to is the command of the multiplexor. The nets given as parameters are -all the input nets. This method returns a net : the output net. -There are two ways to describe the multiplexor : the argument arg -can be a list or a dictionnary. -Note that it is possible to change the generator instanciated with the -SetMux method.

-
-
-

Parameters¶

-
    -
  • List : -For each value of the command, the corresponding net is specified. -All values must be specified. -For example :

    -
    out <= cmd.Mux ( [in0, in1, in2, in3] )
    -
    -
    -

    The net out is then initialised like this :

    -
    if cmd == 0 : out <= in0
    -if cmd == 1 : out <= in1
    -if cmd == 2 : out <= in2
    -if cmd == 3 : out <= in3
    -
    -
    -
  • -
  • Dictionnary : -A dictionnary makes the correspondance between a value of the -command and the corresponding net. -For example :

    -
    out <= cmd.Mux ( {"0" : in0, "1" : in1, "2" : in2, "3" : in3} )
    -
    -
    -

    This initialisation corresponds to the one before. Thanks to the use -of a dictionnary, the connections can be clearer :

    -
      -
    • 'default': This key of the dictionnary corresponds to all -the nets that are not specified -For example :

      -
      out <= cmd.Mux ( {"0" : in0, "default" : in1} )
      -
      -
      -

      This notation corresponds to :

      -
      if cmd == 0 : out <= in0
      -else        : out <= in1
      -
      -
      -

      Note that if there is no 'default' key specified and that not -all the nets are specified, the non specified nets are set to 0.

      -
    • -
    • # and ? : When a key of the dictionnary begins with -#, the number after the # has to be binary and each ? in -the number means that this bit is not precised -For example :

      -
      out <= cmd.Mux ( {"#01?" : in0, "default" : in1} )
      -
      -
      -

      This notation corresponds to :

      -
      if cmd in ( 2, 3 ) : out <= in0
      -else               : out <= in1
      -
      -
      -
    • -
    • , and - : When keys contains thoses symbols, it permits -to enumerate intervals -For example :

      -
      out <= cmd.Mux ( {"0,4" : in0, "1-3,5" : in1} )
      -
      -
      -

      This notation corresponds to :

      -
      if   cmd in ( 0, 4 )      : out <= in0
      -elif cmd in ( 1, 2, 3, 5) : out <= in1
      -else                      : out <= 0
      -
      -
      -
    • -
    -
  • -
-
-
-

Example¶

-
class essai ( Model ) :
-
-  def Interface ( self ) :
-    self.A    = SignalIn  (    "a", 4 )
-    self.B    = SignalIn  (    "b", 4 )
-    self.C    = SignalIn  (    "c", 4 )
-    self.D    = SignalIn  (    "d", 4 )
-
-    self.Cmd1 = SignalIn  ( "cmd1", 2 )
-    self.Cmd2 = SignalIn  ( "cmd2", 4 )
-
-    self.S1   = SignalOut (   "s1", 4 )
-    self.S2   = SignalOut (   "s2", 4 )
-
-    self.Vdd = VddIn  ( "vdd" )
-    self.Vss = VssIn  ( "vss" )
-
-  def Netlist ( self ) :
-
-    self.S1 <= self.Cmd1.Mux ( [sefl.A, self.B, self.C, self.D] )
-
-    self.S2 <= self.Cmd2.Mux ( { "0"       : self.A
-                               , "1,5-7"   : self.B
-                               , "#1?1?"   : self.C
-                               , "default" : self.D
-                             } )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] Mux : all the nets must have the same lenght. -All the input nets pust have the same lenght.
  • -
  • [Stratus ERROR] Mux : there are no input nets. -The input nets seem to have been forgotten.
  • -
  • [Stratus ERROR] Mux : wrong argument type. -The connections of the buses are not described by a list nor a -dictionnary.
  • -
  • [Stratus ERROR] Mux : -the number of nets does not match with the lenght of the command. -When using a list, the number of nets has to correspond to the -number of possible values of the command.
  • -
  • [Stratus ERROR] Mux : wrong key. -One of the key of the dictionnary is not un number, neither a list -or an interval.
  • -
  • [Stratus ERROR] Mux : -when an interval is specified, the second number of the interval -must be greater than the first one. -When creating an interval with “-â€, the second number has to be -greater than the first one.
  • -
  • [Stratus ERROR] Mux : -the binary number does not match with the lenght of the command. -When using the # notation, each digit of the binary number -corresponds to a wire of the cmd. The leghts have to correspond.
  • -
  • [Stratus ERROR] Mux : after #, the number has to be binary. -When using the # notation, the number has to be binary : one -can use 0, 1 or ?.
  • -
-
-
-
-

Shifter¶

-
-

Name¶

-

Shift – Easy way to instantiate a shifter

-
-
-

Synopsys¶

-
netOut <= netCmd.Shift ( netIn, direction, type )
-
-
-
-
-

Description¶

-

This method is a method of net. The net which this method is applied -to is the command of the shifter, it’s the one which defines the number -of bits to shift. The net given as parameter is the input net. The other -arguments set the different patameters. The method returns a net : the -output net. -Note that it is possible to change the generator instanciated with the -SetShift method.

-
-
-

Parameters¶

-
    -
  • netIn : the net which is going to be shifted
  • -
  • direction : this string represents the direction of the shift :
      -
    • “leftâ€
    • -
    • “rightâ€
    • -
    -
  • -
  • type : this string represents the type of the shift :
      -
    • “logical†: only “zeros†are put in the net
    • -
    • “arith†: meaningful for “right†shift, the values put in the nets -are an extension of the MSB
    • -
    • “circular†: the values put in the nets are the ones which have -just been taken off
    • -
    -
  • -
-
-
-

Example¶

-
class essai ( Model ) :
-
-  def Interface ( self ) :
-    self.A = SignalIn ( "a", 4 )
-
-    self.Cmd = SignalIn ( "cmd", 2 )
-
-    self.S1 = SignalOut ( "s1", 4 )
-    self.S2 = SignalOut ( "s2", 4 )
-    self.S3 = SignalOut ( "s3", 4 )
-
-    self.Vdd = VddIn  ( "vdd" )
-    self.Vss = VssIn  ( "vss" )
-
-  def Netlist ( self ) :
-
-    self.S1 <= self.Cmd.Shift ( self.A, "right", "logical" )
-    self.S2 <= self.Cmd.Shift ( self.A, "right", "arith"   )
-
-    self.S3 <= self.Cmd.Shift ( self.A, "left", "circular" )
-
-
-

If the value of “a†is “0b1001†and the value of “cmd†is “0b10â€, we -will have :

-
    -
  • “s1†: “0b0010â€
  • -
  • “s2†: “0b1110â€
  • -
  • “s3†: “0b0110â€
  • -
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] Shift : -The input net does not have a positive arity. -The net which is going to be shifted must have a positive arity.
  • -
  • [Stratus ERROR] Shift : -The direction parameter must be "left" or "right". -The “direction†argument is not correct.
  • -
  • [Stratus ERROR] Shift : -The type parameter must be "logical" or "arith" or "circular". -The “type†argument is not correct.
  • -
-
-
-
-

Register¶

-
-

Name¶

-

Reg – Easy way to instantiate a register

-
-
-

Synopsys¶

-
netOut <= netCk.Reg ( netIn )
-
-
-
-
-

Description¶

-

This method is a method of net. The net which this method is applied -to is the clock of the register. The net given as parameter is the input -net. The method returns a net : the output net. -Note that it is possible to change the generator instanciated with the -SetReg method.

-
-
-

Example¶

-
class essai ( Model ) :
-
-  def Interface ( self ) :
-    self.A  = SignalIn  (  "a", 4 )
-    self.S  = SignalOut (  "s", 4 )
-
-    self.Ck = CkIn ( "ck" )
-
-    self.Vdd = VddIn  ( "vdd" )
-    self.Vss = VssIn  ( "vss" )
-
-  def Netlist ( self ) :
-
-    self.S <= self.Ck.Reg ( self.A )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] Reg : The input net does not have a positive arity. -The input net must have a positive arity.
  • -
  • [Stratus ERROR] Reg : The clock does not have a positive arity. -The clock must have a positive arity.
  • -
-
-
-
-

Constants¶

-
-

Name¶

-

Constant – Easy way to instantiate constants

-
-
-

Synopsys¶

-
netOne  <=  One ( 2 )
-
-net8    <= "8"
-
-
-
-
-

Description¶

-

These functions simplify the way to instanciate constants.

-
    -
  • The functions One andZero permits to initialise all the -bits of a net to ’one’ or ’zero’.
  • -
  • The instanciation of a constant thanks to a string can be done in -decimal, hecadecimal or binary.
  • -
-
-
-

Parameters¶

-
    -
  • For One and Zero :
      -
    • n : the arity of the net
    • -
    -
  • -
  • For the instanciation of a constant :
      -
    • the constant given must be a string representing :
        -
      • A decimal number
      • -
      • A binary number : the string must begin with “0bâ€
      • -
      • An hexadecimal number : the string must begin with “0xâ€
      • -
      -
    • -
    -
  • -
-
-
-

Example¶

-
class essai ( Model ) :
-
-  def Interface ( self ) :
-    self.Ones   = SignalOut (   "ones", 2 )
-    self.Zeros  = SignalOut (  "zeros", 4 )
-
-    self.Eight  = SignalOut (  "eight", 4 )
-    self.Twentu = SignalOut ( "twenty", 5 )
-    self.Two    = SignalOut (    "two", 5 )
-
-    self.Vdd = VddIn  ( "vdd" )
-    self.Vss = VssIn  ( "vss" )
-
-  def Netlist ( self ) :
-
-    self.Ones  <=  One ( 2 )
-    self.Zero  <= Zero ( 4 )
-
-    self.Eight   <= "8"
-    self.Twenty  <= "0x14"
-    self.Two     <= "0b10"
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] Const : -the argument must be a string representing a number in decimal, -binary (0b) or hexa (0x). -The string given as argument does not have the right form.
  • -
-
-
-
-

Boolean operations¶

-
-

Description¶

-

Most common boolean operators can be instantiated without the Inst -constructor.

-
-
-

List¶

-

Boolean operators are listed below :

-
    -
  • And2 : q <= i0 & i1
  • -
  • Or2 : q <= i0 | i1
  • -
  • Xor2 : q <= i0 ^ i1
  • -
  • Inv : q <= ~i0
  • -
-
-
-

Generators to instantiate¶

-

One can choose the generator to be used. Some methods are applied to -the cell and set the generator used when using &, |, ^ and -~. The generators used by default are the ones from the virtual -library.

-

Methods are :

-
    -
  • SetAnd
  • -
  • SetOr
  • -
  • SetXor
  • -
  • SetNot
  • -
-
-
-

Example¶

-
class essai ( Model ) :
-
-  def Interface ( self ) :
-    self.A = SignalIn  ( "a", 4 )
-    self.B = SignalIn  ( "b", 4 )
-    self.B = SignalIn  ( "c", 4 )
-
-    self.S = SignalOut ( "s", 4 )
-
-    self.vdd = VddIn  ( "vdd" )
-    self.vss = VssIn  ( "vss" )
-
-  def Netlist ( self ) :
-
-    self.S <= ( ~self.A & self.B ) | self.C
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] & : the nets must have the same lenght. -When one uses boolean expressions, one has to check that the sizes -of both nets are equivalent.
  • -
  • [Stratus ERROR] : there is no alim. -The cell being created does not have the alimentation nets. The -instanciation is impossible.
  • -
-
-
-
-

Arithmetical operations¶

-
-

Description¶

-

Most common arithmetic operators can be instantiated without the -Inst constructor.

-
-
-

List¶

-

Arithmetical operators are listed below :

-
    -
  • Addition : q <= i0 + i1
  • -
  • Substraction : q <= i0 - i1
  • -
  • Multiplication : q <= i0 * i1
  • -
  • Division : q <= i0 / i1
  • -
-
-
-

Generators to instantiate¶

-

One can choose the generator to be used. Some methods are applied to the -cell and set the generator used when using overloard. Methods are :

-
    -
  • SetAdd (for addition and substraction)
  • -
  • SetMult
  • -
  • SetDiv
  • -
-

The generators used by default are :

-
    -
  • Addition : Slansky adder
  • -
  • Substraction : Slansky adder + inversor + cin = ’1’
  • -
  • Multiplication : CA2 multiplier (signed, modified booth/Wallace -tree)
  • -
  • Division : not available yet
  • -
-
-
-

Example¶

-
class essai ( Model ) :
-
-  def Interface ( self ) :
-    self.A = SignalIn  ( "a", 4 )
-    self.B = SignalIn  ( "b", 4 )
-
-    self.S = SignalOut ( "s", 4 )
-
-    self.T = SignalOut ( "t", 8 )
-
-    self.vdd = VddIn  ( "vdd" )
-    self.vss = VssIn  ( "vss" )
-
-  def Netlist ( self ) :
-
-    self.S <= self.A + self.B
-
-    self.T <= self.A * self.B
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] + : the nets must have the same lenght. -When one uses arithmetic expressions, one has to check that the -sizes of both nets are equivalent.
  • -
  • [Stratus ERROR] : there is no alim. -The cell being created does not have the alimentation nets. The -instanciation is impossible.
  • -
-
-
-
-

Comparison operations¶

-
-

Name¶

-

Eq/Ne : Easy way to test the value of the nets

-
-
-

Synopsys¶

-
netOut <= net.Eq ( "n" )
-
-
-
-
-

Description¶

-

Comparaison functions are listed below :

-
    -
  • Eq : returns true if the value of the net is equal to n.
  • -
  • Ne : returns true if the value of the net is different from -n.
  • -
-

Note that it is possible to change the generator instanciated with the -SetComp method.

-
-
-

Parameters¶

-

The constant given as argument must be a string representing :

-
    -
  • A decimal number
  • -
  • A binary number : the string must begin with “0bâ€
  • -
  • An hexadecimal number : the string must begin with “0xâ€
  • -
-
-
-

Example¶

-
class essai ( Model ) :
-
-  def Interface ( self ) :
-    self.A = SignalIn  ( "a", 4 )
-
-    self.S = SignalOut ( "s", 1 )
-    self.T = SignalOut ( "t", 1 )
-
-    self.vdd = VddIn  ( "vdd" )
-    self.vss = VssIn  ( "vss" )
-
-  def Netlist ( self ) :
-
-    self.S <= self.A.Eq ( "4" )
-
-    self.T <= self.A.Ne ( "1" )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] Eq : -the number does not match with the net's lenght. -When one uses comparaison functions on one net, one has to check -that the number corresponds to the size of the net.
  • -
  • [Stratus ERROR] Eq : -the argument must be a string representing a number in decimal, -binary (0b) or hexa (0x). -The string given as argument does not have the right form.
  • -
-
-
-
-

Virtual library¶

-
-

Description¶

-

The virtual library permits to create a cell and map it to different -libraries without having to change it.

-
-
-

List of the generators provided¶

-
    -
  • a2 : q <= i0 & i1
  • -
  • a3 : q <= i0 & i1 & i2
  • -
  • a4 : q <= i0 & i1 & i2 & i3
  • -
  • na2 : nq <= ~ ( i0 & i1 )
  • -
  • na3 : nq <= ~ ( i0 & i1 & i2 )
  • -
  • na4 : nq <= ~ ( i0 & i1 & i2 & i3 )
  • -
  • o2 : q <= i0 & i1
  • -
  • o3 : q <= i0 & i1 & i2
  • -
  • o4 : q <= i0 & i1 & i2 & i3
  • -
  • no2 : nq <= ~ ( i0 & i1 )
  • -
  • no3 : nq <= ~ ( i0 & i1 & i2 )
  • -
  • no4 : nq <= ~ ( i0 & i1 & i2 & i3 )
  • -
  • inv : nq <= ~ i
  • -
  • buf : q <= i
  • -
  • xr2 : q <= i0 ^ i1
  • -
  • nxr2 : nq <= ~ ( i0 ^ i1 )
  • -
  • zero : nq <= '0'
  • -
  • one : q <= '1'
  • -
  • halfadder : sout <= a ^ b and cout <= a & b
  • -
  • fulladder : sout <= a ^ b ^ cin -and cout <= ( a & b ) | ( a & cin ) | ( b & cin )
  • -
  • mx2 : q <= (i0 & ~cmd) | (i1 & cmd)
  • -
  • nmx2 : nq <= ~( (i0 & ~cmd) | (i1 & cmd) )
  • -
  • sff : if RISE ( ck ) : q <= i
  • -
  • sff2 : if RISE ( ck ) : q <= (i0 & ~cmd) | (i1 & cmd)
  • -
  • sff3 : if RISE ( ck ) : -`` q <= (i0 & ~cmd0) | (((i1 & cmd1)|(i2&~cmd1)) & cmd0)``
  • -
  • ts : if cmd : q <= i
  • -
  • nts : if cmd : nq <= ~i
  • -
-
-
-

Mapping file¶

-

The virtual library is mapped to the sxlib library. A piece of the -corresponding mapping file is shown below. -In order to map the virtual library to another library, on has to -write a .xml file which makes correspond models and interfaces. -Note that the interfaces of the cells must be the same (except for the -names of the ports). Otherwise, one has to create .vst file in order to -make the interfaces match.

-

The environment variable used to point the right file is -STRATUS_MAPPING_NAME.

-

xml

-
-
-

Generators¶

-

Some generators are also provided in order to use the cells of the -library with nets of more than 1 bit. One has to upper the first letter -of the model name in order to user those generators. What is simply done -is a for loop with the bits of the nets. The parameter 'nbit' gives -the size of the generator.

-
-
-

Example¶

-
    -
  • Direct instanciation of a cell
  • -
-
for i in range ( 4 ) :
-  Inst ( 'a2'
-       , map = { 'i0'  : neti0[i]
-               , 'i1'  : neti1[i]
-               , 'q'   : netq[i]
-               , 'vdd' : netvdd
-               , 'vss' : netvss
-               }
-       )
-
-
-
    -
  • Instanciation of a generator
  • -
-
Generate ( 'A2', "my_and2_4bits", param = { 'nbit' : 4 } )
-Inst ( 'my_and2_4bits'
-     , map  = { 'i0'  : neti0
-              , 'i1'  : neti1
-              , 'q'   : netq
-              , 'vdd' : vdd
-              , 'vss' : vss
-              }
-     )
-
-
-
-
-

Errors¶

-

Some errors may occur :

-
    -
  • [Stratus ERROR] Inst : the model ... does not exist. -Check CRL_CATA_LIB. -The model of the cell has not been found. One has to check the -environment variable.
  • -
  • [Stratus ERROR] Virtual library : No file found in order to parse. -Check STRATUS_MAPPING_NAME. -The mapping file is not given in the environment variable.
  • -
-
-
-
- -
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/Stratus/Patterns.html b/documentation/_build/html/Stratus/Patterns.html deleted file mode 100644 index 42e3809c..00000000 --- a/documentation/_build/html/Stratus/Patterns.html +++ /dev/null @@ -1,814 +0,0 @@ - - - - - - - - - - - Patterns module User’s Guide — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

Patterns module User’s Guide¶

-

Roselyne Chotin-Avot

-
-

Description¶

-

The patterns module of Stratus is a set of Python classes and -methods that allows a procedural description of input pattern file for -the logic simulator. The Stratus Pattern method produces a pattern -description file as output. The file generated by Pattern method is -in pat format, so IT IS STRONGLY RECOMMENDED TO SEE pat(5) manual BEFORE -TO USE IT.

-
-
-

Syntax¶

-

From a user point of view, Pattern method is a pattern description -language using all standard Python facilities. Here follows the -description of the Pattern method. -A pat format file can be divided in two parts : declaration and -description part. -The declaration part is the list of inputs, outputs, internal signals -and registers. Inputs are to be forced to a certain value and all the -others are to be observed during simulation. -The description part is a set of patterns, where each pattern defines -the value of inputs and outputs. The pattern number represents actually -the absolute time for the simulator. -Similarly, a Pattern method can be divided in two parts : -declaration and description part. Methods related to the declaration -must be called before any function related to the description part.

-
-

Declaration part¶

-

The first thing you should do in this part is to instantiate the class -Patwrite to have access to all patterns declaration and description -methods. The constructor of this class take as parameters the name of -pattern output file and the Stratus cell that is described (see -PatWrite [patwrite]). -Then, this part allows you to declare the inputs, the outputs, and -internal observing points (see declar[declar] and -declar_interface [declar:sub:interface]).

-
-
-

Description part¶

-

After all signals are declared, you can begin the description part (see -pattern_begin [pattern:sub:begin]). In this part you have to -define input values which are to be applied to the inputs of the circuit -or output values which are to be compare with the values produced during -the simulation. (see affect [affect], affect_any -[affect:sub:any], affect_int [affect:sub:int] and -affect_fix [affect:sub:fix]). Pattern method describes the -stimulus by event : only signal transitions are described. After each -event there is a new input in the pattern file (see addpat -[addpat]). Last thing you should do in this part is to generate the -output file (see pattern_end [pattern:sub:end]).

-
-
-
-

Methods¶

-
-

PatWrite¶

-

This class is used to create patterns for Stratus models. Currently it -only supports Alliance “.pat†pattern format. Patterns time stamps are -in the “absolute date†format, “relative date†isn’t allowed. Legal time -unit are ps (default), ns, us and ms. The constructor takes as -parameters the pattern output filename and an optional reference to -Stratus cell.

-
-
-

declar¶

-

Adds a connector from a Stratus model to the pattern interface. Writes -the corresponding connector declaration in the pattern file with name, -arity and direction automatically extracted from the connector -properties. -Supported Stratus connectors are:

-
    -
  • SignalIn,
  • -
  • SignalOut (only supported if used as an output),
  • -
  • VddIn,
  • -
  • VssIn,
  • -
  • CkIn,
  • -
  • SignalInOut,
  • -
  • TriState (always an output),
  • -
  • Signals.
  • -
-
-

Parameters¶

-
    -
  • connector : can either be a reference to a stratus net or a string -containing the name of the stratus net.
  • -
  • format : optional format for the connectors values into the pattern -file, accepted values are :
      -
    • ’B’: binary (default),
    • -
    • ’X’: hexadecimal,
    • -
    • ’O’: octal.
    • -
    -
  • -
-
-
-
-

declar_interface¶

-

Adds all the connectors from a Stratus model to the pattern interface. -Write the corresponding connector declaration in the pattern file with -name, arity and direction directly taken from the connector proprieties.

-
-

Parameters¶

-
    -
  • cell : the tested Stratus model reference. Optional if a reference to -the tested Stratus model was given during instanciation[patwrite].
  • -
  • format : optional format for the connectors values into the pattern -file, accepted values are :
      -
    • ’B’: binary (default),
    • -
    • ’X’: hexadecimal,
    • -
    • ’O’: octal.
    • -
    -
  • -
-
-
-
-

declar¶

-

Affect a string value to a connector.

-
-

Parameters¶

-
    -
  • connector : Stratus connector
  • -
  • value : string to affect to connector
  • -
-
-
-
-

affect_int¶

-

Affect an integer (CA2) value to a connector. Convert the 2’s complement -value to the corresponding binary value. The binary size is taken from -the connector arity. If the connector is an output, the binary value is -preceded by “?â€.

-
-

Parameters¶

-
    -
  • connector : Stratus connector.
  • -
  • value : 2’s complement value to affect to the connector.
  • -
-
-
-
-

affect_fix¶

-

Affect a fixed point value to a connector. Convert the floating point -input value to the corresponding fixed point value with -word_length=connector.arity() and integer_word_length=iwl. If the -connector is an output, the binary value is preceded by “?â€.

-
-

Parameters¶

-
    -
  • connector : Stratus connector.
  • -
  • value : floating point value to convert and asign to connector.
  • -
  • iwl : integer word length
  • -
-
-
-
-

affect_any¶

-

Disable comparison between this connector value and the one calculated -during simulation.

-
-

Parameters¶

-
    -
  • connector : Stratus connector.
  • -
-
-
-
-

addpat¶

-

Adds a pattern in the pattern file.

-
-
-

pattern_begin¶

-

Mark the end of the interface declaration and the beginning of the test -vectors.

-
-
-

pattern_end¶

-

Mark the end of the test vectors and of the patterns file.

-
-
-
-

Example¶

-

Pattern method for an addaccu

-
def Pattern(self):
-    # initialisation
-    pat = PatWrite(self._name+'.pat',self)
-
-    # declaration of ports
-    pat.declar(self.ck, 'B')
-    pat.declar(self.load, 'B')
-    pat.declar(self.input, 'X')
-    pat.declar(self.output, 'X')
-    pat.declar(self.vdd, 'B')
-    pat.declar(self.vss, 'B')
-
-    # use of pat.declar_interface(self) has the same effect
-
-    # description beginning
-    pat.pattern_begin()
-
-    # affect vdd and vss values
-    pat.affect_int(self.vdd,1)
-    pat.affect_int(self.vss,0)
-
-    # first pattern : load an initial value
-    pat.affect_int(self.input,5)
-    pat.affect_int(self.load,1)
-    pat.affect_int(self.ck,0)
-    # add the pattern in the pattern file
-    pat.addpat()
-    # compute next event
-    pat.affect_int(self.ck,1)
-    pat.addpat()
-
-    # compute 22 cycle of accumulation
-    pat.affect_int(self.load,0)
-    for i in range(1,22):
-       pat.affect_int(self.ck,0)
-       pat.addpat()
-       pat.affect_int(self.ck,1)
-       pat.affect_int(self.output,i+5)
-       pat.addpat()
-
-    # end of the description
-    pat.pattern_end()
-
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/Stratus/index.html b/documentation/_build/html/Stratus/index.html deleted file mode 100644 index b5b4dd80..00000000 --- a/documentation/_build/html/Stratus/index.html +++ /dev/null @@ -1,593 +0,0 @@ - - - - - - - - - - - Stratus : Netlist Capture Language — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
-
    -
  • Docs »
  • - -
  • Stratus : Netlist Capture Language
  • -
  • - - - -
  • -
-
-
-
- -
-

Stratus : Netlist Capture Language¶

-

Printable version of this document Stratus.pdf.

-

Stratus – Procedural design language based upon Python

- -
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/Unicorn/Unicorn.html b/documentation/_build/html/Unicorn/Unicorn.html deleted file mode 100644 index c39ec405..00000000 --- a/documentation/_build/html/Unicorn/Unicorn.html +++ /dev/null @@ -1,585 +0,0 @@ - - - - - - - - - - - Unicorn Reference — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
-
    -
  • Docs »
  • - -
  • Unicorn Reference
  • -
  • - - - -
  • -
-
-
-
- -
-

Unicorn Reference¶

-

The Unicorn C++ API reference is generated by Doxygen and is -available here: Unicorn

-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/UsersGuide/Configuration.html b/documentation/_build/html/UsersGuide/Configuration.html deleted file mode 100644 index dc7cad07..00000000 --- a/documentation/_build/html/UsersGuide/Configuration.html +++ /dev/null @@ -1,788 +0,0 @@ - - - - - - - - - - - Coriolis Configuration & Initialisation — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

Coriolis Configuration & Initialisation¶

-
-

General Software Architecture¶

-

Coriolis has been built with respect of the classical paradigm that the -computational intensive parts have been written in C++, and almost -everything else in Python. To build the Python interface we used -two methods:

-
    -
  • For self-contained modules boost::python (mainly in vlsisapd).
  • -
  • For all modules based on Hurricane, we created our own wrappers due -to very specific requirements such as shared functions between modules -or C++/Python secure bi-directional object deletion.
  • -
-
-

Note

-

Python Documentation: -Most of the documentation is related to the C++ API and implemetation of -the tools. However, the Python bindings have been created so they -mimic as closely as possible the C++ interface, so the documentation -applies to both languages with only minor syntactic changes.

-
-

Coriolis Software Schematic

-
-
-

Configuration & User’s Settings¶

-

All configurations files are shipped under the form of Python modules. -They are to be loaded through import statements. The user’s configuration -files must be put in a ./coriolis2/ directory under the working directory. -It must be made a Python module so it must contains a __init__.py file -(kept empty most of the time). And as they are true Python files, you may use -in them any valid code you see fit.

-

If no user configuration files are present, Coriolis will use the default -symbolic.cmos technology which matches the Alliance symbolic default one.

-

Contents of the user’s configuration directory ./coriolis2/:

- ---- - - - - - - - - - - - - - - - - - - - -
FileContents/Meaning
./coriolis2/__init__.pyMandatory. Tells Python this directory -is a module. Can be left empty
./coriolis2/settings.pyMandatory. The user’s settings, it must -setup the technology intended for use and -perform any configuration variable settings
./coriolis2/ioring.pyOptional. Define how the I/O pads are to -be placed on the periphery of the chip along -the chip and core sizes
./coriolis2/katana.pyOptional. Hook file for Katana, run -just after the tool has been created for a -Cell. Mostly to setup Nets to be -traced
-

For example, to use mosis 180nm, you can put in your ./coriolis2/setting.py:

-
# -*- Mode:Python -*-
-
-import node180.scn6m_deep_09
-
-
-
-
-

A Comprehensive Example of ./coriolis2/setting.py¶

-
import os
-import Cfg
-import Viewer
-import CRL
-import node180.scn6m_deep_09
-from   helpers       import l, u, n
-
-allianceTop = None
-if os.environ.has_key('ALLIANCE_TOP'):
-  allianceTop = os.environ['ALLIANCE_TOP']
-  if not os.path.isdir(allianceTop):
-    allianceTop = None
-
-if not allianceTop: allianceTop = '/soc/alliance'
-
-Cfg.Configuration.pushDefaultPriority( Cfg.Parameter.Priority.UserFile )
-
-Viewer.Graphics.setStyle( 'Alliance.Classic [black]' )
-
-cellsTop = allianceTop+'/cells'
-
-# Alliance related settings.
-af  = CRL.AllianceFramework.get()
-env = af.getEnvironment()
-
-env.setSCALE_X        ( 100 )
-env.setCATALOG        ( 'CATAL' )
-env.setIN_LO          ( 'vst'   )
-env.setIN_PH          ( 'ap'    )
-env.setOUT_LO         ( 'vst'   )
-env.setOUT_PH         ( 'ap'    )
-env.setPOWER          ( 'vdd'   )
-env.setGROUND         ( 'vss'   )
-env.setCLOCK          ( '.*ck.*|.*nck.*'   )
-env.setBLOCKAGE       ( 'blockage[Nn]et.*' )
-env.setPad            ( '.*_mpx$'          )
-
-env.setWORKING_LIBRARY( '.' )
-env.addSYSTEM_LIBRARY ( library=cellsTop+'/nsxlib', mode=CRL.Environment.Append )
-env.addSYSTEM_LIBRARY ( library=cellsTop+'/mpxlib', mode=CRL.Environment.Append )
-
-# Misc. setting parameters.
-Cfg.getParamBool      ( 'misc.logMode'                ).setBool      ( False     )
-Cfg.getParamBool      ( 'misc.verboseLevel1'          ).setBool      ( True      )
-Cfg.getParamBool      ( 'misc.verboseLevel2'          ).setBool      ( True      )
-
-# P&R related parameters.
-Cfg.getParamString    ( 'anabatic.routingGauge'       ).setString    ( 'msxlib4' )
-Cfg.getParamString    ( 'anabatic.topRoutingLayer'    ).setString    ( 'METAL4'  )
-Cfg.getParamInt       ( 'katana.hTracksReservedLocal' ).setInt       ( 6         )
-Cfg.getParamInt       ( 'katana.vTracksReservedLocal' ).setInt       ( 3         )
-
-Cfg.Configuration.popDefaultPriority()
-
-
-

The example above shows the user’s configuration file, with all the -available settings for Alliance and a small subset for other tools. Some remarks -about this file:

-
    -
  • The Cfg.Configuration.pushDefaultPriority() and Cfg.Configuration.popDefaultPriority() -statements are there so the value sets by the user will not be overriden by system -ones event if they are setup afterwards. This priority system is introduced so the -various configuration files could be loaded in out of order.

    -
  • -
  • The Viewer.Graphics.setStyle() allows you to choose the look of your liking from -the start.

    -
  • -
  • For Alliance, the user does not need to redefine all the settings, -just the one he wants to change. In most of the cases, the addSYSTEM_LIBRARY(), -the setWORKING_LIBRARY() and the special net names (at this point there is not -much alternatives for the others settings).

    -
  • -
  • addSYSTEM_LIBRARY() adds a directory to the library search path. -Each library entry will be added to the search path according to the second parameter:

    -
      -
    • CRL.Environment::Append: append to the search path.
    • -
    • CRL.Environment::Prepend: insert in head of the search path.
    • -
    • CRL.Environment::Replace: look for a library of the same name and replace -it, whithout changing the search path order. If no library of that name -already exists, it is appended.
    • -
    -

    A library is identified by its name, this name is the last component of the -path name. For instance: /soc/alliance/sxlib will be named sxlib. -Implementing the Alliance specification, when looking for a Cell name, -the system will browse sequentially through the library list and returns -the first Cell whose name match.

    -
  • -
  • For setPOWER(), setGROUND(), setCLOCK() and setBLOCKAGE() net names, -a regular expression (gnu regexp) is expected.

    -
  • -
  • For other tools parameters, just use getter and setter according to their types:

    - ---- - - - - - - - - - - - - - - - - - - - - - - - - - -
    TypeGetter/Setter
    BoolCgt.getParamBool('name').setBool( True )
    IntCgt.getParamInt('name').setBool( 12 )
    EnumerateCgt.getParamEnumerate('name').setBool( 12 )
    DoubleCgt.getParamDouble('name').setDouble( 254.5 )
    PercentageCgt.getParamPercentage('name').setPercentage( 75.0 )
    StringCgt.getParamString('name').setString( 'machin' )
    -

    Lists of the configurable parameters of most interest to the user are given in -Viewer & Tools.

    -
  • -
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/UsersGuide/DesignFlow.html b/documentation/_build/html/UsersGuide/DesignFlow.html deleted file mode 100644 index 6dfc1ba6..00000000 --- a/documentation/_build/html/UsersGuide/DesignFlow.html +++ /dev/null @@ -1,601 +0,0 @@ - - - - - - - - - - - Complete Design Flow & Examples — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -

-
-

Complete Design Flow & Examples¶

-

While Coriolis can be used stand-alone, it is in fact part of a more complete -design flow build upon Yosys and Alliance. In addition, a set of demos and -examples are supplied in the repository alliance-check-toolkit.

- -
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/UsersGuide/Installation.html b/documentation/_build/html/UsersGuide/Installation.html deleted file mode 100644 index a7f1e5d8..00000000 --- a/documentation/_build/html/UsersGuide/Installation.html +++ /dev/null @@ -1,949 +0,0 @@ - - - - - - - - - - - Installation — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

Installation¶

-
-

Note

-

As the sources are being released, the binary packaging is dropped. -You may still find (very) old versions here: http://asim.lip6.fr/pub/coriolis/2.0 .

-
-

In a nutshell, building source consists in pulling the git repository then -running the ccb installer.

-
-

Note

-

The documentation is already generated and commited in the git tree. -You may not install the additional prerequisites for the documentation. -By default the documentation is not generated, just installed by ccb. -If you really want to re-generate it, add the --doc flag to ccb.

-
-

Main building prerequisites:

-
    -
  • cmake
  • -
  • C++11-capable compiler
  • -
  • BFD library (provided through binutils).
  • -
  • RapidJSON
  • -
  • python2.7
  • -
  • boost
  • -
  • libxml2
  • -
  • bzip2
  • -
  • yacc & lex
  • -
  • Qt 4 or Qt 5
  • -
  • PyQt 4 or PyQt 5
  • -
  • Qwt 6
  • -
-

Building documentation prerequisites:

-
    -
  • doxygen
  • -
  • latex
  • -
  • python-docutils (for reStructuredText)
  • -
-

The following libraries get directly bundled with Coriolis:

- -

For other distributions, refer to their own packaging system.

-
-

Cross Dependencies Issues¶

-

There is a difficult tangle of dependencies between Python, qt, qwt and PyQt, -the requirements are:

-
    -
  • A Python 2.7.
  • -
  • qt, either 4 or 5.
  • -
  • qwt version 6, compiled against the relevant qt version.
  • -
  • PyQt, version 4 or 5, according to the choosen qt.
  • -
-

Problems arise because:

-
    -
  • Under rhel 7 or clones, there is no compatible PyQt5 build compatible with their -qt 5 version (we fall short of one minor, they provides qt 5.9 were we need at -least qt 5.10). So we have to stick to qt 4 on those platforms.

    -

    Fortunately we can build a qwt 6 with qt 4.

    -
  • -
  • Under Debian or Ubuntu there is no qwt 6 build against qt 4, so we have to -use qt 5 and PyQt 5.

    -
  • -
-
-
-

Fixed Directory Tree¶

-

In order to simplify the work of the ccb installer, the source, build -and installation tree is fixed. To successfully compile Coriolis you must -follow it exactly. The tree is relative to the home directory of the user -building it (note ~/ or $HOME/). Only the source -directory needs to be manually created by the user, all others will be -automatically created either by ccb or the build system.

-

- ---- - - - - - - - - - - - - - - - - - - - - - - -
Sources
-
Sources root
-
under git
-
-
-
~/coriolis-2.x/src
-
~/coriolis-2.x/src/coriolis
-
-
Architecture Dependant Build
-
Linux, SL 7, 64b
-
Linux, SL 6, 32b
-
Linux, SL 6, 64b
-
Linux, Fedora, 64b
-
Linux, Fedora, 32b
-
FreeBSD 8, 32b
-
FreeBSD 8, 64b
-
Windows 7, 32b
-
Windows 7, 64b
-
Windows 8.x, 32b
-
Windows 8.x, 64b
-
-
-
~/coriolis-2.x/Linux.el7_64/Release.Shared/build/<tool>
-
~/coriolis-2.x/Linux.slsoc6x/Release.Shared/build/<tool>
-
~/coriolis-2.x/Linux.slsoc6x_64/Release.Shared/build/<tool>
-
~/coriolis-2.x/Linux.fc_64/Release.Shared/build/<tool>
-
~/coriolis-2.x/Linux.fc/Release.Shared/build/<tool>
-
~/coriolis-2.x/FreeBSD.8x.i386/Release.Shared/build/<tool>
-
~/coriolis-2.x/FreeBSD.8x.amd64/Release.Shared/build/<tool>
-
~/coriolis-2.x/Cygwin.W7/Release.Shared/build/<tool>
-
~/coriolis-2.x/Cygwin.W7_64/Release.Shared/build/<tool>
-
~/coriolis-2.x/Cygwin.W8/Release.Shared/build/<tool>
-
~/coriolis-2.x/Cygwin.W8_64/Release.Shared/build/<tool>
-
-
Architecture Dependant Install
Linux, SL 6, 32b~/coriolis-2.x/Linux.slsoc6x/Release.Shared/install/
FHS Compliant Structure under Install
-
Binaries
-
Libraries (Python)
-
Include by tool
-
Configuration files
-
Doc, by tool
-
-
-
.../install/bin
-
.../install/lib
-
.../install/include/coriolis2/<project>/<tool>
-
.../install/etc/coriolis2/
-
.../install/share/doc/coriolis2/en/html/<tool>
-
-
-
-

Note

-

Alternate build types: the Release.Shared means an optimized build -with shared libraries. But there are also available Static instead of Shared -and Debug instead of Release and any combination of them.

-

Static does not work because I don’t know yet to mix statically linked binaries -and Python modules (which must be dynamic).

-
-
-
-

Building Coriolis¶

-
-

The actively developed branch¶

-

The devel_anabatic branch is now closed and we go back to a more classical -scheme where master is the stable version and devel the development one.

-

The Coriolis git repository is https://www-soc.lip6.fr/git/coriolis.git

-
-

Note

-

Again, the devel_anabatic branch is now closed. Please revert to devel -or master.

-
-
-

Note

-

Under rhel 7 or clones, they upgraded their version of qt 4 (from 4.6 to 4.8) -so the diagonal line bug no longer occurs. So we can safely use the default -system qt again.

-
-
-
-

Installing on RedHat or compatible distributions¶

-
    -
  1. Install or check that the required prerequisites are installed :

    -
    dummy@lepka:~> yum install -y git cmake bison flex gcc-c++ libstdc++-devel  \
    -                              binutils-devel                                \
    -                              boost-devel boost-python boost-filesystem     \
    -                              boost-regex  boost-wave                       \
    -                              python-devel libxml2-devel bzip2-devel        \
    -                              qt-devel qwt-devel                            # Qt 4
    -
    -
    -

    Note, that the Qwt packages are directly available from the standart distribution -when using qt 4.

    -
  2. -
  3. Install the unpackaged prerequisites. Currently, only RapidJSON.

    -
    dummy@lepka:~> mkdir -p ~/coriolis-2.x/src/support
    -dummy@lepka:support> cd ~/coriolis-2.x/src/support
    -dummy@lepka:support> git clone http://github.com/miloyip/rapidjson
    -
    -
    -
  4. -
  5. Create the source directory and pull the git repository:

    -
    dummy@lepka:~> mkdir -p ~/coriolis-2.x/src
    -dummy@lepka:src> cd ~/coriolis-2.x/src
    -dummy@lepka:src> git clone https://www-soc.lip6.fr/git/coriolis.git
    -
    -
    -
  6. -
  7. Build & install:

    -
    dummy@lepka:src> cd coriolis
    -dummy@lepka:coriolis> git checkout devel
    -dummy@lepka:coriolis> ./bootstrap/ccb.py --project=support  \
    -                                         --project=coriolis \
    -                                         --make="-j4 install"
    -
    -
    -
  8. -
-
-

Note

-

Pre-generated documentation will get installed by the previous command. -Only if you did made modifications to it you need to regenerate it with:

-
dummy@lepka:coriolis> ./bootstrap/ccb.py --project=support  \
-                                         --project=coriolis \
-                                         --doc --make="-j1 install"
-
-
-

We need to perform a separate installation of the documentation because it -does not support to be generated with a parallel build. So we compile & install in a first -stage in -j4 (or whatever) then we generate the documentation in -j1

-
-

Under rhel6 or clones, you must build using the devtoolset, the version is to -be given as argument:

-
dummy@lepka:coriolis> ./bootstrap/ccb.py --project=coriolis \
-                                         --devtoolset=8 --make="-j4 install"
-
-
-

If you want to use Qt 5 instead of Qt 4, modify the previous steps as follows:

-
    -
  • At step 1, do not install the qt 4 related development package (qt4-devel), -but instead:

    -
    dummy@lepka:~> yum install -y qt5-qtbase-devel qt5-qtsvg-devel              # Qt 5.
    -
    -
    -

    The package qwt-qt5-devel and it’s dependency qwt-qt5 are not provided -by any standard repository (like epel). You may download them from the -LIP6 Addons Repository -Then run:

    -
    dummy@lepka:~> yum localinstall -y qwt-qt5-6.1.2-4.fc23.x86_64.rpm  \
    -                                   qwt-qt5-6.1.2-4.fc23.x86_64.rpm  # Qwt for Qt 5.
    -
    -
    -
  • -
  • At step 4, add a --qt5 argument to the ccb.py command line.

    -
  • -
  • The Python scripts that make use of PyQt in crlcore and cumulus must be -edited to import PyQt5 instead of PtQt4 (should find a way to automatically -switch between the two of them).

    -
  • -
-

The complete list of ccb functionalities can be accessed with the --help argument. -It also may be run in graphical mode (--gui).

-
-
-

Building a Debug Enabled Version¶

-

The Release.Shared default version of the Coriolis is built stripped of symbols -and optimized so that it makes analysing a core dump after a crash difficult. In the -(unlikely) case of a crash, you may want to build, alongside the optimized version, -a debug one which allows forensic examination by gdb (or valgrind or whatever).

-

Run again ccb.py, adding the --debug argument:

-
dummy@lepka:coriolis> ./bootstrap/ccb.py --project=support  \
-                                         --project=coriolis \
-                                         --make="-j4 install" --debug
-
-
-

As cgt is a Python script, the right command to run gdb is:

-
dummy@lepka:work> gdb python core.XXXX
-
-
-
-
-

Installing on Debian 9, Ubuntu 18 or compatible distributions¶

-

First, install or check that the required prerequisites are installed :

-
dummy@lepka:~> sudo apt install -y build-essential binutils-dev                     \
-                                   git cmake bison flex gcc python-dev              \
-                                   libboost-all-dev libboost-python-dev             \
-                                   libbz2-dev libxml2-dev rapidjson-dev libbz2-dev  \
-                                   qtbase5-dev libqt5svg5-dev libqwt-qt5-dev        \ # Qt 5
-                                   python-pyqt5                                     \
-                                   doxygen dvipng graphviz python-sphinx            \
-                                   texlive-fonts-extra texlive-lang-french
-
-
-

Second step is to create the source directory and pull the git repository:

-
dummy@lepka:~> mkdir -p ~/coriolis-2.x/src
-dummy@lepka:src> cd ~/coriolis-2.x/src
-dummy@lepka:src> git clone https://www-soc.lip6.fr/git/coriolis.git
-
-
-

Third and final step, build & install:

-
dummy@lepka:src> cd coriolis
-dummy@lepka:coriolis> git checkout devel
-dummy@lepka:coriolis> ./bootstrap/ccb.py --project=coriolis --qt5 \
-                                         --make="-j4 install"
-
-
-
-
-

Additionnal Requirement under MacOS¶

-

Coriolis makes use of the boost::python module, but the MacPorts boost -seems unable to work with the Python bundled with MacOS. So you have to install -both of them from MacPorts:

-
dummy@macos:~> port install boost +python27
-dummy@macos:~> port select python python27
-dummy@macos:-> export DYLD_FRAMEWORK_PATH=/opt/local/Library/Frameworks
-
-
-

The last two lines tell MacOS to use the Python from MacPorts and not from -the system.

-

Then proceed with the generic install instructions.

-
-
-
-

Packaging Coriolis¶

-

Packager should not use ccb, instead bootstrap/Makefile.package is provided -to emulate a top-level autotool makefile. Just copy it in the root of the -Coriolis git repository (~/corriolis-2.x/src/coriolis/) and build.

-

Sligthly outdated packaging configuration files can also be found under bootstrap/:

-
    -
  • bootstrap/coriolis2.spec.in for rpm based distributions.
  • -
  • bootstrap/debian for Debian based distributions.
  • -
-
-
-

Hooking up into Alliance¶

-

Coriolis relies on Alliance for the cell libraries. So after installing or -packaging, you must configure it so that it can found those libraries.

-

The easiest way is to setup the Alliance environment (i.e. sourcing -.../etc/profile.d/alc_env.{sh,csh}) before setting up Coriolis environment -(see the next section). To understand how Coriolis find/setup Alliance you may -have look to the Configuration and User’s Settings section.

-
-
-

Setting up the Environment (coriolisEnv.py)¶

-

To simplify the tedious task of configuring your environment, a helper is provided -in the bootstrap source directory (also installed in the directory -.../install/etc/coriolis2/) :

-
~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py
-
-
-

Use it like this:

-
dummy@lepka:~> eval `~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py`
-
-
-
-

Note

-

Do not call that script in your environement initialisation. -When used under rhel6 or clones, it needs to be run in the devtoolset -environement. The script then launch a new shell, which may cause an -infinite loop if it’s called again in, say ~/.bashrc.

-

Instead you may want to create an alias:

-
alias c2r='eval "`~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py`"'
-
-
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/UsersGuide/LicenseCredits.html b/documentation/_build/html/UsersGuide/LicenseCredits.html deleted file mode 100644 index 21097b22..00000000 --- a/documentation/_build/html/UsersGuide/LicenseCredits.html +++ /dev/null @@ -1,612 +0,0 @@ - - - - - - - - - - - Credits & License — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

Credits & License¶

-

Hurricane -Rémy Escassut & - Christian Masson

-
-

Etesian -Gabriel Gouvine

-
-

Stratus -Sophie Belloeil

-
-

Katana (global) -Damien Dupuis

-
-

Katana (detailed), - Unicorn -Jean-Paul Chaput

-


-

The Hurricane data-base is copyright© Bull 2000-2019 and is -released under the terms of the lgpl license. All other tools are -copyright© upmc 2008-2018, Sorbonne Université 2018-2019 -and released under the gpl license.

-

Others important contributors to Coriolis are Christophe Alexandre, -Roselyne Chotin, Hugo Clement, Marek Sroka and Wu Yifei.

-

The Katana router makes use of the Flute software, which is -copyright© Chris C. N. Chu from the Iowa State University -(http://home.eng.iastate.edu/~cnchu/).

-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/UsersGuide/Releases.html b/documentation/_build/html/UsersGuide/Releases.html deleted file mode 100644 index 0134863e..00000000 --- a/documentation/_build/html/UsersGuide/Releases.html +++ /dev/null @@ -1,706 +0,0 @@ - - - - - - - - - - - Release Notes — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

Release Notes¶

-
-

Release 1.0.1475¶

-

This is the first preliminary release of the Coriolis 2 framework.

-

This release mainly ships the global router Knik and the detailed router -Kite. Together they aim to replace the Alliance Nero router. -Unlike Nero, Kite is based on an innovating routing modeling and ad-hoc -algorithm. Although it is released under gpl license, the source code -will be avalaible later. -

-

Contents of this release:

-
    -
  1. A graphical user interface (viewer only).
  2. -
  3. The Knik global router.
  4. -
  5. The Kite detailed router.
  6. -
-

Supported input/output formats:

-
    -
  • Alliance vst (netlist) & ap (physical) formats.
  • -
  • Even if there are some references to the Cadence lefdef format, its -support is not included because it depends on a library only available -to Si2 affiliated members.
  • -
-
-
-

Release 1.0.1963¶

-

Release 1963 is alpha. All the tools from Coriolis 1 have been ported into -this release.

-

Contents of this release:

-
    -
  1. The Stratus netlist capture language (GenLib replacement).
  2. -
  3. The Mauka placer (still contains bugs).
  4. -
  5. A graphical user interface (viewer only).
  6. -
  7. The Knik global router.
  8. -
  9. The Kite detailed router.
  10. -
  11. Partially implemented python support for configuration files -(alternative to xml).
  12. -
  13. A documentation (imcomplete/obsoleted in Hurricane‘s case).
  14. -
-
-
-

Release 1.0.2049¶

-

Release 2049 is Alpha.

-

Changes of this release:

-
    -
  1. The Hurricane documentation is now accurate. Documentation -for the Cell viewer and CRLcore has been added.
  2. -
  3. More extensive Python support for all the components of -Coriolis.
  4. -
  5. Configuration is now completly migrated under Python. -xml loaders can still be used for compatibilty.
  6. -
  7. The cgt main has been rewritten in Python.
  8. -
-
-
-

Release v2.0.1¶

-
    -
  1. Migrated the repository from svn to git, and release complete sources. -As a consequence, we drop the distribution packaging support and give -public read-only access to the repository.
  2. -
  3. Deep rewrite of the Katabatic database and Kite detailed router, -achieve a speedup factor greater than 20...
  4. -
-
-
-

Release v2.1¶

-
    -
  1. Replace the old simulated annealing placer Mauka by the analytical placer -Etesian and its legalization and detailed placement tools.
  2. -
  3. Added a Blif format parser to process circuits generated by the Yosys and ABC -logic synthetizers.
  4. -
  5. The multiple user defined configuration files are now grouped under -a common hidden (dot) directory .coriolis2 and the file extension -is back from .conf to .py.
  6. -
-
-
-

Release v2.2¶

-
    -
  1. Added JSON import/export of the whole Hurricane DataBase. Two save mode -are supported: Cell mode (standalone) or Blob mode, which dump the -whole design down and including the standard cells.
  2. -
-
-
-

Release v2.3¶

-
    -
  1. Reverts to a more standard organisation of the branches. devel_anabatic is -closed and we go on with master (stable version) and devel.

    -
  2. -
  3. Makes Katana the default global & detailed router. Put Knik & Kite in the -obsolete menus.

    -
  4. -
  5. Finally makes use of PyQt4 widgets. Seems to integrate without problems -with the Coriolis own qt widget. The drawback is that to build against qt 5 -needs adjustement from the user.

    -
  6. -
  7. Improved support for whole chip management. The outer part of the chip containing -the pad is decoupled from the core. This allows to cleanly separate real pads from -the foundry from a symbolic core. But this does not preclude other combinations -as fully symbolic or fully real.

    -

    To perform the separation, an intermediate hierarchical level corona between chip -and core has been introduced.

    -
  8. -
-
-
-

Release v2.4¶

-
    -
  1. Complete rewrite of the initialisation system. No longer use “configuration like” -files with various list of items. Now the configuration is supplied under the -from of Python modules to be imported as the user see fit.
  2. -
  3. Clean separation between nda protected parts and free ones. Now all the nda -related components are put under one separated tree, whether they are configuration -files or Python plugins, so that they be can easily by exported.
  4. -
  5. In Anabatic & Katana better accuracy at how obstacles decrease the edges -capacities of the GCells. Reduce the edge capacity of a GCell according to it’s -inner cluttering (that is, it’s number of terminals). Change of semantics -for katana.hReservedLocal and katana.vReservedLocal parameters.
  6. -
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/UsersGuide/ScriptsPlugins.html b/documentation/_build/html/UsersGuide/ScriptsPlugins.html deleted file mode 100644 index 696b8646..00000000 --- a/documentation/_build/html/UsersGuide/ScriptsPlugins.html +++ /dev/null @@ -1,948 +0,0 @@ - - - - - - - - - - - Python Interface for Hurricane / Coriolis — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -

-
-

Python Interface for Hurricane / Coriolis¶

-

The (almost) complete interface of Hurricane is exported as a Python module -and some parts of the other components of Coriolis (each one in a separate -module). The interface has been made to mirror as closely as possible the -C++ one, so the C++ doxygen documentation could be used to write code with -either languages.

-

Summary of the C++ Documentation

-

A script could be run directly in text mode from the command line or through -the graphical interface (see Executing Python Scripts in Cgt).

-

Aside for this requirement, the python script can contain anything valid -in Python, so don’t hesitate to use any package or extension.

-

Small example of Python/Stratus script:

-
import symbolic.cmos
-from   Hurricane import *
-from   Stratus   import *
-
-def doSomething ():
-    # ...
-    return
-
-def ScriptMain ( **kw ):
-  editor = None
-  if kw.has_key('editor') and kw['editor']:
-    editor = kw['editor']
-    stratus.setEditor( editor )
-
-  doSomething()
-  return
-
-if __name__ == "__main__" :
-  kw           = {}
-  success      = ScriptMain( **kw )
-  shellSuccess = 0
-  if not success: shellSuccess = 1
-
-  sys.exit( shellSuccess )
-      ScriptMain ()
-
-
-

This typical script can be executed in two ways:

-
    -
  1. Run directly as a Python script, thanks to the

    -
    if __name__ == "__main__" :
    -
    -
    -

    part (this is standart Python). It is a simple adapter that will -call ScriptMain().

    -

    In this case, the import symbolic.cmos statement at the begining -is mandatory.

    -
  2. -
  3. Through cgt, either in text or graphical mode. In that case, the -ScriptMain() is directly called trough a sub-interpreter. -The arguments of the script are passed through the **kw dictionnary.

    -

    In this case, the import symbolic.cmos statement at the begining -may be omitted.

    - ---- - - - - - - - - - - - - - - - -
    **kw Dictionnary
    Parameter Key/NameContents type
    'cell'A Hurricane cell on which to work. Depending -on the context, it may be None. -For example, when run from cgt, the cell -currently loaded in the viewer, if any.
    'editor'The viewer from which the script is run, when -lauched through cgt.
    -
  4. -
-
-

Plugins¶

-

Plugins are Python scripts specially crafted to integrate with cgt. -Their entry point is a ScriptMain() method as described in -Python Interface to Coriolis. They can be called by user scripts -through this method.

-
-

Chip Placement¶

-

Automatically performs the placement of a complete chip. This plugin, as well -as the other P&R tools expect a specific top-level hierarchy for the design. -The top-level hierarchy must contain the instances of all the I/O pads and -exactly one instance named corona of an eponym cell corona. -The corona cell in turn contains the instance of the chip’s core model.

-

The intermediate corona hierarchical level has been introduced to handle -the possible decoupling between real I/O pads supplied by a foundry and a -symbolic core. So the chip level contains only real layout and the corona -and below only symbolic layer.

-
-

Note

-

This does not prevent having a design either fully symbolic (pads and core) -or fully real.

-
-
-

Note

-

The corona also avoids the router to actually have to manage directly -the pads which simplify its configuration and besides avoid -to have the pads stuffed with blockages.

-
-

Chip Top Structure

-

The designer must provide a configuration file that defines the rules for the -placement of the top-level hierarchy (that is, the pads and the core). -This file must be names ioring.py and put into the user’s configuration -directory ./coriolis2/

-

Example of chip placement configuration file (for AM2901):

-
from helpers import l, u, n
-
-chip = \
-  { 'pads.ioPadGauge' : 'pxlib'
-  , 'pads.south'      : [ 'p_a3'     , 'p_a2'     , 'p_a1'     , 'p_r0'
-                        , 'p_vddick0', 'p_vssick0', 'p_a0'     , 'p_i6'
-                        , 'p_i8'     , 'p_i7'     , 'p_r3'     ]
-  , 'pads.east'       : [ 'p_zero'   , 'p_i0'     , 'p_i1'     , 'p_i2'
-                        , 'p_vddeck0', 'p_vsseck0', 'p_q3'     , 'p_b0'
-                        , 'p_b1'     , 'p_b2'     , 'p_b3'     ]
-  , 'pads.north'      : [ 'p_noe'    , 'p_y3'     , 'p_y2'     , 'p_y1'
-                        , 'p_y0'     , 'p_vddeck1', 'p_vsseck1', 'p_np'
-                        , 'p_ovr'    , 'p_cout'   , 'p_ng'     ]
-  , 'pads.west'       : [ 'p_cin'    , 'p_i4'     , 'p_i5'     , 'p_i3'
-                        , 'p_ck'     , 'p_d0'     , 'p_d1'     , 'p_d2'
-                        , 'p_d3'     , 'p_q0'     , 'p_f3'     ]
-  , 'core.size'       : ( l(1500), l(1500) )
-  , 'chip.size'       : ( l(3000), l(3000) )
-  , 'chip.clockTree'  : True
-  }
-
-
-

The file must contain one dictionnary named chip.

- ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Chip Dictionnary
Parameter Key/NameValue/Contents type
'pad.ioPadGauge'The routing gauge to use for the pad. Must be given -as it differs from the one used to route -inside the core
'pad.south'Ordered list (left to right) of pad instance names -to put on the south side of the chip
'pad.east'Ordered list (down to up) of pad instance names -to put on the east side of the chip
'pad.north'Ordered list (left to right) of pad instance names -to put on the north side of the chip
'pad.west'Ordered list (down to up) of pad instance names -to put on the west side of the chip
'core.size'The size of the core (to be used by the placer)
'chip.size'The size of the whole chip. The sides must be large -enough to accomodate all the pads
'chip.clockTree'Whether to generate a clock tree or not. This calls -the ClockTree plugin
-

Configuration parameters, defaults are defined in etc/coriolis2/<STECHNO>/plugins.conf.

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameter IdentifierTypeDefault
Chip Plugin Parameters
chip.block.rails.countInt5
The minimum number of rails around the core -block. Must be odd and above 5. -One rail for the clock and at least two pairs -of power/grounds
chip.block.rails.hWidthInt12 λ
The horizontal width of the rails
chip.block.rails.vWidthInt12 λ
The vertical width of the rails
chip.block.rails.hSpacingInt6 λ
The spacing, edge to edge of two adjacent -horizontal rails
chip.block.rails.vSpacingInt6 λ
The spacing, edge to edge of two adjacent -vertical rails
-
-

Note

-

If no clock tree is generated, then the clock rail is not created. -So even if the requested number of rails chip.block.rails.count is, say 5, -only four rails (2* power, 2* ground) will be generated.

-
-
-
-

Clock Tree¶

-

Inserts a clock tree into a block. The clock tree uses the H strategy. -The clock net is splitted into sub-nets, one for each branch of the -tree.

-
    -
  • On chip design, the sub-nets are created in the model of the -core block (then trans-hierarchically flattened to be shown at -chip level).

    -
  • -
  • On blocks, the sub nets are created directly in the top block.

    -
  • -
  • The sub-nets are named according to a simple geometrical scheme. -A common prefix ck_htree, then one postfix by level telling -on which quarter of plane the sub-clock is located:

    -
      -
    1. _bl: bottom left plane quarter.
    2. -
    3. _br: bottom right plane quarter.
    4. -
    5. _tl: top left plane quarter.
    6. -
    7. _tr: top right plane quarter.
    8. -
    -

    We can have ck_htree_bl, ck_htree_bl_bl, ch_htree_bl_tl and so on.

    -
  • -
-

The clock tree plugin works in four steps:

-
    -
  1. Builds the clock tree: creates the top-block abutment box, computes the -required levels of H tree and places the clock buffers.
  2. -
  3. Once the clock buffers are placed, calls the placer (Etesian) to place -the ordinary standard cells, whithout disturbing clock H-tree buffers.
  4. -
  5. At this point we know the exact positions of all the DFFs, so we can -connect them to the nearest H-tree leaf clock signal.
  6. -
  7. Leaf clock signals that are not connected to any DFFs are removed.
  8. -
-

Netlist reorganisation:

-
    -
  • Obviously the top block or chip core model netlist is modified to -contain all the clock sub-nets. The interface is not changed.
  • -
  • If the top block contains instances of other models and those models -contain DFFs that get re-connected to the clock sub-nets (from the -top level): Changes both the model netlist and interface to propagate -the relevant clock sub-nets to the instanciated model. The new model -with the added clock signal is renamed with a _cts suffix. -For example, the sub-block model ram.vst will become ram_cts.vst.
  • -
-
-

Note

-

If you are to re-run the clock tree plugin on a netlist, be careful -to erase any previously generated _cts file (both netlist and -layout: rm *_cts.{ap,vst}). And restart cgt to clear its -memory cache.

-
-

Configuration parameters, defaults are defined in etc/coriolis2/<STECHNO>/plugins.conf.

- ----- - - - - - - - - - - - - - - - - - - - - - - -
Parameter IdentifierTypeDefault
ClockTree Plugin Parameters
clockTree.minimumSideInt300 λ
The minimum size below which the clock tree -will stop to perform quadri-partitions
clockTree.bufferStringbuf_x2
The buffer model to use to drive sub-nets
-
-
-

Recursive-Save (RSave)¶

-

Performs a recursive top down save of all the models from the top cell -loaded in cgt. Forces a write of any non-terminal model. This plugin is used -by the clock tree plugin after the netlist clock sub-nets creation.

-
-
-
-

A Simple Example: AM2901¶

-

To illustrate the capabilities of Coriolis tools and Python scripting, a small -example, derived from the Alliance AM2901 is supplied.

-

This example contains only the synthetized netlists and the doChip.py script -which perform the whole P&R of the design.

-

You can generate the chip using one of the following methods:

-
    -
  1. Command line mode: directly run the script:

    -
    dummy@lepka:AM2901> ./doChip -V --cell=amd2901
    -
    -
    -
  2. -
  3. Graphic mode: launch cgt, load chip netlist amd2901 (the top cell) -then run the Python script doChip.py.

    -
  4. -
-
-

Note

-

Between two consecutive run, be sure to erase the netlist/layout generated:

-
dummy@lepka:AM2901> rm *_cts*.vst *.ap
-
-
-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/UsersGuide/ViewerTools.html b/documentation/_build/html/UsersGuide/ViewerTools.html deleted file mode 100644 index 3096f669..00000000 --- a/documentation/_build/html/UsersGuide/ViewerTools.html +++ /dev/null @@ -1,1434 +0,0 @@ - - - - - - - - - - - CGT - The Graphical Interface — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
- -
-
-
- -
-

CGT - The Graphical Interface¶

-

The Coriolis graphical interface is split up into two windows.

-
    -
  • The Viewer, with the following features:
      -
    • Basic load/save capabilities.
    • -
    • Displays the current working cell. Could be empty if the design -is not yet placed.
    • -
    • Executes Stratus Scripts.
    • -
    • Menu to run the tools (placement, routage).
    • -
    -
  • -
-

Features are detailed in Viewer & Tools.

-

Viewer Basic Snapshot

-
    -
  • The Controller, which allows to:
      -
    • Tweak what is displayed by the Viewer. Through the Look, -Filter and Layers&Gos tabs.
    • -
    • Browse the netlist with eponym tab.
    • -
    • Show the list of selected objects (if any) with selection
    • -
    • Walk through the Database, the Cell or the Selection with Inspector. -This is an advanced feature, reserved for experimented users.
    • -
    • The tab Settings which gives access to all the settings. -They are closely related to Configuration & Initialisation.
    • -
    -
  • -
-

Controller Basic Snapshot

-
-

Viewer & Tools¶

-
-

Stratus Netlist Capture¶

-

Stratus is the replacement for GenLib procedural netlist capture language. -It is designed as a set of Python classes, and comes with it’s own documentation -(Stratus Documentation)

-
-
-

The Hurricane Data-Base¶

-

The Alliance flow is based on the mbk data-base, which has one data-structure -for each view. That is, Lofig for the logical view and Phfig for the physical -view. The place and route tools were responsible for maintaining (or not) the -coherency between views. Reflecting this weak coupling between views, each one -was stored in a separate file with a specific format. The logical view is stored -in a vst file in vhdl format and the physical in an ap file in an ad-hoc format.

-

The Coriolis flow is based on the Hurricane data-base, which has a unified -structure for logical and physical view. That data structure is the Cell object. -The Cell can have any state between pure netlist and completly placed and -routed design. Although the memory representation of the views has deeply -changed we still use the Alliance files format, but they now really represent -views of the same object. The point is that one must be very careful about -view coherency when going to and from Coriolis.

-

As for the second release, Coriolis can be used only for three purposes :

-
    -
  • Placing a design, in which case the netlist view must be present.
  • -
  • Routing a design, in that case the netlist -view and the layout view must be present and layout view must contain -a placement. Both views must have the same name. When saving the routed design, -it is advised to change the design name otherwise the original unrouted placement -in the layout view will be overwritten.
  • -
  • Viewing a design, the netlist view must be present, if a layout -view is present it still must have the same name but it can be in any -state.
  • -
-
-
-

Synthetizing and loading a design¶

-

Coriolis supports several file formats. It can load all file format -from the Alliance toolchain (.ap for layout, behavioural and structural vhdl .vbe and .vst), -BLIF netlist format as well as benchmark formats from the ISPD contests.

-

It can be compiled with LEF/DEF support, although it requires acceptance of the SI2 license -and may not be compiled in your version of the software.

-
-

Synthesis under Yosys¶

-

You can create a BLIF file from the Yosys synthetizer, which can be imported under Coriolis. -Most libraries are specified as a .lib liberty file and a .lef LEF file. -Yosys opens most .lib files with minor modifications, but LEF support in Coriolis relies on SI2. -If Coriolis hasn’t been compiled against it, the library is given in Alliance .ap format. -Some free libraries already provide both .ap and .lib files.

-

Once you have installed a common library under Yosys and Coriolis, just synthetize your design -with Yosys and import it (as Blif without the extension) under Coriolis to perform place&route.

-
-
-

Synthesis under Alliance¶

-

Alliance is an older toolchain but has been extensively used for years. Coriolis can import -and write Alliance designs and libraries directly.

-
-
-
-

Etesian – Placer¶

-

The Etesian placer is a state of the art (as of 2015) analytical placer. It is -within 5% of other placers’ solutions, but is normally a bit worse than ePlace. -This Coriolis tool is actually an encapsulation of Coloquinte which is the placer.

-
-

Note

-

Instance Uniquification: a same logical instance cannot have -two different placements. So, if you don’t supply a placement for it, it will be -uniquified (cloned) and you will see the copy files appears on disk upon saving.

-
-

-Hierarchical Placement

-

The placement area is defined by the top cell abutment box.

-

When placing a complete hierarchy, the abutment boxes of the cells (models) other than -the top cell are set identical to the one of the top cell and their instances are -all placed at position (0,0,ID). That is, all the abutments boxes, whatever the -hierarchical level, define the same area (they are exactly superposed).

-

We choose this scheme because the placer will see all the instances as virtually -flattened, so they can be placed anywhere inside the top-cell abutment box.

-

Etesian Abutment Box

-

-Computing the Placement Area

-

The placement area is computed using the etesian.aspectRatio and etesian.spaceMargin -parameters only if the top-cell has an empty abutment box. If the top-cell abutment -box has to be set, then it is propagated to all the instances models recursively.

-

-Reseting the Placement

-

Once a placement has been done, the placer cannot reset it (will be implemented -later). To perform a new placement, you must restart cgt. In addition, if you -have saved the placement on disk, you must erase any .ap file, which are -automatically reloaded along with the netlist (.vst).

-

-Limitations

-

Etesian supports standard cells and fixed macros. As for the Coriolis 2.1 version, -it doesn’t support movable macros, and you must place every macro beforehand. -Timing and routability analysis are not included either, and the returned placement -may be unroutable.

-
-

Etesian Configuration Parameters¶

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameter IdentifierTypeDefault
Etesian Parameters
etesian.aspectRatioPercentage100
Define the height on width H/W aspect -ratio, can be comprised between 10 and 1000
etesian.spaceMarginPercentage5
The extra white space added to the total area -of the standard cells
etesian.uniformDensityBoolFalse
Whether the cells will be spread envenly -across the area or allowed to form denser -clusters
etesian.effortInt2
Sets the balance between the speed of the -placer and the solution quality
etesian.routingDrivenBoolFalse
Whether the tool will try routing iterations -and whitespace allocation to improve -routability; to be implemented
etesian.graphicsInt2

How often the display will be refreshed -More refreshing slows the placer.

-
    -
  • 1 shows both upper and lower bounds
  • -
  • 2 only shows lower bound results
  • -
  • 3 only shows the final results
  • -
-
-

-
-
-
-

Katana – Global Router¶

-

The quality of Katana global routing solutions are equivalent to those of FGR 1.0. -For an in-depth description of Katana algorithms, you may download the thesis of -D. Dupuis avalaible from here~: Knik Thesis (Knik has been rewritten as part -of Katana, the algorithms remains essentially the same).

-

The global router is now deterministic.

-
-
-

Katana – Detailed Router¶

-

Katana no longer suffers from the limitations of Nero. It can route big designs -as its runtime and memory footprint is almost linear (with respect to the number -of gates). It has successfully routed design of more than 150K gates. -

-
-

Note

-

Slow Layer Assignment. Most of the time, the layer assignment stage is -fast (less than a dozen seconds), but in some instances it can take more -than a dozen minutes. This is a known bug and will be corrected in later -releases.

-
-

After each run, Katana displays a set of completion ratios which must all -be equal to 100% or (NNNN+0) if the detailed routing has been successfull. -In the event of a failure, on a saturated design, you may tweak the three -following configuration parameters:

-
    -
  1. katana.hTrackReservedLocal, the number of track reserved for local routing, -that quantity is substracted from the edge capacities (global routing) to -give a sense of the cluttering inside the GCells.
  2. -
  3. katana.vTrackReservedLocal, same as above.
  4. -
  5. etesian.spaceMargin, increases the free area of the overall design so the -routing density decrease.
  6. -
-

The idea is to increase the horizontal and vertical local track reservation until -the detailed router succeeds. But in doing so we make the task of the global router -more and more difficult as the capacity of the edges decreases, and at some point -it will fail too. So this is a balance.

-

Routing a design is done in four ordered steps:

-
    -
  1. Detailed pre-route \textbf{P\&R} \rightarrow \textbf{Step by Step} \rightarrow \textbf{Detailed PreRoute}
  2. -
  3. Global routing \textbf{P\&R} \rightarrow \textbf{Step by Step} \rightarrow \textbf{Global Route}
  4. -
  5. Detailed routing \textbf{P\&R} \rightarrow \textbf{Step by Step} \rightarrow \textbf{Detailed Route}
  6. -
  7. Finalize routing \textbf{P\&R} \rightarrow \textbf{Step by Step} \rightarrow \textbf{Finalize Route}
  8. -
-

It is possible to supply to the router a complete wiring for some nets that the user -wants to be routed according to a specific topology. The supplied topology must respect -the building rules of the Anabatic database (contacts must be, terminals, turns, h-tee -& v-tee only). During the first step Detailed Pre-Route the router will solve -overlaps between the segments, without making any dogleg. If no pre-routed topologies -are present, this step may be ommited. Any net routed at this step is then fixed and -become unmovable for the later stages.

-

After the detailed routing step the Katana data-structure is still active -(the Hurricane wiring is decorated). The finalize step performs the removal of -the Katana data-structure, and it is not advisable to save the design before -that step.

-

You may visualize the density (saturation) of either the edges (global routing) -or the GCells (detailed routing) until the routing is finalized. Special layers appear -to that effect in the The Layers&Go Tab.

-
-

Katana Configuration Parameters¶

-

The Anabatic parameters control the layer assignment step.

-

All the defaults value given below are from the default Alliance technology -(cmos and SxLib cell gauge/routing gauge).

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameter IdentifierTypeDefault
Anabatic Parameters
anabatic.topRoutingLayerStringMETAL5
Define the highest metal layer that will be -used for routing (inclusive).
anabatic.globalLengthThresholdInt1450
This parameter is used by a layer assignment -method which is no longer used (did not give -good results)
anabatic.saturateRatioPercentage80
If M(x) density is above this ratio, -move up feedthru global segments up from -depth x to x+2
anabatic.saturateRpInt8
If a GCell contains more terminals -(RoutingPad) than that number, force a -move up of the connecting segments to those -in excess
anabatic.globalIterationsInt10
The maximum number of iterations the global -router will try to solve edges overload
Katana Parameters
katana.hTracksReservedLocalInt3
To take account the tracks needed inside a -GCell to build the local routing the -capacities of the edges needs to be decreased. -The decrease is computed by the GCell and -cannot exceed this number (this is maximum). -For better accuracy vertical and horizontal -edges are distinguisheds
katana.vTracksReservedLocalInt3
cf. kite.hTracksReservedLocal
katana.eventsLimitInt4000002
The maximum number of segment displacements, -this is a last ditch safety against infinite -loop. It’s perhaps a little too low for big -designs
katana.ripupCostInt3
Differential introduced between two ripup -costs to avoid a loop between two ripped up -segments
katana.strapRipupLimitInt16
Maximum number of ripup for strap segments
katana.localRipupLimitInt9
Maximum number of ripup for local segments
katana.globalRipupLimitInt5
Maximum number of ripup for global segments, -when this limit is reached, triggers topologic -modification
katana.longGlobalRipupLimitInt5
Maximum number of ripup for long global -segments, when this limit is reached, triggers -topological modification
-
-
-
-

Executing Python Scripts in Cgt¶

-

Python/Stratus scripts can be executed either in text or graphical mode.

-
-

Note

-

How Cgt Locates Python Scripts: -cgt uses the Python import mechanism to load Python scripts. -So you must give the name of your script whithout .py extension and -it must be reachable through the PYTHONPATH. You may use the -dotted module notation.

-
-

A Python/Stratus script must contain a function called ScriptMain() -with one optional argument, the graphical editor into which it may be -running (will be set to None in text mode). The Python interface to -the editor (type: CellViewer) is limited to basic capabilities -only.

-

Any script given on the command line will be run immediatly after the -initializations and before any other argument is processed.

-

For more explanation on Python scripts see Python Interface to Coriolis.

-
-
-

Printing & Snapshots¶

-

Printing or saving into a pdf is fairly simple, just use the File -> Print -menu or the CTRL+P shortcut to open the dialog box.

-

The print functionality uses exactly the same rendering mechanism as for the -screen, beeing almost WYSIWYG. Thus, to obtain the best results it is advisable -to select the Coriolis.Printer look (in the Controller), which uses a -white background and well suited for high resolutions 32x32 pixels patterns

-

There is also two modes of printing selectable through the Controller -Settings -> Misc -> Printer/Snapshot Mode:

- ----- - - - - - - - - - - - - - - -
ModeDPI (approx.)Intended Usage
Cell Mode150For single Cell printing or very small designs. -Patterns will be bigger and more readable.
Design Mode300For designs (mostly commposed of wires and cells -outlines).
-
-

Note

-

The pdf file size -Be aware that the generated pdf files are indeed only pixmaps. -So they can grew very large if you select paper format above A2 -or similar.

-
-

-Saving into an image is subject to the same remarks as for pdf.

-
-
-

Memento of Shortcuts in Graphic Mode¶

-

The main application binary is cgt.

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CategoryKeysAction
Moves
-
Up, -Down
-
Left, -Right
-
-
Shifts the view in the according direction
FitfFits to the Cell abutment box
RefreshCTRL+LTriggers a complete display redraw
Gotogapperture is the minimum side of the area -displayed around the point to go to. It’s an -alternative way of setting the zoom level
Zoomz, -mRespectively zoom by a 2 factor and unzoom -by a 2 factor
-
BigMouse
-
Area Zoom
-
-
You can perform a zoom to an area. -Define the zoom area by holding down the left -mouse button while moving the mouse.
Selection
-
BigMouse
-
Area Selection
-
-
You can select displayed objects under an area. -Define the selection area by holding down the -right mouse button while moving the mouse.
-
BigMouse
-
Toggle Selection
-
-
You can toggle the selection of one object under -the mouse position by pressing CTRL and -pressing down the right mouse button. A popup -list of what’s under the position shows up into -which you can toggle the selection state of one -item.
SToggle the selection visibility
ControllerCTRL+I

Show/hide the controller window.

-

It’s the Swiss Army Knife of the viewer. -From it, you can fine-control the display and -inspect almost everything in your design.

-
Rulersk, -ESCOne stroke on k enters the ruler mode, in -which you can draw one ruler. You can exit the -ruler mode by pressing ESC. Once in ruler -mode, the first click on the left mouse button -sets the ruler’s starting point and the second -click the ruler’s end point. The second click -exits automatically the ruler mode.
KClears all the drawn rulers
PrintCTRL+PCurrently rather crude. It’s a direct copy of -what’s displayed in pixels. So the resulting -picture will be a little blurred due to -anti-aliasing mechanism.
Open/CloseCTRL+OOpens a new design. The design name must be -given without path or extention.
CTRL+WCloses the current viewer window, but does not quit -the application.
CTRL+QCTRL+Q quits the application -(closing all windows).
HierarchyCTRL+DownGoes one hierarchy level down. That is, if there -is an instance under the cursor position, loads -its model Cell in place of the current one.
CTRL+UpGoes one hierarchy level up. If we have entered -the current model through CTRL+Down -reloads the previous model (the one -in which this model is instanciated).
-
-
-

Cgt Command Line Options¶

-

Appart from the obvious --text options, all can be used for text and graphical mode.

- ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ArgumentsMeaning
-t|–textInstructs cgt to run in text mode.
-L|–log-modeDisables the use of ansi escape sequence on -the tty. Useful when the output is -redirected to a file.
-c <cell>|–cell=<cell>The name of the design to load, without -leading path or extention.
-m <val>|–margin=<val>Percentage val of white space for the placer -(Etesian).
–events-limit=<count>The maximal number of events after which the -router will stop. This is mainly a failsafe -against looping. The limit is set to 4 -millions of iteration which should suffice to -any design of 100K. gates. For bigger -designs you may want to increase this limit.
-G|–global-routeRuns the global router (Katana).
-R|–detailed-routeRuns the detailed router (Katana).
-s|–save-design=<routed>The design into which the routed layout will -be saved. It is strongly recommanded to choose -a different name from the source (unrouted) -design.
–stratus-script=<module>Run the Python/Stratus script module. -See Python Scripts in Cgt.
-

-

Some Examples :

-
    -
  • Run both global and detailed router, then save the routed design :

    -
    > cgt -v -t -G -R --cell=design --save-design=design_r
    -
    -
    -
  • -
-
-
-

Miscellaneous Settings¶

- ----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameter IdentifierTypeDefault
Verbosity/Log Parameters
misc.infoBoolFalse
Enables display of info level message -(cinfo stream)
misc.bugBoolFalse
Enables display of bug level message -(cbug stream), messages can be a little -scarry
misc.logModeBoolFalse
If enabled, assumes that the output device -is not a tty and suppresses any escape -sequences
misc.verboseLevel1BoolTrue
First level of verbosity, disables level 2
misc.verboseLevel2BoolFalse
Second level of verbosity
Development/Debug Parameters
misc.minTraceLevelInt0
misc.maxTraceLevelInt0
Displays trace information between those two -levels (cdebug stream)
misc.catchCoreBoolFalse
By default, cgt does not dump core. -To generate one set this flag to True
-

-
-
-
-

The Controller¶

-

The Controller window is composed of seven tabs:

-
    -
  1. The Look Tab to select the display style.
  2. -
  3. The Filter Tab the hierarchical levels to be displayed, the look of -rubbers and the dimension units.
  4. -
  5. The Layers&Go Tab to selectively hide/display layers.
  6. -
  7. The Netlist Tab to browse through the netlist. Works in association -with the Selection tab.
  8. -
  9. The Selection Tab allows to view all the currently selected elements.
  10. -
  11. The Inspector Tab browses through either the DataBase, the Cell or -the current selection.
  12. -
  13. The Settings Tab accesses all the tool’s configuration settings.
  14. -
-
-

The Look Tab¶

-

You can select how the layout will be displayed. There is a special one -Printer.Coriolis specifically designed for Printing & Snapshots. -You should select it prior to calling the print or snapshot dialog boxes.

-

Controller Look, Snapshot 1

-

-
-
-

The Filter Tab¶

-

The filter tab let you select what hierarchical levels of your design will be -displayed. Hierarchy level are numbered top-down: the level 0 corresponds to -the top-level cell, the level one to the instances of the top-level Cell and -so on.

-

There are also check boxes to enable/disable the processing of Terminal Cell, -Master Cells and Components. The processing of Terminal Cell (hierarchy leaf -cells) is disabled by default when you load a hierarchical design and enabled -when you load a single Cell.

-

You can choose what kind of form to give to the rubbers and the type of -unit used to display coordinates.

-
-

Note

-

What are Rubbers: Hurricane uses Rubbers to materialize -physical gaps in net topology. That is, if some wires are missing to -connect two or more parts of net, a rubber will be drawn between them -to signal the gap.

-

For example, after the detailed routing no rubber should remain. -They have been made very visible as big violet lines...

-
-

Controller Basic Snapshot

-

-
-
-

The Layers&Go Tab¶

-

Control the individual display of all layers and Gos.

-
    -
  • Layers correspond to true physical layers. From a Hurricane point of -view they are all the BasicLayers (could be matched to GDSII).
  • -
  • Gos stands from Graphical Objects, they are drawings that have no -physical existence but are added by the various tools to display extra -information. One good exemple is the density map of the detailed router, -to easily locate congested areas.
  • -
-

For each layer/Go there are two check boxes:

-
    -
  • The normal one triggers the display.
  • -
  • The red-outlined allows objects of that layer to be selectable or not.
  • -
-

Controller Basic Snapshot

-
-
-

The Netlist Tab¶

-

The Netlist tab shows the list of nets... By default the tab is not -synched with the displayed Cell. To see the nets you must check the -Sync Netlist checkbox. You can narrow the set of displayed nets by -using the filter pattern (supports regular expressions).

-

A very useful feature is to enable the Sync Selection, which will -automatically select all the components of the selected net(s). You can -select multiple nets. In the figure the net auxsc35 is selected and -is highlighted in the Viewer.

-

Controller Basic Snapshot - Controller Basic Snapshot

-
-
-

The Selection Tab¶

-

The Selection tab lists all the components currently selected. They -can be filtered thanks to the filter pattern.

-

Used in conjunction with the Netlist Sync Selection you will all see -all the components part of net.

-

In this list, you can toggle individually the selection of component by -pressing the t key. When unselected in this way a component is not -removed from the the selection list but instead displayed in red italic. -To see where a component is you may make it blink by repeatedly press -the t key...

-

Controller Basic Snapshot

-
-
-

The Inspector Tab¶

-

This tab is very useful, but mostly for Coriolis developpers. It allows -to browse through the live DataBase. The Inspector provides three entry points:

-
    -
  • DataBase: Starts from the whole Hurricane DataBase.
  • -
  • Cell: Inspects the currently loaded Cell.
  • -
  • Selection: Inspects the object currently highlighted in the Selection tab.
  • -
-

Once an entry point has been activated, you may recursively expore all -its fields using the right/left arrows.

-
-

Note

-

Do not put your fingers in the socket: when inspecting -anything, do not modify the DataBase. If any object under inspection -is deleted, you will crash the application...

-
-
-

Note

-

Implementation Detail: the inspector support is done with -Slot, Record and getString().

-
-

Controller Basic Snapshot - Controller Basic Snapshot - Controller Basic Snapshot

-
-
-

The Settings Tab¶

-

Here comes the description of the Settings tab.

-

Controller Basic Snapshot

-
-
-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/UsersGuide/index.html b/documentation/_build/html/UsersGuide/index.html deleted file mode 100644 index 3f0c815d..00000000 --- a/documentation/_build/html/UsersGuide/index.html +++ /dev/null @@ -1,626 +0,0 @@ - - - - - - - - - - - Coriolis User’s Guide — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/Viewer/Viewer.html b/documentation/_build/html/Viewer/Viewer.html deleted file mode 100644 index baae3c5a..00000000 --- a/documentation/_build/html/Viewer/Viewer.html +++ /dev/null @@ -1,585 +0,0 @@ - - - - - - - - - - - Viewer Reference — Coriolis 2 documentation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
- - - - - - -
-
-
-
    -
  • Docs »
  • - -
  • Viewer Reference
  • -
  • - - - -
  • -
-
-
-
- -
-

Viewer Reference¶

-

The Viewer C++ API reference is generated by Doxygen and is -available here: Viewer

-
- - -
-
- - - - -
- -
- - - - - -
- Generated by Sphinx - using a RTD theme on Oct 30, 2019. -
- - - - - -
Coriolis 2 Documentation - © Copyright 2000-2019, Sorbonne Université. -
-
- -
- -
-
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/_images/math/0d59c123dd2cd130ca29a2ba930fabbc4f547771.png b/documentation/_build/html/_images/math/0d59c123dd2cd130ca29a2ba930fabbc4f547771.png deleted file mode 100644 index e121fb14..00000000 Binary files a/documentation/_build/html/_images/math/0d59c123dd2cd130ca29a2ba930fabbc4f547771.png and /dev/null differ diff --git a/documentation/_build/html/_images/math/44344a23b2a3007fed067629259108385790ee6a.png b/documentation/_build/html/_images/math/44344a23b2a3007fed067629259108385790ee6a.png deleted file mode 100644 index ea41cf7e..00000000 Binary files a/documentation/_build/html/_images/math/44344a23b2a3007fed067629259108385790ee6a.png and /dev/null differ diff --git a/documentation/_build/html/_images/math/8080e7327f421afe79e142b39735819ab9631cb9.png b/documentation/_build/html/_images/math/8080e7327f421afe79e142b39735819ab9631cb9.png deleted file mode 100644 index 7725368f..00000000 Binary files a/documentation/_build/html/_images/math/8080e7327f421afe79e142b39735819ab9631cb9.png and /dev/null differ diff --git a/documentation/_build/html/_images/math/9354e2441491d324ef5fd162920f581bdf022af5.png b/documentation/_build/html/_images/math/9354e2441491d324ef5fd162920f581bdf022af5.png deleted file mode 100644 index e9cb6050..00000000 Binary files a/documentation/_build/html/_images/math/9354e2441491d324ef5fd162920f581bdf022af5.png and /dev/null differ diff --git a/documentation/_build/html/_images/math/db2555e54bec0d091b2124dccd645c2d7ddaae68.png b/documentation/_build/html/_images/math/db2555e54bec0d091b2124dccd645c2d7ddaae68.png deleted file mode 100644 index 8f9725e8..00000000 Binary files a/documentation/_build/html/_images/math/db2555e54bec0d091b2124dccd645c2d7ddaae68.png and /dev/null differ diff --git a/documentation/_build/html/_images/math/e6bc812a13677a4608e3f0624c560af92a3d7887.png b/documentation/_build/html/_images/math/e6bc812a13677a4608e3f0624c560af92a3d7887.png deleted file mode 100644 index 3fdb4dfe..00000000 Binary files a/documentation/_build/html/_images/math/e6bc812a13677a4608e3f0624c560af92a3d7887.png and /dev/null differ diff --git a/documentation/_build/html/_sources/Analog/Analog.txt b/documentation/_build/html/_sources/Analog/Analog.txt deleted file mode 100644 index 27927665..00000000 --- a/documentation/_build/html/_sources/Analog/Analog.txt +++ /dev/null @@ -1,11 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -========================== -Hurricane/Analog Reference -========================== - -The Viewer C++ API reference is generated by Doxygen_ and is -available here: `Hurricane/Analog `_ diff --git a/documentation/_build/html/_sources/Contents.txt b/documentation/_build/html/_sources/Contents.txt deleted file mode 100644 index 670fd7fd..00000000 --- a/documentation/_build/html/_sources/Contents.txt +++ /dev/null @@ -1,18 +0,0 @@ -.. Coriolis documentation master file, created by - sphinx-quickstart on Mon Jul 10 15:08:36 2017. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Comprenhensive Table of Contents -================================ - -.. toctree:: - - UsersGuide/index.rst - Stratus/index.rst - Hurricane/Hurricane.rst - Viewer/Viewer.rst - CrlCore/CrlCore.rst - Unicorn/Unicorn.rst - PythonCpp/index.rst - RDS/index.rst diff --git a/documentation/_build/html/_sources/CrlCore/CrlCore.txt b/documentation/_build/html/_sources/CrlCore/CrlCore.txt deleted file mode 100644 index d462e48e..00000000 --- a/documentation/_build/html/_sources/CrlCore/CrlCore.txt +++ /dev/null @@ -1,11 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -==================== -CRL Core Reference -==================== - -The CRL Core C++ API reference is generated by Doxygen_ and is -available here: `CRL Core `_ diff --git a/documentation/_build/html/_sources/Hurricane/Hurricane.txt b/documentation/_build/html/_sources/Hurricane/Hurricane.txt deleted file mode 100644 index 4b1ec994..00000000 --- a/documentation/_build/html/_sources/Hurricane/Hurricane.txt +++ /dev/null @@ -1,11 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -===================== -Hurricane Reference -===================== - -The Hurricane C++ API reference is generated by Doxygen_ and is -available here: `Hurricane `_ diff --git a/documentation/_build/html/_sources/Katabatic/Katabatic.txt b/documentation/_build/html/_sources/Katabatic/Katabatic.txt deleted file mode 100644 index 10f35831..00000000 --- a/documentation/_build/html/_sources/Katabatic/Katabatic.txt +++ /dev/null @@ -1,14 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -===================== -Katabatic Reference -===================== - -The Katabatic C++ API reference is generated by Doxygen_ and is -available here: `Katana `_ - -.. note:: The Katabatic API has served as a base for it's - mixed signal conterpart **Anabatic**. diff --git a/documentation/_build/html/_sources/Kite/Kite.txt b/documentation/_build/html/_sources/Kite/Kite.txt deleted file mode 100644 index 41450be3..00000000 --- a/documentation/_build/html/_sources/Kite/Kite.txt +++ /dev/null @@ -1,14 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -================= -Kite Reference -================= - -The Kite C++ API reference is generated by Doxygen_ and is -available here: `Kite `_ - -.. note:: The Kite API has also served has a base for it's - mixed-signal conterpart Katana (:sc:`Kit[e]-Ana[logic]`). diff --git a/documentation/_build/html/_sources/Oroshi/Oroshi.txt b/documentation/_build/html/_sources/Oroshi/Oroshi.txt deleted file mode 100644 index f8edd57a..00000000 --- a/documentation/_build/html/_sources/Oroshi/Oroshi.txt +++ /dev/null @@ -1,11 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -================ -Oroshi Reference -================ - -The Oroshi Python API reference is generated by Doxygen_ and is -available here: `Oroshi `_ diff --git a/documentation/_build/html/_sources/PythonCpp/Configuration.txt b/documentation/_build/html/_sources/PythonCpp/Configuration.txt deleted file mode 100644 index 2e9d11e9..00000000 --- a/documentation/_build/html/_sources/PythonCpp/Configuration.txt +++ /dev/null @@ -1,42 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -2. Basic File Structure and CMake configuration -================================================= - -As a first example we will consider the ``Hurrican::Library`` -class. To export a class into Python, we must create three files: - -#. ``PyLibrary.h``, defines the ``PyLibrary`` C-Struct and the functions - needed outside the module istself (mostly for ``PyHurricane.cpp``). - -#. ``PyLibrary.cpp``, contains the complete wrapping of the class and - the Python type definition (``PyTypeLibrary``). - -#. ``PyHurricane.cpp``, the definition of the Python module into which - the classes are registered. The module act as a ``namespace`` in - Python so it is good practice to give it the same name as it's - associated C++ namespace. - -|newpage| - -To build a Python module in |cmake|, use the following macro: - - .. code-block:: cmake - - set( pyCpps PyLibrary.cpp - PyHurricane.cpp ) - set( pyIncludes hurricane/isobar/PyLibrary.h - - add_python_module( "${pyCpps}" - "${pyIncludes}" - "isobar;1.0;1" # Name & version of the supporting - # shared library. - Hurricane # Name of the Python module will give: - # Hurricane.so - "${depLibs}" # List of dependency libraries. - include/coriolis2/hurricane/isobar - # Where to install the include files. - ) diff --git a/documentation/_build/html/_sources/PythonCpp/DBoHierarchy.txt b/documentation/_build/html/_sources/PythonCpp/DBoHierarchy.txt deleted file mode 100644 index 4c72bf3b..00000000 --- a/documentation/_build/html/_sources/PythonCpp/DBoHierarchy.txt +++ /dev/null @@ -1,439 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -|newpage| - - -4. Case 2 - Hierarchy of DBo Derived Classes -============================================== - -Now we want to export the following C++ class hierarchy into Python: :: - - PyEntity <-- PyComponent <-+- PyContact - +- PySegment <-+- PyHorizontal - +- PyVertical - - -4.1 Base Class Header -~~~~~~~~~~~~~~~~~~~~~~~ - -**Remark:** this is only a partial description of the tree for the sake of -clarity. - -One important fact to remember is that ``PyEntity`` and ``PyComponent`` -being related to C++ abstract classes, no objects of those types will be -created, only ``PyContact``, ``PyHorizontal`` or ``PyVertical`` will. - -The consequence is that there is no ``PyEntity_Link()`` like in :ref:`3.1` -but instead two functions: - -#. ``PyEntity_NEW()`` which create the relevant ``PyEntity`` *derived* - object from the ``Entity`` one. For example, if the ``Entity*`` given - as argument is in fact a ``Horizontal*``, then the function will - return a ``PyHorizontal*``. - -#. ``EntityCast()`` do the reverse of ``PyEntity_NEW()`` that is, from - a ``PyEntity``, return the C++ *derived* object. Again, if the - ``PyEntity*`` is a ``PyHorizontal*``, the function will cast it as - a ``Horizontal*`` *then* return it as an ``Entity*``. - -.. code-block:: python - - #ifndef ISOBAR_PY_ENTITY_H - #define ISOBAR_PY_ENTITY_H - - #include "hurricane/isobar/PyHurricane.h" - #include "hurricane/Entity.h" - - namespace Isobar { - extern "C" { - - typedef struct { - PyObject_HEAD - Hurricane::Entity* _object; - } PyEntity; - - extern PyObject* PyEntity_NEW ( Hurricane::Entity* entity ); - extern void PyEntity_LinkPyType (); - extern PyTypeObject PyTypeEntity; - extern PyMethodDef PyEntity_Methods[]; - - - #define IsPyEntity(v) ( (v)->ob_type == &PyTypeEntity ) - #define PYENTITY(v) ( (PyEntity*)(v) ) - #define PYENTITY_O(v) ( PYENTITY(v)->_object ) - - } // extern "C". - - Hurricane::Entity* EntityCast ( PyObject* derivedObject ); - - } // Isobar namespace. - - #endif // ISOBAR_PY_ENTITY_H - -|newpage| - - -4.2 Base Class File -~~~~~~~~~~~~~~~~~~~~~ - -Changes from :ref:`3.2 Class Associated File` are: - -#. No call to ``DBoLinkCreateMethod()`` because there must be no ``PyEntity_Link()``, - but the definitions of ``PyEntity_NEW()`` and ``EntityCast``. - -#. For defining the ``PyTypeEntity`` Python type, we call a different - macro: ``PyTypeRootObjectDefinitions``, dedicated to base classes. - - -.. code-block:: c++ - - #include "hurricane/isobar/PyCell.h" - #include "hurricane/isobar/PyHorizontal.h" - #include "hurricane/isobar/PyVertical.h" - #include "hurricane/isobar/PyContact.h" - - namespace Isobar { - using namespace Hurricane; - - extern "C" { - - #if defined(__PYTHON_MODULE__) - - #define METHOD_HEAD(function) GENERIC_METHOD_HEAD(Entity,entity,function) - - DBoDestroyAttribute(PyEntity_destroy ,PyEntity) - - static PyObject* PyEntity_getCell ( PyEntity *self ) - { - Cell* cell = NULL; - HTRY - METHOD_HEAD( "Entity.getCell()" ) - cell = entity->getCell(); - HCATCH - return PyCell_Link( cell ); - } - - PyMethodDef PyEntity_Methods[] = - { { "getCell", (PyCFunction)PyEntity_getCell, METH_NOARGS - , "Returns the entity cell." } - , { "destroy", (PyCFunction)PyEntity_destroy, METH_NOARGS - , "Destroy associated hurricane object, the python object remains." } - , {NULL, NULL, 0, NULL} /* sentinel */ - }; - - - DBoDeleteMethod(Entity) - PyTypeObjectLinkPyType(Entity) - - #else // End of Python Module Code Part. - - PyObject* PyEntity_NEW ( Entity* entity ) - { - if (not entity) { - PyErr_SetString ( HurricaneError, "Invalid Entity (bad occurrence)" ); - return NULL; - } - - Horizontal* horizontal = dynamic_cast(entity); - if (horizontal) return PyHorizontal_Link( horizontal ); - - Vertical* vertical = dynamic_cast(entity); - if (vertical) return PyVertical_Link( vertical ); - - Contact* contact = dynamic_cast(entity); - if (contact) return PyContact_Link( contact ); - - Py_RETURN_NONE; - } - - PyTypeRootObjectDefinitions(Entity) - - #endif // Shared Library Code Part (1). - - } // extern "C". - - - #if !defined(__PYTHON_MODULE__) - - Hurricane::Entity* EntityCast ( PyObject* derivedObject ) { - if (IsPyHorizontal(derivedObject)) return PYHORIZONTAL_O(derivedObject); - if (IsPyVertical (derivedObject)) return PYVERTICAL_O(derivedObject); - if (IsPyContact (derivedObject)) return PYCONTACT_O(derivedObject); - return NULL; - } - - #endif // Shared Library Code Part (2). - - } // Isobar namespace. - -|newpage| - - -4.3 Intermediate Class Header -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Changes from :ref:`3.1 Class Associated Header File` are: - -#. As for ``PyEntity``, and because this is still an abstract class, - there is no ``PyComponent_Link()`` function. - -#. The definition of the ``PyComponent`` |struct| is differs. There is - no ``PyObject_HEAD`` (it is a Python *derived* class). The only - field is of the base class type ``PyEntity`` and for use with - Coriolis macros, **it must** be named ``_baseObject`` (note that - this is *not* a pointer but a whole object). - -.. code-block:: c++ - - #ifndef ISOBAR_PY_COMPONENT_H - #define ISOBAR_PY_COMPONENT_H - - #include "hurricane/isobar/PyEntity.h" - #include "hurricane/Component.h" - - namespace Isobar { - extern "C" { - - typedef struct { - PyEntity _baseObject; - } PyComponent; - - extern PyTypeObject PyTypeComponent; - extern PyMethodDef PyComponent_Methods[]; - extern void PyComponent_LinkPyType (); - - #define IsPyComponent(v) ((v)->ob_type == &PyTypeComponent) - #define PYCOMPONENT(v) ((PyComponent*)(v)) - #define PYCOMPONENT_O(v) (static_cast(PYCOMPONENT(v)->_baseObject._object)) - - } // extern "C". - } // Isobar namespace. - - #endif - - -4.4 Intermediate Class File -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Changes from :ref:`3.2 Class Associated File` are: - -1. Redefinition of the default macros ``ACCESS_OBJECT`` and ``ACCESS_CLASS``. - - * The pointer to the C++ encapsulated object (attribute ``_object``) is hold - by the base class ``PyEntity``. The ``ACCESS_OBJECT`` macro which is tasked - to give access to that attribute is then ``_baseObject._object`` as - ``PyComponent`` is a direct derived class of ``PyEntity``. - - * ``ACCESS_CLASS`` is similar to ``ACCESS_OBJECT`` for accessing the base - class, that is a pointer to ``PyEntity``. - -|newpage| - -2. For defining the ``PyTypeComponent`` Python type, we call a yet different - macro: ``PyTypeInheritedObjectDefinitions()``, dedicated to derived classes. - For this this macro we need to give as argument the derived class and the - base class. - -.. code-block:: c++ - - #include "hurricane/isobar/PyComponent.h" - #include "hurricane/isobar/PyNet.h" - - namespace Isobar { - using namespace Hurricane; - - extern "C" { - - #undef ACCESS_OBJECT - #undef ACCESS_CLASS - #define ACCESS_OBJECT _baseObject._object - #define ACCESS_CLASS(_pyObject) &(_pyObject->_baseObject) - #define METHOD_HEAD(function) GENERIC_METHOD_HEAD(Component,component,function) - - #if defined(__PYTHON_MODULE__) - - DirectGetLongAttribute(PyComponent_getX,getX,PyComponent,Component) - DirectGetLongAttribute(PyComponent_getY,getY,PyComponent,Component) - DBoDestroyAttribute(PyComponent_destroy,PyComponent) - - static PyObject* PyComponent_getNet ( PyComponent *self ) - { - Net* net = NULL; - HTRY - METHOD_HEAD( "Component.getNet()" ) - net = component->getNet( ); - HCATCH - return PyNet_Link( net ); - } - - PyMethodDef PyComponent_Methods[] = - { { "getX" , (PyCFunction)PyComponent_getX , METH_NOARGS - , "Return the Component X value." } - , { "getY" , (PyCFunction)PyComponent_getY , METH_NOARGS - , "Return the Component Y value." } - , { "getNet" , (PyCFunction)PyComponent_getNet , METH_NOARGS - , "Returns the net owning the component." } - , { "destroy", (PyCFunction)PyComponent_destroy, METH_NOARGS - , "destroy associated hurricane object, the python object remains." } - , {NULL, NULL, 0, NULL} /* sentinel */ - }; - - DBoDeleteMethod(Component) - PyTypeObjectLinkPyType(Component) - - #else // Python Module Code Part. - - PyTypeInheritedObjectDefinitions(Component, Entity) - - #endif // Shared Library Code Part. - - } // extern "C". - } // Isobar namespace. - - -4.5 Terminal Class Header -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The contents of this file is almost identical to `4.3 Intermediate Class Header`_, -save for the presence of a ``PyContact_Link()`` function. She is present -at this level because the class is a concrete one and can be instanciated. - -.. code-block:: c++ - - #ifndef ISOBAR_PY_CONTACT_H - #define ISOBAR_PY_CONTACT_H - - #include "hurricane/isobar/PyComponent.h" - #include "hurricane/Contact.h" - - namespace Isobar { - extern "C" { - - typedef struct { - PyComponent _baseObject; - } PyContact; - - extern PyTypeObject PyTypeContact; - extern PyMethodDef PyContact_Methods[]; - extern PyObject* PyContact_Link ( Hurricane::Contact* object ); - extern void PyContact_LinkPyType (); - - #define IsPyContact(v) ( (v)->ob_type == &PyTypeContact ) - #define PYCONTACT(v) ( (PyContact*)(v) ) - #define PYCONTACT_O(v) ( PYCONTACT(v)->_baseObject._baseObject._object ) - - } // extern "C". - } // Isobar namespace. - - #endif // ISOBAR_PY_CONTACT_H - - -4.6 Terminal Class File -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Changes from `4.4 Intermediate Class File`_ are: - -#. As previously, we have to redefine the macros ``ACCESS_OBJECT`` and ``ACCESS_CLASS``. - But, as we are one level deeper into the hierarchy, one more level of - indirection using ``_baseObject`` must be used. - - * ``ACCESS_OBJECT`` becomes ``_baseObject._baseObject._object``. - - * ``ACCESS_CLASS`` becomes ``&(_pyObject->_baseObject._baseObject)``. - -#. For defining the ``PyTypeContact`` Python type, we call again - ``PyTypeInheritedObjectDefinitions()``. It is the same whether the class is - terminal or not. - -#. And, this time, as the Python class is concrete, we call the macro - ``DBoLinkCreateMethod()`` to create the ``PyContact_Link()`` function. - - -.. code-block:: c++ - - #include "hurricane/isobar/PyContact.h" - - namespace Isobar { - using namespace Hurricane; - - extern "C" { - - #undef ACCESS_OBJECT - #undef ACCESS_CLASS - #define ACCESS_OBJECT _baseObject._baseObject._object - #define ACCESS_CLASS(_pyObject) &(_pyObject->_baseObject._baseObject) - #define METHOD_HEAD(function) GENERIC_METHOD_HEAD(Contact,contact,function) - - #if defined(__PYTHON_MODULE__) - - DirectGetLongAttribute(PyContact_getWidth , getWidth , PyContact,Contact) - DirectGetLongAttribute(PyContact_getHeight, getHeight, PyContact,Contact) - DBoDestroyAttribute(PyContact_destroy, PyContact) - - static PyObject* PyContact_create ( PyObject*, PyObject *args ) - { - Contact* contact = NULL; - HTRY - // Usual signature then arguments parsing. - HCATCH - return PyContact_Link(contact); - } - - PyMethodDef PyContact_Methods[] = - { { "create" , (PyCFunction)PyContact_create , METH_VARARGS|METH_STATIC - , "Create a new Contact." } - , { "destroy" , (PyCFunction)PyContact_destroy , METH_NOARGS - , "Destroy associated hurricane object, the python object remains." } - , { "getWidth" , (PyCFunction)PyContact_getWidth , METH_NOARGS - , "Return the contact width." } - , { "getHeight", (PyCFunction)PyContact_getHeight, METH_NOARGS - , "Return the contact height." } - , {NULL, NULL, 0, NULL} /* sentinel */ - }; - - DBoDeleteMethod(Contact) - PyTypeObjectLinkPyType(Contact) - - #else // Python Module Code Part. - - DBoLinkCreateMethod(Contact) - PyTypeInheritedObjectDefinitions(Contact, Component) - - #endif // Shared Library Code Part. - - } // extern "C". - } // Isobar namespace. - - -4.8 Python Module -~~~~~~~~~~~~~~~~~~~ - -.. code-block:: c++ - - DL_EXPORT(void) initHurricane () - { - PyEntity_LinkPyType(); // step 1. - PyComponent_LinkPyType(); - PyContact_LinkPyType(); - - PYTYPE_READY( Entity ) // step 2. - PYTYPE_READY_SUB( Component, Entity ) - PYTYPE_READY_SUB( Contact , Component ) - - __cs.addType( "ent" , &PyTypeEntity , "" , false ); // step 3. - __cs.addType( "comp" , &PyTypeComponent, "", false, "ent" ); - __cs.addType( "contact", &PyTypeContact , "" , false, "comp" ); - - PyObject* module = Py_InitModule( "Hurricane", PyHurricane_Methods ); - if (module == NULL) { - cerr << "[ERROR]\n" - << " Failed to initialize Hurricane module." << endl; - return; - } - - Py_INCREF( &PyTypeContact ); // step 4. - PyModule_AddObject( module, "Contact", (PyObject*)&PyTypeContact ); // step 4. - } diff --git a/documentation/_build/html/_sources/PythonCpp/DBoStandalone.txt b/documentation/_build/html/_sources/PythonCpp/DBoStandalone.txt deleted file mode 100644 index 36cdb46e..00000000 --- a/documentation/_build/html/_sources/PythonCpp/DBoStandalone.txt +++ /dev/null @@ -1,395 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -3. Case 1 - DBo Derived, Standalone -====================================== - -As example, we take ``Library``. This a ``DBo`` derived class, but we -choose not to export the parent classes. From Python, it will appear -as a base class. - -.. _3.1: - -.. _3.1 Class Associated Header File: - -3.1 Class Associated Header File -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is the typical content of a header file (for ``PyLibrary``): - -.. code-block:: c++ - - #ifndef PY_LIBRARY_H - #define PY_LIBRARY_H - - #include "hurricane/isobar/PyHurricane.h" - #include "hurricane/Library.h" - - namespace Isobar { - using namespace Hurricane; - - extern "C" { - - typedef struct { - PyObject_HEAD - Library* _object; - } PyLibrary; - - extern PyTypeObject PyTypeLibrary; - extern PyMethodDef PyLibrary_Methods[]; - extern PyObject* PyLibrary_Link ( Hurricane::Library* lib ); - extern void PyLibrary_LinkPyType (); - - - #define IsPyLibrary(v) ( (v)->ob_type == &PyTypeLibrary ) - #define PYLIBRARY(v) ( (PyLibrary*)(v) ) - #define PYLIBRARY_O(v) ( PYLIBRARY(v)->_object ) - - } // extern "C". - } // Isobar namespace. - - #endif // PY_LIBRARY_H - - -The code is organized as follow: - -1. It must have, *as the first include* ``PyHurricane.h``, which provides - the complete bunch of macros needed to build the module. Then the include - of the C++ class we want to wrap (``Library.h``). - -2. As Python is written in C, all the wrapper code has to be but inside - an ``extern "C"`` namespace. - -3. Definition of the wrapped |struct|, ``PyLibrary``. It is standard Python here. - - .. note:: - For our set of macros to work, the name of the pointer to the - C++ class must always be **_object**, and the various functions and - macros defined here must take the name of the class (either in - lowercase, camel case or capitals). - -4. Declaration of the Python type ``PyTypeLibrary`` (standard). - -5. Declaration of the Python type table of methods ``PyLibrary_Methods`` (standard). - -.. _3.6: - -6. Declaration of ``PyLibrary_Link()``, helper to convert a C++ ``Lybrary`` into - a ``PyLibrary`` (put in the support shared library). - -7. Declaration of ``PyLibrary_LinkPyType()``, this function setup the class-level - function of the new Python type (here, ``PyTypeLibrary``). - -8. And, lastly, three macros to: - - * ``IsPylibrary()``, know if a Python object is a ``PyLibrary`` - * ``PYLIBRARY()``, force cast (C style) of a ``PyObject`` into a ``PyLibrary``. - * ``PYLIBRARY_O()``, extract the C++ object (``Library*``) from the Python - object (``PyLibrary``). - - -.. _3.2 Class Associated File: - -3.2 Class Associated File -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -3.2.1 Head of the file ------------------------- - -.. code-block:: c++ - - #include "hurricane/isobar/PyLibrary.h" - #include "hurricane/isobar/PyDataBase.h" - #include "hurricane/isobar/PyCell.h" - - namespace Isobar { - using namespace Hurricane; - - extern "C" { - - #define METHOD_HEAD(function) GENERIC_METHOD_HEAD(Library,lib,function) - -As for the header, all the code must be put inside a ``extern "C"`` namespace. - -A convenience macro ``METHOD_HEAD()`` must be defined, by refining -``GENERIC_METHOD_HEAD()``. This macro will be used in the method wrappers -below to cast the ``_object`` field of the Python object into the -appropriate C++ class, this is done using a C-style cast. -The parameters of that macro are: - -#. The C++ encapsulated class (``Library``). -#. The name of the *variable* that will be used to store a pointer - to the C++ working object. -#. The name of the C++ method which is to be wrapped. - - -3.2.2 The Python Module Part ------------------------------- - -First, we have to build all the wrappers to the C++ methods of -the class. For common predicates, accessors, and mutators macros -are supplied. - -Wrapping of the ``Library::getCell()`` method: - -.. code-block:: c++ - - static PyObject* PyLibrary_getCell ( PyLibrary* self, PyObject* args ) - { - Cell* cell = NULL; - - HTRY - METHOD_HEAD( "Library.getCell()" ) - char* name = NULL; - if (PyArg_ParseTuple(args,"s:Library.getCell", &name)) { - cell = lib->getCell( Name(name) ); - } else { - PyErr_SetString( ConstructorError - , "invalid number of parameters for Library::getCell." ); - return NULL; - } - HCATCH - - return PyCell_Link(cell); - } - -Key points about this method wrapper: - -#. The ``HTRY`` / ``HCATCH`` macros provides an insulation from the C++ - exceptions. If one is emitted, it will be catched and transformed in - a Python one. This way, the Python program will be cleanly interrupted - and the usual stack trace displayed. - -#. The returned value of this method is of type ``Cell*``, we have to - transform it into a Python one. This is done with ``PyCell_Link()``. - This macro is supplied by the ``PyCell.h`` header and this is why - it must be included. - -|newpage| - - -Wrapping of the ``Library::create()`` method: - -.. code-block:: c++ - - static PyObject* PyLibrary_create( PyObject*, PyObject* args ) - { - PyObject* arg0; - PyObject* arg1; - Library* library = NULL; - - HTRY - __cs.init( "Library.create" ); // Step (1). - if (not PyArg_ParseTuple( args, "O&O&:Library.create" - , Converter, &arg0 - , Converter, &arg1 )) { // Step (2). - PyErr_SetString( ConstructorError - , "invalid number of parameters for Library constructor." ); - return NULL; - } - if (__cs.getObjectIds() == ":db:string") { // Step (3.a) - DataBase* db = PYDATABASE_O(arg0); - library = Library::create( db, Name(PyString_AsString(arg1)) ); - } else if (__cs.getObjectIds() == ":library:string") { // Step (3.b) - Library* masterLibrary = PYLIBRARY_O(arg0); - library = Library::create( masterLibrary, Name(PyString_AsString(arg1)) ); - } else { - PyErr_SetString( ConstructorError - , "invalid number of parameters for Library constructor." ); - return NULL; - } - HCATCH - - return PyLibrary_Link( library ); - } - -Key point about this constructor: - -#. We want the Python interface to mimic as closely as possible the - C++ API. As such, Python object will be created using a static - ``.create()`` method. So we do not use the usual Python allocation - mechanism. - -#. As it is a *static* method, there is no first argument. - -#. Python do not allow function overload like C++. To emulate that - behavior we use the ``__cs`` object (which is a global variable). - - #. Init/reset the ``__cs`` object: see *step (1)*. - - #. Call ``PyArg_ParseTuple()``, read every mandatory or optional - argument as a Python object (``"O&"``) and use ``Converter`` - on each one. ``Converter`` will determine the real type of - the Python object given as argument by looking at the - encapsulated C++ class. It then update the ``__cs`` object. - Done in *step (2)* - - #. After the call to ``PyArg_ParseTuple()``, the function - ``__cs.getObjectIds()`` will return the *signature* of - the various arguments. In our case, the valid signatures - will be ``":db:string"`` (*step (3.a)*a) and ``":library:string"`` - (*step (3.b)*). - - #. Call the C++ method after extracting the C++ objects from - the Python arguments. Note the use of the ``PYLIBRARY_O()`` - and ``PYDATABSE_O()`` macros to perform the conversion. - -#. Return the result, encapsulated through a call to ``PyLibrary_Link()``. - -|newpage| - - -Wrapping of the ``Library::destroy()`` method: - -.. code-block:: c++ - - DBoDestroyAttribute(PyLibrary_destroy, PyLibrary) - -For C++ classes **that are derived** from ``DBo``, the destroy method -wrapper must be defined using the macro ``DBoDestroyAttribute()``. -This macro implements the bi-directional communication mechanism -using ``Hurricane::Property``. It **must not** be used for -non ``DBo`` derived classes. - - -Defining the method table of the PyLibrary type: - -.. code-block:: c++ - - PyMethodDef PyLibrary_Methods[] = - { { "create" , (PyCFunction)PyLibrary_create , METH_VARARGS|METH_STATIC - , "Creates a new library." } - , { "getCell" , (PyCFunction)PyLibrary_getCell, METH_VARARGS - , "Get the cell of name " } - , { "destroy" , (PyCFunction)PyLibrary_destroy, METH_NOARGS - , "Destroy associated hurricane object The python object remains." } - , {NULL, NULL, 0, NULL} /* sentinel */ - }; - - -This is standard Python/C API. The name of the ``PyMethodDef`` table must be -named from the class: ``PyLibrary_Methods``. - - -3.2.3 Python Type Linking ---------------------------- - -Defining the ``PyTypeLibrary`` class methods and the type linking function. - -Those are the functions for the Python object itself to work, not the -wrapped method from the C++ class. - -.. note:: - At this point we **do not** define the ``PyTypeLibrary`` itself. - Only it's functions and a function to set them up *once* the - type will be defined. - -.. code-block:: c++ - - DBoDeleteMethod(Library) - PyTypeObjectLinkPyType(Library) - - -The macro ``DBoDeleteMethod()`` define the function to delete a -``PyLibrary`` *Python* object. Again, do not mistake it for the deletion -of the C++ class (implemented by ``DBoDestroyAttribute()``). -Here again, ``DBoDeleteMethod()`` is specially tailored for -``DBo`` derived classes. - -.. _PyLibrary_LinkPyType(): - -To define ``PyLibrary_LinkPyType()``, use the ``PyTypeObjectLinkPyType()`` -macro. This macro is specific for ``DBo`` derived classes that are seen as -base classes under Python (i.e. we don't bother exposing the base -class under Python). ``PyLibrary_LinkPyType()`` setup the class functions -in the ``PyTypeLibrary`` type object, it **must** be called in the -Python module this class is part of (in this case: ``PyHurricane.cpp``). -This particular flavor of the macro *will define* and setup the -following class functions: - -* ``PyTypeLibrary.tp_compare`` (defined by the macro). -* ``PyTypeLibrary.tp_repr`` (defined by the macro). -* ``PyTypeLibrary.tp_str`` (defined by the macro). -* ``PyTypeLibrary.tp_hash`` (defined by the macro). -* ``PyTypeLibrary.tp_methods`` sets to the previously defined ``PyLibrary_Methods`` table. -* ``PyTypeLibrary.tp_dealloc`` is set to a function that *must* be named ``PyLibrary_DeAlloc``, - this is what ``DBoDeleteMethod`` does. It is *not* done by ``PyTypeObjectLinkPyType``. - -Defining the ``PyTypeLibrary`` type: - - -3.2.4 The Shared Library Part -------------------------------- - -This part will be put in a separate supporting shared library, allowing -other Python module to link against it (and make use of its symbols). - -.. code-block:: c++ - - DBoLinkCreateMethod(Library) - PyTypeObjectDefinitions(Library) - - -To define ``PyTypeLibrary``, use the ``PyTypeObjectDefinitions()`` macro. -This macro is specific for classes that, as exposed by Python, -are neither *derived* classes nor *base* classes for others. -That is, they are standalone from the inheritance point of view. - -The ``DBoLinkCreateMethod()`` macro will define the ``PyLibrary_Link()`` -function which is responsible for encapsulating a C++ ``Library`` object -into a Python ``PyLibrary`` one. - - -3.3 Python Module (C++ namespace) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -We use the Python module to replicate the C++ *namespace*. Thus, for the -``Hurricane`` namespace we create a Python ``Hurricane`` module which is -defined in the ``PyHurricane.cpp`` file, then we add into that module -dictionary all the Python types encapsulating the C++ classes of that -namespace. - -.. code-block:: c++ - - DL_EXPORT(void) initHurricane () - { - PyLibrary_LinkPyType(); // step 1. - - PYTYPE_READY( Library ) // step 2. - - __cs.addType( "library", &PyTypeLibrary, "", false ); // step 3. - - PyObject* module = Py_InitModule( "Hurricane", PyHurricane_Methods ); - if (module == NULL) { - cerr << "[ERROR]\n" - << " Failed to initialize Hurricane module." << endl; - return; - } - - Py_INCREF( &PyTypeLibrary ); // step 4. - PyModule_AddObject( module, "Library", (PyObject*)&PyTypeLibrary ); // step 4. - } - -The ``initHurricane()`` initialisation function shown above has -been scrubbed of everything not relevant to the ``PyLibrary`` class. -The integration of the ``PyLibrary`` class into the module needs -four steps: - -#. A call to `PyLibrary_LinkPyType()`_ to hook the Python type functions - in the Python type object. - -#. A call to the ``PYTYPE_READY()`` macro (standard Python). - -#. Registering the type into the ``__cs`` object, with ``addType()``. - The arguments are self explanatory, save for the last which is a - boolean to tell if this is a *derived* class or not. - -#. Adding the type object (``PyTypeLibrary``) into the dictionnary of - the module itself. This allow to mimic closely the C++ syntax: - - .. code-block:: python - - import Hurricane - lib = Hurricane.Library.create( db, 'root' ) diff --git a/documentation/_build/html/_sources/PythonCpp/DbU.txt b/documentation/_build/html/_sources/PythonCpp/DbU.txt deleted file mode 100644 index 930e76d1..00000000 --- a/documentation/_build/html/_sources/PythonCpp/DbU.txt +++ /dev/null @@ -1,67 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -6. Encapsulating DbU -====================== - -While ``Hurricane::DbU`` is a class, the ``Hurricane::DbU::Unit`` is only -a ``typedef`` over ``uint64_t``. The ``DbU`` class only provides a set of -static methods to manipulate and convert to and from other units. -At Python level, ``DbU::Unit`` will be stored in plain ``long long``. - -When a ``DbU::Unit`` argument is expected in a Python functions, just use -the ``DbU::Unit PyAny_AsLong( PyObject* )`` function to convert it. - -For example, if we explicit the expension of: - -.. code-block:: c++ - - DirectSetLongAttribute(PyPoint_SetX,setX,PyPoint,Point) - -|newpage| - -We would get: - -.. code-block:: c++ - - static PyObject* PyPoint_setX ( PyPoint *self, PyObject* args ) - { - Point* cobject = static_cast( self->_object ); - if (cobject == NULL) { - PyErr_SetString( ProxyError - , "Attempt to call Point.setX() on an unbound Hurricane object" ); - return NULL; - } - - HTRY - PyObject* arg0 = NULL; - if (not PyArg_ParseTuple( args, "O:Point.setX()", &arg0 )) - return ( NULL ); - cobject->setX( Isobar::PyAny_AsLong(arg0) ); - HCATCH - Py_RETURN_NONE; - } - - -For the other way around, use ``PyObject* PyDbU_FromLong( DbU::Unit )``. - -.. code-block:: c++ - - DirectGetLongAttribute(PyPoint_GetX,getX,PyPoint,Point) - -We would get: - -.. code-block:: c++ - - static PyObject* PyPoint_GetX ( PyPoint *self, PyObject* args ) - { - Point* cobject = static_cast( self->_object ); - if (cobject == NULL) { - PyErr_SetString( ProxyError - , "Attempt to call Point.getX() on an unbound Hurricane object" ); - return NULL; - } - return Isobar::PyDbU_FromLong(cobject->getX()); - } diff --git a/documentation/_build/html/_sources/PythonCpp/Introduction.txt b/documentation/_build/html/_sources/PythonCpp/Introduction.txt deleted file mode 100644 index 5a3300e4..00000000 --- a/documentation/_build/html/_sources/PythonCpp/Introduction.txt +++ /dev/null @@ -1,185 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -1. Introduction -================= - -* This document is written for people already familiar with the - `Python/C API Reference Manual`_. - -* The macros provided by the Hurricane Python/C API are written using - the standard Python C/API. That is, you may not use them and write - directly your functions with the original API or any mix between. - You only have to respect some naming convention. - -* Coriolis is build against Python 2.7. - - -1.1 First, A Disclaimer -~~~~~~~~~~~~~~~~~~~~~~~~~ - -The Hurricane Python/C++ API has been written about ten years ago, at a time -my mastering of template programming was less than complete. This is why this -interface is build with old fashioned C macro instead of C++ template. - -It is my hope that at some point in the future I will have time to completly -rewrite it, borrowing the interface from ``boost::python``. - - -1.2 About Technical Choices -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Some would say, why not use *off the shelf* wrappers like ``swig`` -or ``boost::python``, here are some clues. - -#. **Partial exposure of the C++ class tree.** We expose at Python level - C++ base classes, only if they provides common methods that we want - to see. Otherwise, we just show them as base classes under Python. - For instance ``Library`` is derived from ``DBo``, but we won't see - it under Python. - -#. **Bi-directional communication.** When a Python object is deleted, the - wrapper obviously has a pointer toward the underlying C++ object and - is able to delete it. But, the reverse case can occurs, meaning that - you have a C++ object wrapped in Python and the database delete the - underlying object. The wrapped Python object *must* be informed that - it no longer refer a valid C++ one. Moreover, as we do not control - when Python objects gets deleteds (that is, when their reference count - reaches zero), we can have valid Python object with a dangling - C++ pointer. So our Python objects can be warned by the C++ objects - that they are no longer valid and any other operation than the - deletion should result in a severe non-blocking error. - - To be precise, this apply to persistent object in the C++ database, - like ``Cell``, ``Net``, ``Instance`` or ``Component``. Short lived - objects like ``Box`` or ``Point`` retains the classic Python behavior. - - Another aspect is that, for all derived ``DBo`` objects, one and only - one Python object is associated. For one given ``Instance`` object we - will always return the *same* ``PyInstance`` object, thanks to the - bi-directional link. Obviously, the *reference count* of the - ``PyInstance`` is managed accordingly. This mechanism is implemented - by the ``PyInstance_Link()`` function. - -#. **Linking accross modules.** As far as I understand, the wrappers - are for monolithic libraries. That is, you wrap the entire library - in one go. But Hurricane has a modular design, the core database - then various tools. We do not, and cannot, have one gigantic wrapper - that would encompass all the libraries in one go. We do one Python - module for one C++ library. - - This brings another issue, at Python level this time. The Python - modules for the libraries have to share some functions. Python - provides a mechanism to pass C function pointers accross modules, - but I did found it cumbersome. Instead, all our modules are split - in two: - - * The first part contains the classic Python module code. - * The second part is to be put in a separate dynamic library that - will hold the shared functions. The Python module is dynamically linked - against that library like any other. And any other Python module - requiring the functions will link against the associated shared - library. - - Each module file will be compiled *twice*, once to build the Python - module (``__PYTHON_MODULE`` is defined) and once to build the supporting - shared library (``__PYTHON_MODULE__`` **not** defined). This tricky - double compilation is taken care of though the ``add_python_module`` - ``cmake`` macro. - - For the core Hurricane library we will have: - - * ``Hurricane.so`` the Python module (use with: ``import Hurricane``). - * ``libisobar.so.1.0`` the supporting shared library. - - The ``PyLibrary.cpp`` file will have the following structure: - - .. code-block:: c++ - - #include "hurricane/isobar/PyLibrary.h" - - namespace Isobar { - - extern "C" { - - #if defined(__PYTHON_MODULE__) - - // +=================================================================+ - // | "PyLibrary" Python Module Code Part | - // +=================================================================+ - // - // The classic part of a Python module. Goes into Hurricane.so. - - - #else // End of Python Module Code Part. - - // x=================================================================x - // | "PyLibrary" Shared Library Code Part | - // x=================================================================x - // - // Functions here will be part of the associated shared library and - // made available to all other Python modules. Goes into libisobar.so.1.0 - - - # endif // Shared Library Code Part. - - } // extern "C". - - } // Isobar namespace. - - - This way, we do not rely upon a pointer transmission through Python - modules, but directly uses linker capabilities. - - -1.3 Botched Design -~~~~~~~~~~~~~~~~~~~~ - -The mechanism to compute the signature of a call to a Python function, -the ``__cs`` object, is much too complex and, in fact, not needed. -At some point I may root it out, but it is used in so many places... - -What I should have used the ``"O!"`` capablity of ``PyArg_ParseTuple()``, -like in the code below: - -|newpage| - -.. code-block:: c++ - - static PyObject* PyContact_create ( PyObject*, PyObject *args ) - { - Contact* contact = NULL; - HTRY - PyNet* pyNet = NULL; - PyLayer* pyLayer = NULL; - PyComponent* pyComponent = NULL; - DbU::Unit x = 0; - DbU::Unit y = 0; - DbU::Unit width = 0; - DbU::Unit height = 0; - - if (PyArg_ParseTuple( args, "O!O!ll|ll:Contact.create" - , &PyTypeNet , &pyNet - , &PyTypeLayer, &pyLayer - , &x, &y, &width, &height)) { - contact = Contact::create( PYNET_O(pyNet), PYLAYER_O(pyLayer) - , x, y, width, height ); - } else { - PyErr_Clear(); - if (PyArg_ParseTuple( args, "O!O!ll|ll:Contact.create" - , &PyTypeComponent, &pyComponent - , &PyTypeLayer , &pyLayer - , &x, &y, &width, &height)) { - contact = Contact::create( PYCOMPONENT_O(pyComponent), PYLAYER_O(pyLayer) - , x, y, width, height ); - } else { - PyErr_SetString( ConstructorError - , "invalid number of parameters for Contact constructor." ); - return NULL; - } - } - HCATCH - return PyContact_Link( contact ); - } diff --git a/documentation/_build/html/_sources/PythonCpp/Name.txt b/documentation/_build/html/_sources/PythonCpp/Name.txt deleted file mode 100644 index bb4470e8..00000000 --- a/documentation/_build/html/_sources/PythonCpp/Name.txt +++ /dev/null @@ -1,9 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -7. No C++ Hurricane::Name encapsulation -========================================== - -To be written. diff --git a/documentation/_build/html/_sources/PythonCpp/NonDBo.txt b/documentation/_build/html/_sources/PythonCpp/NonDBo.txt deleted file mode 100644 index db9f570a..00000000 --- a/documentation/_build/html/_sources/PythonCpp/NonDBo.txt +++ /dev/null @@ -1,171 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -5. Case 3 - Non-DBo Standalone Classe -======================================= - -Let's have a look at the encapsulation of ``Hurricane::Point``. - -Non-BDo derived classes do not support the bi-directionnal communication. -So each Python object is associated with one C++ object. The C++ object -is created and deleted along with the Python one. This behavior implies -that the C++ object is *copy constructible* (which should be the case). - - -5.1 Class Header -~~~~~~~~~~~~~~~~~~ - -Changes from :ref:`3.1 Class Associated Header File`: - -* There is no ``PyPoint_Link()`` function, as it's related to the - bi-directional communication mechanism. - -.. note:: - **About the _object attribute** of the PyPoint. As the C++ object life span - (``Point``) is linked to the Python (``PyPoint``) one, we may have used a - value instead of a pointer. It is best to keep a pointer as the macros - written for ``DBo`` derived classes will remain usables. - - -.. code-block:: c++ - - #ifndef ISOBAR_PY_POINT_H - #define ISOBAR_PY_POINT_H - - #include "hurricane/isobar/PyHurricane.h" - #include "hurricane/Point.h" - - namespace Isobar { - extern "C" { - - typedef struct { - PyObject_HEAD - Hurricane::Point* _object; - } PyPoint; - - extern PyTypeObject PyTypePoint; - extern PyMethodDef PyPoint_Methods[]; - extern void PyPoint_LinkPyType(); - - #define IsPyPoint(v) ( (v)->ob_type == &PyTypePoint ) - #define PYPOINT(v) ( (PyPoint*)(v) ) - #define PYPOINT_O(v) ( PYPOINT(v)->_object ) - - } // extern "C". - } // Isobar namespace. - - #endif // ISOBAR_PY_POINT_H - -|newpage| - - -5.2 Class File -~~~~~~~~~~~~~~~~ - -Changes from :ref:`3.2 Class Associated File`: - -* As there is no ``PyPoint_Link()`` function, there is no call to any - flavor of the ``DBoLinkcreatemethod()`` macro (obvious as it's *not* - a ``DBo``). - -* To use the standard Python constructor, we have to define ``PyPoint_NEW()`` - and ``PyPoint_Init()`` functions, I'm not absolutely certain that the later - needs to be defined (that part is still not clear to me from the Python doc). - -* As it's not a ``DBo`` there is no ``destroy()`` method, so no call to - ``DirectDestroyMethod()`` - -* Lastly, as this object has a ``PyPoint_NEW()`` (field ``tp_new``) and - a ``PyPoint_Init()`` (field ``tp_init``) we have to use the macro - ``PyTypeObjectLinkPyTypeNewInit()`` to define ``PyPoint_LinkPyType()``. - - -.. code-block:: c++ - - #include "hurricane/isobar/PyPoint.h" - - namespace Isobar { - using namespace Hurricane; - - extern "C" { - - #define METHOD_HEAD(function) GENERIC_METHOD_HEAD(Point,point,function) - - #if defined(__PYTHON_MODULE__) - - static PyObject* PyPoint_NEW ( PyObject* module, PyObject *args ) - { - Point* point = NULL; - HTRY - PyObject* arg0 = NULL; - PyObject* arg1 = NULL; - - __cs.init( "Point.Point" ); - if (not PyArg_ParseTuple( args,"|O&O&:Point.Point" - , Converter,&arg0 - , Converter,&arg1 )) { - PyErr_SetString ( ConstructorError - , "invalid number of parameters for Point constructor." ); - return NULL; - } - - if (__cs.getObjectIds() == "") - { point = new Point()); } - else if (__cs.getObjectIds() == ":point") - { point = new Point( *PYPOINT_O(arg0) ); } - else if (__cs.getObjectIds() == ":int:int") - { point = new Point( PyAny_AsLong(arg0), PyAny_AsLong(arg1) ); } - else { - PyErr_SetString ( ConstructorError - , "invalid number of parameters for Point constructor." ); - return NULL; - } - - PyPoint* pyPoint = PyObject_NEW( PyPoint, &PyTypePoint ); - if (pyPoint == NULL) { delete point; return NULL; } - pyPoint->_object = point; - HCATCH - - return (PyObject*)pyPoint; - } - - static int PyPoint_Init ( PyPoint* self, PyObject* args, PyObject* kwargs ) - { return 0; } - - DirectGetLongAttribute(PyPoint_getX,getX,PyPoint,Point) - DirectGetLongAttribute(PyPoint_getY,getY,PyPoint,Point) - DirectSetLongAttribute(PyPoint_SetX,setX,PyPoint,Point) - DirectSetLongAttribute(PyPoint_SetY,setY,PyPoint,Point) - - PyMethodDef PyPoint_Methods[] = - { { "getX" , (PyCFunction)PyPoint_getX , METH_NOARGS - , "Return the Point X value." } - , { "getY" , (PyCFunction)PyPoint_getY , METH_NOARGS - , "Return the Point Y value." } - , { "setX" , (PyCFunction)PyPoint_SetX , METH_VARARGS - , "Modify the Point X value." } - , { "setY" , (PyCFunction)PyPoint_SetY , METH_VARARGS - , "Modify the Point Y value." } - , {NULL, NULL, 0, NULL} /* sentinel */ - }; - - DirectDeleteMethod(PyPoint_DeAlloc,PyPoint) - PyTypeObjectLinkPyTypeNewInit(Point) - - #else // Python Module Code Part. - - PyTypeObjectDefinitions(Point) - - #endif // Shared Library Code Part. - - } // extern "C". - } // Isobar namespace. - - -5.2 Class File -~~~~~~~~~~~~~~~~ - -To put it bluntly, there is no difference in the Python module for -a standalone ``DBo`` class and a non-``DBo`` class. diff --git a/documentation/_build/html/_sources/PythonCpp/index.txt b/documentation/_build/html/_sources/PythonCpp/index.txt deleted file mode 100644 index cb5575c2..00000000 --- a/documentation/_build/html/_sources/PythonCpp/index.txt +++ /dev/null @@ -1,23 +0,0 @@ -.. -*- mode: rst; explicit-buffer-name: "index.rst" -*- - -.. include:: ../etc/definitions.rst - - -=================================== -Hurricane Python/C++ API Tutorial -=================================== - -Printable version of this document `PythonCpp.pdf <../../../pdf/main/PythonCpp.pdf>`_. - - -.. toctree:: - :maxdepth: 2 - - Introduction.rst - Configuration.rst - DBoStandalone.rst - DBoHierarchy.rst - NonDBo.rst - DbU.rst - Name.rst - diff --git a/documentation/_build/html/_sources/PythonTutorial/AdvancedTopics.txt b/documentation/_build/html/_sources/PythonTutorial/AdvancedTopics.txt deleted file mode 100644 index 89045f34..00000000 --- a/documentation/_build/html/_sources/PythonTutorial/AdvancedTopics.txt +++ /dev/null @@ -1,36 +0,0 @@ -.. -*- Mode: rst -*- -.. include:: ../etc/definitions.rst -.. include:: ./definitions.rst - - -9. Advanced Topics -================== - -This is a place holder as well as a reminder to myself to write this part of -the documentation. - - -9.1 Occurrence -~~~~~~~~~~~~~~ - -The trans-hierarchical workhorse. - - -9.2 RoutingPads -~~~~~~~~~~~~~~~ - -Unlike the Plugs_ that only make connections between two **adjacent** -hierarchical levels, RoutingPads_ can refer to a deeply buried terminal. - - -9.3 HyperNets -~~~~~~~~~~~~~ - -This class is part of the *virtual flattening* mechanism, it allows to -go through all the components of a trans-hierarchical net. - - -9.4 Miscellaeous trans-hierarchical functions -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -For a starter, how to get all the leaf cells... diff --git a/documentation/_build/html/_sources/PythonTutorial/CellNetComponent.txt b/documentation/_build/html/_sources/PythonTutorial/CellNetComponent.txt deleted file mode 100644 index f0d38e72..00000000 --- a/documentation/_build/html/_sources/PythonTutorial/CellNetComponent.txt +++ /dev/null @@ -1,338 +0,0 @@ -.. -*- Mode: rst -*- -.. include:: ../etc/definitions.rst -.. include:: ./definitions.rst - - - -3. Making a Standard Cell -- Layout -=================================== - -In this part, we will show how to create and save a terminal Cell_, -that is, a cell without instances (the end point of a hierarchical -design). To illustrate the case we will draw the layout of a -standard cell. - -We will introduce the following classes : Cell_, Net_, Component_ -and its derived classes. - - -3.1 The AllianceFramework (CRL Core) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The |Hurricane| database only manages objects in memory. To load or save -something from the outside, we need to use a *framework*. As of today, only -one is available : the Alliance framework. It allows |Coriolis| to handle -|Alliance| libraries and cells in the exact same way. - -.. note:: To see how the AllianceFramework_ is configured for your - installation, please have a look to ``alliance.conf`` in the - ``etc/coriolis2`` directory. It must contains the same settings - as the various ``MBK_`` variables used for |Alliance|. - - -3.2 Session Mechanism (Hurricane) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In the |Hurricane| database, all modifications must take place inside -an UpdateSession_. At the closing of a session, created or modificated -objects are fully inserted in the database. This is especially true for -the visualisation, a created component will be visible *only* only after -the session close. - -.. note:: See ``QuadTree`` and ``Query``. - - -3.3 Creating a new Cell (CRL Core) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The creation of a new Cell_ occurs through the AllianceFramework_, -and, as stated above, inside a UpdateSession_. The AllianceFramework_ -environment is provided by the |CRL| module. - -.. code-block:: Python - - from Hurricane import * - from CRL import * - - af = AllianceFramework.get() - UpdateSession.open() - - cell = af.createCell( 'my_inv' ) - - # Build then save the Cell. - - UpdateSession.close() - - -This is the simplest call to ``createCell()``, and in that case, the newly -created Cell_ will be saved in the *working library* (usually, the current -directory). You may supply a second argument telling into which library -you want the Cell_ to be created. - -In the |Hurricane| Cell_ object, there is no concept of *view*, it contains -completly fused logical (netlist) and physical (layout) views. - - -3.4 The DbU Measurement Unit -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -All coordinates in the |Hurricane| database are expressed in DbU_ -(for *Database Unit*) which are integer numbers of foundry grid. -To be more precise, they are fixed points numbers expressed in -hundredth of foundry grid (to allow transient non-integer -computation). - -To work with symbolic layout, that is, using lambda based lengths, -two conversion functions are provided: - -* ``unit = DbU.fromLambda( lbd )`` convert a lambda :cb:`lbd` into a ``DbU``. -* ``lbd = DbU.toLambda( unit )`` convert a ``DbU`` into a lambda :cb:`lbd`. - -In the weakly typed |Python| world, :cb:`lbd` is *float* while :cb:`unit` -is *integer*. - - -3.5 Setting up the Abutment Box -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To setup the abutment box, we use a Box_ which defines a box from -the coordinates of the lower left corner ``(x1,y1)`` and upper left -corner ``(x2,y2)``. - -.. code-block:: Python - - b = Box( DbU.fromLambda( 0.0) # x1 - , DbU.fromLambda( 0.0) # y1 - , DbU.fromLambda(15.0) # x2 - , DbU.fromLambda(50.0) ) # y2 - cell.setAbutmentBox( b ) - -Or more simply: - -.. code-block:: Python - - cell.setAbutmentBox( Box( DbU.fromLambda( 0.0) - , DbU.fromLambda( 0.0) - , DbU.fromLambda(15.0) - , DbU.fromLambda(50.0) ) ) - - -3.6 Adding Nets and Components -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In the |Hurricane| terminology, a **component** is any kind of physical object -among: - -* Contact_ -* Pad_ -* RoutingPad_ -* Horizontal_ -* Vertical_ -* Plug_ is the only exception and will be detailed later (see ??). - -Components_ cannot be created *alone*. They must be part of a Net_. - - -3.6.1 Getting a Layer ---------------------- - -As physical elements, Components_ are created using a Layer_. So prior to -their creation, we must get one from the database. Layers_ are stored in the -Technology_, which in turn, is stored in the DataBase_. So, to get a -Layer_: - -.. code-block:: Python - - layer = DataBase.getDB().getTechnology().getLayer( 'METAL1' ) - - -.. note:: **Convention for layer names.** As the database can manage both real layers - and symbolic ones we adopt the following convention: - - * **Real layers** are named in lowercase (``metal1``, ``nwell``). - * **Symbolic layers** are named in uppercase (``METAL1``, ``NWELL``). - - -3.6.2 Creating a Net --------------------- - -As said above, prior to creating any Component_, we must create the Net_ it -will belong to. In that example we also make it an *external* net, that is, -a part of the interface. Do not mistake the name of the net given as a string -argument :cb:`'i'` and the name of the *variable* :cb:`i` holding the Net_ object. -For the sake of clarity we try to give the variable a close name, but this is -not mandatory. - -.. code-block:: Python - - i = Net.create( cell, 'i' ) - i.setExternal( True ) - -.. note:: Unlike some other database models, in |Hurricane|, - **there is no explicit terminal object**, you only need to make the - net external. For more information about how to connect to an - external net, see `6.2 Creating Nets and connecting to Instances`_. - - -3.6.3 Creating a Component --------------------------- - -Finally, we get ready to create a Component_, we will make a Vertical_ segment -of ``METAL1``. - -.. code-block:: Python - - segment = Vertical.create( i # The owner Net. - , layer # The layer. - , DbU.fromLambda( 5.0 ) # The X coordinate. - , DbU.fromLambda( 2.0 ) # The width. - , DbU.fromLambda( 10.0 ) # The Y source coordinate. - , DbU.fromLambda( 40.0 ) ) # The Y target coordinate. - -With this overload of the ``Vertical.create()`` function the segment is created at an -absolute position. There is a second overload for creating a relatively placed -segment, see *articulated layout*. - -If the net is external, that is, part of the interface of the cell, you may have -to declare some of its components as physical connectors usable by the router. -This is done by calling the NetExternalComponents_ class: - -.. code-block:: Python - - NetExternalComponents.setExternal( segment ) - - -3.7 Saving to Disk (CRL Core) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Once you have finished to build your cell, you have to save it on disk. -Using the AllianceFramework_ you can save it as a pair of file: - -========================= =================================== ======================= -View Flag File extension -========================= =================================== ======================= -Logical / Netlist ``Catalog.State.Logical`` ``.vst`` -Physical / Layout ``Catalog.State.Physical`` ``.ap`` -========================= =================================== ======================= - -To save both views, use the ``Catalog.State.Views`` flag. The files -will be written in the |Alliance| ``WORK_DIR``. - -.. code-block:: Python - - af.saveCell( cell, Catalog.State.Views ) - - -3.8 The Complete Example File -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The example files can be found in the ``share/doc/coriolis2/examples/scripts/`` -directory (under the the root of the |Coriolis| installation). - -The code needed to run it through the |cgt| viewer has been added. For the -explanation of that part of the code, refer to `5. Make a script runnable through cgt`_. - - -.. code-block:: Python - - #!/usr/bin/python - - import sys - from Hurricane import * - from CRL import * - - - def toDbU ( l ): return DbU.fromLambda(l) - - - def doBreak ( level, message ): - UpdateSession.close() - Breakpoint.stop( level, message ) - UpdateSession.open() - - - def buildInvertor ( editor ): - UpdateSession.open() - - cell = AllianceFramework.get().createCell( 'invertor' ) - cell.setTerminal( True ) - - cell.setAbutmentBox( Box( toDbU(0.0), toDbU(0.0), toDbU(15.0), toDbU(50.0) ) ) - - if editor: - UpdateSession.close() - editor.setCell( cell ) - editor.fit() - UpdateSession.open() - - technology = DataBase.getDB().getTechnology() - metal1 = technology.getLayer( "METAL1" ) - poly = technology.getLayer( "POLY" ) - ptrans = technology.getLayer( "PTRANS" ) - ntrans = technology.getLayer( "NTRANS" ) - pdif = technology.getLayer( "PDIF" ) - ndif = technology.getLayer( "NDIF" ) - contdifn = technology.getLayer( "CONT_DIF_N" ) - contdifp = technology.getLayer( "CONT_DIF_P" ) - nwell = technology.getLayer( "NWELL" ) - contpoly = technology.getLayer( "CONT_POLY" ) - ntie = technology.getLayer( "NTIE" ) - - net = Net.create( cell, "nwell" ) - Vertical.create( net, nwell, toDbU(7.5), toDbU(15.0), toDbU(27.0), toDbU(51.0) ) - - vdd = Net.create( cell, "vdd" ) - vdd.setExternal( True ) - vdd.setGlobal ( True ) - h = Horizontal.create(vdd, metal1, toDbU(47.0), toDbU(6.0), toDbU(0.0), toDbU(15.0) ) - NetExternalComponents.setExternal( h ) - Contact.create ( vdd, contdifn, toDbU(10.0), toDbU(47.0), toDbU( 1.0), toDbU( 1.0) ) - Contact.create ( vdd, contdifp, toDbU( 4.0), toDbU(45.0), toDbU( 1.0), toDbU( 1.0) ) - Vertical.create( vdd, pdif , toDbU( 3.5), toDbU( 4.0), toDbU(28.0), toDbU(46.0) ) - Vertical.create( vdd, ntie , toDbU(10.0), toDbU( 3.0), toDbU(43.0), toDbU(48.0) ) - doBreak( 1, 'Done building vdd.' ) - - vss = Net.create( cell, "vss" ) - vss.setExternal( True ) - vss.setGlobal ( True ) - h = Horizontal.create(vss, metal1, toDbU(3.0), toDbU(6.0), toDbU(0.0), toDbU(15.0)) - NetExternalComponents.setExternal( h ) - Vertical.create( vss, ndif , toDbU(3.5), toDbU(4.0), toDbU(4.0), toDbU(12.0) ) - Contact.create ( vss, contdifn, toDbU(4.0), toDbU(5.0), toDbU(1.0), toDbU( 1.0) ) - doBreak( 1, 'Done building vss.' ) - - i = Net.create( cell, "i" ) - i.setExternal( True ) - v = Vertical.create ( i, metal1, toDbU(5.0), toDbU(2.0), toDbU(10.0), toDbU(40.0) ) - NetExternalComponents.setExternal( v ) - Vertical.create ( i, ptrans , toDbU( 7.0), toDbU( 1.0), toDbU(26.0), toDbU(39.0) ) - Vertical.create ( i, ntrans , toDbU( 7.0), toDbU( 1.0), toDbU( 6.0), toDbU(14.0) ) - Vertical.create ( i, poly , toDbU( 7.0), toDbU( 1.0), toDbU(14.0), toDbU(26.0) ) - Horizontal.create( i, poly , toDbU(20.0), toDbU( 3.0), toDbU( 4.0), toDbU( 7.0) ) - Contact.create ( i, contpoly, toDbU( 5.0), toDbU(20.0), toDbU( 1.0), toDbU( 1.0) ) - doBreak( 1, 'Done building i.' ) - - nq = Net.create ( cell, "nq" ) - nq.setExternal( True ) - v = Vertical.create( nq, metal1, toDbU(10.0), toDbU(2.0), toDbU(10.0), toDbU(40.0) ) - NetExternalComponents.setExternal( v ) - Vertical.create( nq, pdif , toDbU(10.0), toDbU( 3.0), toDbU(28.0), toDbU(37.0) ) - Vertical.create( nq, ndif , toDbU(10.0), toDbU( 3.0), toDbU( 8.0), toDbU(12.0) ) - Contact.create ( nq, contdifp, toDbU(10.0), toDbU(35.0), toDbU( 1.0), toDbU( 1.0) ) - Contact.create ( nq, contdifp, toDbU(10.0), toDbU(30.5), toDbU( 1.0), toDbU( 1.0) ) - Contact.create ( nq, contdifn, toDbU(10.0), toDbU(10.0), toDbU( 1.0), toDbU( 1.0) ) - doBreak( 1, 'Done building q.' ) - - UpdateSession.close() - AllianceFramework.get().saveCell( cell, Catalog.State.Views ) - - return - - - def ScriptMain ( **kw ): - editor = None - if kw.has_key('editor') and kw['editor']: - editor = kw['editor'] - - buildInvertor( editor ) - return True diff --git a/documentation/_build/html/_sources/PythonTutorial/CgtScript.txt b/documentation/_build/html/_sources/PythonTutorial/CgtScript.txt deleted file mode 100644 index 8e8ad6a4..00000000 --- a/documentation/_build/html/_sources/PythonTutorial/CgtScript.txt +++ /dev/null @@ -1,84 +0,0 @@ -.. -*- Mode: rst -*- -.. include:: ../etc/definitions.rst -.. include:: ./definitions.rst - - - -5. Make a script runnable through |cgt| -======================================= - -To use your script you may run it directly like any other |Python| script. -But, for debugging purpose it may be helpful to run it through the -interactive layout viewer |cgt|. - -For |cgt| to be able to run your script, you must add to your script -file a function named :cb:`ScriptMain()`, which takes a dictionary -as sole argument (:cb:`**kw`). The ``kw`` dictionary contains, in -particular, the CellViewer_ object we are running under with the -keyword ``editor``. You can then load your cell into the viewer -using the menu: - -* :fboxtt:`Tools` |rightarrow| :fboxtt:`Python Script`. The script - file name must be given without the ``.py`` extension. - -.. note:: If you use breakpoints and want to see the progress of your - script in the viewer, do not use the ``--script`` option of - |cgt|. - - .. code-block:: console - - ego@home:~> cgt -V --script=invertor - - Because the script is run **before** the viewer is launched, - you will only see the end result of your script. - - -.. code-block:: Python - - def buildInvertor ( editor ): - UpdateSession.open() - - cell = AllianceFramework.get().createCell( 'invertor' ) - cell.setTerminal( True ) - - cell.setAbutmentBox( Box( toDbU(0.0), toDbU(0.0), toDbU(15.0), toDbU(50.0) ) ) - - if editor: - UpdateSession.close() - editor.setCell( cell ) - editor.fit() - UpdateSession.open() - - # The rest of the script... - - return - - - def ScriptMain ( **kw ): - editor = None - if kw.has_key('editor') and kw['editor']: - editor = kw['editor'] - - buildInvertor( editor ) - return True - - -5.1 Using Breakpoints -~~~~~~~~~~~~~~~~~~~~~ - -It is possible to add breakpoints inside a script by calling the ``Breakpoint.stop()`` -function. To be able to see exactly what has just been mofied, we must close the -UpdateSession_ just before calling the breakpoint and reopen it just after. -The ``Breakpoint.stop()`` function takes two arguments: - -#. The ``level`` above which it will be active. -#. An informative message about the purpose of the breakpoint. - -We can create a little function to ease the work: - -.. code-block:: Python - - def doBreak ( level, message ): - UpdateSession.close() - Breakpoint.stop( level, message ) - UpdateSession.open() diff --git a/documentation/_build/html/_sources/PythonTutorial/Collections.txt b/documentation/_build/html/_sources/PythonTutorial/Collections.txt deleted file mode 100644 index 1e31d234..00000000 --- a/documentation/_build/html/_sources/PythonTutorial/Collections.txt +++ /dev/null @@ -1,93 +0,0 @@ -.. -*- Mode: rst -*- -.. include:: ../etc/definitions.rst -.. include:: ./definitions.rst - - -.. _2.1 The Alliance Framework: ./CellNetComponent.html#the-allianceframework-crl-core - - -4. Manipulating Cells, Nets and Components -========================================== - -In this part, we will show how to navigate through the Nets_ and Components_ of a Cell_. - - -4.1 Hurricane Collections -~~~~~~~~~~~~~~~~~~~~~~~~~ - -In |Hurricane| all kind of set of objects, whether organized in a real container -like a ``map<>`` (dictionary / ``dict``) or a ``vector<>`` (table / ``list``) or -an algorithmic walkthrough of the database can be accessed through a Collection_. - -C++ Collections objects are exposed in |Python| through the *iterable* protocol, -allowing to simply write: - -.. code-block:: Python - - for net in cell.getNets(): - print 'Components of', net - for component in net.getComponents(): - print '|', component - - -In C++ we would have written: - -.. code-block:: C++ - - for ( Net* net : cell->getNets() ) { - cout << "Components of " << net << endl; - for ( Component* component : net->getComponents() ) { - cout << "| " << component << endl, - } - } - - -4.1.1 Restrictions about using Collections ------------------------------------------- - -**Never delete or create an element while you are iterating over a Collection.** - -Results can be unpredictable, you may just end up with a core dump, but more -subtly, some element of the Collection_ may be skipped or processed twice. -If you want to create or delete an element, do it outside the collection -loop. For example: - -.. code-block:: Python - - cellNets = [] - for net in cell.getNets(): - cellNets.append( net ) - - # Remove all the anonymous nets. - for net in cellNets: - if net.getName().endswith('nymous_'): - print 'Destroy', net - net.destroy() - - - -4.2 Loading a Cell with AllianceFramework -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -As presented in `2.1 The Alliance Framework`_, the Cell_ that will be returned by -the ``getCell()`` call wil be: - -#. If a Cell_ of that name is already loaded into memory, it will be returned. - - .. note:: It means that it shadows any modifications that could have been on - disk since it was first loaded. Conversely, if the Cell_ has been - modified in memory, you will get those modifications. - -#. Search, in the ordered list of libraries, the first Cell_ that matches the - requested name. - - .. note:: It means that if cells with the same name exist in different - libraries, only the one in the first library will be ever used. - Be also aware that cell files that may remain in the ``WORK_LIB``, - may unexpectedly shadow cells from the libraries. - - -.. code-block:: Python - - cell = af.getCell( 'inv_x1', Catalog.State.Views ) - diff --git a/documentation/_build/html/_sources/PythonTutorial/Environment.txt b/documentation/_build/html/_sources/PythonTutorial/Environment.txt deleted file mode 100644 index 703b3486..00000000 --- a/documentation/_build/html/_sources/PythonTutorial/Environment.txt +++ /dev/null @@ -1,91 +0,0 @@ -.. -*- Mode: rst -*- -.. include:: ../etc/definitions.rst -.. include:: ./definitions.rst - - - - -2. Setting up the Environment -============================= - -2.1 Setting up the Paths -~~~~~~~~~~~~~~~~~~~~~~~~~ - -To simplify the tedious task of configuring your environment, a helper is provided. -It will setup or modify the :cb:`PATH`, :cb:`LD_LIBRARY_PATH` (or :cb:`DYLD_LIBRARY_PATH` -under |Darwin|), :cb:`PYTHONPATH` and :cb:`CORIOLIS_TOP` variables. -It should automatically adapt to your kind of shell (``Bourne`` like -or ``C-Shell`` like). :: - - /etc/coriolis2/coriolisEnv.py - -Use it like this (don't forget the ``eval`` **and** the backquotes): - -.. code-block:: console - - dummy@lepka:~> eval `/etc/coriolis2/coriolisEnv.py` - -.. note:: **Do not call that script in your environment initialisation.** - When used under |RHEL6| or clones, it needs to be run in the |devtoolset| - environment. The script then launches a new shell, which may cause an - infinite loop if it's called again in, say :cb:`~/.bashrc`. - - Instead you may want to create an alias: :: - - alias c2r='eval "`/etc/coriolis2/coriolisEnv.py`"' - - -2.2 User's Configurations File -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You may create, in the directory you are lanching |Coriolis| tools, a special -sub-directory ``.coriolis2/`` that can contain two configuration files: - -* ``techno.py`` tells which technology to use. -* ``settings.py`` can override almost any default configuration setting. - -Those two files are *optional*, if they do not exist the default settings -will be used and the technology is ``symbolic/cmos`` (i.e. purely symbolic). - -.. note:: Those two files will by processed by the |Python| interpreter, - so they can contain any code in addition to the mandatory - variables. - -2.2.1 The :cb:`techno.py` File ------------------------------- - -Must provide one variable named :cb:`technology` which values the path towards -the technology file. The available technologies are installed under -``/etc/coriolis2``. For example, to use the 45nm FreeDPK -which is in: :: - - /etc/coriolis2/45/freepdk_45/ - -The ``techno.py`` file must contain: - -.. code-block:: Python - - technology = '45/freepdk_45' - - -2.2.2 The :cb:`settings.py` File --------------------------------- - -The entries of the ``parametersTable`` and their definitions are detailed -in `CGT - The Graphical Interface <../UsersGuide/ViewerTools.html>`_. - -Example of file: - -.. code-block:: Python - - defaultStyle = 'Alliance.Classic [black]' - - parametersTable = \ - ( ('misc.catchCore' , TypeBool , False ) - , ('misc.info' , TypeBool , False ) - , ('misc.paranoid' , TypeBool , False ) - , ('misc.bug' , TypeBool , False ) - , ('misc.logMode' , TypeBool , False ) - , ('misc.verboseLevel1' , TypeBool , False ) - , ('misc.verboseLevel2' , TypeBool , True ) - ) diff --git a/documentation/_build/html/_sources/PythonTutorial/Introduction.txt b/documentation/_build/html/_sources/PythonTutorial/Introduction.txt deleted file mode 100644 index 861e85a5..00000000 --- a/documentation/_build/html/_sources/PythonTutorial/Introduction.txt +++ /dev/null @@ -1,140 +0,0 @@ -.. -*- Mode: rst -*- -.. include:: ../etc/definitions.rst -.. include:: ./definitions.rst - - -1. Introduction -=============== - -This tutorial is aimed at two goals : - -* Presenting how to use Python scripts to control |Coriolis|. - -* Make a basic introduction about the |Hurricane| database and its - concepts. - -While this tutorial is aimed at presenting the |Hurricane| database, -do not feel limited by it. You can use |Hurricane| objects as attributes -of |Python| objects or use |Python| containers to store them. -The only limitation is that you may not use |Hurricane| classes as base -classes in |Python|. - -All |Hurricane| objects implements the |Python| ``__str__()`` function, -they print the result of C++ ``::getString()``. - - -1.1 Terminology -~~~~~~~~~~~~~~~ - -In the |Hurricane| database, the *logical* (netlist) and *physical* (layout) -views are fused. As the main goal of the database is to support place & route -tools, we usually starts with a *pure* netlist which is progessively enriched -to become a layout. Cell, in particular, is able to be in any intermediate -state. Many of our objects have self-explanatory names, but some -don't. Thus we summarize below the more important ones: - -=============== ===================================================== -**Class** **Meaning** -=============== ===================================================== -Cell_ The model. A Cell does not have terminals, only nets - flagged as *external* -Instance_ An instance of a model -Net_ A grouping of electrically connected components -Plug_ A terminal of an instance -RoutingPad_ A physical connexion (*pin*) to an instance -=============== ===================================================== - - -1.2 Generalities -~~~~~~~~~~~~~~~~ - -The C++ API has been exported in Python as closely as possible. Meaning -that, save for a slight change in syntax, any code written in |Python| -could be easily transformed into C++ code. There is no specific documentation -written for the |Python| interface, you may directly use the C++ one. - -Mostly: - -* C++ namespaces are exported as |Python| modules. -* The *scope resolution operator* :fboxtt:`::` converts into :fboxtt:`.`. -* C++ blocks (between braces :fboxtt:`{}`) are replaced by indentations. -* In C++, names are managed through a dedicated ``Name`` class. - It has not been exported to the |Python| interface, you only have - to use ``string``. -* Coordinates are expressed in ``DbU`` which are ``long`` with a special - semantic (see ??). - -In ``hurricane/Session.h`` header we have: - -.. code-block:: c++ - - namespace Hurricane { - - class UpdateSession { - public: - static void open (); - static void close (); - }; - - } - - -So we can use it the following way in C++: - -.. code-block:: c++ - - #include "hurricane/Session.h" - - using namespace Hurricane; - - void doSomething () - { - UpdateSession::open(); - // Something... - UpdateSession::close(); - } - - -The equivalent |Python| code will be: - -.. code-block:: Python - - from Hurricane import * - - def doSomething (): - UpdateSession.open() - # Something... - UpdateSession.close() - - -1.3 Various Kinds of Constructors -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Regarding the memory allocation, the |Hurricane| database contains two kind of objects. - -#. Objects that are linked to others in the database and whose creation or deletion - implies coherency operations. This is the case for Net_ or Horizontal_. - They must be created using the static :cb:`create()` method of their class - and destroyed with their :cb:`destroy()` method. - - And, of course, they cannot be copied (the copy constructor has been disabled). - - .. code-block:: Python - - net = Net.create( cell, 'tmp' ) # Call the static Net.create() function. - # Work with this net. - # ... - net.destroy() # Call the dynamic destroy() method. - -#. Objects that are *standalone*, like Point_ or Box_, uses the usual construction - methods. They also use the |Python| garbage collector mechanism and do not need - to be explicitly deleted. - - .. code-block:: Python - - def myfunc(): - bb = Box( DbU.fromLambda( 0.0) - , DbU.fromLambda( 0.0) - , DbU.fromLambda(15.0) - , DbU.fromLambda(50.0) ) - return # bb will be freed at that point. diff --git a/documentation/_build/html/_sources/PythonTutorial/Netlist.txt b/documentation/_build/html/_sources/PythonTutorial/Netlist.txt deleted file mode 100644 index ae1de186..00000000 --- a/documentation/_build/html/_sources/PythonTutorial/Netlist.txt +++ /dev/null @@ -1,399 +0,0 @@ -.. -*- Mode: rst -*- -.. include:: ../etc/definitions.rst -.. include:: ./definitions.rst - - -6. Making a hierarchical Cell -- Netlist -======================================== - -To illustrate the topic, we will build the netlist of a fulladder from -standard cell. - -|fulladder_1| - - -6.1 Creating an Instance_ -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Creating an Instance_ is straigthforward, the constructor needs only three -parameters: - -#. The Cell_ **into which** the instance is to be created. -#. The name of the instance. -#. The **master cell**, the Cell_ model it refers to. The master cell - will be part of the hierarchical level just below the ``fulladder`` - cell. - -.. note:: Do not confuse the cell the instance is create into (``fulladder``) - and the cells it refers to (the *master cell* ``xr2_x2``). - -.. code-block:: Python - - af = AllianceFramework.get() - xr2_x2 = af.getCell( 'xr2_x1', Catalog.State.Views ) - - fulladder = af.createCell( 'fulladder' ) - xr2_1 = Instance.create( fulladder, 'xr2_1', xr2_x2 ) - - -6.2 Creating Nets and connecting to Instances -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -An Instance_ has one Plug_ for each external net of the *master cell*. -The plug allows to create a **logical** connection bewteen a Net_ of -``fulladder`` and a net from an Instance_ *master cell*. - -A plug is somewhat equivalent to an *instance terminal* in other -well known databases. - -Therefore, a plug is related to two nets: - -#. The net of the *master cell* it is linked to. Obviously that - net cannot be changed. You can access the master net with the - function ``plug.getMasterNet()``. - -#. The net of ``fulladder`` the plug is connected to. This can - be set, it is how we build the netlist. To set the net, use - the function ``plug.setNet( net )``. If the argument is ``None``, - the plug is *disconnected*. - -To find the plug of an instance associated to a given net in -the *master cell*, use ``instance.getPlug( masterNet )``. -The ``masterNet`` argument being an object of class net (not -its name). - -Building the :cb:`a` net of ``fulladder``: - -.. code-block:: Python - - a = Net.create( fulladder, "a" ) - a.setExternal( True ) - xr2_1.getPlug( xr2_x2.getNet("i0") ).setNet( a ) - a2_1 .getPlug( a2_x2.getNet("i0") ).setNet( a ) - - -.. note:: **Limitation of Hurricane Netlists.** There is no explicit - terminal object in the |Hurricane| database. Plugs are - generated *on the fly* for each *external net* of the - instance. One important consequence is that a *net* - cannot appear on the interface as two differently named - terminals (sometimes referred as *weekly connected* - terminals). There is a strict bijection between external - nets and plugs. - - While it may be restrictive, it enforces cleaner designs - and make it possible for the HyperNet_ concept/class. - - -6.3 Power supplies special case -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -For supplies, it may be tedious to connect the Plugs_ of each cell one by one -(and create a lot of unneeded objects). To avoid that, we may use **Named -connections**. If a signal in ``fulladder`` is set to *global*, then it will -be considered as connected to any signal with the *same name* and *global* in -the master cell of the instances. - -.. code-block:: Python - - vdd = Net.create( fulladder, "vdd" ) - vdd.setExternal( True ) - vdd.setGlobal ( True ) # Will be connected to all the instances. - - -6.4 Creating the physical view of a Cell netlist -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Even if loaded in the viewer, an Instance will not be displayed -until it is placed. - - -6.4.1 Transformation --------------------- - -To place an Instance, we apply a Transformation_ to the coordinate system -of the *master cell*. A transformation is composed of two operations: - -#. An Orientation_, which can be a symmetry or a rotation (or a combination - of those two). The Orientation **is applied first** to the coordinate - system of the *master cell*. The complete list of Orientation and their - codes are given on the Orientation documentation page. - -#. A **Translation**, applied in second. Translation are represented by - Points_. - -The transformation is a change of coordinate system, be aware that if the -abutment box lower left corner of the *master* cell is **not** at ``(0,0)`` -the result of the Transformation may not be what you expect. To simplify -the computation of the transformation of an instance, always place the -lower left corner of the abutment box at ``(0,0)`` - - -6.4.2 Placing an Instance -------------------------- - -Assuming that we want to place the cells of the ``fulladder`` into two rows, -that the abutment box lower left corner is at ``(0,0)`` (same for the -``xr2_x2`` *master cell* layout). Here is the code to place the ``xr2_1`` -instance to left of the second row. - -Setting the translation on an Instance_ is not enough to make it be displayed, -we also must set its *placement status* to ``Instance.PlacementStatus.PLACED``. - -.. code-block:: Python - - xr2_1.setTransformation( Transformation( DbU.fromLambda( 0.0) - , DbU.fromLambda(100.0) - , Transformation.Orientation.MY ) ) - xr2_1.setPlacementStatus( Instance.PlacementStatus.PLACED ) - - -6.4.3 Nets -- From Plugs to RoutingPads ---------------------------------------- - -As was stated before, Plugs_ represent a logical connection between two -levels of hierarchy. To make the physical connection to the *master net* -in the instance, we now must create, in the ``fulladder``, a special -component which is a kind of *reference* to a component of the -*master net* (in the master cell). - -The so called *special component* is a RoutingPad_. - -The ``RoutingPad`` can be considered as an equivalent to ``pin`` in other -well known databases. - -.. code-block:: Python - - rp = RoutingPad.create( a - , Occurrence( xr2_1.getPlug( xr2_x2.getNet("i0")) ) - , RoutingPad.BiggestArea ) - -For the second parameter, we must pass an Occurrence_. Occurrence objects will -be explained in detail later, for now, let say that we must construct the -Occurrence object with one parameter : the Plug_ for which we want to create a -physical connection. - -The RoutingPad_ ``rp`` will be a component of the ``a`` net. - -The third argument ask the constructor of the RoutingPad_ to select in the -master net, the component which has the biggest area. - -.. note:: **Component selection.** Not all the components of a net can be - selected for connection through a RoutingPad_. The candidates must - have been flagged with the NetExternalComponents_ class. - - See `3.6.3 Creating a Component`_. - - -6.4.4 Nets -- Regular wiring ----------------------------- - -After the creation of the RoutingPads_, the wiring is to be created with -ordinary layout components (Horizontal_, Vertical_ and Contact_ possibly -articulated). Here is the complete code for net ``a``. We made an articulated -layout where contacts are created over RoutingPads_ then segments over -contacts. - -.. code-block:: Python - - # Build wiring for a. - # Create RoutingPads first. - rp1 = RoutingPad.create( a - , Occurrence( xr2_1.getPlug( xr2_x2.getNet("i0")) ) - , RoutingPad.BiggestArea ) - rp2 = RoutingPad.create( a - , Occurrence( a2_1.getPlug( a2_x2.getNet("i0")) ) - , RoutingPad.BiggestArea ) - - # Then regular wiring. - contact1 = Contact.create( rp1, via12, toDbU( 0.0), toDbU(-15.0) ) - contact2 = Contact.create( rp2, via12, toDbU( 0.0), toDbU( 10.0) ) - turn = Contact.create( a , via23, toDbU(10.0), toDbU( 35.0) ) - Horizontal.create( contact2, turn , metal2, toDbU(35.0), toDbU(2.0) ) - Vertical .create( turn , contact1 , metal3, toDbU(10.0), toDbU(2.0) ) - - -.. note:: In order to better see the layout of the wiring only, open the - ``Controller`` and in the :fboxtt:`Filter` tab, uncheck - :fboxtt:`Process Terminal Cells`. - - -6.5 The Complete Example File -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The example file ``fulladder.py`` can be found in the ``share/doc/coriolis2/examples/scripts/`` -directory (under the the root of the |Coriolis| installation). - -.. code-block:: Python - - #!/usr/bin/python - - import sys - from Hurricane import * - from CRL import * - - - def toDbU ( l ): return DbU.fromLambda(l) - - - def doBreak ( level, message ): - UpdateSession.close() - Breakpoint.stop( level, message ) - UpdateSession.open() - - - def buildFulladder ( editor ): - - # Get the Framework and all the master cells. - af = AllianceFramework.get() - xr2_x2 = af.getCell( 'xr2_x1', Catalog.State.Views ) - a2_x2 = af.getCell( 'a2_x2' , Catalog.State.Views ) - o2_x2 = af.getCell( 'o2_x2' , Catalog.State.Views ) - - UpdateSession.open() - - fulladder = af.createCell( 'fulladder' ) - fulladder.setAbutmentBox( Box( toDbU(0.0), toDbU(0.0), toDbU(90.0), toDbU(100.0) ) ) - - if editor: - UpdateSession.close() - editor.setCell( fulladder ) - editor.fit() - UpdateSession.open() - - # Create Instances. - a2_1 = Instance.create( fulladder, 'a2_1', a2_x2 ) - a2_2 = Instance.create( fulladder, 'a2_2', a2_x2 ) - xr2_1 = Instance.create( fulladder, 'xr2_1', xr2_x2 ) - xr2_2 = Instance.create( fulladder, 'xr2_2', xr2_x2 ) - o2_1 = Instance.create( fulladder, 'o2_1', o2_x2 ) - - # Create Nets. - vss = Net.create( fulladder, "vss" ) - vss.setExternal( True ) - vss.setGlobal ( True ) - - vdd = Net.create( fulladder, "vdd" ) - vdd.setExternal( True ) - vdd.setGlobal ( True ) - - cin = Net.create( fulladder, "cin" ) - cin.setExternal( True ) - xr2_2.getPlug( xr2_x2.getNet('i0') ).setNet( cin ) - a2_2 .getPlug( a2_x2.getNet('i0') ).setNet( cin ) - - a = Net.create( fulladder, 'a' ) - a.setExternal( True ) - xr2_1.getPlug( xr2_x2.getNet('i0') ).setNet( a ) - a2_1 .getPlug( a2_x2.getNet('i0') ).setNet( a ) - - b = Net.create( fulladder, 'b' ) - b.setExternal( True ) - xr2_1.getPlug( xr2_x2.getNet('i1') ).setNet( b ) - a2_1 .getPlug( a2_x2.getNet('i1') ).setNet( b ) - - sout_1 = Net.create( fulladder, 'sout_1' ) - xr2_1.getPlug( xr2_x2.getNet('q' ) ).setNet( sout_1 ) - xr2_2.getPlug( xr2_x2.getNet('i1') ).setNet( sout_1 ) - a2_2 .getPlug( a2_x2.getNet('i1') ).setNet( sout_1 ) - - carry_1 = Net.create( fulladder, 'carry_1' ) - a2_1.getPlug( a2_x2.getNet('q' ) ).setNet( carry_1 ) - o2_1.getPlug( o2_x2.getNet('i1') ).setNet( carry_1 ) - - carry_2 = Net.create( fulladder, 'carry_2' ) - a2_2.getPlug( a2_x2.getNet('q' ) ).setNet( carry_2 ) - o2_1.getPlug( o2_x2.getNet('i0') ).setNet( carry_2 ) - - sout = Net.create( fulladder, 'sout' ) - sout.setExternal( True ) - xr2_2.getPlug( xr2_x2.getNet('q') ).setNet( sout ) - - cout = Net.create( fulladder, 'cout' ) - cout.setExternal( True ) - o2_1.getPlug( o2_x2.getNet('q') ).setNet( cout ) - - # Instances placement. - a2_1.setTransformation( Transformation( toDbU(0.0) - , toDbU(0.0) - , Transformation.Orientation.ID ) ) - a2_1.setPlacementStatus( Instance.PlacementStatus.PLACED ) - doBreak( 1, 'Placed a2_1' ) - - xr2_1.setTransformation( Transformation( toDbU( 0.0) - , toDbU(100.0) - , Transformation.Orientation.MY ) ) - xr2_1.setPlacementStatus( Instance.PlacementStatus.PLACED ) - doBreak( 1, 'Placed xr2_1' ) - - a2_2.setTransformation( Transformation( toDbU(25.0) - , toDbU( 0.0) - , Transformation.Orientation.ID ) ) - a2_2.setPlacementStatus( Instance.PlacementStatus.PLACED ) - doBreak( 1, 'Placed a2_2' ) - - xr2_2.setTransformation( Transformation( toDbU( 45.0) - , toDbU(100.0) - , Transformation.Orientation.MY ) ) - xr2_2.setPlacementStatus( Instance.PlacementStatus.PLACED ) - doBreak( 1, 'Placed xr2_2' ) - - o2_1.setTransformation( Transformation( toDbU(65.0) - , toDbU( 0.0) - , Transformation.Orientation.ID ) ) - o2_1.setPlacementStatus( Instance.PlacementStatus.PLACED ) - doBreak( 1, 'Placed o2_1' ) - - # Add filler cells. - tie_x0 = af.getCell( 'tie_x0', Catalog.State.Views ) - rowend_x0 = af.getCell( 'rowend_x0', Catalog.State.Views ) - filler_1 = Instance.create( fulladder, 'filler_1', tie_x0 ) - filler_2 = Instance.create( fulladder, 'filler_2', rowend_x0 ) - - filler_1.setTransformation( Transformation( toDbU(50.0) - , toDbU( 0.0) - , Transformation.Orientation.ID ) ) - filler_1.setPlacementStatus( Instance.PlacementStatus.PLACED ) - - filler_2.setTransformation( Transformation( toDbU(60.0) - , toDbU( 0.0) - , Transformation.Orientation.ID ) ) - filler_2.setPlacementStatus( Instance.PlacementStatus.PLACED ) - doBreak( 1, 'Filler cell placeds' ) - - # Getting the layers. - technology = DataBase.getDB().getTechnology() - metal2 = technology.getLayer( "METAL2" ) - metal3 = technology.getLayer( "METAL3" ) - via12 = technology.getLayer( "VIA12" ) - via23 = technology.getLayer( "VIA23" ) - - # Build wiring for a. - # Create RoutingPads first. - rp1 = RoutingPad.create( a - , Occurrence( xr2_1.getPlug( xr2_x2.getNet("i0")) ) - , RoutingPad.BiggestArea ) - rp2 = RoutingPad.create( a - , Occurrence( a2_1.getPlug( a2_x2.getNet("i0")) ) - , RoutingPad.BiggestArea ) - - # Then regular wiring. - contact1 = Contact.create( rp1, via12, toDbU( 0.0), toDbU(-15.0) ) - contact2 = Contact.create( rp2, via12, toDbU( 0.0), toDbU( 10.0) ) - turn = Contact.create( a , via23, toDbU(10.0), toDbU( 35.0) ) - Horizontal.create( contact2, turn , metal2, toDbU(35.0), toDbU(2.0) ) - Vertical .create( turn , contact1 , metal3, toDbU(10.0), toDbU(2.0) ) - - UpdateSession.close() - - af.saveCell( fulladder, Catalog.State.Views ) - return - - - def ScriptMain ( **kw ): - editor = None - if kw.has_key('editor') and kw['editor']: - editor = kw['editor'] - - buildFulladder( editor ) - return True diff --git a/documentation/_build/html/_sources/PythonTutorial/RealDesigns.txt b/documentation/_build/html/_sources/PythonTutorial/RealDesigns.txt deleted file mode 100644 index b9315184..00000000 --- a/documentation/_build/html/_sources/PythonTutorial/RealDesigns.txt +++ /dev/null @@ -1,51 +0,0 @@ -.. -*- Mode: rst -*- -.. include:: ../etc/definitions.rst -.. include:: ./definitions.rst - - -7. Working in real mode -======================= - -The AllianceFramework_ only manages *symbolic* layout as |Alliance| does. -But |Coriolis| is also able to work directly in *real* mode, meaning -that distances will be expressed in microns instead of lambdas. - -The *real* mode will be illustrated by working with the FreePDK45_. - -We will assume that the FreePDK45_ archives is installed under: :: - - /home/dks/ - - -7.1 Loading a |LEF| file -~~~~~~~~~~~~~~~~~~~~~~~~ - -Importing a |LEF| file is simple, you just call the static function -``LefImport.load()``. Multiple |LEF| file can be imported one after -another. - -.. code-block:: Python - - # You must set "DKsdir" to where you did install the NCSU FreePDK 45nm DK. - DKsdir = '/home/dks' - - library = LefImport.load( DKsdir + '/FreePDK45/osu_soc/lib/files/gscl45nm.lef' ) - - -.. note:: **Technology checking.** The first imported |LEF| file must contain the - technology. The technology described in the |LEF| file will be checked - against the one configured in the running instance of |Coriolis| to look - for any discrepencies. - - -7.2 Loading a |Blif| file -- |Yosys| -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The |Blif| format is generated by the Yosys_ logic synthetizer. Here again, it is -pretty straightforward: call the static function ``Blif.load()``. If you made -your synthesis on a cell library not managed by AllianceFramework_, for example -the one of the FreePDK45, you must load it prior to calling the |Blif| loader. - -.. code-block:: Python - - cell = Blif.load( 'snx' ) # load "snx.blif" in the working directory. diff --git a/documentation/_build/html/_sources/PythonTutorial/ToolEngines.txt b/documentation/_build/html/_sources/PythonTutorial/ToolEngines.txt deleted file mode 100644 index fe3a75d4..00000000 --- a/documentation/_build/html/_sources/PythonTutorial/ToolEngines.txt +++ /dev/null @@ -1,213 +0,0 @@ -.. -*- Mode: rst -*- -.. include:: ../etc/definitions.rst -.. include:: ./definitions.rst - - -8. Tool Engines (CRL Core) -========================== - -The ToolEngine_ class is the base class for all tools developped in -|Coriolis|. In the rest of the tutorial we will use the names ``tool`` -or ``engine`` as synonyms. - - -8.1 Placer -- Etesian -~~~~~~~~~~~~~~~~~~~~~ - -To run the placer, create the |Etesian| engine, then call the ``place()`` -function. - -.. code-block:: Python - - import Etesian - - # [...] - - etesian = Etesian.EtesianEngine.create(cell) - etesian.place() - -You can configure the placer in two ways: - -#. Prior to the creation of the engine, setup an abutment for the cell. - The placer will fit the cells into that area. If the area is too - small, it will issue an error. - -#. Setup |Etesian| parameters through the ``settings.py`` configuration - file. For example: - - .. code-block:: Python - - parametersTable = \ - ( ("etesian.effort" , TypeEnumerate , 2 ) - , ('etesian.uniformDensity' , TypeBool , True ) - , ('etesian.spaceMargin' , TypePercentage, 3.0 ) - , ('etesian.aspectRatio' , TypePercentage, 100.0 ) - ) - - With this setup, the cells will be spread uniformally over the - area (``etesian.uniformDensity``), with ``3.0%`` of free space - added and an aspect ratio of ``100%`` (square shape). - - -8.1 Router -- Katana -~~~~~~~~~~~~~~~~~~~~ - -Like for |Etesian|, you have to create the engine on the cell then call -the sequence of functions detailed below. - -.. note:: **Kite vs. Katana.** There are currently two routers in |Coriolis|, - |Kite| is the old one and digital only. |Katana| is a re-implementation - with support for mixed routing (digital **and** analog). - Until |Katana| is fully implemented we keep both of them. - -.. code-block:: Python - - import Anabatic - import Katana - - # [...] - - katana = Katana.KatanaEngine.create(cell) - katana.digitalInit () - katana.runGlobalRouter () - katana.loadGlobalRouting( Anabatic.EngineLoadGrByNet ) - katana.layerAssign ( Anabatic.EngineNoNetLayerAssign ) - katana.runNegociate ( Katana.Flags.NoFlags ) - - -8.2 A Complete Example -~~~~~~~~~~~~~~~~~~~~~~~ - -The example file ``toolengines.py`` can be found in the ``share/doc/coriolis2/examples/scripts/`` -directory (under the the root of the |Coriolis| installation). - -This script automatically places and routes the ``fulladder`` netlist as seen -previously. The call to the ToolEngines_ is made inside the new function -``placeAndRoute()``. - -.. note:: As the ``ToolEngine`` take care of opening and closing UpdateSession_, we - do not need the wrapper function ``doBreak()`` around the breakpoints. - We directly call Breakpoint_. - -.. note:: The space margin for this example is very high (``30%``), it's only - because it's too small for the placer to run correctly. For normal - case it is around ``3%``. - -.. code-block:: Python - - #!/usr/bin/python - - import sys - from Hurricane import * - from CRL import * - import Etesian - import Anabatic - import Katana - - # Everybody needs it. - af = AllianceFramework.get() - - - def toDbU ( l ): return DbU.fromLambda(l) - - - def buildFulladder ( editor ): - - # Get the Framework and all the master cells. - xr2_x2 = af.getCell( 'xr2_x1', Catalog.State.Views ) - a2_x2 = af.getCell( 'a2_x2' , Catalog.State.Views ) - o2_x2 = af.getCell( 'o2_x2' , Catalog.State.Views ) - - UpdateSession.open() - - fulladder = af.createCell( 'fulladder' ) - - # Create Instances. - a2_1 = Instance.create( fulladder, 'a2_1', a2_x2 ) - a2_2 = Instance.create( fulladder, 'a2_2', a2_x2 ) - xr2_1 = Instance.create( fulladder, 'xr2_1', xr2_x2 ) - xr2_2 = Instance.create( fulladder, 'xr2_2', xr2_x2 ) - o2_1 = Instance.create( fulladder, 'o2_1', o2_x2 ) - - # Create Nets. - vss = Net.create( fulladder, "vss" ) - vss.setExternal( True ) - vss.setGlobal ( True ) - - vdd = Net.create( fulladder, "vdd" ) - vdd.setExternal( True ) - vdd.setGlobal ( True ) - - cin = Net.create( fulladder, "cin" ) - cin.setExternal( True ) - xr2_2.getPlug( xr2_x2.getNet('i0') ).setNet( cin ) - a2_2 .getPlug( a2_x2.getNet('i0') ).setNet( cin ) - - a = Net.create( fulladder, 'a' ) - a.setExternal( True ) - xr2_1.getPlug( xr2_x2.getNet('i0') ).setNet( a ) - a2_1 .getPlug( a2_x2.getNet('i0') ).setNet( a ) - - b = Net.create( fulladder, 'b' ) - b.setExternal( True ) - xr2_1.getPlug( xr2_x2.getNet('i1') ).setNet( b ) - a2_1 .getPlug( a2_x2.getNet('i1') ).setNet( b ) - - sout_1 = Net.create( fulladder, 'sout_1' ) - xr2_1.getPlug( xr2_x2.getNet('q' ) ).setNet( sout_1 ) - xr2_2.getPlug( xr2_x2.getNet('i1') ).setNet( sout_1 ) - a2_2 .getPlug( a2_x2.getNet('i1') ).setNet( sout_1 ) - - carry_1 = Net.create( fulladder, 'carry_1' ) - a2_1.getPlug( a2_x2.getNet('q' ) ).setNet( carry_1 ) - o2_1.getPlug( o2_x2.getNet('i1') ).setNet( carry_1 ) - - carry_2 = Net.create( fulladder, 'carry_2' ) - a2_2.getPlug( a2_x2.getNet('q' ) ).setNet( carry_2 ) - o2_1.getPlug( o2_x2.getNet('i0') ).setNet( carry_2 ) - - sout = Net.create( fulladder, 'sout' ) - sout.setExternal( True ) - xr2_2.getPlug( xr2_x2.getNet('q') ).setNet( sout ) - - cout = Net.create( fulladder, 'cout' ) - cout.setExternal( True ) - o2_1.getPlug( o2_x2.getNet('q') ).setNet( cout ) - - UpdateSession.close() - - af.saveCell( fulladder, Catalog.State.Views ) - return fulladder - - - def placeAndRoute ( editor, cell ): - # Run the placer. - etesian = Etesian.EtesianEngine.create(cell) - etesian.place() - - if editor: - editor.setCell( cell ) - editor.fit() - - Breakpoint.stop( 1, 'After placement' ) - - # Run the router. - katana = Katana.KatanaEngine.create(cell) - katana.digitalInit () - katana.runGlobalRouter () - katana.loadGlobalRouting( Anabatic.EngineLoadGrByNet ) - katana.layerAssign ( Anabatic.EngineNoNetLayerAssign ) - katana.runNegociate ( Katana.Flags.NoFlags ) - - af.saveCell( cell, Catalog.State.Views ) - return - - - def ScriptMain ( **kw ): - editor = None - if kw.has_key('editor') and kw['editor']: - editor = kw['editor'] - - fulladder = buildFulladder( editor ) - placeAndRoute( editor, fulladder ) - return True diff --git a/documentation/_build/html/_sources/PythonTutorial/definitions.txt b/documentation/_build/html/_sources/PythonTutorial/definitions.txt deleted file mode 100644 index fd8d78ad..00000000 --- a/documentation/_build/html/_sources/PythonTutorial/definitions.txt +++ /dev/null @@ -1,56 +0,0 @@ -.. -*- Mode: rst -*- - - -.. Hurricane doxygen doc links. -.. _Breakpoint: ../../hurricane/classHurricane_1_1Breakpoint.html -.. _UpdateSession: ../../hurricane/classHurricane_1_1UpdateSession.html -.. _Layer: ../../hurricane/classHurricane_1_1Layer.html -.. _Layers: ../../hurricane/classHurricane_1_1Layer.html -.. _Technology: ../../hurricane/classHurricane_1_1Technology.html -.. _DataBase: ../../hurricane/classHurricane_1_1DataBase.html -.. _DbU: ../../hurricane/classHurricane_1_1DbU.html -.. _Point: ../../hurricane/classHurricane_1_1Point.html -.. _Points: ../../hurricane/classHurricane_1_1Point.html -.. _Box: ../../hurricane/classHurricane_1_1Box.html -.. _Cell: ../../hurricane/classHurricane_1_1Cell.html -.. _Net: ../../hurricane/classHurricane_1_1Net.html -.. _Nets: ../../hurricane/classHurricane_1_1Net.html -.. _NetExternalComponents: ../../hurricane/classHurricane_1_1NetExternalComponents.html -.. _HyperNet: ../../hurricane/classHurricane_1_1HyperNet.html -.. _Component: ../../hurricane/classHurricane_1_1Component.html -.. _Components: ../../hurricane/classHurricane_1_1Component.html -.. _Contact: ../../hurricane/classHurricane_1_1Contact.html -.. _Contacts: ../../hurricane/classHurricane_1_1Contact.html -.. _Pad: ../../hurricane/classHurricane_1_1Pad.html -.. _RoutingPad: ../../hurricane/classHurricane_1_1RoutingPad.html -.. _RoutingPads: ../../hurricane/classHurricane_1_1RoutingPad.html -.. _Horizontal: ../../hurricane/classHurricane_1_1Horizontal.html -.. _Vertical: ../../hurricane/classHurricane_1_1Vertical.html -.. _Plug: ../../hurricane/classHurricane_1_1Plug.html -.. _Plugs: ../../hurricane/classHurricane_1_1Plug.html -.. _Collection: ../../hurricane/classHurricane_1_1Collection.html -.. _Instance: ../../hurricane/classHurricane_1_1Instance.html -.. _Instances: ../../hurricane/classHurricane_1_1Instance.html -.. _Transformation: ../../hurricane/classHurricane_1_1Transformation.html -.. _Orientation: ../../hurricane/classHurricane_1_1Orientation.html -.. _Occurrence: ../../hurricane/classHurricane_1_1Occurrence.html - -.. Hurricane Viewer doxygen doc links. -.. _CellViewer: ../../viewer/classHurricane_1_1CellViewer.html - -.. CRL Core doxygen doc links. -.. _AllianceFramework: ../../crlcore/classCRL_1_1AllianceFramework.html -.. _ToolEngine: ../../crlcore/classCRL_1_1ToolEngine.html -.. _ToolEngines: ../../crlcore/classCRL_1_1ToolEngine.html - -.. Hurricane Python Tutorial internal links. -.. _5. Make a script runnable through cgt: ./CgtScript.html -.. _3.6.3 Creating a Component: ./CellNetComponent.html#id1 -.. _6.2 Creating Nets and connecting to Instances: ./Netlist.html#id1 - -.. |rightarrow| replace:: :math:`\rightarrow` - -.. |fulladder_1| image:: ./images/fulladder-1.png - :alt: The fulladder netlist - :align: middle - :width: 80% diff --git a/documentation/_build/html/_sources/PythonTutorial/index.txt b/documentation/_build/html/_sources/PythonTutorial/index.txt deleted file mode 100644 index bc0ef11f..00000000 --- a/documentation/_build/html/_sources/PythonTutorial/index.txt +++ /dev/null @@ -1,29 +0,0 @@ -.. -*- mode: rst; explicit-buffer-name: "index.rst`_. - -First, a small disclaimer. This tutorial assumes that you are already familiar -with the concepts of |VLSI| designs, such as *netlist*, *layout*, *instances* -and hierarchical design. - - -.. toctree:: - :maxdepth: 2 - - Introduction.rst - Environment.rst - CellNetComponent.rst - Collections.rst - CgtScript.rst - Netlist.rst - RealDesigns.rst - ToolEngines.rst - AdvancedTopics.rst - diff --git a/documentation/_build/html/_sources/RDS/RDSpage.txt b/documentation/_build/html/_sources/RDS/RDSpage.txt deleted file mode 100644 index be3aa644..00000000 --- a/documentation/_build/html/_sources/RDS/RDSpage.txt +++ /dev/null @@ -1,474 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -.. Tools -.. |ocp| replace:: ``ocp`` -.. |nero| replace:: ``nero`` -.. |ring| replace:: ``ring`` -.. |s2r| replace:: ``s2r`` -.. |druc| replace:: ``druc`` -.. |graal| replace:: ``graal`` -.. |cougar| replace:: ``cougar`` -.. |cif| replace:: ``cif`` -.. |gds| replace:: ``gds`` -.. |phseg| replace:: ``phseg`` -.. |phvia| replace:: ``phvia`` - -.. RDS file syntax. -.. |MBK_TO_RDS_SEGMENT| replace:: ``MBK_TO_RDS_SEGMENT`` -.. |MBK_TO_RDS_VIA| replace:: ``MBK_TO_RDS_VIA`` -.. |MBK_TO_RDS_BIGVIA_HOLE| replace:: ``MBK_TO_RDS_BIGVIA_HOLE`` -.. |MBK_TO_RDS_BIGVIA_METAL| replace:: ``MBK_TO_RDS_BIGVIA_METAL`` -.. |MBK_WIRESETTING| replace:: ``MBK_WIRESETTING`` -.. |ALL| replace:: ``ALL`` -.. |DRC| replace:: ``DRC`` -.. |EXT| replace:: ``EXT`` -.. |VW| replace:: ``VW`` -.. |LCW| replace:: ``LCW`` -.. |RCW| replace:: ``RCW`` -.. |ALUx| replace:: ``ALUx`` -.. |CALUx| replace:: ``CALUx`` -.. |TALUx| replace:: ``TALUx`` -.. |ALU1| replace:: ``ALU1`` -.. |POLY| replace:: ``POLY`` -.. |NTIE| replace:: ``NTIE`` -.. |PTIE| replace:: ``PTIE`` -.. |NDIF| replace:: ``NDIF`` -.. |PDIF| replace:: ``PDIF`` -.. |PWELL| replace:: ``PWELL`` -.. |NTRANS| replace:: ``NTRANS`` -.. |PTRANS| replace:: ``PTRANS`` -.. |CONT_DIF_N| replace:: ``CONT_DIF_N`` -.. |CONT_DIF_P| replace:: ``CONT_DIF_P`` -.. |CONT_BODY_N| replace:: ``CONT_BODY_N`` -.. |CONT_BODY_P| replace:: ``CONT_BODY_P`` -.. |CONT_POLY| replace:: ``CONT_POLY`` -.. |CONT_VIA| replace:: ``CONT_VIA`` -.. |CONT_VIAx| replace:: ``CONT_VIAx`` -.. |C_X_N| replace:: ``C_X_N`` -.. |C_X_P| replace:: ``C_X_P`` -.. |RDS_NDIF| replace:: ``RDS_NDIF`` -.. |RDS_NIMP| replace:: ``RDS_NIMP`` -.. |RDS_ACTIV| replace:: ``RDS_ACTIV`` -.. |RDS_GATE| replace:: ``RDS_GATE`` -.. |RDS_POLY| replace:: ``RDS_POLY`` -.. |RDS_ALU1| replace:: ``RDS_ALU1`` - -.. Stand-alone images. -.. |RDS_VW| image:: ./images/RDS_VW.png - :alt: RDS Variable Width Rule - :align: middle - :width: 60% - -.. |RDS_LCW| image:: ./images/RDS_LCW.png - :alt: RDS Left Constant Width Rule - :align: middle - :width: 40% - -.. |SegmentOrientation| image:: ./images/SegmentOrientation.png - :alt: Symbolic Segment Orientations - :align: middle - :width: 50% - -.. |BIGVIA_1| image:: ./images/bigvia-1.png - :alt: BIGVIA holes - :align: middle - :width: 40% - -.. |BIGVIA_2| image:: ./images/bigvia-2.png - :alt: BIGVIA holes overlap - :align: middle - :width: 40% - - - -|newpage| - - -Symbolic Layout -=============== - -Symbolic Components -~~~~~~~~~~~~~~~~~~~ - -A symbolic layout is, in practice, made of only of three objects: - -=========================== ============ =================================================== -Object |MBK| Explanation -=========================== ============ =================================================== -Segments |phseg| Oriented segments with a width and an orientation. -VIAs & contacts |phvia| Boils down to just a point. -Big VIAs & Big Contacts |phvia| Point with a width and a height - That is a rectangle of width by height centered - on the VIA coordinates. -=========================== ============ =================================================== - -Each of thoses objects is associated to a *symbolic layer* which will -control how the object is translated in many *real rectangles*. - -+---------+---------------+-------------+--------------------------------------------+ -| |MBK| | Layer Name | Usable By | Usage | -+=========+===============+=============+============================================+ -| |phseg| | |NWELL| | Segment | N Well | -| +---------------+-------------+--------------------------------------------+ -| | |PWELL| | Segment | P Well | -| +---------------+-------------+--------------------------------------------+ -| | |NDIF| | Segment | N Diffusion | -| +---------------+-------------+--------------------------------------------+ -| | |PDIF| | Segment | P Diffusion | -| +---------------+-------------+--------------------------------------------+ -| | |NTIE| | Segment | N Tie | -| +---------------+-------------+--------------------------------------------+ -| | |PTIE| | Segment | P Tie | -| +---------------+-------------+--------------------------------------------+ -| | |NTRANS| | Segment | N transistor, in |Alliance|, a transistor | -| | | | is represented as a segment (it's grid). | -| +---------------+-------------+--------------------------------------------+ -| | |PTRANS| | Segment | P transistor | -| +---------------+-------------+--------------------------------------------+ -| | |POLY| | Segment | Polysilicium | -| +---------------+-------------+--------------------------------------------+ -| | |ALUx| | Segment | Metal level *x* | -| +---------------+-------------+--------------------------------------------+ -| | |CALUx| | Segment | Metal level *x*, that can be used by the | -| | | | upper hierarchical level as a connector. | -| | | | From the layout point of view it is the | -| | | | same as |ALUx|. | -| +---------------+-------------+--------------------------------------------+ -| | |TALUx| | Segment | Blockage for metal level *x*. Will | -| | | | diseappear in the real layout as it is an | -| | | | information for the P&R tools only. | -+---------+---------------+-------------+--------------------------------------------+ -| |phvia| | |CONT_BODY_N| | VIA, BIGVIA | Contact to N Well | -| +---------------+-------------+--------------------------------------------+ -| | |CONT_BODY_P| | VIA, BIGVIA | Contact to P Well | -| +---------------+-------------+--------------------------------------------+ -| | |CONT_DIF_N| | VIA, BIGVIA | Contact to N Diffusion | -| +---------------+-------------+--------------------------------------------+ -| | |CONT_DIF_P| | VIA, BIGVIA | Contact to P Diffusion | -| +---------------+-------------+--------------------------------------------+ -| | |CONT_POLY| | VIA, BIGVIA | Contact to polysilicium | -| +---------------+-------------+--------------------------------------------+ -| | |CONT_VIA| | VIA, BIGVIA | Contact between metal1 and metal2 | -| +---------------+-------------+--------------------------------------------+ -| | |CONT_VIAx| | VIA, BIGVIA | Contact between metal *x* and metal *x+1*. | -| | | | The index is the the one of the bottom | -| | | | metal of the VIA. | -| +---------------+-------------+--------------------------------------------+ -| | |C_X_N| | VIA | N transistor corner, to build transistor | -| | | | bend. Not used anymore in recent technos | -| +---------------+-------------+--------------------------------------------+ -| | |C_X_P| | VIA | P transistor corner, to build transistor | -| | | | bend. Not used anymore in recent technos | -+---------+---------------+-------------+--------------------------------------------+ - -.. note:: - Not all association of object and symbolic layers are meaningful. - For instance you cannot associate a contact to a ``NTRANS`` layer. - -.. note:: - The symbolic layer associated with blockages is prefixed by a ``T``, - for *transparency*, which may seems silly. It is for historical reasons, - it started as a true transparency, but at some point we had to invert - the meaning (blockage) with the rise of over-the-cell routing, but the - name stuck... - - - -Symbolic Segments -~~~~~~~~~~~~~~~~~ - -In |Alliance|, segments are oriented (up, down, left, right). This disambiguate -the left or right side when using the ``LCW`` and ``RCW`` rules in the |RDS| file. -It allows to generate, if needed, asymetric object in the real layout file. - -|bcenter| |SegmentOrientation| |ecenter| - -|newpage| - - -The RDS File -============ - - -The RDS file control how a symbolic layout is transformed into it's real -conterpart. - -.. note:: **Unit used inside the RDS file:** all units are expressed in micrometers. - -Alliance tools relying on the RDS file, and what layers are active for them: - -======================================= ============= =============================== -Tool Name RDS Flags -======================================= ============= =============================== -Layout editor |graal| |ALL| -Design Rule Checker |druc| |ALL|, |DRC| -Electrical extractor |cougar| |ALL|, |EXT| -The symbolic to real layout translator |s2r| |ALL| -======================================= ============= =============================== - - -Physical Grid & Lambda Value -~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -RDS file: :: - - DEFINE PHYSICAL_GRID 0.005 - DEFINE LAMBDA 0.09 - -Tells that the physical grid (founder grid) step is 0.005µm and the lambda has -a value of 0.09µm. That is, one lambda is 18 grid steps. - -We can distinguish two kind of |RDS| files: - -* The *1µm* kind, odd segment widths and coordinates are allowed, but the ``LAMBDA`` - value **must** represent an *even* number of foundry grid step. -* The *2µm* kind, segments widths and coordinates must all be even. And in that case - the ``LAMBDA`` value can be any multiple of the foundry grid. - - -The |MBK_TO_RDS_SEGMENT| table -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The |MBK_TO_RDS_SEGMENT| table control the way segments are translated into -real rectangles. Be aware that we are translating *segments* and not *rectangles*. -Segments are defined by their axis (source & target points) and their width. -The geometrical transformations are described according to that model. -Obviously, they are either horizontal or vertical. - -The translation method of a symbolic segment is as follow: - -1. The segment is translated into one or more physical rectangles. - The generated rectangles depends on the tool which is actually - using |RDS| and the flag for the considered real layer. - For instance, real layers flagged with |DRC| will be generated - for |s2r| (for the |cif| or |gds|) and |druc|, but will not - be shown under |graal|. - -2. Translation into one real layer. *First* the source & target coordinates and width - of the symbolic segment are multiplied by the ``LAMBDA`` value to obtain a real - segment. *Then* one of the |VW|, |LCW| or |RCW| transformation is applied to - that segment to get the final real rectangle. - - * |VW| for Variable Width, expand the real layer staying centered from the - original one. In those rules, the third number is not used, it is only here - to make the life easier for the parser... - - |bcenter| |RDS_VW| |ecenter| - - * |LCW| or |RCW| for Left/Right Constant Width, create an off-center rectangle - of fixed width relatively to the real segment. Note that the ``SP`` number - is the distance *between the edge* of the real segment and the edge of the - generated real rectangle (*not* from the axis). It is often zero. - - |bcenter| |RDS_LCW| |ecenter| - - -|newpage| - -Examples: :: - - TABLE MBK_TO_RDS_SEGMENT - - # (Case 1) - ALU1 RDS_ALU1 VW 0.18 0.09 0.0 ALL - - # (Case 2) - NDIF RDS_NDIF VW 0.18 0.0 0.0 ALL \ - RDS_ACTIV VW 0.18 0.0 0.0 DRC \ - RDS_NIMP VW 0.36 0.36 0.0 DRC - - # (Case 3) - NTRANS RDS_POLY VW 0.27 0.00 0.0 ALL \ - RDS_GATE VW 0.27 0.00 0.0 DRC \ - RDS_NDIF LCW 0.0 0.27 0.0 EXT \ - RDS_NDIF RCW 0.0 0.27 0.0 EXT \ - RDS_NDIF VW 0.0 0.72 0.0 DRC \ - RDS_ACTIV VW 0.0 0.72 0.0 ALL \ - RDS_NIMP VW 0.18 1.26 0.0 DRC - - END - -:fboxtt:`Case 1` the |ALU1| is translated in exacltly one real rectangle of -|RDS_ALU1|, both ends are extended by 0.18µm and it's width is increased -by 0.09µm. - -:fboxtt:`Case 2` the |NDIF| will be translated into only one segment -under |graal|, for symbolic visualization. And into three real rectangles -for |s2r| and |druc|. - -:fboxtt:`Case 3` the |NTRANS|, associated to a transistor is a little bit -more complex, the generated shapes are different for the extractor |cougar| -in one hand, and for both |druc| & |s2r| in the other hand. - -* For the extractor (|EXT| & |ALL| flags) there will be four rectangles - generateds: - - 1. The gate (|RDS_GATE|) - 2. The left diffusion of the transistor (source or drain) (|RDS_NDIF|). - 3. The right diffusion of the transistor (drain or source) (|RDS_NDIF|). - 4. The active area (|RDS_ACTIV|). - - As the extractor must kept separate the source and the drain of the transistor, - they are generated as two offset rectangles, using the |LCW| and |RCW| directives. - -* For |s2r| and |druc| (|DRC| and |ALL|), five rectangles are generateds: - - 1. The poly (|RDS_POLY|). - 2. The gate (|RDS_GATE|). - 3. The diffusion, as one rectangle that covers both the |LCW| and the |RCW| (|RDS_NDIF|). - 4. The active area (|RDS_ACTIV|). - 5. The N implantation (|RDS_NIMP|). - - In the layout send to the foundry, the source & drain are draw as one rectangle - across the gate area (the transistor being defined by the intersection of both - rectangles). - - -|newpage| - -The |MBK_TO_RDS_VIA| table -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This table is to translate *default* VIAs into real via. In the symbolic layout -the default VIA is simply a point and a set of layers. All layers are converted -in squares shapes centered on the VIA coordinate. The one dimension given is the -size of the side of that square. - -Note that although we are refering to VIAs, which for the purists are between two -metal layers, this table also describe *contacts*. - -Example: :: - - TABLE MBK_TO_RDS_VIA - - CONT_DIF_P RDS_PDIF 0.54 ALL \ - RDS_CONT 0.18 ALL \ - RDS_ALU1 0.36 ALL \ - RDS_ACTIV 0.54 DRC \ - RDS_PIMP 0.90 DRC - - CONT_POLY RDS_POLY 0.54 ALL \ - RDS_CONT 0.18 ALL \ - RDS_ALU1 0.36 ALL - - CONT_VIA RDS_ALU1 0.45 ALL \ - RDS_VIA1 0.27 ALL \ - RDS_ALU2 0.45 ALL - - END - -.. note:: **In CONT_DIF_P** you may see that only three layers will be shown under - |graal|, but five will be generated in the |gds| layout. - - -The |MBK_TO_RDS_BIGVIA_HOLE| table -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -In |s2r|, when generating BIGVIAs, the matrix of holes they contains is -not draw relative to the position of the BIGVIA itself, but on a grid which -is common througout all the design real layout. This is to allow overlap -between two BIGVIA without risking the holes matrix to be not exactly overlapping. -As a consequence, when visualizing the |gds| file, the holes may not be centerend -inside one individual BIGVIA. - -The |MBK_TO_RDS_BIGVIA_HOLE| table define the global hole matrix for the whole -design. The first number is the individual hole side and the second the grid step -(edge to edge). The figure below show the hole generation. - -|bcenter| |BIGVIA_1| |ecenter| - -Example of BIGVIA overlap: - -|bcenter| |BIGVIA_2| |ecenter| - -Example: :: - - TABLE MBK_TO_RDS_BIGVIA_HOLE - - CONT_VIA RDS_VIA1 0.27 0.27 ALL - CONT_VIA2 RDS_VIA2 0.27 0.27 ALL - CONT_VIA3 RDS_VIA3 0.27 0.27 ALL - CONT_VIA4 RDS_VIA4 0.27 0.27 ALL - CONT_VIA5 RDS_VIA5 0.36 0.36 ALL - - END - -.. note:: **BIGVIA demotion.** If the size of the bigvia is too small, there is - a possibility that no hole from the global matrix will be under it. - To avoid that case, if the either side of the BIGVIA is less than - ``1.5 * step``, the BIGVIA is demoted to a simple VIA. - - -The |MBK_TO_RDS_BIGVIA_METAL| table -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This table describe how the metal part of a BIGVIA is expanded (for the hole -part, see the previous table |MBK_TO_RDS_BIGVIA_HOLE|). The rule give for each -metal: - -1. The *delta-with* (have to ask Franck). -2. The *overhang*, the length the real rectangle is expanded on each side from - the symbolic rectange. - -Example: :: - - TABLE MBK_TO_RDS_BIGVIA_METAL - - CONT_VIA RDS_ALU1 0.0 0.09 ALL \ - RDS_ALU2 0.0 0.09 ALL - - CONT_VIA2 RDS_ALU2 0.0 0.09 ALL \ - RDS_ALU3 0.0 0.09 ALL - - CONT_VIA3 RDS_ALU3 0.0 0.09 ALL \ - RDS_ALU4 0.0 0.09 ALL - - CONT_VIA4 RDS_ALU4 0.0 0.09 ALL \ - RDS_ALU5 0.0 0.09 ALL - - CONT_VIA5 RDS_ALU5 0.0 0.09 ALL \ - RDS_ALU6 0.0 0.18 ALL - END - - -The |MBK_WIRESETTING| table -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -From a strict standpoint this table shouldn't be here but put in a separate -configuration file, because it contains informations only used by the symbolic -layout tools (|ocp|, |nero|, |ring|). - -This table defines the cell gauge the routing pitch and minimal (symbolic) -wire width and minimal spacing for the routers. They are patly redundant. - -Example: :: - - TABLE MBK_WIRESETTING - - X_GRID 10 - Y_GRID 10 - Y_SLICE 100 - WIDTH_VDD 12 - WIDTH_VSS 12 - TRACK_WIDTH_ALU8 0 - TRACK_WIDTH_ALU7 4 - TRACK_WIDTH_ALU6 4 - TRACK_WIDTH_ALU5 4 - TRACK_WIDTH_ALU4 3 - TRACK_WIDTH_ALU3 3 - TRACK_WIDTH_ALU2 3 - TRACK_WIDTH_ALU1 3 - TRACK_SPACING_ALU8 0 - TRACK_SPACING_ALU7 4 - TRACK_SPACING_ALU6 4 - TRACK_SPACING_ALU5 4 - TRACK_SPACING_ALU4 4 - TRACK_SPACING_ALU3 4 - TRACK_SPACING_ALU2 4 - TRACK_SPACING_ALU1 3 - - END - diff --git a/documentation/_build/html/_sources/RDS/index.txt b/documentation/_build/html/_sources/RDS/index.txt deleted file mode 100644 index 8d7505e9..00000000 --- a/documentation/_build/html/_sources/RDS/index.txt +++ /dev/null @@ -1,26 +0,0 @@ -.. -*- mode: rst; explicit-buffer-name: "index.rst" -*- - -.. include:: ../etc/definitions.rst - - -:Date: 26, september 2014 -:Authors: Jean-Paul Chaput -:Contact: -:Version: 0.2 - - -**Disclaimer:** This document is still far from complete. - - -============================================== -RDS -- Symbolic to Real Conversion in Alliance -============================================== - -Printable version of this document `RDS.pdf <../../../pdf/main/RDS.pdf>`_. - - -.. toctree:: - :maxdepth: 2 - - RDSpage.rst - diff --git a/documentation/_build/html/_sources/Stratus/Developper.txt b/documentation/_build/html/_sources/Stratus/Developper.txt deleted file mode 100644 index f764241a..00000000 --- a/documentation/_build/html/_sources/Stratus/Developper.txt +++ /dev/null @@ -1,315 +0,0 @@ -========================== -Stratus Developper's Guide -========================== -Sophie Belloeil - - -Class Model -=========== - -Synopsys --------- - -:: - - class myClass ( Model ) : - ... - - exemple = myClass ( name, param ) - -Description ------------ - -Every cell made is a class herited from class ``Model``. -Some methods have to be created, like ``Interface``, ``Netlist`` ... -Some methods are inherited from the class ``Model``. - -Parameters ----------- - -- ``name`` : The name of the cell (which is the name of the files which - will be created) - -- ``param`` : A dictionnary which gives all the parameters useful in - order to create the cell - -Attributes ----------- - -- ``_name`` : Name of the cell - -- ``_st_insts`` : List of all the instances of the cell - -- ``_st_ports`` : List of all the external nets of the cell (except for - alimentations and clock) - -- ``_st_sigs`` : List of all the internal nets of the cell - -- ``_st_vdds``, ``_st_vsss`` : Two tabs of the nets which are - instancied as ``VddIn`` and ``VssIn`` - -- ``_st_cks`` : List of all the nets which are instancied as ``CkIn`` - -- ``_st_merge`` : List of all the internal nets which have to be merged - -- ``_param`` : The map given as argument at the creation of the cell - -- ``_underCells`` : List of all the instances which are cells that have - to be created - -- ``_and``, ``_or``, ``_xor``, ``_not``, ``_buff``, ``_mux``, ``_reg``, - ``_shift``, ``_comp``, ``_add``, ``_mult``, ``_div`` : tells which - generator to use when using overloard - -- ``_NB_INST`` : The number of instances of the cell (useful in order - to automatically give a name to the instances) - -- ``_TAB_NETS_OUT`` and ``_TAB_NETS_CAT`` : Lists of all the nets - automatically created - -- ``_insref`` : The reference instance (for placement) - -And, in connection with Hurricane : - -- ``_hur_cell`` : The hurricane cell (None by default) - -- ``_db`` : The database - -- ``_lib0`` : ``self._db.Get_CATA_LIB ( 0 )`` - -- ``_nb_alims_verticales``, ``_nb_pins``, ``_nb_vdd_pins``, - ``_nb_vss_pins``, ``standard_instances_list``, ``pad_north``, - ``pad_south``, ``pad_east``, ``pad_west`` : all place and route - stuffs ... - -Methods -------- - -Methods of class ``Model`` are listed below : - -- ``HurricanePlug`` : Creates the Hurricane cell thanks to the - stratus cell. - Before calling this method, only the stratus cell is created, after - this method, both cells are created. This method has to be called - before View and Save, and before Layout. - -- ``View`` : Opens/Refreshes the editor in order to see the created - layout - -- ``Quit`` : Finishes a cell without saving - -- ``Save`` : Saves the created cell - If several cells have been created, they are all going to be saved - in separated files - -Some of those methods have to be defined in order to create a new cell : - -- ``Interface`` : Description of the external ports of the cell - -- ``Netlist`` : Description of the netlist of the cell - -- ``Layout`` : Description of the layout of the cell - -- ``Vbe`` : Description of the behavior of the cell - -- ``Pattern`` : Description of the patterns in order to test the cell - -Nets -==== - -Synopsys --------- - -:: - - netInput = LogicIn ( name, arity ) - -Description ------------ - -Instanciation of net. Differents kind of nets are listed below : - -- ``LogicIn`` : Creation of an input port - -- ``LogicOut`` : Creation of an output port - -- ``LogicInOut`` : Creation of an inout port - -- ``LogicUnknown`` : Creation of an input/output port which direction - is not defined - -- ``TriState`` : Creation of a tristate port - -- ``CkIn`` : Creation of a clock port - -- ``VddIn`` : Creation of the vdd alimentation - -- ``VssIn`` : Creation of the vss alimentation - -- ``Signal`` : Creation of an internal net - -Parameters ----------- - -- ``name`` : Name of the net (mandatory argument) - -- ``arity`` : Arity of the net (mandatory argument) - -- ``indice`` : For buses only : the LSB bit (optional argument : set - to 0 by default) - -Only ``CkIn, ``\ ``VddIn`` and ``VssIn`` do not have the same parameters: there is only the ``name`` parameter (they are 1 bit nets). - -Attributes ----------- - -- ``_name`` : Name of the net - -- ``_arity`` : Arity of the net (by default set to 0) - -- ``_ind`` : LSB of the net - -- ``_ext`` : Tells if the net is external or not (True/False) - -- ``_direct`` : If the net is external, tells the direction (“INâ€, - “OUTâ€, “INOUTâ€, “TRISTATEâ€, “UNKNOWNâ€) - -- ``_h_type`` : If the net is an alimentation or a clock, tells the - type (“POWERâ€, “GROUNDâ€, “CLOCKâ€) - -- ``_type`` : The arithmetic type of the net ( “nr†) - -- ``_st_cell`` : The stratus cell which the net is instanciated in - -- ``_real_net`` : If the net is a part of a net (Sig) it is the real - net corresponding - -- ``_alias`` : [] by default. When the net has an alias, it’s a tab. - Each element of the tab correspond to a bit of the net (from the LSB - to the MSB), it’a a dictionnary : the only key is the net which this - net is an alias from, the value is the bit of the net - -- ``_to_merge`` : [] by default. The same as \_alias - -- | ``_to_cat`` : [] by default. The same as \_alias - -And, in connection with Hurricane : - -- ``_hur_net`` : A tab with all the hurricane nets corresponding to the - stratus net ; From the LSB to the MSB (for example, with a 1 bit net, - one gets the hurricane net by doing : ``net._hur_net[0]`` ). - -Methods -------- - -- ``Buffer`` : Instanciation of a Buffer - -- ``Shift`` : Instanciation of a shifter - -- ``Mux`` : Instanciation of a multiplexor - -- ``Reg`` : Instanciation of a register - -- ``Eq/Ne`` : Instanciation of comparison generator - -- ``Extend`` : A net is extended - -- ``Alias`` : A net is an alias of another net - -- | ``Delete`` : Deletion of the Hurricane nets - -And the overloards : - -- \_\_init\_\_ : Initialisation of nets - -- \_\_le\_\_ : initialisation of a net thanks to <= notation - -- \_\_getitem\_\_, \_\_geslice\_\_ : Creation of “Sig†nets : which are - part of nets (use of ``[]`` and ``[:]``) - -- \_\_and\_\_, \_\_or\_\_, \_\_xor\_\_, \_\_invert\_\_ : boolean - operation with &, \|, ^ ,   - -- \_\_add\_\_, \_\_mul\_\_, \_\_div\_\_ : arithmetic operators with +, - \* and / - -Instances -========= - -Synopsys --------- - -:: - - Inst ( model - , name - , param = myParam - , map = myMap - ) - -Description ------------ - -Instantiation of an instance. The type of the instance is given by the -``model`` parameter. The connexions are made thanks to the ``map`` -parameters. - -Parameters ----------- - -- ``model`` : Name of the mastercell of the instance to create - (mandatory argument) - -- ``name`` : Name of the instance (optional) - When this argument is not defined, the instance has a name created - by default. This argument is usefull when one wants to create a - layout as well. Indeed, the placement of the instances is much easier - when the conceptor has chosen himself the name f the instances. - -- ``param`` : Dictionnary for parameters of the mastercell (optional : - only for mastercells which require it) - -- ``map`` : Dictionnary for connexions in order to make the netlist - -Attributes ----------- - -- ``_name`` : Name of the instance (the name given as parameter if - there’s one, a name created otherwise) - -- ``_model`` : Name of the model given as argument - -- ``_real_model`` : Name of the model created thanks to ``_model`` and - all the parameters - -- ``_map`` : Dictionnary ``map`` given at the instanciation - -- ``_param`` : Dictionnary ``param`` given at the instanciation - -- ``_st_cell`` : The stratus cell which the instance is instanciated in - -- ``_st_masterCell`` : The stratus master cell of the instance - -For placement : - -- ``_plac`` : tells if the instance is placed or not (UNPLACED by - default) - -- ``_x``, ``_y`` : the coordinates of the instance (only for placed - instances) - -- ``_sym`` : the symetry of the instance (only for placed instances) - -And, in connection with Hurricane : - -- ``_hur_instance`` : The hurricane instance (None by default) - -- ``_hur_masterCell`` : The Hurricane master cell of the instance (None - by default) - -Methods -------- - -- Delete : Deletion of the Hurricane instance - - diff --git a/documentation/_build/html/_sources/Stratus/DpGen.txt b/documentation/_build/html/_sources/Stratus/DpGen.txt deleted file mode 100644 index cd8c1cac..00000000 --- a/documentation/_build/html/_sources/Stratus/DpGen.txt +++ /dev/null @@ -1,3540 +0,0 @@ -======================= -DpGen generators manual -======================= -Sophie Belloeil - - -DpgenInv -======== - -- **Name** : DpgenInv – Inverter Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenInv', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits inverter with an output - power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **nq** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 1, 2, 4 or 8 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= not ( i0 ) - -- **Example** : - - :: - - from stratus import * - - class inst_inv ( Model ) : - - def Interface ( self ) : - self.i = SignalIn ( "i", 54 ) - self.o = SignalOut ( "o", 54 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenInv', 'inv_54' - , param = { 'nbit' : 54 - , 'physical' : True - } - ) - self.I = Inst ( 'inv_54', 'inst' - , map = { 'i0' : self.i - , 'nq' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenBuff -========= - -- **Name** : DpgenBuff – Buffer Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenBuff', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits inverter with an output - power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **q** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 2, 4 or 8 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= i0 - -- **Example** : - - :: - - from stratus import * - - class inst_buff ( Model ) : - - def Interface ( self ) : - self.i = SignalIn ( "i", 32 ) - self.o = SignalOut ( "o", 32 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenBuff', 'buff_32' - , param = { 'nbit' : 32 - , 'physical' : True - } - ) - self.I = Inst ( 'buff_32', 'inst' - , map = { 'i0' : self.i - , 'q' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenNand2 -========== - -- **Name** : DpgenNand2 – Nand2 Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenNand2', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits two inputs NAND with an - output power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **i1** : input (``n`` bits) - - - **nq** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 1 or 4 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= not ( i0 and i1 ) - -- **Example** : - - :: - - from stratus import * - - class inst_nand2 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 8 ) - self.in2 = SignalIn ( "in2", 8 ) - self.o = SignalOut ( "o", 8 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenNand2', 'nand2_8' - , param = { 'nbit' : 8 - , 'physical' : True - } - ) - self.I = Inst ( 'nand2_8', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'nq' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenNand3 -========== - -- **Name** : DpgenNand3 – Nand3 Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenNand3', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits three inputs NAND with an - output power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **i1** : input (``n`` bits) - - - **i2** : input (``n`` bits) - - - **nq** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 1 or 4 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= not ( i0 and i1 and i2 ) - -- **Example** : - - :: - - from stratus import * - - class inst_nand3 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 20 ) - self.in2 = SignalIn ( "in2", 20 ) - self.in3 = SignalIn ( "in3", 20 ) - self.o = SignalOut ( "o", 20 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenNand3', 'nand3_20' - , param = { 'nbit' : 20 - , 'physical' : True - } - ) - self.I = Inst ( 'nand3_20', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'i2' : self.in3 - , 'nq' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -Dpgennand4 -========== - -- **Name** : DpgenNand4 – Nand4 Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenNand4', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits four inputs NAND with an - output power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **i1** : input (``n`` bits) - - - **i2** : input (``n`` bits) - - - **i3** : input (``n`` bits) - - - **nq** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 1 or 4 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= not ( i0 and i1 and i2 and i3 ) - -- **Example** : - - :: - - from stratus import * - - class inst_nand4 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 9 ) - self.in2 = SignalIn ( "in2", 9 ) - self.in3 = SignalIn ( "in3", 9 ) - self.in4 = SignalIn ( "in4", 9 ) - self.o = SignalOut ( "o", 9 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenNand4', 'nand4_9' - , param = { 'nbit' : 9 - , 'physical' : True - } - ) - self.I = Inst ( 'nand4_9', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'i2' : self.in3 - , 'i3' : self.in4 - , 'nq' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenAnd2 -========= - -- **Name** : DpgenAnd2 – And2 Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenAnd2', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits two inputs AND with an - output power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **i1** : input (``n`` bits) - - - **q** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 2 or 4 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= i0 and i1 - -- **Example** : - - :: - - from stratus import * - - class inst_and2 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 8 ) - self.in2 = SignalIn ( "in2", 8 ) - self.out = SignalOut ( "o", 8 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenAnd2', 'and2_8' - , param = { 'nbit' : 8 - , 'physical' : True - } - ) - self.I = Inst ( 'and2_8', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'q' : self.out - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenAnd3 -========= - -- **Name** : DpgenAnd3 – And3 Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenAnd3', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits three inputs AND with an - output power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **i1** : input (``n`` bits) - - - **i2** : input (``n`` bits) - - - **q** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional): Defines the output power of the gates - - - Valid drive are : 2 or 4 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False): In order to - generate a layout - - - **behavioral** (optional, default value : False): In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= i0 and i1 and i2 - -- **Example** : - - :: - - from stratus import * - - class inst_and3 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 16 ) - self.in2 = SignalIn ( "in2", 16 ) - self.in3 = SignalIn ( "in3", 16 ) - self.out = SignalOut ( "o", 16 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenAnd3', "and3_16" - , param = { 'nbit' : 16 - , 'physical' : True - } - ) - self.I = Inst ( 'and3_16', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'i2' : self.in3 - , 'q' : self.out - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref (0, 0) ) - -DpgenAnd4 -========= - -- **Name** : DpgenAnd4 – And4 Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenAnd4', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits four inputs AND with an - output power of ``d`` named ``modelname``. - -- Terminal Names : - - - **i0** : input (``n`` bits) - - - **i1** : input (``n`` bits) - - - **i2** : input (``n`` bits) - - - **i3** : input (``n`` bits) - - - **q** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 2 or 4 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= i0 and i1 and i2 and i3 - -- **Example** : - - :: - - from stratus import * - - class inst_and4 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 2 ) - self.in2 = SignalIn ( "in2", 2 ) - self.in3 = SignalIn ( "in3", 2 ) - self.in4 = SignalIn ( "in4", 2 ) - self.out = SignalOut ( "o", 2 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenAnd4', 'and4_2' - , param = { 'nbit' : 2 - , 'physical' : True - } - ) - self.I = Inst ( 'and4_2', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'i2' : self.in3 - , 'i3' : self.in4 - , 'q' : self.out - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenNor2 -========= - -- **Name** : DpgenNor2 – Nor2 Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenNor2', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits two inputs NOR with an - output power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **i1** : input (``n`` bits) - - - **nq** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 1 or 4 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= not ( i0 or i1 ) - -- **Example** : - - :: - - from stratus import * - - class inst_nor2 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 8 ) - self.in2 = SignalIn ( "in2", 8 ) - self.o = SignalOut ( "o", 8 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenNor2', 'nor2_8' - , param = { 'nbit' : 8 - , 'physical' : True - } - ) - self.I = Inst ( 'nor2_8', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'nq' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenNor3 -========= - -- **Name** : DpgenNor3 – Nor3 Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenNor3', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits three inputs NOR with an - output power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **i1** : input (``n`` bits) - - - **i2** : input (``n`` bits) - - - **nq** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 1 or 4 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= not ( i0 or i1 or i2 ) - -- **Example** : - - :: - - from stratus import * - - class inst_nor3 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 3 ) - self.in2 = SignalIn ( "in2", 3 ) - self.in3 = SignalIn ( "in3", 3 ) - self.o = SignalOut ( "out", 3 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenNor3', 'nor3_3' - , param = { 'nbit' : 3 - , 'physical' : True - } - ) - self.I = Inst ( 'nor3_3', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'i2' : self.in3 - , 'nq' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenNor4 -========= - -- **Name** : DpgenNor4 – Nor4 Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenNor4', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits four inputs NOR with an - output power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **i1** : input (``n`` bits) - - - **i2** : input (``n`` bits) - - - **i3** : input (``n`` bits) - - - **nq** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 1 or 4 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= not ( i0 or i1 or i2 or i3 ) - -- **Example** : - - :: - - from stratus import * - - class inst_nor4 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 15 ) - self.in2 = SignalIn ( "in2", 15 ) - self.in3 = SignalIn ( "in3", 15 ) - self.in4 = SignalIn ( "in4", 15 ) - self.out = SignalOut ( "o", 15 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenNor4', 'nor4_15' - , param = { 'nbit' : 15 - , 'physical' : True - } - ) - self.I = Inst ( 'nor4_15', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'i2' : self.in3 - , 'i3' : self.in4 - , 'nq' : self.out - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenOr2 -======== - -- **Name** : DpgenOr2 – Or2 Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenOr2', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits two inputs OR with an output - power of ``drive`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **i1** : input (``n`` bits) - - - **q** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the a map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 2 or 4 - - - If this parameter is not defined, the ``drive`` is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= i0 or i1 - -- **Example** : - - :: - - from stratus import * - - class inst_or2 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 8 ) - self.in2 = SignalIn ( "in2", 8 ) - self.o = SignalOut ( "o", 8 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenOr2', 'or2_8' - , param = { 'nbit' : 8 - , 'physical' : True - } - ) - self.I = Inst ( 'or2_8', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'q' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenOr3 -======== - -- **Name** : DpgenOr3 – Or3 Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenOr3', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits three inputs OR with an - output power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **i1** : input (``n`` bits) - - - **i2** : input (``n`` bits) - - - **q** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 2 or 4 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= i0 or i1 or i2 - -- **Example** : - - :: - - from stratus import * - - class inst_or3 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 5 ) - self.in2 = SignalIn ( "in2", 5 ) - self.in3 = SignalIn ( "in3", 5 ) - self.o = SignalOut ( "o", 5 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenOr3', 'or3_5' - , param = { 'nbit' : 5 - , 'physical' : True - } - ) - self.I = Inst ( 'or3_5', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'i2' : self.in3 - , 'q' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenOr4 -======== - -- **Name** : DpgenOr4 – Or4 Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenOr4', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits four inputs OR with an - output power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **i1** : input (``n`` bits) - - - **i2** : input (``n`` bits) - - - **i3** : input (``n`` bits) - - - **q** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 2 or 4 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= i0 or i1 or i2 or i3 - -- **Example** : - - :: - - from stratus import * - - class inst_or4 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 16 ) - self.in2 = SignalIn ( "in2", 16 ) - self.in3 = SignalIn ( "in3", 16 ) - self.in4 = SignalIn ( "in4", 16 ) - self.out = SignalOut ( "o", 16 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenOr4', 'or4_16' - , param = { 'nbit' : 16 - , 'physical' : True - } - ) - self.I = Inst ( 'or4_16', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'i2' : self.in3 - , 'i3' : self.in4 - , 'q' : self.out - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenXor2 -========= - -- **Name** : DpgenXor2 – Xor2 Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenXor2', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits two inputs XOR with an - output power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **i1** : input (``n`` bits) - - - **q** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 2 or 4 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optionnal, default value : False) : In order to - generate a layout - - - **behavioral** (optionnal, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= i0 xor i1 - -- **Example** : - - :: - - from stratus import * - - class inst_xor2 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 8 ) - self.in2 = SignalIn ( "in2", 8 ) - self.o = SignalOut ( "o", 8 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenXor2', 'xor2_8' - , param = { 'nbit' : 8 - , 'physical' : True - } - ) - self.I = Inst ( 'xor2_8', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'q' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenXnor2 -========== - -- **Name** : DpgenXnor2 – Xnor2 Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenXnor2', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits two inputs XNOR with an - output power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **i0** : input (``n`` bits) - - - **i1** : input (``n`` bits) - - - **nq** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 1 or 4 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= not ( i0 xor i1 ) - -- **Example** : - - :: - - from stratus import * - - class inst_xnor2 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 8 ) - self.in2 = SignalIn ( "in2", 8 ) - self.o = SignalOut ( "o", 8 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenXnor2', 'xnor2_8' - , param = { 'nbit' : 8 - , 'physical' : True - } - ) - self.I = Inst ( 'xnor2_8', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'nq' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenNmux2 -========== - -- **Name** : DpgenNmux2 – Multiplexer Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenNmux2', modelname - , param = { 'nbit' : n - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits two inputs multiplexer named - ``modelname``. - -- **Terminal Names** : - - - **cmd** : select ( 1 bit ) - - - **i0** : input ( ``n`` bits ) - - - **i1** : input ( ``n`` bits ) - - - **nq** : output ( ``n`` bits ) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= WITH cmd SELECT not i0 WHEN '0', - not i1 WHEN '1'; - -- **Example** : - - :: - - from stratus import * - - class inst_nmux2 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 5 ) - self.in2 = SignalIn ( "in2", 5 ) - self.cmd = SignalIn ( "cmd", 1 ) - self.o = SignalOut ( "o", 5 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenNmux2', 'nmux2_5' - , param = { 'nbit' : 5 - , 'physical' : True - } - ) - self.I = Inst ( 'nmux2_5', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'cmd' : self.cmd - , 'nq' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenMux2 -========= - -- **Name** : DpgenMux2 – Multiplexer Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenMux2', modelname - , param = { 'nbit' : n - , 'drive' : d - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits two inputs multiplexer with - an output power of ``d`` named ``modelname``. - -- **Terminal Names** : - - - **cmd** : select ( 1 bit ) - - - **i0** : input ( ``n`` bits ) - - - **i1** : input ( ``n`` bits ) - - - **q** : output ( ``n`` bits ) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **nbit\_cmd** (mandatory) : Defines the size of the generator - - - **drive** (optional) : Defines the output power of the gates - - - Valid drive are : 2 or 4 - - - If this parameter is not defined, it’s value is the smallest - one permitted - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nq <= WITH cmd SELECT i0 WHEN '0', - i1 WHEN '1'; - -- **Example** : - - :: - - from stratus import * - - class inst_mux2 ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 8 ) - self.in2 = SignalIn ( "in2", 8 ) - self.cmd = SignalIn ( "cmd", 1 ) - self.o = SignalOut ( "o", 8 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenMux2', 'mux2_8' - , param = { 'nbit' : 8 - , 'physical' : True - } - ) - self.I = Inst ( 'mux2_8', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'cmd' : self.cmd - , 'q' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenNbuse -========== - -- **Name** : DpgenNbuse – Tristate Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenNbuse', modelname - , param = { 'nbit' : n - , 'physical' : true - , 'behavioral' : true - } - ) - -- **Description** : Generates a ``n`` bits tristate with an - complemented output named ``modelname``. - -- **Terminal Names** : - - - **cmd** : select ( 1 bit ) - - - **i0** : input ( ``n`` bits ) - - - **nq** : output ( ``n`` bits ) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nts:BLOCK(cmd = '1') BEGIN - nq <= GUARDED not(i0); - END - -- **Example** : - - :: - - from stratus import * - - class inst_nbuse ( Model ) : - - def Interface ( self ) : - self.i = SignalIn ( "i", 29 ) - self.cmd = SignalIn ( "cmd", 1 ) - self.o = SignalOut ( "o", 29 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenNbuse', 'nbuse29' - , param = { 'nbit' : 29 - , 'physical' : True - } - ) - self.I = Inst ( 'nbuse29', 'inst' - , map = { 'i0' : self.i - , 'cmd' : self.cmd - , 'nq' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenBuse -========= - -- **Name** : DpgenBuse – Tristate Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenBuse', modelname - , param = { 'nbit' : n - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits tristate named - ``modelname``. - -- **Terminal Names** : - - - **cmd** : select ( 1 bit ) - - - **i0** : input ( ``n`` bits ) - - - **q** : output ( ``n`` bits ) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - nts:BLOCK(cmd = '1') BEGIN - q <= GUARDED i0; - END - -- **Example** : - - :: - - from stratus import * - - class inst_buse ( Model ) : - - def Interface ( self ) : - self.i = SignalIn ( "i", 8 ) - self.cmd = SignalIn ( "cmd", 1 ) - self.o = SignalOut ( "o", 8 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenBuse', 'buse_8' - , param = { 'nbit' : 8 - , 'physical' : True - } - ) - self.I = Inst ( 'buse_8', 'inst' - , map = { 'i0' : self.i - , 'cmd' : self.cmd - , 'q' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenNand2mask -============== - -- **Name** : DpgenNand2mask – Programmable Mask Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenNand2mask', modelname - , param = { 'nbit' : n - , 'const' : constVal - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits conditionnal NAND mask named - ``modelname``. - -- **Terminal Names** : - - - **cmd** : mask control ( 1 bit ) - - - **i0** : input ( ``n`` bits ) - - - **nq** : output ( ``n`` bits ) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **const** (mandatory) : Defines the constant (string beginning - with 0b, 0x or 0o functions of the basis) - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **How it works** : - - - If the ``cmd`` signal is set to ``zero``, the mask is NOT applied, - so the whole operator behaves like an inverter. - - - If the ``cmd`` signal is set to ``one``, the mask is applied, the - output is the *complemented* result of the input value *ANDed* - with the mask (suplied by ``constVal``). - - - The constant ``constVal`` is given to the macro-generator call, - therefore the value cannot be changed afterward : it’s hard wired - in the operator. - - - A common error is to give a real constant for the ``constVal`` - argument. Be aware that it is a character string. - -- **Behavior** : - - :: - - nq <= WITH cmd SELECT not(i0) WHEN '0', - not(i0 and constVal) WHEN '1'; - -- **Example** : - - :: - - from stratus import * - - class inst_nand2mask ( Model ) : - - def Interface ( self ) : - self.i = SignalIn ( "i", 32 ) - self.cmd = SignalIn ( "cmd", 1 ) - self.o = SignalOut ( "o", 32 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenNand2mask', 'nand2mask_0x0000ffff' - , param = { 'nbit' : 32 - , 'const' : "0x0000FFFF" - , 'physical' : True - } - ) - self.I = Inst ( 'nand2mask_0x0000ffff', 'inst' - , map = { 'i0' : self.i - , 'cmd' : self.cmd - , 'nq' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenNor2mask -============= - -- **Name** : DpgenNor2mask – Programmable Mask Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenNor2mask', modelname - , param = { 'nbit' : n - , 'const' : constVal - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits conditionnal NOR mask named - ``modelname``. - -- **Terminal Names** : - - - **cmd** : mask control ( 1 bit ) - - - **i0** : input ( ``n`` bits ) - - - **nq** : output ( ``n`` bits ) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **const** (mandatory) : Defines the constant (string beginning - with 0b, 0x or 0o functions of the basis) - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **How it works** : - - - If the ``cmd`` signal is set to ``zero``, the mask is NOT applied, - so the whole operator behaves like an inverter. - - - If the ``cmd`` signal is set to ``one``, the mask is applied, the - output is the *complemented* result of the input value *ORed* with - the mask (suplied by ``constVal``). - - - The constant ``constVal`` is given to the macro-generator call, - therefore the value cannot be changed afterward : it’s hard wired - in the operator. - - - A common error is to give a real constant for the ``constVal`` - argument. Be aware that it is a character string. - -- **Behavior** : - - :: - - nq <= WITH cmd SELECT not(i0) WHEN '0', - not(i0 or constVal) WHEN '1'; - -- **Example** : - - :: - - from stratus import * - - class inst_nor2mask ( Model ) : - - def Interface ( self ) : - self.i = SignalIn ( "i", 8 ) - self.cmd = SignalIn ( "cmd", 1 ) - self.o = SignalOut ( "o", 8 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenNor2mask', 'nor2mask_000111' - , param = { 'nbit' : 8 - , 'const' : "0b000111" - , 'physical' : True - } - ) - self.I = Inst ( 'nor2mask_000111', 'inst' - , map = { 'i0' : self.i - , 'cmd' : self.cmd - , 'nq' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenXnor2mask -============== - -- **Name** : DpgenXnor2mask – Programmable Mask Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenXnor2mask', modelname - , param = { 'nbit' : n - , 'const' : constVal - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits conditionnal XNOR mask named - ``modelname``. - -- **Terminal Names** : - - - **cmd** : mask control ( 1 bit ) - - - **i0** : input ( ``n`` bits ) - - - **nq** : output ( ``n`` bits ) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **const** (mandatory) : Defines the constant (string beginning - with 0b, 0x or 0o functions of the basis) - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **How it works** : - - - If the ``cmd`` signal is set to ``zero``, the mask is NOT applied, - so the whole operator behaves like an inverter. - - - If the ``cmd`` signal is set to ``one``, the mask is applied, the - output is the *complemented* result of the input value *XORed* - with the mask (suplied by ``constVal``). - - - The constant ``constVal`` is given to the macro-generator call, - therefore the value cannot be changed afterward : it’s hard wired - in the operator. - - - A common error is to give a real constant for the ``constVal`` - argument. Be aware that it is a character string. - -- **Behavior** : - - :: - - nq <= WITH cmd SELECT not(i0) WHEN '0', - not(i0 xor constVal) WHEN '1'; - -- **Example** : - - :: - - from stratus import * - - class inst_xnor2mask ( Model ) : - - def Interface ( self ) : - self.i = SignalIn ( "i", 8 ) - self.cmd = SignalIn ( "cmd", 1 ) - self.o = SignalOut ( "o", 8 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenXnor2mask', 'xnor2mask_0b000111' - , param = { 'nbit' : 8 - , 'const' : "0b000111" - , 'physical' : True - } - ) - self.I = Inst ( 'xnor2mask_0b000111', 'inst' - , map = { 'i0' : self.i - , 'cmd' : self.cmd - , 'nq' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenAdsb2f -=========== - -- **Name** : DpgenAdsb2f – Adder/Substractor Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenAdsb2f', modelname - , param = { 'nbit' : n - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits adder/substractor named - ``modelname``. - -- **Terminal Names** : - - - **i0** : First operand (input, ``n`` bits) - - - **i1** : Second operand (input, ``n`` bits) - - - **q** : Output operand (ouput, ``n`` bits) - - - **add\_sub** : Select addition or substraction (input, 1 bit) - - - **c31** : Sarry out. In unsigned mode, this is the overflow - (output, 1 bit) - - - **c30** : Used to compute overflow in signed mode : - ``overflow = c31 xor c30`` (output, 1 bit) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **How it works** : - - - If the ``add_sub`` signal is set to ``zero``, an addition is - performed, otherwise it’s a substraction. - - - Operation can be either signed or unsigned. In unsigned mode - ``c31`` is the overflow ; in signed mode you have to compute - overflow by *XORing* ``c31`` and ``c30`` - -- **Example** : - - :: - - from stratus import * - - class inst_ADSB2F ( Model ) : - - def Interface ( self ) : - self.in1 = SignalIn ( "in1", 8 ) - self.in2 = SignalIn ( "in2", 8 ) - self.out = SignalOut ( "o", 8 ) - self.as = SignalIn ( "as", 1 ) - self.c0 = SignalOut ( "c0", 1 ) - self.c1 = SignalOut ( "c1", 1 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenAdsb2f', 'adder_8' - , param = { 'nbit' : 8 - , 'physical' : True - } - ) - self.I = Inst ( 'adder_8', 'inst' - , map = { 'i0' : self.in1 - , 'i1' : self.in2 - , 'add_sub' : self.as - , 'q' : self.out - , 'c30' : self.c0 - , 'c31' : self.c1 - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenShift -========== - -- **Name** : DpgenShift – Shifter Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenShift', modelname - , param = { 'nbit' : n - , 'physical' : True - } - ) - -- **Description** : Generates a ``n`` bits shifter named ``modelname``. - -- **Terminal Names** : - - - **op** : select the kind of shift (input, 2 bits) - - - **shamt** : the shift amount (input, ``Y`` bits) - - - **i** : value to shift (input, ``n`` bits) - - - **o** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **physical** (optional, default value : False) : In order to - generate a layout - -- **How it works** : - - - If the ``op[0]`` signal is set to ``one``, performs a right shift, - performs a left shift otherwise. - - - If the ``op[1]`` signal is set to ``one``, performs an arithmetic - shift (only meaningful in case of a right shift). - - - shamt : specifies the shift amount. The width of this signal - (``Y``) is computed from the operator’s width : ``Y = ceil(log2(n))`` - 1 - -- **Example** : - - :: - - from stratus import * - - class inst_shifter ( Model ) : - - def Interface ( self ) : - self.instop = SignalIn ( "instop", 2 ) - self.instshamt = SignalIn ( "instshamt", 2 ) - self.insti = SignalIn ( "insti", 4 ) - self.insto = SignalOut ( "insto", 4 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenShifter', 'shifter_4' - , param = { 'nbit' : 4 - , 'physical' : True - } - ) - self.I = Inst ( 'shifter_4', 'inst' - , map = { 'op' : self.instop - , 'shamt' : self.instshamt - , 'i' : self.insti - , 'o' : self.insto - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenShrot -========== - -- **Name** : DpgenShrot – Shift/Rotation Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenShrot', modelname - , param = { 'nbit' : n - , 'physical' : True - } - ) - -- **Description** : Generates a ``n`` bits shift/rotation operator - named ``modelname``. - -- **Terminal Names** : - - - **op** : select the kind of shift/rotation (input, 3 bits) - - - **shamt** : the shift amount (input, ``Y`` bits) - - - **i** : value to shift (input, ``n`` bits) - - - **o** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **physical** (optional, default value : False) : In order to - generate a layout - -- **How it works** : - - - If the ``op[0]`` signal is set to ``one``, performs a right - shift/rotation , otherwise left shift/rotation occurs. - - - If the ``op[1]`` signal is set to ``one``, performs an arithmetic - shift (only meaningful in case of a right shift). - - - If the ``op[2]`` signal is set to ``one``, performs a rotation, - otherwise performs a shift.. - - - ``shamt`` specifies the shift amount. The width of this signal - (``Y``) is computed from the operator’s width : - ``Y = ceil(log2(n))`` - 1 - -- **Example** : - - :: - - from stratus import * - - class inst_shrot ( Model ) : - - def Interface ( self ) : - self.rotop = SignalIn ( "rotop", 3 ) - self.instshamt = SignalIn ( "instshamt", 2 ) - self.insti = SignalIn ( "insti", 4 ) - self.insto = SignalOut ( "insto", 4 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenShrot', 'shrot_4' - , param = { 'nbit' : 4 - , 'physical' : True - } - ) - self.I = Inst ( 'shrot_4', 'inst' - , map = { 'op' : self.rotop - , 'shamt' : self.instshamt - , 'i' : self.insti - , 'o' : self.insto - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenNul -======== - -- **Name** : DpgenNul – Zero Detector Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenNul', modelname - , param = { 'nbit' : n - , 'physical' : True - } - ) - -- **Description** : Generates a ``n`` bits zero detector named - ``modelname``. - -- **Terminal Names** : - - - **i0** : value to check (input, ``n`` bits) - - - **q** : null flag (1 bit) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **physical** (optional, default value : False) : In order to - generate a layout - -- **Behavior** : - - :: - - q <= '1' WHEN ( i0 = X"00000000" ) ELSE '0'; - -- **Example** : - - :: - - from stratus import * - - class inst_nul ( Model ) : - - def Interface ( self ) : - self.i = SignalIn ( "i", 4 ) - self.o = SignalOut ( "o", 1 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenNul', 'nul_4' - , param = { 'nbit' : 4 - , 'physical' : True - } - ) - self.I = Inst ( 'nul_4', 'inst' - , map = { 'i0' : self.i - , 'nul' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenConst -========== - -- **Name** : DpgenConst – Constant Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenConst', modelname - , param = { 'nbit' : n - , 'const' : constVal - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a ``n`` bits constant named - ``modelname``. - -- **Terminal Names** : - - - **q** : the constant (output, ``n`` bit) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **const** (mandatory) : Defines the constant (string beginning - with 0b, 0x or 0o functions of the basis) - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **Behavior** : - - :: - - q <= constVal - -- **Example** : - - :: - - from stratus import * - - class inst_const ( Model ) : - - def Interface ( self ) : - self.o = SignalOut ( "o", 32 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenConst', 'const_0x0000ffff' - , param = { 'nbit' : 32 - , 'const' : "0x0000FFFF" - , 'physical' : True - } - ) - self.I = Inst ( 'const_0x0000ffff', 'inst' - , map = { 'q' : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenRom2 -========= - -- **Name** : DpgenRom2 – 2 words ROM Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenRom2', modelname - , param = { 'nbit' : n - , 'val0' : constVal0 - , 'val1' : constVal1 - , 'physical' : True - } - ) - -- **Description** : Generates a ``n`` bits 2 words optimized ROM named - ``modelname``. - -- **Terminal Names** : - - - **sel0** : address of the value (input, 1 bit) - - - **q** : the selected word (output, ``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **val0** (mandatory) : Defines the first word - - - **val1** (mandatory) : Defines the second word - - - **physical** (optional, default value : False) : In order to - generate a layout - -- **Behavior** : - - :: - - q <= WITH sel0 SELECT - constVal0 WHEN B"0", - constVal1 WHEN B"1"; - -- **Example** : - - :: - - from stratus import * - - class inst_rom2 ( Model ) : - - def Interface ( self ) : - self.sel0 = SignalIn ( "sel0", 1 ) - self.q = SignalOut ( "dataout", 4 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenRom2', 'rom2_0b1010_0b1100' - , param = { 'nbit' : 4 - , 'val0' : "0b1010" - , 'val1' : "0b1100" - , 'physical' : True - } - ) - self.I = Inst ( 'rom2_0b1010_0b1100', 'inst' - , map = { 'sel0' : self.sel0 - , 'q' : self.q - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenRom4 -========= - -- **Name** : DpgenRom4 – 4 words ROM Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenRom4', modelname - , param = { 'nbit' : n - , 'val0' : constVal0 - , 'val1' : constVal1 - , 'val2' : constVal2 - , 'val3' : constVal3 - , 'physical' : True - } - ) - -- **Description** : Generates a ``n`` bits 4 words optimized ROM named - ``modelname``. - -- **Terminal Names** : - - - **sel1** : upper bit of the address of the value (input, 1 bit) - - - **sel0** : lower bit of the address of the value (input, 1 bit) - - - **q** : the selected word (output, ``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **val0** (mandatory) : Defines the first word - - - **val1** (mandatory) : Defines the second word - - - **val2** (mandatory) : Defines the third word - - - **val3** (mandatory) : Defines the fourth word - - - **physical** (optional, default value : False) : In order to - generate a layout - -- **Behavior** : - - :: - - q <= WITH sel1 & sel0 SELECT constVal0 WHEN B"00", - constVal1 WHEN B"01", - constVal2 WHEN B"10", - constVal3 WHEN B"11"; - -- **Example** : - - :: - - from stratus import * - - class inst_rom4 ( Model ) : - - def Interface ( self ) : - self.sel0 = SignalIn ( "sel0", 1 ) - self.sel1 = SignalIn ( "sel1", 1 ) - self.q = SignalOut ( "dataout", 4 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenRom4', 'rom4_0b1010_0b1100_0b1111_0b0001' - , param = { 'nbit' : 4 - , 'val0' : "0b1010" - , 'val1' : "0b1100" - , 'val2' : "0b1111" - , 'val3' : "0b0001" - , 'physical' : True - } - ) - self.I = Inst ( 'rom4_0b1010_0b1100_0b1111_0b0001', 'inst' - , map = { 'sel0' : self.sel0 - , 'sel1' : self.sel1 - , 'q' : self.q - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenRam -======== - -- **Name** : DpgenRam – RAM Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenRam', modelname - , param = { 'nbit' : n - , 'nword' : regNumber - , 'physical' : True - } - ) - -- **Description** : Generates a RAM of ``regNumber`` words of ``n`` - bits named ``modelname``. - -- **Terminal Names** : - - - **ck** : clock signal (input, 1 bit) - - - **w** : write requested (input, 1 bit) - - - **selram** : select the write bus (input, 1 bit) - - - **ad** : the address (input, ``Y`` bits) - - - **datain** : write bus (input, ``n`` bits) - - - **dataout** : read bus (output, ``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **nword** (mandatory) : Defines the size of the words - - - **physical** (optional, default value : False) : In order to - generate a layout - -- **Example** : - - :: - - from stratus import * - - class inst_ram ( Model ) : - - def Interface ( self ) : - self.ck = SignalIn ( "ck", 1 ) - self.w = SignalIn ( "w", 1 ) - self.selram = SignalIn ( "selram", 1 ) - self.ad = SignalIn ( "ad", 5 ) - self.datain = SignalIn ( "datain", 32 ) - self.dataout = TriState ( "dataout", 32 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenRam', 'ram_32_32' - , param = { 'nbit' : 32 - , 'nword' : 32 - , 'physical' : True - } - ) - self.I = Inst ( 'ram_32_32', 'inst' - , map = { 'ck' : self.ck - , 'w' : self.w - , 'selram' : self.selram - , 'ad' : self.ad - , 'datain' : self.datain - , 'dataout' : self.dataout - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenRf1 -======== - -- **Name** : DpgenRf1, DpgenRf1r0 – Register File Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenRf1', modelname - , param = { 'nbit' : n - , 'nword' : regNumber - , 'physical' : True - } - ) - -- **Description** : Generates a register file of ``regNumber`` words of - ``n`` bits without decoder named ``modelname``. - -- **Terminal Names** : - - - **ckok** : clock signal (input, 1 bit) - - - **sel** : select the write bus (input, 1 bit) - - - **selr** : the decoded read address (input, ``regNumber`` bits) - - - **selw** : the decoded write address (input, ``regNumber`` bits) - - - **datain0** : first write bus (input, ``n`` bits) - - - **datain1** : second write bus (input, ``n`` bits) - - - **dataout** : read bus (output, ``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the words (even, - between 2 and 64) - - - **nword** (mandatory) : Defines the number of the words (even, - between 4 and 32) - - - **physical** (optional, default value : False) : In order to - generate a layout - -- **How it works** : - - - datain0 and datain1 are the two write busses. Only one is used to - actually write the register word, it is selected by the sel - signal. - - - When sel is set to zero datain0 is used to write the register - word, otherwise it will be datain1 - - - selr, selw : this register file have no decoder, so selr have a - bus width equal to ``regNumber``. One bit for each word - - - The DpgenRf1r0 variant differs from the DpgenRf1 in that the - register of address zero is stuck to zero. You can write into it, - it will not change the value. When read, it will always return - zero - -- **Example** : - - :: - - from stratus import * - - class inst_rf1 ( Model ) : - - def Interface ( self ) : - self.ck = SignalIn ( "ck", 1 ) - self.sel = SignalIn ( "sel", 1 ) - self.selr = SignalIn ( "selr", 16 ) - self.selw = SignalIn ( "selw", 16 ) - self.datain0 = SignalIn ( "datain0", 4 ) - self.datain1 = SignalIn ( "datain1", 4 ) - self.dataout = SignalOut ( "dataout", 4 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenRf1', 'rf1_4_16' - , param = { 'nbit' : 4 - , 'nword' : 16 - , 'physical' : True - } - ) - self.I = Inst ( 'rf1_4_16', 'inst' - , map = { 'ck' : self.ck - , 'sel' : self.sel - , 'selr' : self.selr - , 'selw' : self.selw - , 'datain0' : self.datain0 - , 'datain1' : self.datain1 - , 'dataout' : self.dataout - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenRf1d -========= - -- **Name** : DpgenRf1d, DpgenRf1dr0 – Register File with Decoder - Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenRf1d', modelname - , param = { 'nbit' : n - , 'nword' : regNumber - , 'physical' : True - } - ) - -- **Description** : Generates a register file of ``regNumber`` words of - ``n`` bits with decoder named ``modelname``. - -- **Terminal Names** : - - - **ck** : clock signal (input, 1 bit) - - - **sel** : select the write bus (input, 1 bit) - - - **wen** : write enable (input, 1 bit) - - - **ren** : read enable (input, 1 bit) - - - **adr** : the read address (input, ``Y`` bits) - - - **adw** : the write address (input, ``Y`` bits) - - - **datain0** : first write bus (input, ``n`` bits) - - - **datain1** : second write bus (input, ``n`` bits) - - - **dataout** : read bus (output, ``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the words (even, - between 2 and 64) - - - **nword** (mandatory) : Defines the number of the words (even, - between 6 and 32) - - - **physical** (optional, default value : False) : In order to - generate a layout - -- **How it works** : - - - datain0 and datain1 are the two write busses. Only one is used to - actually write the register word, it is selected by the sel - signal. - - - When sel is set to zero datain0 is used to write the register - word, otherwise it will be datain1 - - - adr, adw : the width (Y) of those signals is computed from - regNumber : ``Y = log2(regNumber)`` - - - wen and ren : write enable and read enable, allows reading and - writing when sets to ``one`` - - - The DpgenRf1dr0 variant differs from the DpgenRf1d in that the - register of address zero is stuck to zero. You can write into it, - it will not change the value. When read, it will always return - zero - -- **Example** : - - :: - - from stratus import * - - class inst_rf1d ( Model ) : - - def Interface ( self ) : - self.ck = SignalIn ( "ck", 1 ) - self.sel = SignalIn ( "sel", 1 ) - self.wen = SignalIn ( "wen", 1 ) - self.ren = SignalIn ( "ren", 1 ) - self.adr = SignalIn ( "adr", 4 ) - self.adw = SignalIn ( "adw", 4 ) - self.datain0 = SignalIn ( "datain0", 4 ) - self.datain1 = SignalIn ( "datain1", 4 ) - self.dataout = SignalOut ( "dataout", 4 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenRf1d', 'rf1d_4_16' - , param = { 'nbit' : 4 - , 'nword' : 16 - , 'physical' : True - } - ) - self.I = Inst ( 'rf1d_4_16', 'inst' - , map = { 'ck' : self.ck - , 'sel' : self.sel - , 'wen' : self.wen - , 'ren' : self.ren - , 'adr' : self.adr - , 'adw' : self.adw - , 'datain0' : self.datain0 - , 'datain1' : self.datain1 - , 'dataout' : self.dataout - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenFifo -========= - -- **Name** : DpgenFifo – Fifo Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenFifo', modelname - , param = { 'nbit' : n - , 'nword' : regNumber - , 'physical' : True - } - ) - -- **Description** : Generates a FIFO of ``regNumber`` words of ``n`` - bits named ``modelname``. - -- **Terminal Names** : - - - **ck** : clock signal (input, 1 bit) - - - **reset** : reset signal (input, 1 bit) - - - **r** : read requested (input, 1 bit) - - - **w** : write requested (input, 1 bit) - - - **rok** : read acknowledge (output, 1 bit) - - - **wok** : write acknowledge (output, 1 bit) - - - **sel** : select the write bus (input, 1 bit) - - - **datain0** : first write bus (input, ``n`` bits) - - - **datain1** : second write bus (input, ``n`` bits) - - - **dataout** : read bus (output, ``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the words (even, - between 2 and 64) - - - **nword** (mandatory) : Defines the number of words (even, between - 4 and 32) - - - **physical** (optional, default value : False) : In order to - generate a layout - -- **How it works** : - - - datain0 and datain1 : the two write busses. Only one is used to - actually write the FIFO, it is selected by the sel signal. - - - sel : when set to ``zero`` the datain0 is used to write the - register word, otherwise it will be datain1. - - - r, rok : set r when a word is requested, rok tells that a word has - effectively been popped (rok == not empty). - - - w, wok : set w when a word is pushed, wok tells that the word has - effectively been pushed (wok == not full). - -- **Example** : - - :: - - from stratus import * - - class inst_fifo ( Model ) : - - def Interface ( self ) : - self.ck = SignalIn ( "ck", 1 ) - self.reset = SignalIn ( "reset", 1 ) - self.r = SignalIn ( "r", 1 ) - self.w = SignalIn ( "w", 1 ) - self.rok = SignalInOut ( "rok", 1 ) - self.wok = SignalInOut ( "wok", 1 ) - self.sel = SignalIn ( "sel", 1 ) - self.datain0 = SignalIn ( "datain0", 4 ) - self.datain1 = SignalIn ( "datain1", 4 ) - self.dataout = SignalOut ( "dataout", 4 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenFifo', 'fifo_4_16' - , param = { 'nbit' : 4 - , 'nword' : 16 - , 'physical' : True - } - ) - self.I = Inst ( 'fifo_4_16', 'inst' - , map = { 'ck' : self.ck - , 'reset' : self.reset - , 'r' : self.r - , 'w' : self.w - , 'rok' : self.rok - , 'wok' : self.wok - , 'sel' : self.sel - , 'datain0' : self.datain0 - , 'datain1' : self.datain1 - , 'dataout' : self.dataout - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenDff -======== - -- **Name** : DpgenDff – Dynamic Flip-Flop Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenDff', modelname - , param = { 'nbit' : n - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a n bits dynamic flip-flop named - ``modelname``. The two latches of this flip-flop are dynamic, i.e. - the data is stored in a capacitor. - -- **Terminal Names** : - - - **wen** : write enable (1 bit) - - - **ck** : clock signal (1 bit) - - - **i0** : data input (``n`` bits) - - - **q** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **How it works** : - - - When wen is set to ``one``, enables the writing of the flip-flop - -- **Example** : - - :: - - from stratus import * - - class inst_dff ( Model ) : - - def Interface ( self ) : - self.ck = SignalIn ( "ck", 1 ) - self.wen = SignalIn ( "wen", 1 ) - self.i = SignalIn ( "i", 4 ) - self.o = SignalOut ( "o", 4 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenDff', 'dff_4' - , param = { 'nbit' : 4 - , 'physical' : True - } - ) - self.I = Inst ( 'dff_4', 'inst' - , map = { "wen" : self.wen - , "ck" : self.ck - , "i0" : self.i - , "q" : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenDfft -========= - -- **Name** : DpgenDfft – Dynamic Flip-Flop with Scan-Path - Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenDfft', modelname - , param = { 'nbit' : n - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a n bits dynamic flip-flop with scan-path - named ``modelname``. The two latches of this flip-flop are dynamic, - i.e. the data is stored in a capacitor. - -- **Terminal Names** : - - - **scan** : scan-path mode (input, 1 bit) - - - **scin** : scan path in (input, 1 bit) - - - **wen** : write enable (1 bit) - - - **ck** : clock signal (1 bit) - - - **i0** : data input (``n`` bits) - - - **q** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **How it works** : - - - When scan is set to ``one``, it enables the scan-path mode. Note - that in scan-path mode, the wen signal is not effective - - - scin is the input of the scan-path. This terminal is different - from ``i0[0]``. The scout is q[N-1] (in the following example this - is ``q[31]``) - - - When wen is set to ``one`` enables the writing of the flip-flop - -- **Example** : - - :: - - from stratus import * - - class inst_dfft ( Model ) : - - def Interface ( self ) : - self.scan = SignalIn ( "scin", 1 ) - self.scin = SignalIn ( "scan", 1 ) - self.ck = SignalIn ( "ck", 1 ) - self.wen = SignalIn ( "wen", 1 ) - self.i = SignalIn ( "i", 4 ) - self.o = SignalOut ( "o", 4 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenDfft', 'dfft_4' - , param = { 'nbit' : 4 - , 'physical' : True - } - ) - self.I = Inst ( 'dfft_4', 'inst' - , map = { "wen" : self.wen - , "ck" : self.ck - , "scan" : self.scan - , "scin" : self.scin - , "i0" : self.i - , "q" : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenSff -======== - -- **Name** : DpgenSff – Static Flip-Flop Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenSff', modelname - , param = { 'nbit' : n - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a n bits static flip-flop named - ``modelname``. The two latches of this flip-flop are static, i.e. - each one is made of two interters looped together. - -- **Terminal Names** : - - - **wen** : write enable (1 bit) - - - **ck** : clock signal (1 bit) - - - **i0** : data input (``n`` bits) - - - **q** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **How it works** : - - - When wen is set to ``one``, enables the writing of the flip-flop - -- **Example** : - - :: - - from stratus import * - - class inst_sff ( Model ) : - - def Interface ( self ) : - self.ck = SignalIn ( "ck", 1 ) - self.wen = SignalIn ( "wen", 1 ) - self.i = SignalIn ( "i", 4 ) - self.o = SignalOut ( "o", 4 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenSff', 'sff_4' - , param = { 'nbit' : 4 - , 'physical' : True - } - ) - self.I = Inst ( 'sff_4', 'inst' - , map = { "wen" : self.wen - , "ck" : self.ck - , "i0" : self.i - , "q" : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - -DpgenSfft -========= - -- **Name** : DpgenSfft – Static Flip-Flop with Scan-Path - Macro-Generator - -- **Synopsys** : - - :: - - Generate ( 'DpgenSfft', modelname - , param = { 'nbit' : n - , 'physical' : True - , 'behavioral' : True - } - ) - -- **Description** : Generates a n bits static flip-flop with scan-path - named ``modelname``. The two latches of this flip-flop are static - i.e. each one is made of two interters looped togethers. - -- **Terminal Names** : - - - **scan** : scan-path mode (input, 1 bit) - - - **scin** : scan path in (input, 1 bit) - - - **wen** : write enable (1 bit) - - - **ck** : clock signal (1 bit) - - - **i0** : data input (``n`` bits) - - - **q** : output (``n`` bits) - - - **vdd** : power - - - **vss** : ground - -- **Parameters** : Parameters are given in the a map ``param``. - - - **nbit** (mandatory) : Defines the size of the generator - - - **physical** (optional, default value : False) : In order to - generate a layout - - - **behavioral** (optional, default value : False) : In order to - generate a behavior - -- **How it works** : - - - When scan is set to ``one``, it enables the scan-path mode. Note - that in scan-path mode, the wen signal is not effective - - - scin : the input of the scan-path. This terminal is different from - ``i0[0]``. The scout is ``q[N``-``1]`` (in the following example - this is ``q[3]``) - - - When wen is set to ``one``, it enables the writing of the - flip-flop - -- **Example** : - - :: - - from stratus import * - - class inst_sfft ( Model ) : - - def Interface ( self ) : - self.scan = SignalIn ( "scin", 1 ) - self.scin = SignalIn ( "scan", 1 ) - self.ck = SignalIn ( "ck", 1 ) - self.wen = SignalIn ( "wen", 1 ) - self.i = SignalIn ( "in", 4 ) - self.o = SignalOut ( "out", 4 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - Generate ( 'DpgenSfft', 'sfft_4' - , param = { 'nbit' : 4 - , 'physical' : True - } - ) - self.I = Inst ( 'sfft_4', 'inst' - , map = { "wen" : self.wen - , "ck" : self.ck - , "scan" : self.scan - , "scin" : self.scin - , "i0" : self.i - , "q" : self.o - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - def Layout ( self ) : - Place ( self.I, NOSYM, Ref(0, 0) ) - - diff --git a/documentation/_build/html/_sources/Stratus/Language.txt b/documentation/_build/html/_sources/Stratus/Language.txt deleted file mode 100644 index 793afe6a..00000000 --- a/documentation/_build/html/_sources/Stratus/Language.txt +++ /dev/null @@ -1,2796 +0,0 @@ -==================== -Stratus User's Guide -==================== -Sophie Belloeil - - -Introduction -============ - -Stratus -------- - -Name -~~~~ - -Stratus – Procedural design language based upon *Python* - -Description -~~~~~~~~~~~ - -*Stratus* is a set of *Python* methods/functions dedicated to -procedural generation purposes. From a user point of view, *Stratus* is -a circuit’s description language that allows *Python* programming flow -control, variable use, and specialized functions in order to handle vlsi -objects. - -Based upon the *Hurricane* data structures, the *Stratus* language gives -the user the ability to describe netlist and layout views. - -Configuration -~~~~~~~~~~~~~ - -A configuration file can be used to direct the generation process of -Stratus. With this file, the user can choose the output format (vst, -vhdl...), the simulator (asimut, ghdl...), the standard cell library... -This configuration file named ``.st_config.py`` must be placed either in -the HOME directory or in the current directory. This file contains a set -of variables used in the process generation of Stratus, as for example : - -:: - - format = 'vhdl' - simulator = 'ghdl' - -The default configuration of Stratus uses the Alliance CAD system, ie -``'vst'`` as ``format`` and ``'asimut'`` as ``simulator``. - -Description of a cell -~~~~~~~~~~~~~~~~~~~~~ - -A cell is a hierachical structural description of a circuit in terms -of ports (I/Os), signals (nets) and instances. - -The description of a cell is done by creating a new class, derivating -for class ``Model``, with different methods : - -- Method ``Interface`` : Description of the external ports of the cell - : - - - SignalIn, SignalOut, ... - -- Method ``Netlist`` : Description of the netlist of the cell : - - - Inst, Signal - -- Method ``Layout`` : Description of the layout of the cell : - - - Place, PlaceTop, PlaceBottom, PlaceRight, PlaceLeft ... - -- Method ``Stimuli`` : Description of the simulation stimuli of the - cell : - - - affect, addd ... - -Creation of the cell -~~~~~~~~~~~~~~~~~~~~ - -After the description of a cell as a sub-class of ``Model``, the cell -has to be instantiated. The different methods described before have to -be called. - -Then different methods are provided : - -- Method ``View`` : Opens/Refreshes the editor in order to see the - created layout - -- Method ``Save`` : Saves the created cell in the desired format thanks - to the configuration file - - - no argument : creation of a netlist file - - - PHYSICAL : creation of a netlist file AND a layout file - - - STRATUS : creation of a python/stratus file - - - FileName : optionnal argument when using Save(STRATUS) in order - to choose the name of the file to be generated - - - Be careful : if one wants to create a stratus file AND a - netlist, always use Save(STRATUS) before Save() ! - -- Method ``Testbench`` : Creates the testbench of the cell using the - ``Stimuli`` method to compute the stimuli. The output format depends - of the ``format`` variable given in the configuration file - -- Method ``Simul`` : Runs the simulation using the simulator named in - the configuration file - -Syntax -~~~~~~ - -A *Stratus* file must have a .py extension and must begin as follow : - -:: - - #!/usr/bin/env python - - from stratus import * - -The description of a cell as a sub-class of ``Model`` is done as follow -: - -:: - - class myClass ( Model ) : - ... - -The creation of the cell is done by instantiating the previous class as -follow : - -:: - - exemple = myClass ( name, param ) - -After the different methods can be called as follow : - -:: - - exemple.Interface() - exemple.Netlist() - exemple.Save() - ... - -In order to execute a *Stratus* file (named ``file`` for example), one -has two choices : - -:: - - python file.py - -Or : - -:: - - chmod u+x file.py - ./file.py - -The names used in *Stratus*, as arguments to *Stratus* functions, -should be alphanumerical, including the underscore. The arguments of -*Stratus* are case sensitive, so VDD is not equivalent to vdd. - -| Vectorized connectors or signal can be used using the [n:m] construct. - -Syntax highlighting -~~~~~~~~~~~~~~~~~~~ - -When using vi, it’s possible to have the right syntax highlighting : - -- Commands to do when you want to change once the coloration of your - file : - -:: - - :syntax off - :source /asim/coriolis/share/etc/stratus.vim - -- Modification of your .vimrc in order to have the syntax highlighting - each time you open a file : - -:: - - syntax off - autocmd BufRead,BufNewfile *.py so /asim/coriolis/share/etc/stratus.vim - syntax on - -Example -------- - -The addaccu circuit -~~~~~~~~~~~~~~~~~~~ - -|add1| - -The data-path -~~~~~~~~~~~~~ - -|add2| - -Description of the circuit with *Stratus* : file addaccu.py -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -|addaccu| - -Creation of the circuit : file test.py -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -|test| - -How to execute the file -~~~~~~~~~~~~~~~~~~~~~~~ - -:: - - python test.py -n 4 - -or : - -:: - - chmod u+x test.py - ./test -n 4 - -The editor -~~~~~~~~~~ - -The method ``View`` permits to open an editor in which one can see the -cell being created as shown in the picture below. - -|editor| - -Function Param -~~~~~~~~~~~~~~ - -This function allows the user to give parameters when creating a cell. -When one wants to give values to two parameters, one can type on the -shell : - -:: - - python test.py -n 4 -w 8 - -The file ``test.py`` has then to contain : - -:: - - nbit, nword = Param ( "n", "w" ) - -The letters typed on the shell must be the ones given as parameters of -function ``Param``. - -How to instanciate your generator in another generator -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -One can create a generator and instantiate it in another generator. -To do that, the model name of the generator must have the form : -“file\_name.class\_nameâ€. -Note that if the two generators are not in the same directory, the -directory of the generator to be instantiated has to be added in the -CRL\_CATA\_LIB environment variable. - -For example, in order to instanciate the addaccu created above in a cell -: - -:: - - n = 4 - Generate ( "addaccu.addaccu", "my_addaccu_%dbits" % n - , param = { 'nbit' : n } ) - - Inst ( "my_addaccu_%dbits" % n - , map = { 'a' : self.netA - , 'b' : self.netB - , 'c' : self.netC - , 'v' : self.netV - , 'cmd' : self.netCmd - , 'cout' : self.netCout - , 's' : self.netS - , 'vdd' : self.vdd - , 'vss' : self.vss - } - ) - - -Description of a netlist -======================== - -Nets ----- - -Name -~~~~ - -SignalIn, SignalOut ... – Creation of nets - -Synopsys -~~~~~~~~ - -:: - - netA = SignalIn ( "a", 4 ) - -Description -~~~~~~~~~~~ - -How to create and use nets. - -Nets -~~~~ - -Differents kind of nets are listed below : - -- ``SignalIn`` : Creation of an input port - -- ``SignalOut`` : Creation of an output port - -- ``SignalInOut`` : Creation of an inout port - -- ``SignalUnknown`` : Creation of an input/output port which direction - is not defined - -- ``TriState`` : Creation of a tristate port - -- ``CkIn`` : Creation of a clock port - -- ``VddIn`` : Creation of the vdd alimentation - -- ``VssIn`` : Creation of the vss alimentation - -- ``Signal`` : Creation of an internal net - -Parameters -~~~~~~~~~~ - -All kind of constructors have the same parameters : - -- ``name`` : the name of the net (mandatory argument) - -- ``arity`` : the arity of the net (mandatory argument) - -- ``indice`` : for bit vectors only : the LSB bit (optional argument : - set to 0 by default) - -Only ``CkIn``, ``VddIn`` and ``VssIn`` do not have the same parameters : -there is only the ``name`` parameter (they are 1 bit nets). - -Functions and methods -~~~~~~~~~~~~~~~~~~~~~ - -Some functions/methods are provided in order to handle nets : - -- function ``Cat`` : Concatenation of nets, beginning with the MSB - - :: - - Inst ( 'DpgenInv' - , map = { 'i0' : Cat ( A, B ) - , 'nq' : S - , 'vdd' : vdd - , 'vss' : vss - } - ) - - Or : - - :: - - tab = [] - tab.append ( A ) - tab.append ( B ) - - Inst ( 'DpgenInv' - , map = { 'i0' : Cat ( tab ) - , 'nq' : S - , 'vdd' : vdd - , 'vss' : vss - } - ) - - If A and B are 2 bits nets, the net ``myNet`` will be such as : - - :: - - myNet[3] = A[1] - myNet[2] = A[0] - myNet[1] = B[1] - myNet[0] = B[0] - -- function ``Extend`` : Creation of a net which is an extension of the - net which it is applied to - - :: - - temp = Signal ( "temp", 5 ) - tempExt = Signal ( "temp_ext", 8 ) - - tempExt <= temp.Extand ( 8, 'one' ) - -- method ``Alias`` : Creation of an alias name for a net - - :: - - cin.Alias ( c_temp[0] ) - cout.Alias ( c_temp[4] ) - for i in range ( 4 ) : - Inst ( "Fulladder" - , map = { 'a' : a[i] - , 'b' : b[i] - , 'cin' : c_temp[i] - , 'sout' : sout[i] - , 'cout' : c_temp[i+1] - , 'vdd' : vdd - , 'vss' : vss - } - ) - - -Errors -~~~~~~ - -Some errors may occur : - -- | ``Error in SignalIn :`` - | ``the lenght of the net must be a positive value.`` - | One can not create a net with a negative lenght. - - -Instances ---------- - -Name -~~~~ - -Inst – Creation of instances - -Synopsys -~~~~~~~~ - -:: - - Inst ( model - , name - , map = connectmap - ) - -Description -~~~~~~~~~~~ - -Instantiation of an instance. The type of the instance is given by the -``model`` parameter. The connexions are made thanks to the -``connectmap`` parameters. - -Parameters -~~~~~~~~~~ - -- ``Model`` : Name of the mastercell of the instance to create - (mandatory argument) - -- ``name`` : Name of the instance (optional) - When this argument is not defined, the instance has a name created - by default. This argument is usefull when one wants to create a - layout as well. Indeed, the placement of the instances is much easier - when the conceptor has chosen himself the name f the - instances. - -- ``connectmap`` : Connexions in order to make the netlist - -``param`` and ``map`` are dictionnaries as shown in the example below. - -Example -~~~~~~~ - -:: - - Inst ( 'a2_x2' - , map = { 'i0' : in0 - , 'i1' : in1 - , 'q' : out - , 'vdd' : vdd - , 'vss' : vss - } - ) - -You can see a concrete example at : - -Errors -~~~~~~ - -Some errors may occur : - -- ``Error in Inst : the model Model does not exist.`` - ``Check CRL_CATA_LIB.`` - Either one has made a mistake in the name of the model, either the - environment variable is not correct. - -- ``Error in Inst : port does not exist in model Model.`` - One port in map is not correct. - -- ``Error in Inst : one input net is not dimensionned.`` - The size of the output nets is automatically calculated bus the - input nets must be dimensionned before being connected. - - -Generators ----------- - -Name -~~~~ - -Generate – Interface with the generators - -Synopsys -~~~~~~~~ - -:: - - Generate ( model, modelname, param = dict ) - -Description -~~~~~~~~~~~ - -The ``Generate`` function call is the generic interface to all -generators. - -Arguments -~~~~~~~~~ - -- ``model`` : Specifies which generator is to be invoked - - - If the generator belongs to the Dpgen library provided by Stratus, - the model name of the generator is simply the name of the class of - the generator. - - - If the generator is created by the user, the model name of the - generator must have the form : “file\_name.class\_nameâ€. (Note - that if the the generator is not in the working directory, the - directory of the generator to be instantiated has to be added in - the CRL\_CATA\_LIB environment variable) - -- ``modelname`` : Specifies the name of the model to be generated - -- ``dict`` : Specifies the parameters of the generator - -Parameters -~~~~~~~~~~ - -Every generator has it’s own parameters. They must be described in the -map ``dict``. -Every generator provides a netlist view. Two other views can be -generated, if they are provided by the generator. Two parameters have to -be given, in order to choose those views : - -- ’physical’ : True/False, generation of the physical view (optionnal, - False by default) - -- ’behavioral’ : True/False, generation of the behavioral view - (optionnal, False by default) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] Generate : the model must be described in a string.`` - - -Description of a layout -======================= - -Place ------ - -Name -~~~~ - -Place – Places an instance - -Synopsys -~~~~~~~~ - -:: - - Place ( ins, sym, point ) - -Description -~~~~~~~~~~~ - -Placement of an instance. -The instance has to be instantiated in the method ``Netlist``, in -order to use the ``Place`` function. - -Parameters -~~~~~~~~~~ - -- ``ins`` : Instance to place. - -- ``sym`` : Geometrical operation to be performed on the instance - before beeing placed. - The ``sym`` argument can take eight legal values : - - - ``NOSYM`` : no geometrical operation is performed - - - ``SYM_Y`` : Y becomes -Y, that means toward X axe symetry - - - ``SYM_X`` : X becomes -X, that means toward Y axe symetry - - - ``SYMXY`` : X becomes -X, Y becomes -Y - - - ``ROT_P`` : a positive 90 degrees rotation takes place - - - ``ROT_M`` : a negative 90 degrees rotation takes place - - - ``SY_RP`` : Y becomes -Y, and then a positive 90 degrees rotation - takes place - - - ``SY_RM`` : Y becomes -Y, and then a negative 90 degrees rotation - takes place - -- ``point`` : coordinates of the lower left corner of the abutment box - of the instance in the current figure. - -Example -~~~~~~~ - -:: - - Place ( myInst, NOSYM, XY ( 0, 0 ) ) - -Errors -~~~~~~ - -Some errors may occur : - -- | ``[Stratus ERROR] Placement : the instance doesn't exist.`` - | The instance must be instanciated in order to be placed. - -- ``[Stratus ERROR] Placement : the first argument is not an instance.`` - -- | ``[Stratus ERROR] Placement : the instance is already placed.`` - | One can not place an instance twice - -- | ``[Stratus ERROR] Place : wrong argument for placement type.`` - | The symetry given as argument is not correct. - -- | ``[Stratus ERROR] Place : wrong argument for placement,`` - | `` the coordinates must be put in a XY object.`` - | The coordinates are not descrobed the bood way. - - -PlaceTop --------- - -Name -~~~~ - -PlaceTop – Places an instance at the top of the “reference instance†- -Synopsys -~~~~~~~~ - -:: - - PlaceTop ( ins, sym, offsetX, offsetY ) - -Description -~~~~~~~~~~~ - -Placement of an instance. -The instance has to be instantiated in the method ``Netlist`` in order -to use the ``PlaceTop`` function. - -The bottom left corner of the abutment box of the instance is placed, -after beeing symetrized and/or rotated, toward the top left corner of -the abutment box of the “reference instanceâ€. The newly placed instance -becomes the “reference instanceâ€. - -Parameters -~~~~~~~~~~ - -- ``ins`` : Instance to place. - -- ``sym`` : Geometrical operation to be performed on the instance - before beeing placed. - The ``sym`` argument can take eight legal values : - - - ``NOSYM`` : no geometrical operation is performed - - - ``SYM_Y`` : Y becomes -Y, that means toward X axe symetry - - - ``SYM_X`` : X becomes -X, that means toward Y axe symetry - - - ``SYMXY`` : X becomes -X, Y becomes -Y - - - ``ROT_P`` : a positive 90 degrees rotation takes place - - - ``ROT_M`` : a negative 90 degrees rotation takes place - - - ``SY_RP`` : Y becomes -Y, and then a positive 90 degrees rotation - takes place - - - ``SY_RM`` : Y becomes -Y, and then a negative 90 degrees rotation - takes place - -- ``offsetX`` (optionnal) : An offset is put horizontally. The value - given as argument must be a multiple of PITCH - -- ``offsetY`` (optionnal) : An offset is put vertically. The value - given as argument must be a multiple of SLICE - -Example -~~~~~~~ - -:: - - Place ( myInst1, NOSYM, 0, 0 ) - PlaceTop ( myInst2, SYM_Y ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] Placement : the instance doesn't exist.`` - The instance must be instanciated in order to be placed. - -- ``[Stratus ERROR] Placement : the first argument is not an instance.`` - -- ``[Stratus ERROR] Placement : the instance is already placed.`` - One can not place an instance twice - -- ``[Stratus ERROR] PlaceTop : no previous instance.`` - One can use ``PlaceTop`` only if a reference instance exist. Use a - ``Place`` call before. - -- ``[Stratus ERROR] PlaceTop : wrong argument for placement type.`` - The symetry given as argument is not correct. - - -PlaceBottom ------------ - -Name -~~~~ - -PlaceBottom – Places an instance below the “reference instance†- -Synopsys -~~~~~~~~ - -:: - - PlaceBottom ( ins, sym, offsetX, offsetY ) - -Description -~~~~~~~~~~~ - -Placement of an instance. -The instance has to be instantiated in the method ``Netlist`` in order -to use the ``PlaceTop`` function. - -The top left corner of the abutment box of the instance is placed, after -beeing symetrized and/or rotated, toward the bottom left corner of the -abutment box of the “reference instanceâ€. The newly placed instance -becomes the “reference instanceâ€. - -Parameters -~~~~~~~~~~ - -- ``ins`` : Instance to place. - -- ``sym`` : Geometrical operation to be performed on the instance - before beeing placed. - The ``sym`` argument can take eight legal values : - - - ``NOSYM`` : no geometrical operation is performed - - - ``SYM_Y`` : Y becomes -Y, that means toward X axe symetry - - - ``SYM_X`` : X becomes -X, that means toward Y axe symetry - - - ``SYMXY`` : X becomes -X, Y becomes -Y - - - ``ROT_P`` : a positive 90 degrees rotation takes place - - - ``ROT_M`` : a negative 90 degrees rotation takes place - - - ``SY_RP`` : Y becomes -Y, and then a positive 90 degrees rotation - takes place - - - ``SY_RM`` : Y becomes -Y, and then a negative 90 degrees rotation - takes place - -- ``offsetX`` (optionnal) : An offset is put horizontally. The value - given as argument must be a multiple of PITCH - -- ``offsetY`` (optionnal) : An offset is put vertically. The value - given as argument must be a multiple of SLICE - -Example -~~~~~~~ - -:: - - Place ( myInst1, NOSYM, 0, 0 ) - PlaceBottom ( myInst2, SYM_Y ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] Placement : the instance doesn't exist.`` - The instance must be instanciated in order to be placed. - -- ``[Stratus ERROR] Placement : the first argument is not an instance.`` - -- ``[Stratus ERROR] Placement : the instance is already placed.`` - One can not place an instance twice - -- ``[Stratus ERROR] PlaceBottom : no previous instance.`` - One can use ``PlaceBottom`` only if a reference instance exist. Use - a ``Place`` call before. - -- ``[Stratus ERROR] PlaceBottom : wrong argument for placement type.`` - The symetry given as argument is not correct. - - -PlaceRight ----------- - -Name -~~~~ - -PlaceRight – Places an instance at the right of the “reference instance†- -Synopsys -~~~~~~~~ - -:: - - PlaceRight ( ins, sym, offsetX, offsetY ) - -Description -~~~~~~~~~~~ - -Placement of an instance. -The instance has to be instantiated in the method ``Netlist`` in order -to use the ``PlaceTop`` function. - -The bottom left corner of the abutment box of the instance is placed, -after beeing symetrized and/or rotated, toward the bottom right corner -of the abutment box of the “reference instanceâ€. The newly placed -instance becomes the “reference instanceâ€. - -Parameters -~~~~~~~~~~ - -- ``ins`` : Instance to place. - -- ``sym`` : Geometrical operation to be performed on the instance - before beeing placed. - The ``sym`` argument can take eight legal values : - - - ``NOSYM`` : no geometrical operation is performed - - - ``SYM_Y`` : Y becomes -Y, that means toward X axe symetry - - - ``SYM_X`` : X becomes -X, that means toward Y axe symetry - - - ``SYMXY`` : X becomes -X, Y becomes -Y - - - ``ROT_P`` : a positive 90 degrees rotation takes place - - - ``ROT_M`` : a negative 90 degrees rotation takes place - - - ``SY_RP`` : Y becomes -Y, and then a positive 90 degrees rotation - takes place - - - ``SY_RM`` : Y becomes -Y, and then a negative 90 degrees rotation - takes place - -- ``offsetX`` (optionnal) : An offset is put horizontally. The value - given as argument must be a multiple of PITCH - -- ``offsetY`` (optionnal) : An offset is put vertically. The value - given as argument must be a multiple of SLICE - -Example -~~~~~~~ - -:: - - Place ( myInst1, NOSYM, 0, 0 ) - PlaceRight ( myInst2, NOSYM ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] Placement : the instance doesn't exist.`` - The instance must be instanciated in order to be placed. - -- ``[Stratus ERROR] Placement : the first argument is not an instance.`` - -- ``[Stratus ERROR] Placement : the instance is already placed.`` - One can not place an instance twice - -- ``[Stratus ERROR] PlaceRight : no previous instance.`` - One can use ``PlaceRight`` only if a reference instance exist. Use - a ``Place`` call before. - -- ``[Stratus ERROR] PlaceRight : wrong argument for placement type.`` - The symetry given as argument is not correct. - - -PlaceLeft ---------- - -Name -~~~~ - -PlaceLeft – Places an instance at the left of the “reference instance†- -Synopsys -~~~~~~~~ - -:: - - PlaceLeft ( ins, sym, offsetX, offsetY ) - -Description -~~~~~~~~~~~ - -Placement of an instance. -The instance has to be instantiated in the method ``Netlist`` in order -to use the ``PlaceTop`` function. - -The bottom right corner of the abutment box of the instance is placed, -after beeing symetrized and/or rotated, toward the bottom left corner of -the abutment box of the “reference instanceâ€. The newly placed instance -becomes the “reference instanceâ€. - -Parameters -~~~~~~~~~~ - -- ``ins`` : Instance to place. - -- ``sym`` : Geometrical operation to be performed on the instance - before beeing placed. - The ``sym`` argument can take eight legal values : - - - ``NOSYM`` : no geometrical operation is performed - - - ``SYM_Y`` : Y becomes -Y, that means toward X axe symetry - - - ``SYM_X`` : X becomes -X, that means toward Y axe symetry - - - ``SYMXY`` : X becomes -X, Y becomes -Y - - - ``ROT_P`` : a positive 90 degrees rotation takes place - - - ``ROT_M`` : a negative 90 degrees rotation takes place - - - ``SY_RP`` : Y becomes -Y, and then a positive 90 degrees rotation - takes place - - - ``SY_RM`` : Y becomes -Y, and then a negative 90 degrees rotation - takes place - -- ``offsetX`` (optionnal) : An offset is put horizontally. The value - given as argument must be a multiple of PITCH - -- ``offsetY`` (optionnal) : An offset is put vertically. The value - given as argument must be a multiple of SLICE - -Example -~~~~~~~ - -:: - - Place ( myInst1, NOSYM, 0, 0 ) - PlaceLeft ( myInst2, NOSYM ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] Placement : the instance doesn't exist.`` - The instance must be instanciated in order to be placed. - -- ``[Stratus ERROR] Placement : the first argument is not an instance.`` - -- ``[Stratus ERROR] Placement : the instance is already placed.`` - One can not place an instance twice - -- ``[Stratus ERROR] PlaceLeft : no previous instance.`` - One can use ``PlaceLeft`` only if a reference instance exist. Use a - ``Place`` call before. - -- ``[Stratus ERROR] PlaceLeft : wrong argument for placement type.`` - The symetry given as argument is not correct. - - -SetRefIns ---------- - -Name -~~~~ - -SetRefIns – Defines the new “reference instance†for placement - -Synopsys -~~~~~~~~ - -:: - - SetRefIns ( ins ) - -Description -~~~~~~~~~~~ - -This function defines the new “reference instanceâ€, used as starting -point in the relative placement functions. -It’s regarding the abutmentbox of the instance ``ins`` that the next -instance is going to be placed, if using the appropriate functions. - -Note that the more recently placed instance becomes automaticaly the -“reference instanceâ€, if SetRefIns isn’t called. - -Parameters -~~~~~~~~~~ - -- ``ins`` : defines the new “reference instance†- -Example -~~~~~~~ - -:: - - Place ( myInst1, NOSYM, 0, 0 ) - PlaceRight ( myInst2, NOSYM ) - - SetRefIns ( myInst1 ) - PlaceTop ( myInst3, SYM_Y ) - -``myInst3`` is on top of ``myInst1`` instead of ``myInst2``. - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] SetRefIns : the instance doesn't exist.`` - If the instance has not been instanciated, it is impossible do to - any placement from it. - -- ``[Stratus ERROR] SetRefIns : the instance ...is not placed.`` - If the instance has not been placed, it is impossible do to any - placement from it. - - -DefAb ------ - -Name -~~~~ - -DefAb – Creates the abutment box of the current cell - -Synopsys -~~~~~~~~ - -:: - - DefAb ( point1, point2 ) - -Description -~~~~~~~~~~~ - -This function creates the abutment box of the current cell. - -Note that one does not have to call this function before saving in order -to create the abutment box. The abutment box is created nevertheless -(given to placed instances). This function is usefull if one wants to -create an abutment before placing the instances. - -Parameters -~~~~~~~~~~ - -- ``point1`` : coordinates of the bottom left corner of the created - abutment box. - -- ``point2`` : coordinates of the top right corner of the created - abutment box. - -Example -~~~~~~~ - -:: - - DefAb ( XY(0, 0), XY(500, 100) ) - - Place ( self.inst, NOSYM, XY(0, 0) ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] DefAb : an abutment box already exists.`` - `` Maybe you should use ResizeAb function.`` - One has called DefAb but the current cell already has an abutment - box. - In order to modify the current abutment box, the function to call - is ResizeAb. - -- ``[Stratus ERROR] DefAb : wrong argument,`` - `` the coordinates must be put in a XY object.`` - The type of one of the arguments is not correct. Coordinates must - be put in a ``XY`` object. - -- ``[Stratus ERROR] DefAb :`` - ``Coordinates of an abutment Box in y must be multiple of the slice.`` - ``Coordinates of an abutment Box in x must be multiple of the pitch.`` - One has called DefAb with non authorized values. - - -ResizeAb --------- - -Name -~~~~ - -ResizeAb – Modifies the abutment box of the current cell - -Synopsys -~~~~~~~~ - -:: - - ResizeAb ( dx1, dy1, dx2, dy2 ) - -Description -~~~~~~~~~~~ - -This function modifies the abutment box of the current cell. -The coordinates of the abutment box are the coordinates of the envelop -of the abutment boxes of each instance plus the delta values given as -argument. - -Note that one can not call this function in order to create the abutment -box. This fonction only modifies the already created abutment box. - -Parameters -~~~~~~~~~~ - -- ``(dx1, dy1)`` : Values to be substracted to the lower left corner of - the previous abutment box. - -- ``(dx2, dy2)`` : Values to be added to the upper right corner of the - previous abutment box. - -The Values are used as follow : - -|resize| - -Example -~~~~~~~ - -:: - - % Expansion of the abutment box at the top and the bottom - ResizeAb ( 0, 100, 0, 100 ) - -Errors -~~~~~~ - -Some errors may occur : - -- `` [Stratus ERROR] ResizeAb :`` - ``Coordinates of an abutment Box in y must be multiple of the slice.`` - ``Coordinates of an abutment Box in x must be multiple of the pitch.`` - One has called ResizeAb with non authorized values - -- `` [Stratus ERROR] ResizeAb :`` - ``one of the values of dx1 or dx2 (dy1 or dy2) is incompatible with`` - ``the size of the abutment box.`` - ``Coordinates of an abutment Box in x must be multiple of the pitch.`` - One has called ResizeAb with a value which deteriorates the - abtument box - - -Patterns generation extension -============================= - -Description of the stimuli --------------------------- - -The stimuli used for the simulation are described in a ``Stimuli`` -method. This method is a Python function generator that is automatically -called by the ``Testbench`` method to generate all the stimuli. As a -Python function generator, the ``yield`` instruction have to be used at -the end of each stimuli computation. - -Affect value to signals -~~~~~~~~~~~~~~~~~~~~~~~ - -The method ``affect`` permits to affect a value to a given signal as -follow - -:: - - self._stim.affect(self.Ck,0) - -Add stimuli -~~~~~~~~~~~ - -The method ``add`` permits to finish a step of simulation by add all the -values to the current stimuli - -:: - - self._stim.add() - -Place and Route -=============== - -PlaceSegment ------------- - -Name -~~~~ - -PlaceSegment – Places a segment - -Synopsys -~~~~~~~~ - -:: - - PlaceSegment ( net, layer, point1, point2, width ) - -Description -~~~~~~~~~~~ - -Placement of a segment. -The segment is created between ``point1`` and ``point2`` on the layer -``layer`` and with width ``width``. It belongs to the net ``net``. -Note that the segment must be horizontal or vertival. - -Parameters -~~~~~~~~~~ - -- ``net`` : Net which the segment belongs to - -- ``layer`` : Layer of the segment. - The ``layer`` argument is a string wich can take different values, - thanks to the technology (file described in HUR\_TECHNO\_NAME) - - - NWELL, PWELL, ptie, ntie, pdif, ndif, ntrans, ptrans, poly, ALU1, - ALU2, ALU3, ALU4, ALU5, ALU6, VIA1, VIA2, VIA3, VIA4, VIA5, TEXT, - UNDEF, SPL1, TALU1, TALU2, TALU3, TALU4, TALU5, TALU6, POLY, NTIE, - PTIE, NDIF, PDIF, PTRANS, NTRANS, CALU1, CALU2, CALU3, CALU4, - CALU5, CALU6, CONT\_POLY, CONT\_DIF\_N, CONT\_DIF\_P, - CONT\_BODY\_N, CONT\_BODY\_P, via12, via23, via34, via45, via56, - via24, via25, via26, via35, via36, via46, CONT\_TURN1, - CONT\_TURN2, CONT\_TURN3, CONT\_TURN4, CONT\_TURN5, CONT\_TURN6 - -- ``point1``, ``point2`` : The segment is created between those two - points - -Example -~~~~~~~ - -:: - - PlaceSegment ( myNet, "ALU3", XY (10, 0), XY (10, 100), 2 ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] PlaceSegment : Argument layer must be a string.`` - -- ``[Stratus ERROR] PlaceSegment : Wrong argument,`` - ``the coordinates of the segment must be put in XY objects.`` - -- ``[Stratus ERROR] PlaceSegment : Segments are vertical or horizontal.`` - The two references given as argument do not describe a vertical or - horizontal segment. Wether coordinate x or y of the references must - be identical. - -]*CopyUpSegment*CopyUpSegmentseccopy - -PlaceContact ------------- - -Name -~~~~ - -PlaceContact – Places a contact - -Synopsys -~~~~~~~~ - -:: - - PlaceContact ( net, layer, point, width, height ) - -Description -~~~~~~~~~~~ - -Placement of a contact. -The contact is located at the coodinates of ``point``, on the layer -``layer`` and has a size of 1 per 1. It belongs to the net ``net``. -Note that the segment must be horizontal or vertival. - -Parameters -~~~~~~~~~~ - -- ``net`` : Net which the contact belongs to - -- ``layer`` : Layer of the segment. - The ``layer`` argument is a string wich can take different values, - thanks to the technology (file described in HUR\_TECHNO\_NAME) - - - NWELL, PWELL, ptie, ntie, pdif, ndif, ntrans, ptrans, poly, ALU1, - ALU2, ALU3, ALU4, ALU5, ALU6, VIA1, VIA2, VIA3, VIA4, VIA5, TEXT, - UNDEF, SPL1, TALU1, TALU2, TALU3, TALU4, TALU5, TALU6, POLY, NTIE, - PTIE, NDIF, PDIF, PTRANS, NTRANS, CALU1, CALU2, CALU3, CALU4, - CALU5, CALU6, CONT\_POLY, CONT\_DIF\_N, CONT\_DIF\_P, - CONT\_BODY\_N, CONT\_BODY\_P, via12, via23, via34, via45, via56, - via24, via25, via26, via35, via36, via46, CONT\_TURN1, - CONT\_TURN2, CONT\_TURN3, CONT\_TURN4, CONT\_TURN5, CONT\_TURN6 - -- ``point`` : Coodinates of the contact - -- ``width`` : Width of the contact - -- ``height`` : Height of the contact - -Example -~~~~~~~ - -:: - - PlaceContact ( myNet, "ALU2", XY (10, 0), 2, 2 ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] PlaceContact : Argument layer must be a string.`` - -- ``[Stratus ERROR] PlaceContact : Wrong argument,`` - ``the coordinates of the contact must be put in a XY object.`` - - -PlacePin --------- - -Name -~~~~ - -PlacePin – Places a pin - -Synopsys -~~~~~~~~ - -:: - - PlacePin ( net, layer, direction, point, width, height ) - -Description -~~~~~~~~~~~ - -Placement of a pin. -The pin is located at the coodinates of ``point``, on the layer -``layer``, has a a direction of ``direction`` and size of 1 per 1. It -belongs to the net ``net``. - -Parameters -~~~~~~~~~~ - -- ``net`` : Net which the pin belongs to - -- ``layer`` : Layer of the segment. - The ``layer`` argument is a string wich can take different values, - thanks to the technology (file described in HUR\_TECHNO\_NAME) - - - NWELL, PWELL, ptie, ntie, pdif, ndif, ntrans, ptrans, poly, ALU1, - ALU2, ALU3, ALU4, ALU5, ALU6, VIA1, VIA2, VIA3, VIA4, VIA5, TEXT, - UNDEF, SPL1, TALU1, TALU2, TALU3, TALU4, TALU5, TALU6, POLY, NTIE, - PTIE, NDIF, PDIF, PTRANS, NTRANS, CALU1, CALU2, CALU3, CALU4, - CALU5, CALU6, CONT\_POLY, CONT\_DIF\_N, CONT\_DIF\_P, - CONT\_BODY\_N, CONT\_BODY\_P, via12, via23, via34, via45, via56, - via24, via25, via26, via35, via36, via46, CONT\_TURN1, - CONT\_TURN2, CONT\_TURN3, CONT\_TURN4, CONT\_TURN5, CONT\_TURN6 - -- ``direction`` : Direction of the pin - - - UNDEFINED, NORTH, SOUTH, EAST, WEST - -- ``point`` : Coodinates of the pin - -- ``width`` : Width of the pin - -- ``height`` : Height of the pin - -Example -~~~~~~~ - -:: - - PlacePin ( myNet, "ALU2", NORTH, XY (10, 0), 2, 2 ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] PlacePin : Argument layer must be a string.`` - -- ``[Stratus ERROR] PlacePin : Illegal pin access direction.`` - ``The values are : UNDEFINED, NORTH, SOUTH, EAST, WEST.`` - -- ``[Stratus ERROR] PlacePin : Wrong argument,`` - ``the coordinates of the pin must be put in a XY object.`` - -PlaceRef --------- - -Name -~~~~ - -PlaceRef – Places a reference - -Synopsys -~~~~~~~~ - -:: - - PlaceRef ( point, name ) - -Description -~~~~~~~~~~~ - -Placement of a reference. -The reference is located at the coordinates of ``point``, with name -``name``. - -Parameters -~~~~~~~~~~ - -- ``point`` : Coodinates of the reference - -- ``name`` : Name of the reference - -Example -~~~~~~~ - -:: - - PlaceRef ( XY (10, 0), "myref" ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] PlaceRef : Wrong argument,`` - ``the coordinates of the reference must be put in a XY object.`` - -- ``[Stratus ERROR] PlaceRef : Argument layer must be a string.`` - - -GetRefXY --------- - -Name -~~~~ - -GetRefXY – Returns the coordinates of a reference - -Synopsys -~~~~~~~~ - -:: - - GetRefXY ( pathname, refname ) - -Description -~~~~~~~~~~~ - -Computation of coordinates. -The point returned (object XY) represents the location of the -reference of name ``refname`` within the coodinates system of the top -cell. The reference ``refname`` is instanciated in an instance found -thanks to ``pathname`` which represents an ordered sequence of instances -through the hierarchy. - -Parameters -~~~~~~~~~~ - -- ``pathname`` : The path in order to obtain, from the top cell, the - instance the reference ``refname`` belongs to - -- ``refname`` : The name of the reference - -Example -~~~~~~~ - -The cell which is being created (the top cell), instanciates a generator -with instance name “my\_dpgen\_and2â€. This generator instanciates an -instance called “cell\_1†which the reference “i0\_20†belongs to. - -:: - - GetRefXY ( "my_dpgen_and2.cell_1", "i0_20" ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] GetRefXY :`` - ``The instance's path must be put with a string.`` - -- ``[Stratus ERROR] GetRefXY :`` - ``The reference must be done with it's name : a string.`` - -- ``[Stratus ERROR] GetRefXY :`` - ``No reference found with name ... in masterCell ...`` - -CopyUpSegment -------------- - -Name -~~~~ - -CopyUpSegment – Copies the segment of an instance in the current cell - -Synopsys -~~~~~~~~ - -:: - - CopyUpSegment ( pathname, netname, newnet ) - -Description -~~~~~~~~~~~ - -Duplication of a segment. -The segment is created with the same cordinates and layer as the -segment corresponding to the net ``netname`` in the instance found -thanks to ``pathname``. It belongs to the net ``newnet``. -Note that if several segments correspond to the net, they are all -going to be copied. - -Parameters -~~~~~~~~~~ - -- ``pathname`` : The path in order to obtain, from the top cell, the - instance the net ``netname`` belongs to - -- ``netname`` : The name of the net which the segment belongs to - -- ``net`` : The net which the top cell segment os going to belong to - -Example -~~~~~~~ - -:: - - CopuUpSegment ( "my_dpgen_and2.cell_1", "i0", myNet ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] CopyUpSegment :`` - ``The instance's path must be put with a string.`` - -- ``[Stratus ERROR] CopyUpSegment :`` - ``The segment must be done with it's name : a string.`` - -- ``[Stratus ERROR] CopyUpSegment :`` - ``No net found with name ... in masterCell ...`` - There is no net with name ``netname`` in the instance found thanks - to the path ``pathname``. - -- ``[Stratus ERROR] CopyUpSegment :`` - ``No segment found with net ... in masterCell ...`` - The net with name ``netname`` has no segment. So the copy of - segment can not be done. - -- ``[Stratus ERROR] CopyUpSegment :`` - ``the segment of net ... are not of type CALU.`` - In other words, the net is not an external net. The copy can be - done only with external nets. - -PlaceCentric ------------- - -Name -~~~~ - -PlaceCentric – Placement of an instance in the middle of an abutment box - -Synopsys -~~~~~~~~ - -:: - - PlaceCentric ( ins ) - -Description -~~~~~~~~~~~ - -This function places an instance in the middle of and abutment box. -The instance has to be instantiated in the method ``Netlist`` in order -to use this function. - -Parameters -~~~~~~~~~~ - -- ``ins`` : Instance to place - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] PlaceCentric: the instance does not exist.`` - The instance must be instanciated in order to be placed. - -- ``[Stratus ERROR] PlaceCentric :`` - ``the instance's size is greater than this model.`` - The instance must fit in the abutment box. The abutment box may not - be big enough. - -PlaceGlu --------- - -Name -~~~~ - -PlaceGlue – Automatic placement of non placed instances - -Synopsys -~~~~~~~~ - -:: - - PlaceGlue ( cell ) - -Description -~~~~~~~~~~~ - -This function places, thanks to the automatic placer Mistral of -Coriolis, all the non placed instances of the cell. - -Parameters -~~~~~~~~~~ - -- ``cell`` : the cell which the fonction is applied to - -FillCell --------- - -Name -~~~~ - -FillCell – Automatic placement of ties. - -Synopsys -~~~~~~~~ - -:: - - FillCell ( cell ) - -Description -~~~~~~~~~~~ - -This function places automatically ties. - -Parameters -~~~~~~~~~~ - -- ``cell`` : the cell which the fonction is applied to - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] FillCell : Given cell doesn't exist.`` - The argument is wrong. Check if one has created the cell correctly. - -Pads ----- - -Name -~~~~ - -PadNorth, PadSouth, PadEast, PasWest – Placement of pads at the -periphery of the cell - -Synopsys -~~~~~~~~ - -:: - - PadNorth ( args ) - -Description -~~~~~~~~~~~ - -These functions place the pads given as arguments at the given side of -the cell (PadNorth : up north, PadSouth : down south ...). Pads are -placed from bottom to top for PadNorth and PadSouth and from left to -right for PadWest and PasEast. - -Parameters -~~~~~~~~~~ - -- ``args`` : List of pads to be placed - -Example -~~~~~~~ - -:: - - PadSouth ( self.p_cin, self.p_np, self.p_ng, self.p_vssick0 - , self.p_vddeck0, self.p_vsseck1, self.p_vddeck1, self.p_cout - , self.p_y[0], self.p_y[1], self.p_y[2] - ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] PadNorth : not enough space for all pads.`` - The abutment box is not big enough in order to place all the pads. - Maybe one could put pads on other faces of the cell. - -- ``[Stratus ERROR] PadNorth : one instance doesn't exist.`` - One of the pads given as arguments does not exist - -- ``[Stratus ERROR] PadNorth : one argument is not an instance.`` - One of the pads is not one of the pads of the cell. - -- ``[Stratus ERROR] PadNorth : the instance ins is already placed.`` - One is trying to place a pad twice. - -- ``[Stratus ERROR] PadNorth : pad ins must be closer to the center.`` - The pad name ins must be put closer to the center in order to route - the cell - -Alimentation rails ------------------- - -Name -~~~~ - -AlimVerticalRail, AlimHorizontalRail – Placement of a -vertical/horizontal alimentation call back - -Synopsys -~~~~~~~~ - -:: - - AlimVerticalRail ( nb ) - -Description -~~~~~~~~~~~ - -These functions place a vertical/horizontal alimentation call back. It’s -position is given by the parameter given. - -Parameters -~~~~~~~~~~ - -- ``nb`` : coordinate of the rail - - - For AlimVerticalRail, ``nb`` is in pitches i.e. 5 lambdas - - - For AlimHorizontalRail, ``nb`` is in slices i.e. 50 lambdas - -Example -~~~~~~~ - -:: - - AlimVerticalRail ( 50 ) - AlimVerticalRail ( 150 ) - - AlimHorizontalRail ( 10 ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] AlimHorizontalRail :`` - ``Illegal argument y, y must be between ... and ...`` - The argument given is wrong : the call back would not be in the - abutment box. - -- ``[Stratus ERROR] Placement of cells :`` - ``please check your file of layout with DRUC.`` - The placement of the cell needs to be correct in order to place a - call back. Check the errors of placement. - -Alimentation connectors ------------------------ - -Name -~~~~ - -AlimConnectors – Creation of connectors at the periphery of the core of -a circuit - -Synopsys -~~~~~~~~ - -:: - - AlimConnectors() - -Description -~~~~~~~~~~~ - -This function creates the connectors in Alu 1 at the periphery of the -core. - -PowerRing ---------- - -Name -~~~~ - -PowerRing – Placement of power rings. - -Synopsys -~~~~~~~~ - -:: - - PowerRing ( nb ) - -Description -~~~~~~~~~~~ - -This function places power rings around the core and around the plots. - -Parameters -~~~~~~~~~~ - -- ``nb`` : Number of pair of rings vdd/vss - -Example -~~~~~~~ - -:: - - PowerRing ( 3 ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] PowerRing : Pads in the north haven't been placed.`` - The pads of the 4 sides of the chip must be placed before calling - function PowerRing. - -- ``[Stratus ERROR] PowerRing : too many rings, not enough space.`` - Wether The argument of PowerRing is to big, or the abutment box of - the chip is to small. There’s no space to put the rings. - -RouteCk -------- - -Name -~~~~ - -RouteCk – Routing of signal Ck to standard cells - -Synopsys -~~~~~~~~ - -:: - - RouteCk ( net ) - -Description -~~~~~~~~~~~ - -This function routes signal Ck to standard cells. - -Parameters -~~~~~~~~~~ - -- ``net`` : the net which the fonction is applied to - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] RouteCk : Pads in the north haven't been placed`` - The pads must be placed before calling RoutageCk. - -Instanciation facilities -======================== - -Buffer ------- - -Name -~~~~ - -Buffer – Easy way to instantiate a buffer - -Synopsys -~~~~~~~~ - -:: - - netOut <= netIn.Buffer() - -Description -~~~~~~~~~~~ - -This method is a method of net. The net which this method is applied -to is the input net of the buffer. The method returns a net : the output -net. -Note that it is possible to change the generator instanciated with the -``SetBuff`` method. - -Example -~~~~~~~ - -:: - - class essai ( Model ) : - - def Interface ( self ) : - self.A = SignalIn ( "a", 4 ) - - self.S = SignalOut ( "s", 4 ) - - self.Vdd = VddIn ( "vdd" ) - self.Vss = VssIn ( "vss" ) - - def Netlist ( self ) : - - self.S <= self.A.Buffer() - -Multiplexor ------------ - -Name -~~~~ - -Mux – Easy way to instantiate a multiplexor - -Synopsys -~~~~~~~~ - -:: - - netOut <= netCmd.Mux ( arg ) - -Description -~~~~~~~~~~~ - -This method is a method of net. The net which this method is applied -to is the command of the multiplexor. The nets given as parameters are -all the input nets. This method returns a net : the output net. -There are two ways to describe the multiplexor : the argument ``arg`` -can be a list or a dictionnary. -Note that it is possible to change the generator instanciated with the -``SetMux`` method. - -Parameters -~~~~~~~~~~ - -- List : - For each value of the command, the corresponding net is specified. - All values must be specified. - For example : - - :: - - out <= cmd.Mux ( [in0, in1, in2, in3] ) - - - The net out is then initialised like this : - - :: - - if cmd == 0 : out <= in0 - if cmd == 1 : out <= in1 - if cmd == 2 : out <= in2 - if cmd == 3 : out <= in3 - - -- Dictionnary : - A dictionnary makes the correspondance between a value of the - command and the corresponding net. - For example : - - :: - - out <= cmd.Mux ( {"0" : in0, "1" : in1, "2" : in2, "3" : in3} ) - - - This initialisation corresponds to the one before. Thanks to the use - of a dictionnary, the connections can be clearer : - - - ``'default'``: This key of the dictionnary corresponds to all - the nets that are not specified - For example : - - :: - - out <= cmd.Mux ( {"0" : in0, "default" : in1} ) - - - This notation corresponds to : - - :: - - if cmd == 0 : out <= in0 - else : out <= in1 - - - Note that if there is no ``'default'`` key specified and that not - all the nets are specified, the non specified nets are set to 0. - - - ``#`` and ``?`` : When a key of the dictionnary begins with - ``#``, the number after the ``#`` has to be binary and each ? in - the number means that this bit is not precised - For example : - - :: - - out <= cmd.Mux ( {"#01?" : in0, "default" : in1} ) - - - This notation corresponds to : - - :: - - if cmd in ( 2, 3 ) : out <= in0 - else : out <= in1 - - - - ``,`` and ``-`` : When keys contains thoses symbols, it permits - to enumerate intervals - For example : - - :: - - out <= cmd.Mux ( {"0,4" : in0, "1-3,5" : in1} ) - - - This notation corresponds to : - - :: - - if cmd in ( 0, 4 ) : out <= in0 - elif cmd in ( 1, 2, 3, 5) : out <= in1 - else : out <= 0 - - -Example -~~~~~~~ - -:: - - class essai ( Model ) : - - def Interface ( self ) : - self.A = SignalIn ( "a", 4 ) - self.B = SignalIn ( "b", 4 ) - self.C = SignalIn ( "c", 4 ) - self.D = SignalIn ( "d", 4 ) - - self.Cmd1 = SignalIn ( "cmd1", 2 ) - self.Cmd2 = SignalIn ( "cmd2", 4 ) - - self.S1 = SignalOut ( "s1", 4 ) - self.S2 = SignalOut ( "s2", 4 ) - - self.Vdd = VddIn ( "vdd" ) - self.Vss = VssIn ( "vss" ) - - def Netlist ( self ) : - - self.S1 <= self.Cmd1.Mux ( [sefl.A, self.B, self.C, self.D] ) - - self.S2 <= self.Cmd2.Mux ( { "0" : self.A - , "1,5-7" : self.B - , "#1?1?" : self.C - , "default" : self.D - } ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] Mux : all the nets must have the same lenght.`` - All the input nets pust have the same lenght. - -- ``[Stratus ERROR] Mux : there are no input nets.`` - The input nets seem to have been forgotten. - -- ``[Stratus ERROR] Mux : wrong argument type.`` - The connections of the buses are not described by a list nor a - dictionnary. - -- ``[Stratus ERROR] Mux :`` - ``the number of nets does not match with the lenght of the command.`` - When using a list, the number of nets has to correspond to the - number of possible values of the command. - -- ``[Stratus ERROR] Mux : wrong key.`` - One of the key of the dictionnary is not un number, neither a list - or an interval. - -- ``[Stratus ERROR] Mux :`` - ``when an interval is specified, the second number of the interval`` - ``must be greater than the first one.`` - When creating an interval with “-â€, the second number has to be - greater than the first one. - -- ``[Stratus ERROR] Mux :`` - ``the binary number does not match with the lenght of the command.`` - When using the ``#`` notation, each digit of the binary number - corresponds to a wire of the cmd. The leghts have to correspond. - -- ``[Stratus ERROR] Mux : after #, the number has to be binary.`` - When using the ``#`` notation, the number has to be binary : one - can use 0, 1 or ?. - -Shifter -------- - -Name -~~~~ - -Shift – Easy way to instantiate a shifter - -Synopsys -~~~~~~~~ - -:: - - netOut <= netCmd.Shift ( netIn, direction, type ) - -Description -~~~~~~~~~~~ - -This method is a method of net. The net which this method is applied -to is the command of the shifter, it’s the one which defines the number -of bits to shift. The net given as parameter is the input net. The other -arguments set the different patameters. The method returns a net : the -output net. -Note that it is possible to change the generator instanciated with the -``SetShift`` method. - -Parameters -~~~~~~~~~~ - -- ``netIn`` : the net which is going to be shifted - -- ``direction`` : this string represents the direction of the shift : - - - “left†- - - “right†- -- ``type`` : this string represents the type of the shift : - - - “logical†: only “zeros†are put in the net - - - “arith†: meaningful for “right†shift, the values put in the nets - are an extension of the MSB - - - “circular†: the values put in the nets are the ones which have - just been taken off - -Example -~~~~~~~ - -:: - - class essai ( Model ) : - - def Interface ( self ) : - self.A = SignalIn ( "a", 4 ) - - self.Cmd = SignalIn ( "cmd", 2 ) - - self.S1 = SignalOut ( "s1", 4 ) - self.S2 = SignalOut ( "s2", 4 ) - self.S3 = SignalOut ( "s3", 4 ) - - self.Vdd = VddIn ( "vdd" ) - self.Vss = VssIn ( "vss" ) - - def Netlist ( self ) : - - self.S1 <= self.Cmd.Shift ( self.A, "right", "logical" ) - self.S2 <= self.Cmd.Shift ( self.A, "right", "arith" ) - - self.S3 <= self.Cmd.Shift ( self.A, "left", "circular" ) - -If the value of “a†is “0b1001†and the value of “cmd†is “0b10â€, we -will have : - -- “s1†: “0b0010†- -- “s2†: “0b1110†- -- “s3†: “0b0110†- -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] Shift :`` - ``The input net does not have a positive arity.`` - The net which is going to be shifted must have a positive arity. - -- ``[Stratus ERROR] Shift :`` - ``The direction parameter must be "left" or "right".`` - The “direction†argument is not correct. - -- ``[Stratus ERROR] Shift :`` - ``The type parameter must be "logical" or "arith" or "circular".`` - The “type†argument is not correct. - -Register --------- - -Name -~~~~ - -Reg – Easy way to instantiate a register - -Synopsys -~~~~~~~~ - -:: - - netOut <= netCk.Reg ( netIn ) - -Description -~~~~~~~~~~~ - -This method is a method of net. The net which this method is applied -to is the clock of the register. The net given as parameter is the input -net. The method returns a net : the output net. -Note that it is possible to change the generator instanciated with the -``SetReg`` method. - -Example -~~~~~~~ - -:: - - class essai ( Model ) : - - def Interface ( self ) : - self.A = SignalIn ( "a", 4 ) - self.S = SignalOut ( "s", 4 ) - - self.Ck = CkIn ( "ck" ) - - self.Vdd = VddIn ( "vdd" ) - self.Vss = VssIn ( "vss" ) - - def Netlist ( self ) : - - self.S <= self.Ck.Reg ( self.A ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] Reg : The input net does not have a positive arity.`` - The input net must have a positive arity. - -- ``[Stratus ERROR] Reg : The clock does not have a positive arity.`` - The clock must have a positive arity. - -Constants ---------- - -Name -~~~~ - -Constant – Easy way to instantiate constants - -Synopsys -~~~~~~~~ - -:: - - netOne <= One ( 2 ) - - net8 <= "8" - -Description -~~~~~~~~~~~ - -These functions simplify the way to instanciate constants. - -- The functions ``One`` and\ ``Zero`` permits to initialise all the - bits of a net to ’one’ or ’zero’. - -- The instanciation of a constant thanks to a string can be done in - decimal, hecadecimal or binary. - -Parameters -~~~~~~~~~~ - -- For ``One`` and ``Zero`` : - - - ``n`` : the arity of the net - -- For the instanciation of a constant : - - - the constant given must be a string representing : - - - A decimal number - - - A binary number : the string must begin with “0b†- - - An hexadecimal number : the string must begin with “0x†- -Example -~~~~~~~ - -:: - - class essai ( Model ) : - - def Interface ( self ) : - self.Ones = SignalOut ( "ones", 2 ) - self.Zeros = SignalOut ( "zeros", 4 ) - - self.Eight = SignalOut ( "eight", 4 ) - self.Twentu = SignalOut ( "twenty", 5 ) - self.Two = SignalOut ( "two", 5 ) - - self.Vdd = VddIn ( "vdd" ) - self.Vss = VssIn ( "vss" ) - - def Netlist ( self ) : - - self.Ones <= One ( 2 ) - self.Zero <= Zero ( 4 ) - - self.Eight <= "8" - self.Twenty <= "0x14" - self.Two <= "0b10" - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] Const :`` - ``the argument must be a string representing a number in decimal,`` - ``binary (0b) or hexa (0x).`` - The string given as argument does not have the right form. - -Boolean operations ------------------- - -Description -~~~~~~~~~~~ - -Most common boolean operators can be instantiated without the ``Inst`` -constructor. - -List -~~~~ - -Boolean operators are listed below : - -- ``And2`` : ``q <= i0 & i1`` - -- ``Or2`` : ``q <= i0 | i1`` - -- ``Xor2`` : ``q <= i0 ^ i1`` - -- ``Inv`` : ``q <= ~i0`` - -Generators to instantiate -~~~~~~~~~~~~~~~~~~~~~~~~~ - -One can choose the generator to be used. Some methods are applied to -the cell and set the generator used when using ``&``, ``|``, ``^`` and -``~``. The generators used by default are the ones from the virtual -library. - -Methods are : - -- ``SetAnd`` - -- ``SetOr`` - -- ``SetXor`` - -- ``SetNot`` - -Example -~~~~~~~ - -:: - - class essai ( Model ) : - - def Interface ( self ) : - self.A = SignalIn ( "a", 4 ) - self.B = SignalIn ( "b", 4 ) - self.B = SignalIn ( "c", 4 ) - - self.S = SignalOut ( "s", 4 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - - self.S <= ( ~self.A & self.B ) | self.C - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] & : the nets must have the same lenght.`` - When one uses boolean expressions, one has to check that the sizes - of both nets are equivalent. - -- ``[Stratus ERROR] : there is no alim.`` - The cell being created does not have the alimentation nets. The - instanciation is impossible. - -Arithmetical operations ------------------------ - -Description -~~~~~~~~~~~ - -Most common arithmetic operators can be instantiated without the -``Inst`` constructor. - -List -~~~~ - -Arithmetical operators are listed below : - -- ``Addition`` : ``q <= i0 + i1`` - -- ``Substraction`` : ``q <= i0`` - ``i1`` - -- ``Multiplication`` : ``q <= i0 * i1`` - -- ``Division`` : ``q <= i0 / i1`` - -Generators to instantiate -~~~~~~~~~~~~~~~~~~~~~~~~~ - -One can choose the generator to be used. Some methods are applied to the -cell and set the generator used when using overloard. Methods are : - -- ``SetAdd`` (for addition and substraction) - -- ``SetMult`` - -- ``SetDiv`` - -The generators used by default are : - -- ``Addition`` : Slansky adder - -- ``Substraction`` : Slansky adder + inversor + cin = ’1’ - -- ``Multiplication`` : CA2 multiplier (signed, modified booth/Wallace - tree) - -- ``Division`` : not available yet - -Example -~~~~~~~ - -:: - - class essai ( Model ) : - - def Interface ( self ) : - self.A = SignalIn ( "a", 4 ) - self.B = SignalIn ( "b", 4 ) - - self.S = SignalOut ( "s", 4 ) - - self.T = SignalOut ( "t", 8 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - - self.S <= self.A + self.B - - self.T <= self.A * self.B - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] + : the nets must have the same lenght.`` - When one uses arithmetic expressions, one has to check that the - sizes of both nets are equivalent. - -- ``[Stratus ERROR] : there is no alim.`` - The cell being created does not have the alimentation nets. The - instanciation is impossible. - -Comparison operations ---------------------- - -Name -~~~~ - -Eq/Ne : Easy way to test the value of the nets - -Synopsys -~~~~~~~~ - -:: - - netOut <= net.Eq ( "n" ) - -Description -~~~~~~~~~~~ - -Comparaison functions are listed below : - -- ``Eq`` : returns ``true`` if the value of the net is equal to ``n``. - -- ``Ne`` : returns ``true`` if the value of the net is different from - ``n``. - -Note that it is possible to change the generator instanciated with the -``SetComp`` method. - -Parameters -~~~~~~~~~~ - -The constant given as argument must be a string representing : - -- A decimal number - -- A binary number : the string must begin with “0b†- -- An hexadecimal number : the string must begin with “0x†- -Example -~~~~~~~ - -:: - - class essai ( Model ) : - - def Interface ( self ) : - self.A = SignalIn ( "a", 4 ) - - self.S = SignalOut ( "s", 1 ) - self.T = SignalOut ( "t", 1 ) - - self.vdd = VddIn ( "vdd" ) - self.vss = VssIn ( "vss" ) - - def Netlist ( self ) : - - self.S <= self.A.Eq ( "4" ) - - self.T <= self.A.Ne ( "1" ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] Eq :`` - ``the number does not match with the net's lenght.`` - When one uses comparaison functions on one net, one has to check - that the number corresponds to the size of the net. - -- ``[Stratus ERROR] Eq :`` - ``the argument must be a string representing a number in decimal,`` - ``binary (0b) or hexa (0x).`` - The string given as argument does not have the right form. - -Virtual library ---------------- - -Description -~~~~~~~~~~~ - -The virtual library permits to create a cell and map it to different -libraries without having to change it. - -List of the generators provided -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- ``a2`` : ``q <= i0 & i1`` - -- ``a3`` : ``q <= i0 & i1 & i2`` - -- ``a4`` : ``q <= i0 & i1 & i2 & i3`` - -- ``na2`` : ``nq <= ~ ( i0 & i1 )`` - -- ``na3`` : ``nq <= ~ ( i0 & i1 & i2 )`` - -- ``na4`` : ``nq <= ~ ( i0 & i1 & i2 & i3 )`` - -- ``o2`` : ``q <= i0 & i1`` - -- ``o3`` : ``q <= i0 & i1 & i2`` - -- ``o4`` : ``q <= i0 & i1 & i2 & i3`` - -- ``no2`` : ``nq <= ~ ( i0 & i1 )`` - -- ``no3`` : ``nq <= ~ ( i0 & i1 & i2 )`` - -- ``no4`` : ``nq <= ~ ( i0 & i1 & i2 & i3 )`` - -- ``inv`` : ``nq <= ~ i`` - -- ``buf`` : ``q <= i`` - -- ``xr2`` : ``q <= i0 ^ i1`` - -- ``nxr2`` : ``nq <= ~ ( i0 ^ i1 )`` - -- ``zero`` : ``nq <= '0'`` - -- ``one`` : ``q <= '1'`` - -- ``halfadder`` : ``sout <= a ^ b`` and ``cout <= a & b`` - -- ``fulladder`` : ``sout <= a ^ b ^ cin`` - and ``cout <= ( a & b ) | ( a & cin ) | ( b & cin )`` - -- ``mx2`` : ``q <= (i0 & ~cmd) | (i1 & cmd)`` - -- ``nmx2`` : ``nq <= ~( (i0 & ~cmd) | (i1 & cmd) )`` - -- ``sff`` : ``if RISE ( ck ) : q <= i`` - -- ``sff2`` : ``if RISE ( ck ) : q <= (i0 & ~cmd) | (i1 & cmd)`` - -- ``sff3`` : ``if RISE ( ck ) :`` - `` q <= (i0 & ~cmd0) | (((i1 & cmd1)|(i2&~cmd1)) & cmd0)`` - -- ``ts`` : ``if cmd : q <= i`` - -- ``nts`` : ``if cmd : nq <= ~i`` - -Mapping file -~~~~~~~~~~~~ - -The virtual library is mapped to the sxlib library. A piece of the -corresponding mapping file is shown below. -In order to map the virtual library to another library, on has to -write a .xml file which makes correspond models and interfaces. -Note that the interfaces of the cells must be the same (except for the -names of the ports). Otherwise, one has to create .vst file in order to -make the interfaces match. - -The environment variable used to point the right file is -``STRATUS_MAPPING_NAME``. - -|xml| - -Generators -~~~~~~~~~~ - -Some generators are also provided in order to use the cells of the -library with nets of more than 1 bit. One has to upper the first letter -of the model name in order to user those generators. What is simply done -is a for loop with the bits of the nets. The parameter ``'nbit'`` gives -the size of the generator. - -Example -~~~~~~~ - -- Direct instanciation of a cell - -:: - - for i in range ( 4 ) : - Inst ( 'a2' - , map = { 'i0' : neti0[i] - , 'i1' : neti1[i] - , 'q' : netq[i] - , 'vdd' : netvdd - , 'vss' : netvss - } - ) - -- Instanciation of a generator - -:: - - Generate ( 'A2', "my_and2_4bits", param = { 'nbit' : 4 } ) - Inst ( 'my_and2_4bits' - , map = { 'i0' : neti0 - , 'i1' : neti1 - , 'q' : netq - , 'vdd' : vdd - , 'vss' : vss - } - ) - -Errors -~~~~~~ - -Some errors may occur : - -- ``[Stratus ERROR] Inst : the model ... does not exist.`` - ``Check CRL_CATA_LIB.`` - The model of the cell has not been found. One has to check the - environment variable. - -- ``[Stratus ERROR] Virtual library : No file found in order to parse.`` - ``Check STRATUS_MAPPING_NAME.`` - The mapping file is not given in the environment variable. - -Useful links -============ - -DpGen generators ----------------- - -You can find the documentation of the DPGEN library at : -file:./DpGen.html - -Arithmetic package of stratus ------------------------------ - -You can find the documentation of the arithmetic stratus’s package at: -file:////users/outil/arith/latest/modules_stratus/arithmetic/doc/arith/index.html - -Arithmetic generators and some stratus packages ------------------------------------------------ - -You can find the documentation of the arithmetic library at : -file:////users/outil/arith/latest/doc/index.html - -Patterns module ---------------- - -You can find the documentation of the patterns module : -file:../patterns/index.html - -.. |add1| image:: ./images/add1.png -.. |add2| image:: ./images/add2.png -.. |addaccu| image:: ./images/addaccu.png -.. |test| image:: ./images/test.png -.. |editor| image:: ./images/editor.png -.. |resize| image:: ./images/resizeAb.png -.. |xml| image:: images/xml.png diff --git a/documentation/_build/html/_sources/Stratus/Patterns.txt b/documentation/_build/html/_sources/Stratus/Patterns.txt deleted file mode 100644 index 32438686..00000000 --- a/documentation/_build/html/_sources/Stratus/Patterns.txt +++ /dev/null @@ -1,257 +0,0 @@ -============================ -Patterns module User's Guide -============================ -Roselyne Chotin-Avot - - -Description -=========== - -The patterns module of *Stratus* is a set of *Python* classes and -methods that allows a procedural description of input pattern file for -the logic simulator. The *Stratus* ``Pattern`` method produces a pattern -description file as output. The file generated by ``Pattern`` method is -in pat format, so IT IS STRONGLY RECOMMENDED TO SEE pat(5) manual BEFORE -TO USE IT. - -Syntax -====== - -From a user point of view, ``Pattern`` method is a pattern description -language using all standard *Python* facilities. Here follows the -description of the ``Pattern`` method. -A pat format file can be divided in two parts : declaration and -description part. -The declaration part is the list of inputs, outputs, internal signals -and registers. Inputs are to be forced to a certain value and all the -others are to be observed during simulation. -The description part is a set of patterns, where each pattern defines -the value of inputs and outputs. The pattern number represents actually -the absolute time for the simulator. -Similarly, a ``Pattern`` method can be divided in two parts : -declaration and description part. Methods related to the declaration -must be called before any function related to the description part. - -Declaration part ----------------- - -The first thing you should do in this part is to instantiate the class -``Patwrite`` to have access to all patterns declaration and description -methods. The constructor of this class take as parameters the name of -pattern output file and the *Stratus* cell that is described (see -``PatWrite`` [patwrite]). -Then, this part allows you to declare the inputs, the outputs, and -internal observing points (see ``declar``\ [declar] and -``declar_interface`` [declar:sub:`i`\ nterface]). - -Description part ----------------- - -After all signals are declared, you can begin the description part (see -``pattern_begin`` [pattern:sub:`b`\ egin]). In this part you have to -define input values which are to be applied to the inputs of the circuit -or output values which are to be compare with the values produced during -the simulation. (see ``affect`` [affect], ``affect_any`` -[affect:sub:`a`\ ny], ``affect_int`` [affect:sub:`i`\ nt] and -``affect_fix`` [affect:sub:`f`\ ix]). ``Pattern`` method describes the -stimulus by event : only signal transitions are described. After each -event there is a new input in the pattern file (see ``addpat`` -[addpat]). Last thing you should do in this part is to generate the -output file (see ``pattern_end`` [pattern:sub:`e`\ nd]). - -Methods -======= - -PatWrite --------- - -This class is used to create patterns for *Stratus* models. Currently it -only supports Alliance “.pat†pattern format. Patterns time stamps are -in the “absolute date†format, “relative date†isn’t allowed. Legal time -unit are ps (default), ns, us and ms. The constructor takes as -parameters the pattern output filename and an optional reference to -Stratus cell. - -declar ------- - -Adds a connector from a Stratus model to the pattern interface. Writes -the corresponding connector declaration in the pattern file with name, -arity and direction automatically extracted from the connector -properties. -Supported Stratus connectors are: - -- SignalIn, - -- SignalOut (only supported if used as an output), - -- VddIn, - -- VssIn, - -- CkIn, - -- SignalInOut, - -- TriState (always an output), - -- Signals. - -Parameters -~~~~~~~~~~ - -- connector : can either be a reference to a stratus net or a string - containing the name of the stratus net. - -- format : optional format for the connectors values into the pattern - file, accepted values are : - - - ’B’: binary (default), - - - ’X’: hexadecimal, - - - ’O’: octal. - -declar\_interface ------------------ - -Adds all the connectors from a Stratus model to the pattern interface. -Write the corresponding connector declaration in the pattern file with -name, arity and direction directly taken from the connector proprieties. - -Parameters -~~~~~~~~~~ - -- cell : the tested Stratus model reference. Optional if a reference to - the tested Stratus model was given during instanciation[patwrite]. - -- format : optional format for the connectors values into the pattern - file, accepted values are : - - - ’B’: binary (default), - - - ’X’: hexadecimal, - - - ’O’: octal. - -declar ------- - -Affect a string value to a connector. - -Parameters -~~~~~~~~~~ - -- connector : *Stratus* connector - -- value : string to affect to connector - -affect\_int ------------ - -Affect an integer (CA2) value to a connector. Convert the 2’s complement -value to the corresponding binary value. The binary size is taken from -the connector arity. If the connector is an output, the binary value is -preceded by “?â€. - -Parameters -~~~~~~~~~~ - -- connector : *Stratus* connector. - -- value : 2’s complement value to affect to the connector. - -affect\_fix ------------ - -Affect a fixed point value to a connector. Convert the floating point -input value to the corresponding fixed point value with -word\_length=connector.arity() and integer\_word\_length=iwl. If the -connector is an output, the binary value is preceded by “?â€. - -Parameters -~~~~~~~~~~ - -- connector : *Stratus* connector. - -- value : floating point value to convert and asign to connector. - -- iwl : integer word length - -affect\_any ------------ - -Disable comparison between this connector value and the one calculated -during simulation. - -Parameters -~~~~~~~~~~ - -- connector : *Stratus* connector. - -addpat ------- - -Adds a pattern in the pattern file. - -pattern\_begin --------------- - -Mark the end of the interface declaration and the beginning of the test -vectors. - -pattern\_end ------------- - -Mark the end of the test vectors and of the patterns file. - -Example -======= - -``Pattern`` method for an addaccu - -:: - - def Pattern(self): - # initialisation - pat = PatWrite(self._name+'.pat',self) - - # declaration of ports - pat.declar(self.ck, 'B') - pat.declar(self.load, 'B') - pat.declar(self.input, 'X') - pat.declar(self.output, 'X') - pat.declar(self.vdd, 'B') - pat.declar(self.vss, 'B') - - # use of pat.declar_interface(self) has the same effect - - # description beginning - pat.pattern_begin() - - # affect vdd and vss values - pat.affect_int(self.vdd,1) - pat.affect_int(self.vss,0) - - # first pattern : load an initial value - pat.affect_int(self.input,5) - pat.affect_int(self.load,1) - pat.affect_int(self.ck,0) - # add the pattern in the pattern file - pat.addpat() - # compute next event - pat.affect_int(self.ck,1) - pat.addpat() - - # compute 22 cycle of accumulation - pat.affect_int(self.load,0) - for i in range(1,22): - pat.affect_int(self.ck,0) - pat.addpat() - pat.affect_int(self.ck,1) - pat.affect_int(self.output,i+5) - pat.addpat() - - # end of the description - pat.pattern_end() - diff --git a/documentation/_build/html/_sources/Stratus/index.txt b/documentation/_build/html/_sources/Stratus/index.txt deleted file mode 100644 index eed54d6b..00000000 --- a/documentation/_build/html/_sources/Stratus/index.txt +++ /dev/null @@ -1,20 +0,0 @@ -.. -*- mode: rst; explicit-buffer-name: "index.rst" -*- - -.. include:: ../etc/definitions.rst - - -================================== -Stratus : Netlist Capture Language -================================== - -Printable version of this document `Stratus.pdf <../../../pdf/main/Stratus.pdf>`_. - -Stratus – Procedural design language based upon *Python* - -.. toctree:: - :maxdepth: 1 - - Language.rst - Developper.rst - Patterns.rst - DpGen.rst diff --git a/documentation/_build/html/_sources/Unicorn/Unicorn.txt b/documentation/_build/html/_sources/Unicorn/Unicorn.txt deleted file mode 100644 index c972e5f0..00000000 --- a/documentation/_build/html/_sources/Unicorn/Unicorn.txt +++ /dev/null @@ -1,11 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -=================== -Unicorn Reference -=================== - -The Unicorn C++ API reference is generated by Doxygen_ and is -available here: `Unicorn `_ diff --git a/documentation/_build/html/_sources/UsersGuide/Configuration.txt b/documentation/_build/html/_sources/UsersGuide/Configuration.txt deleted file mode 100644 index 6db8baa7..00000000 --- a/documentation/_build/html/_sources/UsersGuide/Configuration.txt +++ /dev/null @@ -1,203 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - -.. URLs that changes between the various backends. -.. _Coriolis Tools Documentation: file:///usr/share/doc/coriolis2/index.html - - - -.. |CoriolisSoftSchema| image:: ./images/Coriolis-Soft-Schema.png - :alt: Coriolis Software Schematic - :align: middle - :width: 60% - - -Coriolis Configuration & Initialisation -======================================= - - -General Software Architecture -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -|Coriolis| has been built with respect of the classical paradigm that the -computational intensive parts have been written in C++, and almost -everything else in |Python|. To build the |Python| interface we used -two methods: - -* For self-contained modules :cb:`boost::python` (mainly in :cb:`vlsisapd`). -* For all modules based on |Hurricane|, we created our own wrappers due - to very specific requirements such as shared functions between modules - or C++/|Python| secure bi-directional object deletion. - -.. note:: **Python Documentation:** - Most of the documentation is related to the C++ API and implemetation of - the tools. However, the |Python| bindings have been created so they - mimic *as closely as possible* the C++ interface, so the documentation - applies to both languages with only minor syntactic changes. - -|bcenter| |CoriolisSoftSchema| |ecenter| - - -Configuration & User's Settings -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -All configurations files are shipped under the form of |Python| modules. -They are to be loaded through ``import`` statements. The user's configuration -files must be put in a ``./coriolis2/`` directory under the working directory. -It must be made a |Python| module so it must contains a ``__init__.py`` file -(kept empty most of the time). And as they are true |Python| files, you may use -in them any valid code you see fit. - -If no user configuration files are present, |Coriolis| will use the default -``symbolic.cmos`` technology which matches the |Alliance| symbolic default one. - -Contents of the user's configuration directory ``./coriolis2/``: - -+----------------------------------+----------------------------------------------+ -| File | Contents/Meaning | -+==================================+==============================================+ -| :cb:`./coriolis2/__init__.py` | **Mandatory.** Tells |Python| this directory | -| | *is* a module. Can be left empty | -+----------------------------------+----------------------------------------------+ -| :cb:`./coriolis2/settings.py` | **Mandatory.** The user's settings, it must | -| | setup the technology intended for use and | -| | perform any configuration variable settings | -+----------------------------------+----------------------------------------------+ -| :cb:`./coriolis2/ioring.py` | **Optional.** Define how the I/O pads are to | -| | be placed on the periphery of the chip along | -| | the chip and core sizes | -+----------------------------------+----------------------------------------------+ -| :cb:`./coriolis2/katana.py` | **Optional.** Hook file for |Katana|, run | -| | just after the tool has been created for a | -| | ``Cell``. Mostly to setup ``Nets`` to be | -| | traced | -+----------------------------------+----------------------------------------------+ - -For example, to use |MOSIS| 180nm, you can put in your :cb:`./coriolis2/setting.py`: - -.. code-block:: python - - # -*- Mode:Python -*- - - import node180.scn6m_deep_09 - - -A Comprehensive Example of :cb:`./coriolis2/setting.py` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. code-block:: python - - import os - import Cfg - import Viewer - import CRL - import node180.scn6m_deep_09 - from helpers import l, u, n - - allianceTop = None - if os.environ.has_key('ALLIANCE_TOP'): - allianceTop = os.environ['ALLIANCE_TOP'] - if not os.path.isdir(allianceTop): - allianceTop = None - - if not allianceTop: allianceTop = '/soc/alliance' - - Cfg.Configuration.pushDefaultPriority( Cfg.Parameter.Priority.UserFile ) - - Viewer.Graphics.setStyle( 'Alliance.Classic [black]' ) - - cellsTop = allianceTop+'/cells' - - # Alliance related settings. - af = CRL.AllianceFramework.get() - env = af.getEnvironment() - - env.setSCALE_X ( 100 ) - env.setCATALOG ( 'CATAL' ) - env.setIN_LO ( 'vst' ) - env.setIN_PH ( 'ap' ) - env.setOUT_LO ( 'vst' ) - env.setOUT_PH ( 'ap' ) - env.setPOWER ( 'vdd' ) - env.setGROUND ( 'vss' ) - env.setCLOCK ( '.*ck.*|.*nck.*' ) - env.setBLOCKAGE ( 'blockage[Nn]et.*' ) - env.setPad ( '.*_mpx$' ) - - env.setWORKING_LIBRARY( '.' ) - env.addSYSTEM_LIBRARY ( library=cellsTop+'/nsxlib', mode=CRL.Environment.Append ) - env.addSYSTEM_LIBRARY ( library=cellsTop+'/mpxlib', mode=CRL.Environment.Append ) - - # Misc. setting parameters. - Cfg.getParamBool ( 'misc.logMode' ).setBool ( False ) - Cfg.getParamBool ( 'misc.verboseLevel1' ).setBool ( True ) - Cfg.getParamBool ( 'misc.verboseLevel2' ).setBool ( True ) - - # P&R related parameters. - Cfg.getParamString ( 'anabatic.routingGauge' ).setString ( 'msxlib4' ) - Cfg.getParamString ( 'anabatic.topRoutingLayer' ).setString ( 'METAL4' ) - Cfg.getParamInt ( 'katana.hTracksReservedLocal' ).setInt ( 6 ) - Cfg.getParamInt ( 'katana.vTracksReservedLocal' ).setInt ( 3 ) - - Cfg.Configuration.popDefaultPriority() - - -|noindent| The example above shows the user's configuration file, with all the -available settings for |Alliance| and a small subset for other tools. Some remarks -about this file: - -* The ``Cfg.Configuration.pushDefaultPriority()`` and ``Cfg.Configuration.popDefaultPriority()`` - statements are there so the value sets by the user will not be overriden by system - ones event if they are setup afterwards. This priority system is introduced so the - various configuration files could be loaded in out of order. - -* The ``Viewer.Graphics.setStyle()`` allows you to choose the look of your liking from - the start. - -* For |Alliance|, the user does not need to redefine all the settings, - just the one he wants to change. In most of the cases, the ``addSYSTEM_LIBRARY()``, - the ``setWORKING_LIBRARY()`` and the special net names (at this point there is not - much alternatives for the others settings). - -* ``addSYSTEM_LIBRARY()`` adds a directory to the library search path. - Each library entry will be added to the search path according to the second parameter: - - * :cb:`CRL.Environment::Append`: append to the search path. - - * :cb:`CRL.Environment::Prepend`: insert in head of the search path. - - * :cb:`CRL.Environment::Replace`: look for a library of the same name and replace - it, whithout changing the search path order. If no library of that name - already exists, it is appended. - - A library is identified by its name, this name is the last component of the - path name. For instance: ``/soc/alliance/sxlib`` will be named ``sxlib``. - Implementing the |Alliance| specification, when looking for a |Cell| ``name``, - the system will browse sequentially through the library list and returns - the first |Cell| whose name match. - -* For ``setPOWER()``, ``setGROUND()``, ``setCLOCK()`` and ``setBLOCKAGE()`` net names, - a regular expression (|GNU| regexp) is expected. - -* For other tools parameters, just use getter and setter according to their types: - - +------------------+-----------------------------------------------------------+ - | Type | Getter/Setter | - +==================+===========================================================+ - | ``Bool`` | ``Cgt.getParamBool('name').setBool( True )`` | - +------------------+-----------------------------------------------------------+ - | ``Int`` | ``Cgt.getParamInt('name').setBool( 12 )`` | - +------------------+-----------------------------------------------------------+ - | ``Enumerate`` | ``Cgt.getParamEnumerate('name').setBool( 12 )`` | - +------------------+-----------------------------------------------------------+ - | ``Double`` | ``Cgt.getParamDouble('name').setDouble( 254.5 )`` | - +------------------+-----------------------------------------------------------+ - | ``Percentage`` | ``Cgt.getParamPercentage('name').setPercentage( 75.0 )`` | - +------------------+-----------------------------------------------------------+ - | ``String`` | ``Cgt.getParamString('name').setString( 'machin' )`` | - +------------------+-----------------------------------------------------------+ - - Lists of the configurable parameters of most interest to the user are given in - :ref:`Viewer & Tools`. - diff --git a/documentation/_build/html/_sources/UsersGuide/DesignFlow.txt b/documentation/_build/html/_sources/UsersGuide/DesignFlow.txt deleted file mode 100644 index 90a4c0bf..00000000 --- a/documentation/_build/html/_sources/UsersGuide/DesignFlow.txt +++ /dev/null @@ -1,25 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - -|newpage| - - -Complete Design Flow & Examples -=============================== - -While |Coriolis| can be used stand-alone, it is in fact part of a more complete -design flow build upon |Yosys| and |Alliance|. In addition, a set of demos and -examples are supplied in the repository |alliance-check-toolkit|. - -* |Yosys| : http://www.clifford.at/yosys/ - - An |rpm| packaged version is available here: - - https://ftp.lip6.fr/pub/linux/distributions/slsoc/soc/7/addons/x86_64/repoview/yosys.html - -* Alliance : https://www-soc.lip6.fr/equipe-cian/logiciels/alliance/ - -* |alliance-check-toolkit| |git| repository: - - https://www-soc.lip6.fr/git/alliance-check-toolkit.git/ diff --git a/documentation/_build/html/_sources/UsersGuide/Installation.txt b/documentation/_build/html/_sources/UsersGuide/Installation.txt deleted file mode 100644 index 03303e92..00000000 --- a/documentation/_build/html/_sources/UsersGuide/Installation.txt +++ /dev/null @@ -1,357 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -Installation -============ - -.. note:: - As the sources are being released, the binary packaging is dropped. - You may still find (very) old versions here: http://asim.lip6.fr/pub/coriolis/2.0 . - -In a nutshell, building source consists in pulling the |git| repository then -running the |ccb| installer. - -.. note:: - The documentation is already generated and commited in the |git| tree. - You may not install the additional prerequisites for the documentation. - By default the documentation is not generated, just installed by |ccb|. - If you really want to re-generate it, add the ``--doc`` flag to |ccb|. - -Main building prerequisites: - -* cmake -* C++11-capable compiler -* BFD library (provided through ``binutils``). -* RapidJSON_ -* python2.7 -* boost -* libxml2 -* bzip2 -* yacc & lex -* Qt 4 or Qt 5 -* PyQt 4 or PyQt 5 -* Qwt 6 - -Building documentation prerequisites: - -* doxygen -* latex -* python-docutils (for reStructuredText) - -The following libraries get directly bundled with |Coriolis|: - -* LEF/DEF (from `SI2 `_) -* FLUTE (from `Chris C. N. Chu `_) - -For other distributions, refer to their own packaging system. - - -Cross Dependencies Issues -~~~~~~~~~~~~~~~~~~~~~~~~~ - -There is a difficult tangle of dependencies between |Python|, |Qt|, |Qwt| and |PyQt|, -the requirements are: - -* A |Python| 2.7. -* |Qt|, either 4 or 5. -* |Qwt| version 6, compiled against the relevant |Qt| version. -* |PyQt|, version 4 or 5, according to the choosen |Qt|. - -Problems arise because: - -* Under |RHEL| 7 or clones, there is no compatible |PyQt5| build compatible with their - |Qt| 5 version (we fall short of one minor, they provides |Qt| 5.9 were we need at - least |Qt| 5.10). So we have to stick to |Qt| 4 on those platforms. - - Fortunately we can build a |Qwt| 6 with |Qt| 4. - -* Under |Debian| or |Ubuntu| there is no |Qwt| 6 build against |Qt| 4, so we have to - use |Qt| 5 and |PyQt| 5. - - -Fixed Directory Tree -~~~~~~~~~~~~~~~~~~~~ - -In order to simplify the work of the |ccb| installer, the source, build -and installation tree is fixed. To successfully compile |Coriolis| you must -follow it exactly. The tree is relative to the home directory of the user -building it (note :fboxtt:`~/` or :fboxtt:`$HOME/`). Only the source -directory needs to be manually created by the user, all others will be -automatically created either by |ccb| or the build system. - -|newpage| - -+--------------------------------------------------------------------------------------------------------------+ -| **Sources** | -+------------------------------+-------------------------------------------------------------------------------+ -| | Sources root | | ~/coriolis-2.x/src | -| | **under git** | | ~/coriolis-2.x/src/coriolis | -+------------------------------+-------------------------------------------------------------------------------+ -| **Architecture Dependant Build** | -+------------------------------+-------------------------------------------------------------------------------+ -| | Linux, SL 7, 64b | | ~/coriolis-2.x/Linux.el7_64/Release.Shared/build/ | -| | Linux, SL 6, 32b | | ~/coriolis-2.x/Linux.slsoc6x/Release.Shared/build/ | -| | Linux, SL 6, 64b | | ~/coriolis-2.x/Linux.slsoc6x_64/Release.Shared/build/ | -| | Linux, Fedora, 64b | | ~/coriolis-2.x/Linux.fc_64/Release.Shared/build/ | -| | Linux, Fedora, 32b | | ~/coriolis-2.x/Linux.fc/Release.Shared/build/ | -| | FreeBSD 8, 32b | | ~/coriolis-2.x/FreeBSD.8x.i386/Release.Shared/build/ | -| | FreeBSD 8, 64b | | ~/coriolis-2.x/FreeBSD.8x.amd64/Release.Shared/build/ | -| | Windows 7, 32b | | ~/coriolis-2.x/Cygwin.W7/Release.Shared/build/ | -| | Windows 7, 64b | | ~/coriolis-2.x/Cygwin.W7_64/Release.Shared/build/ | -| | Windows 8.x, 32b | | ~/coriolis-2.x/Cygwin.W8/Release.Shared/build/ | -| | Windows 8.x, 64b | | ~/coriolis-2.x/Cygwin.W8_64/Release.Shared/build/ | -+------------------------------+-------------------------------------------------------------------------------+ -| **Architecture Dependant Install** | -+------------------------------+-------------------------------------------------------------------------------+ -| Linux, SL 6, 32b | ~/coriolis-2.x/Linux.slsoc6x/Release.Shared/install/ | -+------------------------------+-------------------------------------------------------------------------------+ -| **FHS Compliant Structure under Install** | -+------------------------------+-------------------------------------------------------------------------------+ -| | Binaries | | .../install/bin | -| | Libraries (Python) | | .../install/lib | -| | Include by tool | | .../install/include/coriolis2// | -| | Configuration files | | .../install/etc/coriolis2/ | -| | Doc, by tool | | .../install/share/doc/coriolis2/en/html/ | -+------------------------------+-------------------------------------------------------------------------------+ - -.. note:: *Alternate build types:* the ``Release.Shared`` means an optimized build - with shared libraries. But there are also available ``Static`` instead of ``Shared`` - and ``Debug`` instead of ``Release`` and any combination of them. - - ``Static`` does not work because I don't know yet to mix statically linked binaries - and Python modules (which must be dynamic). - - -Building Coriolis -~~~~~~~~~~~~~~~~~ - -The actively developed branch ------------------------------ - -The **devel_anabatic** branch is now closed and we go back to a more classical -scheme where **master** is the stable version and **devel** the development one. - -The |Coriolis| |git| repository is https://www-soc.lip6.fr/git/coriolis.git - -.. note:: - Again, the **devel_anabatic** branch is now closed. Please revert to **devel** - or **master**. - -.. note:: - Under |RHEL| 7 or clones, they upgraded their version of |Qt| 4 (from 4.6 to 4.8) - so the *diagonal line* bug no longer occurs. So we can safely use the default - system |Qt| again. - - -Installing on |RedHat| or compatible distributions --------------------------------------------------- - -1. Install or check that the required prerequisites are installed : :: - - dummy@lepka:~> yum install -y git cmake bison flex gcc-c++ libstdc++-devel \ - binutils-devel \ - boost-devel boost-python boost-filesystem \ - boost-regex boost-wave \ - python-devel libxml2-devel bzip2-devel \ - qt-devel qwt-devel # Qt 4 - - Note, that the ``Qwt`` packages are directly available from the standart distribution - when using |Qt| 4. - -2. Install the unpackaged prerequisites. Currently, only RapidJSON_. :: - - dummy@lepka:~> mkdir -p ~/coriolis-2.x/src/support - dummy@lepka:support> cd ~/coriolis-2.x/src/support - dummy@lepka:support> git clone http://github.com/miloyip/rapidjson - - -3. Create the source directory and pull the |git| repository: :: - - dummy@lepka:~> mkdir -p ~/coriolis-2.x/src - dummy@lepka:src> cd ~/coriolis-2.x/src - dummy@lepka:src> git clone https://www-soc.lip6.fr/git/coriolis.git - -4. Build & install: :: - - dummy@lepka:src> cd coriolis - dummy@lepka:coriolis> git checkout devel - dummy@lepka:coriolis> ./bootstrap/ccb.py --project=support \ - --project=coriolis \ - --make="-j4 install" - -.. note:: - Pre-generated documentation will get installed by the previous command. - Only if you did made modifications to it you need to regenerate it with: :: - - dummy@lepka:coriolis> ./bootstrap/ccb.py --project=support \ - --project=coriolis \ - --doc --make="-j1 install" - - We need to perform a separate installation of the documentation because it - does not support to be generated with a parallel build. So we compile & install in a first - stage in ``-j4`` (or whatever) then we generate the documentation in ``-j1`` - -Under |RHEL6| or clones, you must build using the |devtoolset|, the version is to -be given as argument: :: - - dummy@lepka:coriolis> ./bootstrap/ccb.py --project=coriolis \ - --devtoolset=8 --make="-j4 install" - -If you want to use Qt 5 instead of Qt 4, modify the previous steps as follows: - -* At **step 1**, do not install the |QT| 4 related development package (``qt4-devel``), - but instead: :: - - dummy@lepka:~> yum install -y qt5-qtbase-devel qt5-qtsvg-devel # Qt 5. - - The package ``qwt-qt5-devel`` and it's dependency ``qwt-qt5`` are not provided - by any standard repository (like |EPEL|). You may download them from the - `LIP6 Addons Repository `_ - Then run: :: - - dummy@lepka:~> yum localinstall -y qwt-qt5-6.1.2-4.fc23.x86_64.rpm \ - qwt-qt5-6.1.2-4.fc23.x86_64.rpm # Qwt for Qt 5. - -* At **step 4**, add a ``--qt5`` argument to the ``ccb.py`` command line. - -* The |Python| scripts that make use of |PyQt| in ``crlcore`` and ``cumulus`` must be - edited to import ``PyQt5`` instead of ``PtQt4`` (should find a way to automatically - switch between the two of them). - -The complete list of |ccb| functionalities can be accessed with the ``--help`` argument. -It also may be run in graphical mode (``--gui``). - - -Building a Debug Enabled Version --------------------------------- - -The ``Release.Shared`` default version of the |Coriolis| is built stripped of symbols -and optimized so that it makes analysing a core dump after a crash difficult. In the -(unlikely) case of a crash, you may want to build, alongside the optimized version, -a debug one which allows forensic examination by |gdb| (or |valgrind| or whatever). - -Run again ``ccb.py``, adding the ``--debug`` argument: :: - - dummy@lepka:coriolis> ./bootstrap/ccb.py --project=support \ - --project=coriolis \ - --make="-j4 install" --debug - - -As |cgt| is a |Python| script, the right command to run |gdb| is: :: - - dummy@lepka:work> gdb python core.XXXX - - -.. Building the Devel Branch -.. ------------------------- -.. -.. In the |Coriolis| |git| repository, two branches are present: -.. -.. * The :cb:`master` branch, which contains the latest stable version. This is the -.. one used by default if you follow the above instructions. -.. -.. * The :cb:`devel` branch, which obviously contains the latest commits from the -.. development team. To use it instead of the :cb:`master` one, do the following -.. command just after the first step: :: -.. -.. dummy@lepka:coriolis> git checkout devel -.. dummy@lepka:coriolis> ./bootstrap/ccb.py --project=coriolis \ -.. --make="-j4 install" --debug -.. -.. Be aware that it may require newer versions of the dependencies and may introduce -.. incompatibilities with the stable version. - - -Installing on |Debian| 9, |Ubuntu| 18 or compatible distributions ------------------------------------------------------------------ - -First, install or check that the required prerequisites are installed : :: - - dummy@lepka:~> sudo apt install -y build-essential binutils-dev \ - git cmake bison flex gcc python-dev \ - libboost-all-dev libboost-python-dev \ - libbz2-dev libxml2-dev rapidjson-dev libbz2-dev \ - qtbase5-dev libqt5svg5-dev libqwt-qt5-dev \ # Qt 5 - python-pyqt5 \ - doxygen dvipng graphviz python-sphinx \ - texlive-fonts-extra texlive-lang-french - -Second step is to create the source directory and pull the |git| repository: :: - - dummy@lepka:~> mkdir -p ~/coriolis-2.x/src - dummy@lepka:src> cd ~/coriolis-2.x/src - dummy@lepka:src> git clone https://www-soc.lip6.fr/git/coriolis.git - -Third and final step, build & install: :: - - dummy@lepka:src> cd coriolis - dummy@lepka:coriolis> git checkout devel - dummy@lepka:coriolis> ./bootstrap/ccb.py --project=coriolis --qt5 \ - --make="-j4 install" - - -Additionnal Requirement under |MacOS| -------------------------------------- - -|Coriolis| makes use of the :cb:`boost::python` module, but the |macports| |boost| -seems unable to work with the |Python| bundled with |MacOS|. So you have to install -both of them from |macports|: :: - - dummy@macos:~> port install boost +python27 - dummy@macos:~> port select python python27 - dummy@macos:-> export DYLD_FRAMEWORK_PATH=/opt/local/Library/Frameworks - -The last two lines tell |MacOS| to use the |Python| from |macports| and *not* from -the system. - -Then proceed with the generic install instructions. - - -Packaging Coriolis -~~~~~~~~~~~~~~~~~~ - -Packager should not use |ccb|, instead ``bootstrap/Makefile.package`` is provided -to emulate a top-level ``autotool`` makefile. Just copy it in the root of the -|Coriolis| git repository (``~/corriolis-2.x/src/coriolis/``) and build. - -Sligthly outdated packaging configuration files can also be found under ``bootstrap/``: - -* ``bootstrap/coriolis2.spec.in`` for |rpm| based distributions. -* ``bootstrap/debian`` for |Debian| based distributions. - - -Hooking up into |Alliance| -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -|Coriolis| relies on |Alliance| for the cell libraries. So after installing or -packaging, you must configure it so that it can found those libraries. - -The easiest way is to setup the |Alliance| environment (i.e. sourcing -``.../etc/profile.d/alc_env.{sh,csh}``) **before** setting up |Coriolis| environment -(see the next section). To understand how |Coriolis| find/setup |Alliance| you may -have look to the *Configuration and User's Settings* section. - - -Setting up the Environment (coriolisEnv.py) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -To simplify the tedious task of configuring your environment, a helper is provided -in the ``bootstrap`` source directory (also installed in the directory -``.../install/etc/coriolis2/``) : :: - - ~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py - -Use it like this: :: - - dummy@lepka:~> eval `~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py` - -.. note:: **Do not call that script in your environement initialisation.** - When used under |RHEL6| or clones, it needs to be run in the |devtoolset| - environement. The script then launch a new shell, which may cause an - infinite loop if it's called again in, say :cb:`~/.bashrc`. - - Instead you may want to create an alias: :: - - alias c2r='eval "`~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py`"' diff --git a/documentation/_build/html/_sources/UsersGuide/LicenseCredits.txt b/documentation/_build/html/_sources/UsersGuide/LicenseCredits.txt deleted file mode 100644 index ad99e298..00000000 --- a/documentation/_build/html/_sources/UsersGuide/LicenseCredits.txt +++ /dev/null @@ -1,55 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -Credits & License -================= - -.. raw:: html - -

Hurricane - Rémy Escassut & - Christian Masson

-
-

Etesian - Gabriel Gouvine

-
-

Stratus - Sophie Belloeil

-
-

Katana (global) - Damien Dupuis

-
-

Katana (detailed), - Unicorn - Jean-Paul Chaput

-
- - -.. raw:: latex - - \begin{center}\begin{minipage}[t]{.8\textwidth} - \noindent\DUrole{sc}{Hurricane} \dotfill Rémy \DUrole{sc}{Escassut} \& - Christian \DUrole{sc}{Masson} \\ - \noindent\DUrole{sc}{Etesian} \dotfill Gabriel \DUrole{sc}{Gouvine} \\ - \noindent\DUrole{sc}{Stratus} \dotfill Sophie \DUrole{sc}{Belloeil} \\ - \noindent\DUrole{sc}{Katana} (global) \dotfill Damien \DUrole{sc}{Dupuis} \\ - \noindent\DUrole{sc}{Katana} (detailed), - \DUrole{sc}{Unicorn} \dotfill Jean-Paul \DUrole{sc}{Chaput} \\ - \end{minipage}\end{center} - - -|medskip| - -The |Hurricane| data-base is copyright© |Bull| 2000-2019 and is -released under the terms of the |LGPL| license. All other tools are -copyright© |UPMC| 2008-2018, |SorbonneUniversite| 2018-2019 -and released under the |GPL| license. - -Others important contributors to |Coriolis| are Christophe |Alexandre|, -Roselyne |Chotin|, Hugo |Clement|, Marek |Sroka| and Wu |Yifei|. - -The |Katana| router makes use of the |Flute| software, which is -copyright© Chris C. N. |Chu| from the Iowa State University -(http://home.eng.iastate.edu/~cnchu/). diff --git a/documentation/_build/html/_sources/UsersGuide/Releases.txt b/documentation/_build/html/_sources/UsersGuide/Releases.txt deleted file mode 100644 index fb210145..00000000 --- a/documentation/_build/html/_sources/UsersGuide/Releases.txt +++ /dev/null @@ -1,141 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -Release Notes -============= - -Release 1.0.1475 -~~~~~~~~~~~~~~~~ - -This is the first preliminary release of the |Coriolis2| framework. - -This release mainly ships the global router |Knik| and the detailed router -|Kite|. Together they aim to replace the |Alliance| |Nero| router. -Unlike |Nero|, |Kite| is based on an innovating routing modeling and ad-hoc -algorithm. Although it is released under |GPL| license, the source code -will be avalaible later. -|medskip| - - -|noindent| Contents of this release: - -1. A graphical user interface (viewer only). -2. The |Knik| global router. -3. The |Kite| detailed router. - -|noindent| Supported input/output formats: - -* |Alliance| |vst| (netlist) & |ap| (physical) formats. -* Even if there are some references to the |Cadence| |LEFDEF| format, its - support is not included because it depends on a library only available - to |Si2| affiliated members. - - -Release 1.0.1963 -~~~~~~~~~~~~~~~~ - -Release 1963 is alpha. All the tools from |Coriolis1| have been ported into -this release. - -|noindent| Contents of this release: - -#. The |Stratus| netlist capture language (|GenLib| replacement). -#. The |Mauka| placer (still contains bugs). -#. A graphical user interface (viewer only). -#. The |Knik| global router. -#. The |Kite| detailed router. -#. Partially implemented python support for configuration files - (alternative to |XML|). -#. A documentation (imcomplete/obsoleted in |Hurricane|'s case). - - -Release 1.0.2049 -~~~~~~~~~~~~~~~~ - -Release `2049` is Alpha. - -|noindent| Changes of this release: - -#. The |Hurricane| documentation is now accurate. Documentation - for the Cell viewer and |CRLcore| has been added. -#. More extensive Python support for all the components of - |Coriolis|. -#. Configuration is now completly migrated under Python. - |XML| loaders can still be used for compatibilty. -#. The |cgt| main has been rewritten in Python. - - -Release v2.0.1 -~~~~~~~~~~~~~~ - -#. Migrated the repository from |svn| to |git|, and release complete sources. - As a consequence, we drop the distribution packaging support and give - public read-only access to the repository. -#. Deep rewrite of the |Katabatic| database and |Kite| detailed router, - achieve a speedup factor greater than 20... - - -Release v2.1 -~~~~~~~~~~~~ - -#. Replace the old simulated annealing placer |Mauka| by the analytical placer - |Etesian| and its legalization and detailed placement tools. -#. Added a Blif format parser to process circuits generated by the Yosys and ABC - logic synthetizers. -#. The multiple user defined configuration files are now grouped under - a common hidden (dot) directory ``.coriolis2`` and the file extension - is back from ``.conf`` to ``.py``. - -.. #. Under |RHEL7| / |SL7|, there is a known bug in the graphical visualizer. -.. When shifting to the left, the right-half part of the screen gets -.. badly redrawn. Uses |CTRL_L| to refresh. It will be corrected as soon -.. as possible. - - -Release v2.2 -~~~~~~~~~~~~ - -#. Added JSON import/export of the whole Hurricane DataBase. Two save mode - are supported: *Cell* mode (standalone) or *Blob* mode, which dump the - whole design down and including the standard cells. - - -Release v2.3 -~~~~~~~~~~~~ - -#. Reverts to a more standard organisation of the branches. **devel_anabatic** is - closed and we go on with **master** (stable version) and **devel**. - -#. Makes |Katana| the default global & detailed router. Put |Knik| & |Kite| in the - obsolete menus. - -#. Finally makes use of |PyQt4| widgets. Seems to integrate without problems - with the |Coriolis| own |Qt| widget. The drawback is that to build against |Qt| 5 - needs adjustement from the user. - -#. Improved support for whole chip management. The outer part of the chip containing - the pad is decoupled from the core. This allows to cleanly separate real pads from - the foundry from a symbolic core. But this does not preclude other combinations - as fully symbolic or fully real. - - To perform the separation, an intermediate hierarchical level ``corona`` between chip - and core has been introduced. - - -Release v2.4 -~~~~~~~~~~~~ - -#. Complete rewrite of the initialisation system. No longer use "configuration like" - files with various list of items. Now the configuration is supplied under the - from of |Python| modules to be imported as the user see fit. - -#. Clean separation between |NDA| protected parts and free ones. Now all the |NDA| - related components are put under one separated tree, whether they are configuration - files or |Python| plugins, so that they be can easily by exported. - -#. In |Anabatic| & |Katana| better accuracy at how obstacles decrease the edges - capacities of the GCells. Reduce the edge capacity of a GCell according to it's - inner cluttering (that is, it's number of terminals). Change of semantics - for ``katana.hReservedLocal`` and ``katana.vReservedLocal`` parameters. diff --git a/documentation/_build/html/_sources/UsersGuide/ScriptsPlugins.txt b/documentation/_build/html/_sources/UsersGuide/ScriptsPlugins.txt deleted file mode 100644 index cf72255e..00000000 --- a/documentation/_build/html/_sources/UsersGuide/ScriptsPlugins.txt +++ /dev/null @@ -1,327 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - -.. URLs that changes between the various backends. -.. _Stratus Documentation: file:///usr/share/doc/coriolis2/en/html/stratus/index.html - -.. |ChipStructure-1| image:: ./images/chip-structure-1.png - :alt: Chip Top Structure - :align: middle - :width: 90% - - -.. _Python Interface to Coriolis: - -|newpage| - - -Python Interface for |Hurricane| / |Coriolis| -============================================= - -The (almost) complete interface of |Hurricane| is exported as a |Python| module -and some parts of the other components of |Coriolis| (each one in a separate -module). The interface has been made to mirror as closely as possible the -C++ one, so the C++ doxygen documentation could be used to write code with -either languages. - -`Summary of the C++ Documentation `_ - -A script could be run directly in text mode from the command line or through -the graphical interface (see :ref:`Python Scripts in Cgt`). - -Aside for this requirement, the python script can contain anything valid -in |Python|, so don't hesitate to use any package or extension. - -Small example of Python/Stratus script: :: - - import symbolic.cmos - from Hurricane import * - from Stratus import * - - def doSomething (): - # ... - return - - def ScriptMain ( **kw ): - editor = None - if kw.has_key('editor') and kw['editor']: - editor = kw['editor'] - stratus.setEditor( editor ) - - doSomething() - return - - if __name__ == "__main__" : - kw = {} - success = ScriptMain( **kw ) - shellSuccess = 0 - if not success: shellSuccess = 1 - - sys.exit( shellSuccess ) - ScriptMain () - -This typical script can be executed in two ways: - -#. Run directly as a |Python| script, thanks to the :: - - if __name__ == "__main__" : - - part (this is standart |Python|). It is a simple adapter that will - call :cb:`ScriptMain()`. - - In this case, the ``import symbolic.cmos`` statement at the begining - is mandatory. - -#. Through |cgt|, either in text or graphical mode. In that case, the - :cb:`ScriptMain()` is directly called trough a sub-interpreter. - The arguments of the script are passed through the ``**kw`` dictionnary. - - In this case, the ``import symbolic.cmos`` statement at the begining - may be omitted. - - +----------------------+-----------------------------------------------+ - | \*\*kw Dictionnary | - +----------------------+-----------------------------------------------+ - | Parameter Key/Name | Contents type | - +======================+===============================================+ - | ``'cell'`` | A Hurricane cell on which to work. Depending | - | | on the context, it may be ``None``. | - | | For example, when run from |cgt|, the cell | - | | currently loaded in the viewer, if any. | - +----------------------+-----------------------------------------------+ - | ``'editor'`` | The viewer from which the script is run, when | - | | lauched through |cgt|. | - +----------------------+-----------------------------------------------+ - - -Plugins -~~~~~~~ - -Plugins are |Python| scripts specially crafted to integrate with |cgt|. -Their entry point is a :cb:`ScriptMain()` method as described in -`Python Interface to Coriolis`_. They can be called by user scripts -through this method. - - - -Chip Placement --------------- - -Automatically performs the placement of a complete chip. This plugin, as well -as the other P&R tools expect a specific top-level hierarchy for the design. -The top-level hierarchy must contain the instances of all the I/O pads and -**exactly one** instance named ``corona`` of an eponym cell ``corona``. -The ``corona`` cell in turn contains the instance of the chip's core model. - -The intermediate ``corona`` hierarchical level has been introduced to handle -the possible decoupling between real I/O pads supplied by a foundry and a -symbolic core. So the *chip* level contains only real layout and the corona -and below only symbolic layer. - -.. note:: This does not prevent having a design either fully symbolic (pads and core) - or fully real. - -.. note:: The ``corona`` also avoids the router to actually have to manage directly - the pads which simplify its configuration and besides avoid - to have the pads stuffed with blockages. - -|bcenter| |ChipStructure-1| |ecenter| - -The designer must provide a configuration file that defines the rules for the -placement of the top-level hierarchy (that is, the pads and the core). -This file must be names ``ioring.py`` and put into the user's configuration -directory ``./coriolis2/`` - -Example of chip placement configuration file (for ``AM2901``): :: - - - from helpers import l, u, n - - chip = \ - { 'pads.ioPadGauge' : 'pxlib' - , 'pads.south' : [ 'p_a3' , 'p_a2' , 'p_a1' , 'p_r0' - , 'p_vddick0', 'p_vssick0', 'p_a0' , 'p_i6' - , 'p_i8' , 'p_i7' , 'p_r3' ] - , 'pads.east' : [ 'p_zero' , 'p_i0' , 'p_i1' , 'p_i2' - , 'p_vddeck0', 'p_vsseck0', 'p_q3' , 'p_b0' - , 'p_b1' , 'p_b2' , 'p_b3' ] - , 'pads.north' : [ 'p_noe' , 'p_y3' , 'p_y2' , 'p_y1' - , 'p_y0' , 'p_vddeck1', 'p_vsseck1', 'p_np' - , 'p_ovr' , 'p_cout' , 'p_ng' ] - , 'pads.west' : [ 'p_cin' , 'p_i4' , 'p_i5' , 'p_i3' - , 'p_ck' , 'p_d0' , 'p_d1' , 'p_d2' - , 'p_d3' , 'p_q0' , 'p_f3' ] - , 'core.size' : ( l(1500), l(1500) ) - , 'chip.size' : ( l(3000), l(3000) ) - , 'chip.clockTree' : True - } - -The file must contain *one dictionnary* named ``chip``. - -+----------------------+-------------------------------------------------------+ -| Chip Dictionnary | -+----------------------+-------------------------------------------------------+ -| Parameter Key/Name | Value/Contents type | -+======================+=======================================================+ -| ``'pad.ioPadGauge'`` | The routing gauge to use for the pad. Must be given | -| | as it differs from the one used to route | -| | inside the core | -+----------------------+-------------------------------------------------------+ -| ``'pad.south'`` | Ordered list (left to right) of pad instance names | -| | to put on the south side of the chip | -+----------------------+-------------------------------------------------------+ -| ``'pad.east'`` | Ordered list (down to up) of pad instance names | -| | to put on the east side of the chip | -+----------------------+-------------------------------------------------------+ -| ``'pad.north'`` | Ordered list (left to right) of pad instance names | -| | to put on the north side of the chip | -+----------------------+-------------------------------------------------------+ -| ``'pad.west'`` | Ordered list (down to up) of pad instance names | -| | to put on the west side of the chip | -+----------------------+-------------------------------------------------------+ -| ``'core.size'`` | The size of the core (to be used by the placer) | -+----------------------+-------------------------------------------------------+ -| ``'chip.size'`` | The size of the whole chip. The sides must be large | -| | enough to accomodate all the pads | -+----------------------+-------------------------------------------------------+ -| ``'chip.clockTree'`` | Whether to generate a clock tree or not. This calls | -| | the ClockTree plugin | -+----------------------+-------------------------------------------------------+ - -Configuration parameters, defaults are defined in ``etc/coriolis2//plugins.conf``. - -+-----------------------------------+------------------+----------------------------+ -| Parameter Identifier | Type | Default | -+===================================+==================+============================+ -| **Chip Plugin Parameters** | -+-----------------------------------+------------------+----------------------------+ -|``chip.block.rails.count`` | ``Int`` | :cb:`5` | -| +------------------+----------------------------+ -| | The minimum number of rails around the core | -| | block. Must be odd and above 5. | -| | One rail for the clock and at least two pairs | -| | of power/grounds | -+-----------------------------------+------------------+----------------------------+ -|``chip.block.rails.hWidth`` | ``Int`` | :cb:`12` |lambda| | -| +------------------+----------------------------+ -| | The horizontal width of the rails | -+-----------------------------------+------------------+----------------------------+ -|``chip.block.rails.vWidth`` | ``Int`` | :cb:`12` |lambda| | -| +------------------+----------------------------+ -| | The vertical width of the rails | -+-----------------------------------+------------------+----------------------------+ -|``chip.block.rails.hSpacing`` | ``Int`` | :cb:`6` |lambda| | -| +------------------+----------------------------+ -| | The spacing, *edge to edge* of two adjacent | -| | horizontal rails | -+-----------------------------------+------------------+----------------------------+ -|``chip.block.rails.vSpacing`` | ``Int`` | :cb:`6` |lambda| | -| +------------------+----------------------------+ -| | The spacing, *edge to edge* of two adjacent | -| | vertical rails | -+-----------------------------------+------------------+----------------------------+ - -.. note:: - If no clock tree is generated, then the clock rail is *not* created. - So even if the requested number of rails ``chip.block.rails.count`` is, say 5, - only four rails (2* ``power``, 2* ``ground``) will be generated. - - -Clock Tree ----------- - -Inserts a clock tree into a block. The clock tree uses the H strategy. -The clock net is splitted into sub-nets, one for each branch of the -tree. - -* On **chip** design, the sub-nets are created in the model of the - core block (then trans-hierarchically flattened to be shown at - chip level). -* On **blocks**, the sub nets are created directly in the top block. -* The sub-nets are named according to a simple geometrical scheme. - A common prefix ``ck_htree``, then one postfix by level telling - on which quarter of plane the sub-clock is located: - - #. ``_bl``: bottom left plane quarter. - #. ``_br``: bottom right plane quarter. - #. ``_tl``: top left plane quarter. - #. ``_tr``: top right plane quarter. - - We can have ``ck_htree_bl``, ``ck_htree_bl_bl``, ``ch_htree_bl_tl`` and so on. - -The clock tree plugin works in four steps: - -#. Builds the clock tree: creates the top-block abutment box, computes the - required levels of H tree and places the clock buffers. -#. Once the clock buffers are placed, calls the placer (|etesian|) to place - the ordinary standard cells, whithout disturbing clock H-tree buffers. -#. At this point we know the exact positions of all the DFFs, so we can - connect them to the nearest H-tree leaf clock signal. -#. Leaf clock signals that are not connected to any DFFs are removed. - -Netlist reorganisation: - -* Obviously the top block or chip core model netlist is modified to - contain all the clock sub-nets. The interface is *not* changed. -* If the top block contains instances of other models *and* those models - contain DFFs that get re-connected to the clock sub-nets (from the - top level): Changes both the model netlist and interface to propagate - the relevant clock sub-nets to the instanciated model. The new model - with the added clock signal is renamed with a ``_cts`` suffix. - For example, the sub-block model ``ram.vst`` will become ``ram_cts.vst``. - -.. note:: - If you are to re-run the clock tree plugin on a netlist, be careful - to erase any previously generated ``_cts`` file (both netlist and - layout: ``rm *_cts.{ap,vst}``). And restart |cgt| to clear its - memory cache. - -Configuration parameters, defaults are defined in ``etc/coriolis2//plugins.conf``. - -+-----------------------------------+------------------+----------------------------+ -| Parameter Identifier | Type | Default | -+===================================+==================+============================+ -| **ClockTree Plugin Parameters** | -+-----------------------------------+------------------+----------------------------+ -|``clockTree.minimumSide`` | ``Int`` | :cb:`300` |lambda| | -| +------------------+----------------------------+ -| | The minimum size below which the clock tree | -| | will stop to perform quadri-partitions | -+-----------------------------------+------------------+----------------------------+ -|``clockTree.buffer`` | ``String`` | :cb:`buf_x2` | -| +------------------+----------------------------+ -| | The buffer model to use to drive sub-nets | -+-----------------------------------+------------------+----------------------------+ - - -Recursive-Save (RSave) ----------------------- - -Performs a recursive top down save of all the models from the top cell -loaded in |cgt|. Forces a write of any non-terminal model. This plugin is used -by the clock tree plugin after the netlist clock sub-nets creation. - - -A Simple Example: AM2901 -~~~~~~~~~~~~~~~~~~~~~~~~ - -To illustrate the capabilities of |Coriolis| tools and |Python| scripting, a small -example, derived from the |Alliance| :cb:`AM2901` is supplied. - -This example contains only the synthetized netlists and the :cb:`doChip.py` script -which perform the whole P&R of the design. - -You can generate the chip using one of the following methods: - -#. **Command line mode:** directly run the script: :: - - dummy@lepka:AM2901> ./doChip -V --cell=amd2901 - -#. **Graphic mode:** launch |cgt|, load chip netlist ``amd2901`` (the top cell) - then run the |Python| script :cb:`doChip.py`. - -.. note:: - Between two consecutive run, be sure to erase the netlist/layout generated: :: - - dummy@lepka:AM2901> rm *_cts*.vst *.ap diff --git a/documentation/_build/html/_sources/UsersGuide/ViewerTools.txt b/documentation/_build/html/_sources/UsersGuide/ViewerTools.txt deleted file mode 100644 index a2badb50..00000000 --- a/documentation/_build/html/_sources/UsersGuide/ViewerTools.txt +++ /dev/null @@ -1,843 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - -.. URLs that changes between the various backends. -.. _Stratus Documentation: file:///usr/share/doc/coriolis2/en/html/stratus/index.html - - -.. |BigMouse| image:: ./images/ComputerMouse.png - :scale: 25% - -.. |ViewerSnapshot_1| image:: ./images/Viewer-1.png - :alt: Viewer Basic Snapshot - :align: middle - :width: 80% - -.. |ControllerSnapshot_1| image:: ./images/Controller-1.png - :alt: Controller Basic Snapshot - :align: middle - :width: 80% - -.. |ControllerLook_1| image:: ./images/Controller-Look-1.png - :alt: Controller Look, Snapshot 1 - :align: middle - :width: 80% - -.. |ControllerFilter_1| image:: ./images/Controller-Filter-1.png - :alt: Controller Basic Snapshot - :align: middle - :width: 80% - -.. |ControllerLayersGos_1| image:: ./images/Controller-LayersGos-1.png - :alt: Controller Basic Snapshot - :align: middle - :width: 80% - -.. |ControllerNetlist_1| image:: ./images/Controller-Netlist-1.png - :alt: Controller Basic Snapshot - :align: middle - :width: 80% - -.. |ViewerNetlist_1| image:: ./images/Viewer-Netlist-1.png - :alt: Controller Basic Snapshot - :align: middle - :width: 80% - -.. |ControllerSelection_1| image:: ./images/Controller-Selection-1.png - :alt: Controller Basic Snapshot - :align: middle - :width: 80% - -.. |ControllerInspector_1| image:: ./images/Controller-Inspector-1.png - :alt: Controller Basic Snapshot - :align: middle - :width: 80% - -.. |ControllerInspector_2| image:: ./images/Controller-Inspector-2.png - :alt: Controller Basic Snapshot - :align: middle - :width: 80% - -.. |ControllerInspector_3| image:: ./images/Controller-Inspector-3.png - :alt: Controller Basic Snapshot - :align: middle - :width: 80% - -.. |ControllerSettings_1| image:: ./images/Controller-Settings-1.png - :alt: Controller Basic Snapshot - :align: middle - :width: 80% - -.. |Etesian-1| image:: ./images/etesian-1.png - :alt: Etesian Abutment Box - :align: middle - :width: 80% - - -CGT - The Graphical Interface -============================= - -The |Coriolis| graphical interface is split up into two windows. - -* The **Viewer**, with the following features: - - * Basic load/save capabilities. - * Displays the current working cell. Could be empty if the design - is not yet placed. - * Executes Stratus Scripts. - * Menu to run the tools (placement, routage). - -Features are detailed in `Viewer & Tools`_. - -|ViewerSnapShot_1| - -* The **Controller**, which allows to: - - * Tweak what is displayed by the *Viewer*. Through the *Look*, - *Filter* and *Layers&Gos* tabs. - * Browse the |netlist| with eponym tab. - * Show the list of selected objects (if any) with *selection* - * Walk through the Database, the Cell or the Selection with *Inspector*. - This is an advanced feature, reserved for experimented users. - * The tab *Settings* which gives access to all the settings. - They are closely related to Configuration & Initialisation. - -|bcenter| |ControllerSnapShot_1| |ecenter| - - -.. _Viewer & Tools: - -Viewer & Tools -~~~~~~~~~~~~~~ - -|Stratus| Netlist Capture -------------------------- - -|Stratus| is the replacement for |GenLib| procedural netlist capture language. -It is designed as a set of |Python| classes, and comes with it's own documentation -(`Stratus Documentation`_) - - -The |Hurricane| Data-Base -------------------------- - -The |Alliance| flow is based on the |MBK| data-base, which has one data-structure -for each view. That is, |LOFIG| for the *logical* view and |PHFIG| for the *physical* -view. The place and route tools were responsible for maintaining (or not) the -coherency between views. Reflecting this weak coupling between views, each one -was stored in a separate file with a specific format. The *logical* view is stored -in a |vst| file in |VHDL| format and the *physical* in an |ap| file in an ad-hoc format. - -The |Coriolis| flow is based on the |Hurricane| data-base, which has a unified -structure for *logical* and *physical* view. That data structure is the |Cell| object. -The |Cell| can have any state between pure netlist and completly placed and -routed design. Although the memory representation of the views has deeply -changed we still use the |Alliance| files format, but they now really represent -views of the same object. The point is that one must be very careful about -view coherency when going to and from |Coriolis|. - -As for the second release, |Coriolis| can be used only for three purposes : - -* **Placing a design**, in which case the |netlist| view must be present. -* **Routing a design**, in that case the |netlist| - view and the |layout| view must be present and |layout| view must contain - a placement. Both views must have the same name. When saving the routed design, - it is advised to change the design name otherwise the original unrouted placement - in the |layout| view will be overwritten. -* **Viewing a design**, the |netlist| view must be present, if a |layout| - view is present it still must have the same name but it can be in any - state. - - -Synthetizing and loading a design ---------------------------------- - -|Coriolis| supports several file formats. It can load all file format -from the |Alliance| toolchain (.ap for layout, behavioural and structural vhdl .vbe and .vst), -BLIF netlist format as well as benchmark formats from the ISPD contests. - -It can be compiled with LEF/DEF support, although it requires acceptance of the SI2 license -and may not be compiled in your version of the software. - -Synthesis under Yosys -..................... - -You can create a BLIF file from the |Yosys| synthetizer, which can be imported under Coriolis. -Most libraries are specified as a .lib liberty file and a .lef LEF file. -|Yosys| opens most .lib files with minor modifications, but LEF support in Coriolis relies on SI2. -If Coriolis hasn't been compiled against it, the library is given in |Alliance| .ap format. -`Some free libraries `_ already provide both .ap and .lib files. - -Once you have installed a common library under |Yosys| and Coriolis, just synthetize your design -with |Yosys| and import it (as Blif without the extension) under Coriolis to perform place&route. - -Synthesis under Alliance -........................ - -|Alliance| is an older toolchain but has been extensively used for years. Coriolis can import -and write Alliance designs and libraries directly. - -Etesian -- Placer ------------------ - -The |Etesian| placer is a state of the art (as of 2015) analytical placer. It is -within ``5%`` of other placers' solutions, but is normally a bit worse than ePlace. -This |Coriolis| tool is actually an encapsulation of |Coloquinte| which *is* the placer. - -.. note:: *Instance Uniquification:* a same logical instance cannot have - two different placements. So, if you don't supply a placement for it, it will be - uniquified (cloned) and you will see the copy files appears on disk upon saving. - - -|noindent| -**Hierarchical Placement** - -The placement area is defined by the top cell abutment box. - -When placing a complete hierarchy, the abutment boxes of the cells (models) other than -the top cell are set identical to the one of the top cell and their instances are -all placed at position ``(0,0,ID)``. That is, all the abutments boxes, whatever the -hierarchical level, define the same area (they are exactly superposed). - -We choose this scheme because the placer will see all the instances as virtually -flattened, so they can be placed anywhere inside the top-cell abutment box. - -|bcenter| |Etesian-1| |ecenter| - - -|noindent| -**Computing the Placement Area** - -The placement area is computed using the ``etesian.aspectRatio`` and ``etesian.spaceMargin`` -parameters only if the top-cell has an empty abutment box. If the top-cell abutment -box has to be set, then it is propagated to all the instances models recursively. - - -|noindent| -**Reseting the Placement** - -Once a placement has been done, the placer cannot reset it (will be implemented -later). To perform a new placement, you must restart |cgt|. In addition, if you -have saved the placement on disk, you must erase any :cb:`.ap` file, which are -automatically reloaded along with the netlist (:cb:`.vst`). - -|noindent| -**Limitations** - -Etesian supports standard cells and fixed macros. As for the Coriolis 2.1 version, -it doesn't support movable macros, and you must place every macro beforehand. -Timing and routability analysis are not included either, and the returned placement -may be unroutable. - - -Etesian Configuration Parameters -................................ - -+-----------------------------------+------------------+----------------------------+ -| Parameter Identifier | Type | Default | -+===================================+==================+============================+ -| **Etesian Parameters** | -+-----------------------------------+------------------+----------------------------+ -|``etesian.aspectRatio`` | ``Percentage`` | :cb:`100` | -| +------------------+----------------------------+ -| | Define the height on width ``H/W`` aspect | -| | ratio, can be comprised between 10 and 1000 | -+-----------------------------------+------------------+----------------------------+ -|``etesian.spaceMargin`` | ``Percentage`` | :cb:`5` | -| +------------------+----------------------------+ -| | The extra white space added to the total area | -| | of the standard cells | -+-----------------------------------+------------------+----------------------------+ -|``etesian.uniformDensity`` | ``Bool`` | :cb:`False` | -| +------------------+----------------------------+ -| | Whether the cells will be spread envenly | -| | across the area or allowed to form denser | -| | clusters | -+-----------------------------------+------------------+----------------------------+ -|``etesian.effort`` | ``Int`` | :cb:`2` | -| +------------------+----------------------------+ -| | Sets the balance between the speed of the | -| | placer and the solution quality | -+-----------------------------------+------------------+----------------------------+ -|``etesian.routingDriven`` | ``Bool`` | :cb:`False` | -| +------------------+----------------------------+ -| | Whether the tool will try routing iterations | -| | and whitespace allocation to improve | -| | routability; to be implemented | -+-----------------------------------+------------------+----------------------------+ -|``etesian.graphics`` | ``Int`` | :cb:`2` | -| +------------------+----------------------------+ -| | How often the display will be refreshed | -| | More refreshing slows the placer. | -| | | -| | * ``1`` shows both upper and lower bounds | -| | * ``2`` only shows lower bound results | -| | * ``3`` only shows the final results | -+-----------------------------------+-----------------------------------------------+ - -|newpage| - - -Katana -- Global Router ------------------------ - -The quality of |Katana| global routing solutions are equivalent to those of FGR_ 1.0. -For an in-depth description of |Katana| algorithms, you may download the thesis of -D. |Dupuis| avalaible from here~: `Knik Thesis`_ (|Knik| has been rewritten as part -of |Katana|, the algorithms remains essentially the same). - -The global router is now deterministic. - - -Katana -- Detailed Router -------------------------- - -|Katana| no longer suffers from the limitations of |Nero|. It can route big designs -as its runtime and memory footprint is almost linear (with respect to the number -of gates). It has successfully routed design of more than `150K` gates. -|medskip| - -.. note:: - **Slow Layer Assignment.** Most of the time, the layer assignment stage is - fast (less than a dozen seconds), but in some instances it can take more - than a dozen *minutes*. This is a known bug and will be corrected in later - releases. - -After each run, |Katana| displays a set of *completion ratios* which must all -be equal to `100%` or (``NNNN+0``) if the detailed routing has been successfull. -In the event of a failure, on a saturated design, you may tweak the three -following configuration parameters: - -#. ``katana.hTrackReservedLocal``, the number of track reserved for local routing, - that quantity is substracted from the edge capacities (global routing) to - give a sense of the cluttering inside the GCells. -#. ``katana.vTrackReservedLocal``, same as above. -#. ``etesian.spaceMargin``, increases the free area of the overall design so the - routing density decrease. - -The idea is to increase the horizontal and vertical local track reservation until -the detailed router succeeds. But in doing so we make the task of the global router -more and more difficult as the capacity of the edges decreases, and at some point -it will fail too. So this is a balance. - -Routing a design is done in four ordered steps: - -#. Detailed pre-route :math:`\textbf{P\&R} \rightarrow \textbf{Step by Step} \rightarrow \textbf{Detailed PreRoute}` -#. Global routing :math:`\textbf{P\&R} \rightarrow \textbf{Step by Step} \rightarrow \textbf{Global Route}` -#. Detailed routing :math:`\textbf{P\&R} \rightarrow \textbf{Step by Step} \rightarrow \textbf{Detailed Route}` -#. Finalize routing :math:`\textbf{P\&R} \rightarrow \textbf{Step by Step} \rightarrow \textbf{Finalize Route}` - -It is possible to supply to the router a complete wiring for some nets that the user -wants to be routed according to a specific topology. The supplied topology must respect -the building rules of the |Anabatic| database (contacts must be, *terminals*, *turns*, *h-tee* -& *v-tee* only). During the first step :fboxtt:`Detailed Pre-Route` the router will solve -overlaps between the segments, without making any dogleg. If no pre-routed topologies -are present, this step may be ommited. Any net routed at this step is then fixed and -become unmovable for the later stages. - -After the detailed routing step the |Katana| data-structure is still active -(the Hurricane wiring is decorated). The finalize step performs the removal of -the |Katana| data-structure, and it is not advisable to save the design before -that step. - -You may visualize the density (saturation) of either the edges (global routing) -or the GCells (detailed routing) until the routing is finalized. Special layers appear -to that effect in the `The Layers&Go Tab`_. - - -Katana Configuration Parameters -............................... - -The |Anabatic| parameters control the layer assignment step. - -All the defaults value given below are from the default |Alliance| technology -(:cb:`cmos` and :cb:`SxLib` cell gauge/routing gauge). - -+-----------------------------------+------------------+----------------------------+ -| Parameter Identifier | Type | Default | -+===================================+==================+============================+ -| **Anabatic Parameters** | -+-----------------------------------+------------------+----------------------------+ -|``anabatic.topRoutingLayer`` | ``String`` | :cb:`METAL5` | -| +------------------+----------------------------+ -| | Define the highest metal layer that will be | -| | used for routing (inclusive). | -+-----------------------------------+------------------+----------------------------+ -|``anabatic.globalLengthThreshold`` | ``Int`` | :cb:`1450` | -| +------------------+----------------------------+ -| | This parameter is used by a layer assignment | -| | method which is no longer used (did not give | -| | good results) | -+-----------------------------------+------------------+----------------------------+ -| ``anabatic.saturateRatio`` | ``Percentage`` | :cb:`80` | -| +------------------+----------------------------+ -| | If ``M(x)`` density is above this ratio, | -| | move up feedthru global segments up from | -| | depth ``x`` to ``x+2`` | -+-----------------------------------+------------------+----------------------------+ -| ``anabatic.saturateRp`` | ``Int`` | :cb:`8` | -| +------------------+----------------------------+ -| | If a GCell contains more terminals | -| | (:cb:`RoutingPad`) than that number, force a | -| | move up of the connecting segments to those | -| | in excess | -+-----------------------------------+------------------+----------------------------+ -| ``anabatic.globalIterations`` | ``Int`` | :cb:`10` | -| +------------------+----------------------------+ -| | The maximum number of iterations the global | -| | router will try to solve edges overload | -+-----------------------------------+------------------+----------------------------+ -| **Katana Parameters** | -+-----------------------------------+------------------+----------------------------+ -| ``katana.hTracksReservedLocal`` | ``Int`` | :cb:`3` | -| +------------------+----------------------------+ -| | To take account the tracks needed *inside* a | -| | GCell to build the *local* routing the | -| | capacities of the edges needs to be decreased.| -| | The decrease is computed by the GCell and | -| | cannot exceed this number (this is maximum). | -| | For better accuracy vertical and horizontal | -| | edges are distinguisheds | -+-----------------------------------+------------------+----------------------------+ -| ``katana.vTracksReservedLocal`` | ``Int`` | :cb:`3` | -| +------------------+----------------------------+ -| | cf. ``kite.hTracksReservedLocal`` | -+-----------------------------------+------------------+----------------------------+ -| ``katana.eventsLimit`` | ``Int`` | :cb:`4000002` | -| +------------------+----------------------------+ -| | The maximum number of segment displacements, | -| | this is a last ditch safety against infinite | -| | loop. It's perhaps a little too low for big | -| | designs | -+-----------------------------------+------------------+----------------------------+ -| ``katana.ripupCost`` | ``Int`` | :cb:`3` | -| +------------------+----------------------------+ -| | Differential introduced between two ripup | -| | costs to avoid a loop between two ripped up | -| | segments | -+-----------------------------------+------------------+----------------------------+ -| ``katana.strapRipupLimit`` | ``Int`` | :cb:`16` | -| +------------------+----------------------------+ -| | Maximum number of ripup for *strap* segments | -+-----------------------------------+------------------+----------------------------+ -| ``katana.localRipupLimit`` | ``Int`` | :cb:`9` | -| +------------------+----------------------------+ -| | Maximum number of ripup for *local* segments | -+-----------------------------------+------------------+----------------------------+ -| ``katana.globalRipupLimit`` | ``Int`` | :cb:`5` | -| +------------------+----------------------------+ -| | Maximum number of ripup for *global* segments,| -| | when this limit is reached, triggers topologic| -| | modification | -+-----------------------------------+------------------+----------------------------+ -| ``katana.longGlobalRipupLimit`` | ``Int`` | :cb:`5` | -| +------------------+----------------------------+ -| | Maximum number of ripup for *long global* | -| | segments, when this limit is reached, triggers| -| | topological modification | -+-----------------------------------+------------------+----------------------------+ - - - -.. _Python Scripts in Cgt: - -Executing Python Scripts in Cgt -------------------------------- - -Python/Stratus scripts can be executed either in text or graphical mode. - -.. note:: **How Cgt Locates Python Scripts:** - |cgt| uses the Python ``import`` mechanism to load Python scripts. - So you must give the name of your script whithout ``.py`` extension and - it must be reachable through the ``PYTHONPATH``. You may use the - dotted module notation. - -A Python/Stratus script must contain a function called ``ScriptMain()`` -with one optional argument, the graphical editor into which it may be -running (will be set to ``None`` in text mode). The Python interface to -the editor (type: :cb:`CellViewer`) is limited to basic capabilities -only. - -Any script given on the command line will be run immediatly *after* the -initializations and *before* any other argument is processed. - -For more explanation on Python scripts see :ref:`Python Interface to Coriolis`. - - -Printing & Snapshots --------------------- - -Printing or saving into a |pdf| is fairly simple, just use the **File -> Print** -menu or the |CTRL_P| shortcut to open the dialog box. - -The print functionality uses exactly the same rendering mechanism as for the -screen, beeing almost *WYSIWYG*. Thus, to obtain the best results it is advisable -to select the ``Coriolis.Printer`` look (in the *Controller*), which uses a -white background and well suited for high resolutions ``32x32`` pixels patterns - -There is also two modes of printing selectable through the *Controller* -**Settings -> Misc -> Printer/Snapshot Mode**: - -=============== ================= ===================================================== -Mode DPI (approx.) Intended Usage ---------------- ----------------- ----------------------------------------------------- -**Cell Mode** 150 For single ``Cell`` printing or very small designs. - Patterns will be bigger and more readable. -**Design Mode** 300 For designs (mostly commposed of wires and cells - outlines). -=============== ================= ===================================================== - -.. note:: *The pdf file size* - Be aware that the generated |pdf| files are indeed only pixmaps. - So they can grew very large if you select paper format above ``A2`` - or similar. - - -|noindent| -Saving into an image is subject to the same remarks as for |pdf|. - - -Memento of Shortcuts in Graphic Mode ------------------------------------- - -The main application binary is |cgt|. - -+---------------+-------------------+-----------------------------------------------------------+ -| Category | Keys | Action | -+===============+===================+===========================================================+ -| **Moves** | | |KeyUp|, | Shifts the view in the according direction | -| | |KeyDown| | | -| | | |KeyLeft|, | | -| | |KeyRight| | | -+---------------+-------------------+-----------------------------------------------------------+ -| **Fit** | |KeyF| | Fits to the Cell abutment box | -+---------------+-------------------+-----------------------------------------------------------+ -| **Refresh** | |CTRL_L| | Triggers a complete display redraw | -+---------------+-------------------+-----------------------------------------------------------+ -| **Goto** | |KeyG| | *apperture* is the minimum side of the area | -| | | displayed around the point to go to. It's an | -| | | alternative way of setting the zoom level | -+---------------+-------------------+-----------------------------------------------------------+ -| **Zoom** | |KeyZ|, | Respectively zoom by a 2 factor and *unzoom* | -| | |KeyM| | by a 2 factor | -| +-------------------+-----------------------------------------------------------+ -| | | |BigMouse| | You can perform a zoom to an area. | -| | | Area Zoom | Define the zoom area by *holding down the left | -| | | mouse button* while moving the mouse. | -+---------------+-------------------+-----------------------------------------------------------+ -| **Selection** | | |BigMouse| | You can select displayed objects under an area. | -| | | Area Selection | Define the selection area by *holding down the | -| | | right mouse button* while moving the mouse. | -| +-------------------+-----------------------------------------------------------+ -| | | |BigMouse| | You can toggle the selection of one object under | -| | | Toggle Selection| the mouse position by pressing |CTRL| and | -| | | pressing down *the right mouse button*. A popup | -| | | list of what's under the position shows up into | -| | | which you can toggle the selection state of one | -| | | item. | -| +-------------------+-----------------------------------------------------------+ -| | |KeyCapS| | Toggle the selection visibility | -+---------------+-------------------+-----------------------------------------------------------+ -| **Controller**| |CTRL_I| | Show/hide the controller window. | -| | | | -| | | It's the Swiss Army Knife of the viewer. | -| | | From it, you can fine-control the display and | -| | | inspect almost everything in your design. | -+---------------+-------------------+-----------------------------------------------------------+ -| **Rulers** | |KeyK|, | One stroke on |KeyK| enters the ruler mode, in | -| | |KeyESC| | which you can draw one ruler. You can exit the | -| | | ruler mode by pressing |KeyESC|. Once in ruler | -| | | mode, the first click on the *left mouse button* | -| | | sets the ruler's starting point and the second | -| | | click the ruler's end point. The second click | -| | | exits automatically the ruler mode. | -| +-------------------+-----------------------------------------------------------+ -| | |KeyCapK| | Clears all the drawn rulers | -+---------------+-------------------+-----------------------------------------------------------+ -| **Print** | |CTRL_P| | Currently rather crude. It's a direct copy of | -| | | what's displayed in pixels. So the resulting | -| | | picture will be a little blurred due to | -| | | anti-aliasing mechanism. | -+---------------+-------------------+-----------------------------------------------------------+ -| **Open/Close**| |CTRL_O| | Opens a new design. The design name must be | -| | | given without path or extention. | -| +-------------------+-----------------------------------------------------------+ -| | |CTRL_W| | Closes the current viewer window, but does not quit | -| | | the application. | -| +-------------------+-----------------------------------------------------------+ -| | |CTRL_Q| | `CTRL+Q` quits the application | -| | | (closing all windows). | -+---------------+-------------------+-----------------------------------------------------------+ -| **Hierarchy** | |CTRL_Down| | Goes one hierarchy level down. That is, if there | -| | | is an *instance* under the cursor position, loads | -| | | its *model* Cell in place of the current one. | -| +-------------------+-----------------------------------------------------------+ -| | |CTRL_Up| | Goes one hierarchy level up. If we have entered | -| | | the current model through |CTRL_Down| | -| | | reloads the previous model (the one | -| | | in which this model is instanciated). | -+---------------+-------------------+-----------------------------------------------------------+ - - -Cgt Command Line Options ------------------------- - -Appart from the obvious ``--text`` options, all can be used for text and graphical mode. - -+-----------------------------+------------------------------------------------+ -| Arguments | Meaning | -+=============================+================================================+ -| `-t|--text` | Instructs |cgt| to run in text mode. | -+-----------------------------+------------------------------------------------+ -| `-L|--log-mode` | Disables the use of |ANSI| escape sequence on | -| | the |tty|. Useful when the output is | -| | redirected to a file. | -+-----------------------------+------------------------------------------------+ -| `-c |--cell=` | The name of the design to load, without | -| | leading path or extention. | -+-----------------------------+------------------------------------------------+ -| `-m |--margin=` | Percentage *val* of white space for the placer | -| | (|Etesian|). | -+-----------------------------+------------------------------------------------+ -| `--events-limit=` | The maximal number of events after which the | -| | router will stop. This is mainly a failsafe | -| | against looping. The limit is set to 4 | -| | millions of iteration which should suffice to | -| | any design of `100K`. gates. For bigger | -| | designs you may want to increase this limit. | -+-----------------------------+------------------------------------------------+ -| `-G|--global-route` | Runs the global router (|Katana|). | -+-----------------------------+------------------------------------------------+ -| `-R|--detailed-route` | Runs the detailed router (|Katana|). | -+-----------------------------+------------------------------------------------+ -| `-s|--save-design=` | The design into which the routed layout will | -| | be saved. It is strongly recommanded to choose | -| | a different name from the source (unrouted) | -| | design. | -+-----------------------------+------------------------------------------------+ -| `--stratus-script=` | Run the Python/Stratus script ``module``. | -| | See `Python Scripts in Cgt`_. | -+-----------------------------+------------------------------------------------+ - -|newpage| - - -Some Examples : - -* Run both global and detailed router, then save the routed design : :: - - > cgt -v -t -G -R --cell=design --save-design=design_r - - -Miscellaneous Settings ----------------------- - -+---------------------------------------+------------------+----------------------------+ -| Parameter Identifier | Type | Default | -+=======================================+==================+============================+ -| **Verbosity/Log Parameters** | -+---------------------------------------+------------------+----------------------------+ -| ``misc.info`` | ``Bool`` | :cb:`False` | -| +------------------+----------------------------+ -| | Enables display of *info* level message | -| | (:cb:`cinfo` stream) | -+---------------------------------------+------------------+----------------------------+ -| ``misc.bug`` | ``Bool`` | :cb:`False` | -| +------------------+----------------------------+ -| | Enables display of *bug* level message | -| | (:cb:`cbug` stream), messages can be a little | -| | scarry | -+---------------------------------------+------------------+----------------------------+ -| ``misc.logMode`` | ``Bool`` | :cb:`False` | -| +------------------+----------------------------+ -| | If enabled, assumes that the output device | -| | is not a ``tty`` and suppresses any escape | -| | sequences | -+---------------------------------------+------------------+----------------------------+ -| ``misc.verboseLevel1`` | ``Bool`` | :cb:`True` | -| +------------------+----------------------------+ -| | First level of verbosity, disables level 2 | -+---------------------------------------+------------------+----------------------------+ -| ``misc.verboseLevel2`` | ``Bool`` | :cb:`False` | -| +------------------+----------------------------+ -| | Second level of verbosity | -+---------------------------------------+------------------+----------------------------+ -| **Development/Debug Parameters** | -+---------------------------------------+------------------+----------------------------+ -| ``misc.minTraceLevel`` | ``Int`` | :cb:`0` | -+---------------------------------------+------------------+----------------------------+ -| ``misc.maxTraceLevel`` | ``Int`` | :cb:`0` | -| +------------------+----------------------------+ -| | Displays trace information *between* those two| -| | levels (:cb:`cdebug` stream) | -+---------------------------------------+------------------+----------------------------+ -| ``misc.catchCore`` | ``Bool`` | :cb:`False` | -| +------------------+----------------------------+ -| | By default, |cgt| does not dump core. | -| | To generate one set this flag to :cb:`True` | -+---------------------------------------+------------------+----------------------------+ - -|newpage| - - -.. _The Controller: - -The Controller -~~~~~~~~~~~~~~ - -The *Controller* window is composed of seven tabs: - -#. `The Look Tab`_ to select the display style. -#. `The Filter Tab`_ the hierarchical levels to be displayed, the look of - rubbers and the dimension units. -#. `The Layers&Go Tab`_ to selectively hide/display layers. -#. `The Netlist Tab`_ to browse through the |netlist|. Works in association - with the *Selection* tab. -#. `The Selection Tab`_ allows to view all the currently selected elements. -#. `The Inspector Tab`_ browses through either the DataBase, the Cell or - the current selection. -#. `The Settings Tab`_ accesses all the tool's configuration settings. - - -.. _The Look Tab: - -The Look Tab ------------- - -You can select how the layout will be displayed. There is a special one -``Printer.Coriolis`` specifically designed for `Printing & Snapshots`_. -You should select it prior to calling the print or snapshot dialog boxes. - -|bcenter| |ControllerLook_1| |ecenter| - -|newpage| - - -.. _The Filter Tab: - -The Filter Tab --------------- - -The filter tab let you select what hierarchical levels of your design will be -displayed. Hierarchy level are numbered top-down: the level 0 corresponds to -the top-level cell, the level one to the instances of the top-level Cell and -so on. - -There are also check boxes to enable/disable the processing of Terminal Cell, -Master Cells and Components. The processing of Terminal Cell (hierarchy leaf -cells) is disabled by default when you load a hierarchical design and enabled -when you load a single Cell. - -You can choose what kind of form to give to the rubbers and the type of -unit used to display coordinates. - -.. note:: *What are Rubbers:* |Hurricane| uses *Rubbers* to materialize - physical gaps in net topology. That is, if some wires are missing to - connect two or more parts of net, a *rubber* will be drawn between them - to signal the gap. - - For example, after the detailed routing no *rubber* should remain. - They have been made *very* visible as big violet lines... - -|bcenter| |ControllerFilter_1| |ecenter| - -|newpage| - - -.. _The Layers&Go Tab: - -The Layers&Go Tab ------------------ - -Control the individual display of all *layers* and *Gos*. - -* *Layers* correspond to true physical layers. From a |Hurricane| point of - view they are all the *BasicLayers* (could be matched to GDSII). -* *Gos* stands from *Graphical Objects*, they are drawings that have no - physical existence but are added by the various tools to display extra - information. One good exemple is the density map of the detailed router, - to easily locate congested areas. - -For each layer/Go there are two check boxes: - -* The normal one triggers the display. -* The red-outlined allows objects of that layer to be selectable or not. - -|bcenter| |ControllerLayersGos_1| |ecenter| - - -.. _The Netlist Tab: - -The Netlist Tab ---------------- - -The *Netlist* tab shows the list of nets... By default the tab is not -*synched* with the displayed Cell. To see the nets you must check the -**Sync Netlist** checkbox. You can narrow the set of displayed nets by -using the filter pattern (supports regular expressions). - -A very useful feature is to enable the **Sync Selection**, which will -automatically select all the components of the selected net(s). You can -select multiple nets. In the figure the net ``auxsc35`` is selected and -is highlighted in the *Viewer*. - -|bcenter| |ControllerNetlist_1| |ecenter| -|bcenter| |ViewerNetlist_1| |ecenter| - - -.. _The Selection Tab: - -The Selection Tab ------------------ - -The *Selection* tab lists all the components currently selected. They -can be filtered thanks to the filter pattern. - -Used in conjunction with the *Netlist* **Sync Selection** you will all see -all the components part of *net*. - -In this list, you can toggle individually the selection of component by -pressing the ``t`` key. When unselected in this way a component is not -removed from the the selection list but instead displayed in red italic. -To see where a component is you may make it blink by repeatedly press -the ``t`` key... - -|bcenter| |ControllerSelection_1| |ecenter| - - -.. _The Inspector Tab: - -The Inspector Tab ------------------ - -This tab is very useful, but mostly for |Coriolis| developpers. It allows -to browse through the live DataBase. The *Inspector* provides three entry points: - -* **DataBase**: Starts from the whole |Hurricane| DataBase. -* **Cell**: Inspects the currently loaded Cell. -* **Selection**: Inspects the object currently highlighted in the *Selection* tab. - -Once an entry point has been activated, you may recursively expore all -its fields using the right/left arrows. - -.. note:: *Do not put your fingers in the socket:* when inspecting - anything, do not modify the DataBase. If any object under inspection - is deleted, you will crash the application... - -.. note:: *Implementation Detail:* the inspector support is done with - ``Slot``, ``Record`` and ``getString()``. - -|bcenter| |ControllerInspector_1| |ecenter| -|bcenter| |ControllerInspector_2| |ecenter| -|bcenter| |ControllerInspector_3| |ecenter| - - -.. _The Settings Tab: - -The Settings Tab ----------------- - -Here comes the description of the *Settings* tab. - -|bcenter| |ControllerSettings_1| |ecenter| diff --git a/documentation/_build/html/_sources/UsersGuide/index.txt b/documentation/_build/html/_sources/UsersGuide/index.txt deleted file mode 100644 index 0f50174a..00000000 --- a/documentation/_build/html/_sources/UsersGuide/index.txt +++ /dev/null @@ -1,22 +0,0 @@ -.. -*- mode: rst; explicit-buffer-name: "index.rst" -*- - -.. include:: ../etc/definitions.rst - - -======================= -Coriolis User's Guide -======================= - -Printable version of this document `UsersGuide.pdf <../../../pdf/main/UsersGuide.pdf>`_. - - -.. toctree:: - :maxdepth: 2 - - LicenseCredits.rst - Releases.rst - DesignFlow.rst - Installation.rst - Configuration.rst - ViewerTools.rst - ScriptsPlugins.rst diff --git a/documentation/_build/html/_sources/Viewer/Viewer.txt b/documentation/_build/html/_sources/Viewer/Viewer.txt deleted file mode 100644 index c103b413..00000000 --- a/documentation/_build/html/_sources/Viewer/Viewer.txt +++ /dev/null @@ -1,11 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -================== -Viewer Reference -================== - -The Viewer C++ API reference is generated by Doxygen_ and is -available here: `Viewer `_ diff --git a/documentation/_build/html/_sources/defapi/defapi.txt b/documentation/_build/html/_sources/defapi/defapi.txt deleted file mode 100644 index 39b1345a..00000000 --- a/documentation/_build/html/_sources/defapi/defapi.txt +++ /dev/null @@ -1,12 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -=================== -DEF API Reference -=================== - -The DEF API reference is copyrighted by |Cadence| (http://www.cadence.com) -under the `Apache License, Version 2.0`_ and is available here: -`DEF API `_ diff --git a/documentation/_build/html/_sources/etc/definitions.txt b/documentation/_build/html/_sources/etc/definitions.txt deleted file mode 100644 index 862d55c4..00000000 --- a/documentation/_build/html/_sources/etc/definitions.txt +++ /dev/null @@ -1,206 +0,0 @@ -.. -*- Mode: rst; explicit-buffer-name: "definition.rst" -*- - - -.. role:: raw-html(raw) - :format: html - -.. role:: raw-latex(raw) - :format: latex - -.. role:: ul -.. role:: cb -.. role:: sc -.. role:: fboxtt - -.. HTML/LaTeX backends mixed macros. -.. |br| replace:: :raw-latex:`\linebreak` :raw-html:`
` -.. |medskip| replace:: :raw-latex:`\medskip` :raw-html:`
` -.. |newpage| replace:: :raw-latex:`\newpage` -.. |linebreak| replace:: :raw-latex:`\smallskip` -.. |noindent| replace:: :raw-latex:`\noindent` :raw-html:`

` -.. |dotfill| replace:: :raw-html:`  ` -.. |bcenter| replace:: :raw-latex:`\begin{center}` -.. |ecenter| replace:: :raw-latex:`\end{center}` -.. |pagestylefancy| replace:: :raw-latex:`\thispagestyle{fancy}` -.. |lambda| replace:: :raw-latex:`$\lambda$` :raw-html:`λ` - - -.. Acronyms & names. -.. |NDA| replace:: :sc:`nda` -.. |OS| replace:: :sc:`os` -.. |GNU| replace:: :sc:`gnu` -.. |LGPL| replace:: :sc:`lgpl` -.. |GPL| replace:: :sc:`gpl` -.. |UPMC| replace:: :sc:`upmc` -.. |SorbonneUniversite| replace:: :sc:`Sorbonne Université` -.. |SU| replace:: :sc:`su` -.. |Bull| replace:: :sc:`Bull` -.. |Cadence| replace:: :sc:`Cadence` -.. |Si2| replace:: :sc:`Si2` -.. |LEFDEF| replace:: :sc:`lefdef` -.. |LEF| replace:: :sc:`lef` -.. |DEF| replace:: :sc:`def` -.. |Flute| replace:: :sc:`Flute` -.. |MacOS| replace:: :sc:`MacOS` -.. |Darwin| replace:: :sc:`Darwin` -.. |RHEL| replace:: :sc:`rhel` -.. |RHEL6| replace:: :sc:`rhel6` -.. |RHEL7| replace:: :sc:`rhel7` -.. |SL6| replace:: :sc:`Scientific Linux 6` -.. |SL7| replace:: :sc:`Scientific Linux 7` -.. |Scientific Linux| replace:: :sc:`Scientific Linux` -.. |RedHat| replace:: :sc:`RedHat` -.. |Fedora| replace:: :sc:`Fedora` -.. |FC13| replace:: :sc:`fc13` -.. |EPEL| replace:: :sc:`epel` -.. |Debian| replace:: :sc:`Debian` -.. |Ubuntu| replace:: :sc:`Ubuntu` -.. |MOSIS| replace:: :sc:`mosis` -.. |Blif| replace:: :sc:`blif` - -.. |Alexandre| replace:: :sc:`Alexandre` -.. |Belloeil| replace:: :sc:`Belloeil` -.. |Chaput| replace:: :sc:`Chaput` -.. |Chotin| replace:: :sc:`Chotin` -.. |Chu| replace:: :sc:`Chu` -.. |Clement| replace:: :sc:`Clement` -.. |Dupuis| replace:: :sc:`Dupuis` -.. |Escassut| replace:: :sc:`Escassut` -.. |Gouvine| replace:: :sc:`Gouvine` -.. |Masson| replace:: :sc:`Masson` -.. |Sroka| replace:: :sc:`Sroka` -.. |Yifei| replace:: :sc:`Yifei` - -.. |VLSI| replace:: :sc:`vlsi` -.. |ANSI| replace:: :sc:`ansi` -.. |MIPS| replace:: :sc:`mips` -.. |Am2901| replace:: :sc:`Am2901` -.. |Hurricane| replace:: :sc:`Hurricane` -.. |CRL| replace:: :sc:`crl` -.. |Alliance| replace:: :sc:`Alliance` -.. |Yosys| replace:: :sc:`Yosys` -.. |GenLib| replace:: :sc:`GenLib` -.. |Nero| replace:: :sc:`Nero` -.. |Druc| replace:: :cb:`Druc` -.. |Coloquinte| replace:: :sc:`Coloquinte` -.. |Coriolis| replace:: :sc:`Coriolis` -.. |Coriolis1| replace:: :sc:`Coriolis 1` -.. |Coriolis2| replace:: :sc:`Coriolis 2` -.. |alliance-check-toolkit| replace:: ``alliance-check-toolkit`` -.. |VLSISAPD| replace:: :sc:`vlsisapd` -.. |CRLcore| replace:: :sc:`CRLcore` -.. |Cyclop| replace:: :sc:`Cyclop` -.. |Nimbus| replace:: :sc:`Nimbus` -.. |hMetis| replace:: :sc:`hMetis` -.. |Mauka| replace:: :sc:`Mauka` -.. |Etesian| replace:: :sc:`Etesian` -.. |Knik| replace:: :sc:`Knik` -.. |Anabatic| replace:: :sc:`Anabatic` -.. |Katabatic| replace:: :sc:`Katabatic` -.. |Kite| replace:: :sc:`Kite` -.. |Katana| replace:: :sc:`Katana` -.. |Stratus| replace:: :sc:`Stratus` -.. |Stratus1| replace:: :sc:`Stratus1` -.. |Stratus2| replace:: :sc:`Stratus2` -.. |Unicorn| replace:: :sc:`Unicorn` -.. |ccb| replace:: :cb:`ccb` -.. |cgt| replace:: :cb:`cgt` -.. |Chams| replace:: :sc:`Chams` -.. |OpenChams| replace:: :sc:`OpenChams` -.. |API| replace:: :sc:`api` -.. |STL| replace:: :sc:`stl` -.. |XML| replace:: :sc:`xml` -.. |pdf| replace:: :sc:`pdf` -.. |UTF-8| replace:: :sc:`utf-8` -.. |Python| replace:: :sc:`Python` -.. |Linux| replace:: :sc:`Linux` -.. |MacPorts| replace:: :sc:`MacPorts` -.. |devtoolset| replace:: :cb:`devtoolset` -.. |boost| replace:: :cb:`boost` -.. |Qt| replace:: :sc:`qt` -.. |Qwt| replace:: :sc:`qwt` -.. |PyQt| replace:: :sc:`PyQt` -.. |PyQt4| replace:: :sc:`PyQt4` -.. |PyQt5| replace:: :sc:`PyQt5` -.. |tty| replace:: :cb:`tty` -.. |svn| replace:: :cb:`svn` -.. |git| replace:: :cb:`git` -.. |rpm| replace:: :cb:`rpm` -.. |gdb| replace:: :cb:`gdb` -.. |valgrind| replace:: :cb:`valgrind` -.. |cmake| replace:: :cb:`cmake` -.. |struct| replace:: :cb:`struct` - -.. |KeyUp| replace:: :fboxtt:`Up` -.. |KeyDown| replace:: :fboxtt:`Down` -.. |KeyLeft| replace:: :fboxtt:`Left` -.. |KeyRight| replace:: :fboxtt:`Right` -.. |KeyF| replace:: :fboxtt:`f` -.. |KeyL| replace:: :fboxtt:`l` -.. |KeyG| replace:: :fboxtt:`g` -.. |KeyZ| replace:: :fboxtt:`z` -.. |KeyM| replace:: :fboxtt:`m` -.. |KeyI| replace:: :fboxtt:`i` -.. |KeyK| replace:: :fboxtt:`k` -.. |KeyP| replace:: :fboxtt:`p` -.. |KeyO| replace:: :fboxtt:`o` -.. |KeyW| replace:: :fboxtt:`w` -.. |KeyQ| replace:: :fboxtt:`q` -.. |KeyCapK| replace:: :fboxtt:`K` -.. |KeyCapS| replace:: :fboxtt:`S` -.. |Plus| replace:: :fboxtt:`+` -.. |KeyESC| replace:: :fboxtt:`ESC` -.. |CTRL| replace:: :fboxtt:`CTRL` -.. |CTRL_L| replace:: :fboxtt:`CTRL+L` -.. |CTRL_I| replace:: :fboxtt:`CTRL+I` -.. |CTRL_P| replace:: :fboxtt:`CTRL+P` -.. |CTRL_O| replace:: :fboxtt:`CTRL+O` -.. |CTRL_W| replace:: :fboxtt:`CTRL+W` -.. |CTRL_Q| replace:: :fboxtt:`CTRL+Q` -.. |CTRL_Down| replace:: :fboxtt:`CTRL+Down` -.. |CTRL_Up| replace:: :fboxtt:`CTRL+Up` -.. |CTRL_Left| replace:: :fboxtt:`CTRL+Left` -.. |CTRL_Right| replace:: :fboxtt:`CTRL+Right` - -.. URLs -.. _Doxygen: http://www.stack.nl/~dimitri/doxygen/ -.. _LaTeX2HTML: http://www.latex2html.org/ -.. _FGR: http://vlsicad.eecs.umich.edu/BK/FGR/ -.. _Box Router: http://www.cerc.utexas.edu/~thyeros/boxrouter/boxrouter.htm -.. _hMETIS: http://glaros.dtc.umn.edu/gkhome/views/metis -.. _Knik Thesis: http://www-soc.lip6.fr/en/users/damiendupuis/PhD/ -.. _RapidJSON: http://miloyip.github.io/rapidjson/ -.. _Python/C API Reference Manual: https://docs.python.org/2/c-api/index.html -.. _Apache License, Version 2.0: http://www.apache.org/licences/LICENSE-2.0 -.. _FreePDK45: https://www.eda.ncsu.edu/wiki/FreePDK45:Contents -.. _Yosys: http://www.clifford.at/yosys/ - -.. Standard CAO/VLSI Concepts. -.. |netlist| replace:: *netlist* -.. |netlists| replace:: *netlists* -.. |layout| replace:: *layout* -.. |layouts| replace:: *layouts* -.. |CMOS| replace:: :sc:`cmos` -.. |VHDL| replace:: :sc:`vhdl` -.. |NWELL| replace:: :sc:`nwell` -.. |POWER| replace:: :sc:`power` -.. |GROUND| replace:: :sc:`ground` - -.. MBK Concepts -.. |MBK| replace:: :sc:`mbk` -.. |LOFIG| replace:: :cb:`Lofig` -.. |PHFIG| replace:: :cb:`Phfig` -.. |SxLib| replace:: :sc:`SxLib` -.. |RDS| replace:: :sc:`rds` - -.. Hurricane Concepts. -.. |hypernet| replace:: *hypernet* -.. |hypernets| replace:: *hypernets* -.. |Cell| replace:: *Cell* -.. |Rings| replace:: *Rings* -.. |QuadTrees| replace:: *QuadTrees* -.. |Collections| replace:: *Collections* -.. |ap| replace:: :cb:`ap` -.. |vst| replace:: :cb:`vst` -.. |kgr| replace:: :cb:`kgr` -.. |dot_conf| replace:: :cb:`.conf` diff --git a/documentation/_build/html/_sources/index.txt b/documentation/_build/html/_sources/index.txt deleted file mode 100644 index dfb158f6..00000000 --- a/documentation/_build/html/_sources/index.txt +++ /dev/null @@ -1,39 +0,0 @@ -.. -*- mode: rst; explicit-buffer-name: "index.rst" -*- - -.. Coriolis documentation master file, created by - sphinx-quickstart on Mon Jul 10 15:08:36 2017. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to Coriolis's documentation! -==================================== - -Contents: - -.. toctree:: - - UsersGuide/index.rst - PythonTutorial/index.rst - Stratus/index.rst - Hurricane/Hurricane.rst - Viewer/Viewer.rst - CrlCore/CrlCore.rst - Katabatic/Katabatic.rst - Kite/Kite.rst - Unicorn/Unicorn.rst - PythonCpp/index.rst - RDS/index.rst - Analog/Analog.rst - Oroshi/Oroshi.rst - lefapi/lefapi.rst - defapi/defapi.rst - lefdef/lefdef.rst - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/documentation/_build/html/_sources/lefapi/lefapi.txt b/documentation/_build/html/_sources/lefapi/lefapi.txt deleted file mode 100644 index 1aa0a872..00000000 --- a/documentation/_build/html/_sources/lefapi/lefapi.txt +++ /dev/null @@ -1,47 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -================= -LEF API Reference -================= - -The LEF API reference is copyrighted by |Cadence| (http://www.cadence.com) -under the `Apache License, Version 2.0`_ and is available here: -`LEF API `_ - - -Implementation Notes -==================== - -Understanding Units -~~~~~~~~~~~~~~~~~~~ - -In the ``UNITS`` section, the statement: :: - - DATABASE MICRONS LEFconvertFactor - -Means that: - -#. The distances in the |LEF| file are expresseds (always, it seems) in - micrometers. - -#. The distances are multiples of :math:`\frac{1}{LEFconvertFactor}` which is - the smallest amount of distance we can represent. By default ``LEFconvertFactor`` - is set to ``100``, which means steps of ``0.01µm``. - - This is the equivalent of the **precision** factor in the |Hurricane| database. - - -Callback Calling Order -~~~~~~~~~~~~~~~~~~~~~~ - -The callback for the ``PIN`` section is called *before* the callback of the whole -``MACRO`` it belongs to. - -As a consequence, we have to create ``Net`` before the ``Cell`` can be known. -To avoid transient storage of lots of informations while we are reading the -``PIN``, when we encounter one **and** no temporary ``Cell`` exists, we -create one named ``"LEFImportTmpCell"``. This temporary ``Cell`` will be renamed -and configured when the subsequent ``MACRO`` callback is called. diff --git a/documentation/_build/html/_sources/lefdef/lefdef.txt b/documentation/_build/html/_sources/lefdef/lefdef.txt deleted file mode 100644 index 24a29c0b..00000000 --- a/documentation/_build/html/_sources/lefdef/lefdef.txt +++ /dev/null @@ -1,12 +0,0 @@ -.. -*- Mode: rst -*- - -.. include:: ../etc/definitions.rst - - -============================ -LEF/DEF Language Reference -============================ - -The LEF/DEF language reference is copyrighted by |Cadence| (http://www.cadence.com) -under the `Apache License, Version 2.0`_ and is available here: -`LEF/DEF `_ diff --git a/documentation/_build/html/_static/ajax-loader.gif b/documentation/_build/html/_static/ajax-loader.gif deleted file mode 100644 index 61faf8ca..00000000 Binary files a/documentation/_build/html/_static/ajax-loader.gif and /dev/null differ diff --git a/documentation/_build/html/_static/basic.css b/documentation/_build/html/_static/basic.css deleted file mode 100644 index 0b79414a..00000000 --- a/documentation/_build/html/_static/basic.css +++ /dev/null @@ -1,611 +0,0 @@ -/* - * basic.css - * ~~~~~~~~~ - * - * Sphinx stylesheet -- basic theme. - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: left; - width: 230px; - margin-left: -100%; - font-size: 90%; - word-wrap: break-word; - overflow-wrap : break-word; -} - -div.sphinxsidebar ul { - list-style: none; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar #searchbox input[type="text"] { - width: 170px; -} - -img { - border: 0; - max-width: 100%; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable { - width: 100%; -} - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable dl, table.indextable dd { - margin-top: 0; - margin-bottom: 0; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -div.modindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -div.genindex-jumpbox { - border-top: 1px solid #ddd; - border-bottom: 1px solid #ddd; - margin: 1em 0 1em 0; - padding: 0.4em; -} - -/* -- general body styles --------------------------------------------------- */ - -div.body p, div.body dd, div.body li, div.body blockquote { - -moz-hyphens: auto; - -ms-hyphens: auto; - -webkit-hyphens: auto; - hyphens: auto; -} - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink, -caption:hover > a.headerlink, -p.caption:hover > a.headerlink, -div.code-block-caption:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.field-list ul { - padding-left: 1em; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -img.align-left, .figure.align-left, object.align-left { - clear: left; - float: left; - margin-right: 1em; -} - -img.align-right, .figure.align-right, object.align-right { - clear: right; - float: right; - margin-left: 1em; -} - -img.align-center, .figure.align-center, object.align-center { - display: block; - margin-left: auto; - margin-right: auto; -} - -.align-left { - text-align: left; -} - -.align-center { - text-align: center; -} - -.align-right { - text-align: right; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table caption span.caption-number { - font-style: italic; -} - -table caption span.caption-text { -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 5px; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.field-list td, table.field-list th { - border: 0 !important; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -table.citation { - border-left: solid 1px gray; - margin-left: 1px; -} - -table.citation td { - border-bottom: none; -} - -/* -- figures --------------------------------------------------------------- */ - -div.figure { - margin: 0.5em; - padding: 0.5em; -} - -div.figure p.caption { - padding: 0.3em; -} - -div.figure p.caption span.caption-number { - font-style: italic; -} - -div.figure p.caption span.caption-text { -} - - -/* -- other body styles ----------------------------------------------------- */ - -ol.arabic { - list-style: decimal; -} - -ol.loweralpha { - list-style: lower-alpha; -} - -ol.upperalpha { - list-style: upper-alpha; -} - -ol.lowerroman { - list-style: lower-roman; -} - -ol.upperroman { - list-style: upper-roman; -} - -dl { - margin-bottom: 15px; -} - -dd p { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, .highlighted { - background-color: #fbe54e; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa; -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -.guilabel, .menuselection { - font-family: sans-serif; -} - -.accelerator { - text-decoration: underline; -} - -.classifier { - font-style: oblique; -} - -abbr, acronym { - border-bottom: dotted 1px; - cursor: help; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - overflow-y: hidden; /* fixes display issues on Chrome browsers */ -} - -span.pre { - -moz-hyphens: none; - -ms-hyphens: none; - -webkit-hyphens: none; - hyphens: none; -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -div.code-block-caption { - padding: 2px 5px; - font-size: small; -} - -div.code-block-caption code { - background-color: transparent; -} - -div.code-block-caption + div > div.highlight > pre { - margin-top: 0; -} - -div.code-block-caption span.caption-number { - padding: 0.1em 0.3em; - font-style: italic; -} - -div.code-block-caption span.caption-text { -} - -div.literal-block-wrapper { - padding: 1em 1em 0; -} - -div.literal-block-wrapper div.highlight { - margin: 0; -} - -code.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -code.descclassname { - background-color: transparent; -} - -code.xref, a code { - background-color: transparent; - font-weight: bold; -} - -h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { - background-color: transparent; -} - -.viewcode-link { - float: right; -} - -.viewcode-back { - float: right; - font-family: sans-serif; -} - -div.viewcode-block:target { - margin: -1px -10px; - padding: 0 10px; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} \ No newline at end of file diff --git a/documentation/_build/html/_static/comment-bright.png b/documentation/_build/html/_static/comment-bright.png deleted file mode 100644 index 551517b8..00000000 Binary files a/documentation/_build/html/_static/comment-bright.png and /dev/null differ diff --git a/documentation/_build/html/_static/comment-close.png b/documentation/_build/html/_static/comment-close.png deleted file mode 100644 index 09b54be4..00000000 Binary files a/documentation/_build/html/_static/comment-close.png and /dev/null differ diff --git a/documentation/_build/html/_static/comment.png b/documentation/_build/html/_static/comment.png deleted file mode 100644 index 92feb52b..00000000 Binary files a/documentation/_build/html/_static/comment.png and /dev/null differ diff --git a/documentation/_build/html/_static/doctools.js b/documentation/_build/html/_static/doctools.js deleted file mode 100644 index 81634956..00000000 --- a/documentation/_build/html/_static/doctools.js +++ /dev/null @@ -1,287 +0,0 @@ -/* - * doctools.js - * ~~~~~~~~~~~ - * - * Sphinx JavaScript utilities for all documentation. - * - * :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -/** - * select a different prefix for underscore - */ -$u = _.noConflict(); - -/** - * make the code below compatible with browsers without - * an installed firebug like debugger -if (!window.console || !console.firebug) { - var names = ["log", "debug", "info", "warn", "error", "assert", "dir", - "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", - "profile", "profileEnd"]; - window.console = {}; - for (var i = 0; i < names.length; ++i) - window.console[names[i]] = function() {}; -} - */ - -/** - * small helper function to urldecode strings - */ -jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); -}; - -/** - * small helper function to urlencode strings - */ -jQuery.urlencode = encodeURIComponent; - -/** - * This function returns the parsed url parameters of the - * current request. Multiple values per key are supported, - * it will always return arrays of strings for the value parts. - */ -jQuery.getQueryParameters = function(s) { - if (typeof s == 'undefined') - s = document.location.search; - var parts = s.substr(s.indexOf('?') + 1).split('&'); - var result = {}; - for (var i = 0; i < parts.length; i++) { - var tmp = parts[i].split('=', 2); - var key = jQuery.urldecode(tmp[0]); - var value = jQuery.urldecode(tmp[1]); - if (key in result) - result[key].push(value); - else - result[key] = [value]; - } - return result; -}; - -/** - * highlight a given string on a jquery object by wrapping it in - * span elements with the given class name. - */ -jQuery.fn.highlightText = function(text, className) { - function highlight(node) { - if (node.nodeType == 3) { - var val = node.nodeValue; - var pos = val.toLowerCase().indexOf(text); - if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { - var span = document.createElement("span"); - span.className = className; - span.appendChild(document.createTextNode(val.substr(pos, text.length))); - node.parentNode.insertBefore(span, node.parentNode.insertBefore( - document.createTextNode(val.substr(pos + text.length)), - node.nextSibling)); - node.nodeValue = val.substr(0, pos); - } - } - else if (!jQuery(node).is("button, select, textarea")) { - jQuery.each(node.childNodes, function() { - highlight(this); - }); - } - } - return this.each(function() { - highlight(this); - }); -}; - -/* - * backward compatibility for jQuery.browser - * This will be supported until firefox bug is fixed. - */ -if (!jQuery.browser) { - jQuery.uaMatch = function(ua) { - ua = ua.toLowerCase(); - - var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || - /(webkit)[ \/]([\w.]+)/.exec(ua) || - /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || - /(msie) ([\w.]+)/.exec(ua) || - ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || - []; - - return { - browser: match[ 1 ] || "", - version: match[ 2 ] || "0" - }; - }; - jQuery.browser = {}; - jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; -} - -/** - * Small JavaScript module for the documentation. - */ -var Documentation = { - - init : function() { - this.fixFirefoxAnchorBug(); - this.highlightSearchWords(); - this.initIndexTable(); - - }, - - /** - * i18n support - */ - TRANSLATIONS : {}, - PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, - LOCALE : 'unknown', - - // gettext and ngettext don't access this so that the functions - // can safely bound to a different name (_ = Documentation.gettext) - gettext : function(string) { - var translated = Documentation.TRANSLATIONS[string]; - if (typeof translated == 'undefined') - return string; - return (typeof translated == 'string') ? translated : translated[0]; - }, - - ngettext : function(singular, plural, n) { - var translated = Documentation.TRANSLATIONS[singular]; - if (typeof translated == 'undefined') - return (n == 1) ? singular : plural; - return translated[Documentation.PLURALEXPR(n)]; - }, - - addTranslations : function(catalog) { - for (var key in catalog.messages) - this.TRANSLATIONS[key] = catalog.messages[key]; - this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); - this.LOCALE = catalog.locale; - }, - - /** - * add context elements like header anchor links - */ - addContextElements : function() { - $('div[id] > :header:first').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this headline')). - appendTo(this); - }); - $('dt[id]').each(function() { - $('\u00B6'). - attr('href', '#' + this.id). - attr('title', _('Permalink to this definition')). - appendTo(this); - }); - }, - - /** - * workaround a firefox stupidity - * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 - */ - fixFirefoxAnchorBug : function() { - if (document.location.hash) - window.setTimeout(function() { - document.location.href += ''; - }, 10); - }, - - /** - * highlight the search words provided in the url in the text - */ - highlightSearchWords : function() { - var params = $.getQueryParameters(); - var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; - if (terms.length) { - var body = $('div.body'); - if (!body.length) { - body = $('body'); - } - window.setTimeout(function() { - $.each(terms, function() { - body.highlightText(this.toLowerCase(), 'highlighted'); - }); - }, 10); - $('') - .appendTo($('#searchbox')); - } - }, - - /** - * init the domain index toggle buttons - */ - initIndexTable : function() { - var togglers = $('img.toggler').click(function() { - var src = $(this).attr('src'); - var idnum = $(this).attr('id').substr(7); - $('tr.cg-' + idnum).toggle(); - if (src.substr(-9) == 'minus.png') - $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); - else - $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); - }).css('display', ''); - if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { - togglers.click(); - } - }, - - /** - * helper function to hide the search marks again - */ - hideSearchWords : function() { - $('#searchbox .highlight-link').fadeOut(300); - $('span.highlighted').removeClass('highlighted'); - }, - - /** - * make the url absolute - */ - makeURL : function(relativeURL) { - return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; - }, - - /** - * get the current relative url - */ - getCurrentURL : function() { - var path = document.location.pathname; - var parts = path.split(/\//); - $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { - if (this == '..') - parts.pop(); - }); - var url = parts.join('/'); - return path.substring(url.lastIndexOf('/') + 1, path.length - 1); - }, - - initOnKeyListeners: function() { - $(document).keyup(function(event) { - var activeElementType = document.activeElement.tagName; - // don't navigate when in search box or textarea - if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { - switch (event.keyCode) { - case 37: // left - var prevHref = $('link[rel="prev"]').prop('href'); - if (prevHref) { - window.location.href = prevHref; - return false; - } - case 39: // right - var nextHref = $('link[rel="next"]').prop('href'); - if (nextHref) { - window.location.href = nextHref; - return false; - } - } - } - }); - } -}; - -// quick alias for translations -_ = Documentation.gettext; - -$(document).ready(function() { - Documentation.init(); -}); \ No newline at end of file diff --git a/documentation/_build/html/_static/down-pressed.png b/documentation/_build/html/_static/down-pressed.png deleted file mode 100644 index 7c30d004..00000000 Binary files a/documentation/_build/html/_static/down-pressed.png and /dev/null differ diff --git a/documentation/_build/html/_static/down.png b/documentation/_build/html/_static/down.png deleted file mode 100644 index f48098a4..00000000 Binary files a/documentation/_build/html/_static/down.png and /dev/null differ diff --git a/documentation/_build/html/_static/file.png b/documentation/_build/html/_static/file.png deleted file mode 100644 index 254c60bf..00000000 Binary files a/documentation/_build/html/_static/file.png and /dev/null differ diff --git a/documentation/_build/html/_static/fonts/Lato-Bold.ttf b/documentation/_build/html/_static/fonts/Lato-Bold.ttf deleted file mode 100644 index 59c48434..00000000 Binary files a/documentation/_build/html/_static/fonts/Lato-Bold.ttf and /dev/null differ diff --git a/documentation/_build/html/_static/fonts/Lato-Regular.ttf b/documentation/_build/html/_static/fonts/Lato-Regular.ttf deleted file mode 100644 index f01f5589..00000000 Binary files a/documentation/_build/html/_static/fonts/Lato-Regular.ttf and /dev/null differ diff --git a/documentation/_build/html/_static/fonts/fontawesome-webfont.svg b/documentation/_build/html/_static/fonts/fontawesome-webfont.svg deleted file mode 100644 index a9f84695..00000000 --- a/documentation/_build/html/_static/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,504 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/documentation/_build/html/_static/fonts/fontawesome-webfont.ttf b/documentation/_build/html/_static/fonts/fontawesome-webfont.ttf deleted file mode 100644 index 5ec37c4f..00000000 Binary files a/documentation/_build/html/_static/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/documentation/_build/html/_static/fonts/fontawesome-webfont.woff b/documentation/_build/html/_static/fonts/fontawesome-webfont.woff deleted file mode 100644 index 9eaecb37..00000000 Binary files a/documentation/_build/html/_static/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/documentation/_build/html/_static/jquery-1.11.1.js b/documentation/_build/html/_static/jquery-1.11.1.js deleted file mode 100644 index d4b67f7e..00000000 --- a/documentation/_build/html/_static/jquery-1.11.1.js +++ /dev/null @@ -1,10308 +0,0 @@ -/*! - * jQuery JavaScript Library v1.11.1 - * http://jquery.com/ - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * - * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-05-01T17:42Z - */ - -(function( global, factory ) { - - if ( typeof module === "object" && typeof module.exports === "object" ) { - // For CommonJS and CommonJS-like environments where a proper window is present, - // execute the factory and get jQuery - // For environments that do not inherently posses a window with a document - // (such as Node.js), expose a jQuery-making factory as module.exports - // This accentuates the need for the creation of a real window - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Can't do this because several apps including ASP.NET trace -// the stack via arguments.caller.callee and Firefox dies if -// you try to trace through "use strict" call chains. (#13335) -// Support: Firefox 18+ -// - -var deletedIds = []; - -var slice = deletedIds.slice; - -var concat = deletedIds.concat; - -var push = deletedIds.push; - -var indexOf = deletedIds.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var support = {}; - - - -var - version = "1.11.1", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }, - - // Support: Android<4.1, IE<9 - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }; - -jQuery.fn = jQuery.prototype = { - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // Start with an empty selector - selector: "", - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num != null ? - - // Return just the one element from the set - ( num < 0 ? this[ num + this.length ] : this[ num ] ) : - - // Return all the elements in a clean array - slice.call( this ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - ret.context = this.context; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: deletedIds.sort, - splice: deletedIds.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var src, copyIsArray, copy, name, options, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - isWindow: function( obj ) { - /* jshint eqeqeq: false */ - return obj != null && obj == obj.window; - }, - - isNumeric: function( obj ) { - // parseFloat NaNs numeric-cast false positives (null|true|false|"") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0; - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - isPlainObject: function( obj ) { - var key; - - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Support: IE<9 - // Handle iteration over inherited properties before own properties. - if ( support.ownLast ) { - for ( key in obj ) { - return hasOwn.call( obj, key ); - } - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call(obj) ] || "object" : - typeof obj; - }, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && jQuery.trim( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } - } - - return obj; - }, - - // Support: Android<4.1, IE<9 - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - var len; - - if ( arr ) { - if ( indexOf ) { - return indexOf.call( arr, elem, i ); - } - - len = arr.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in arr && arr[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - while ( j < len ) { - first[ i++ ] = second[ j++ ]; - } - - // Support: IE<9 - // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) - if ( len !== len ) { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, - i = 0, - length = elems.length, - isArray = isArraylike( elems ), - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var args, proxy, tmp; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: function() { - return +( new Date() ); - }, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -function isArraylike( obj ) { - var length = obj.length, - type = jQuery.type( obj ); - - if ( type === "function" || jQuery.isWindow( obj ) ) { - return false; - } - - if ( obj.nodeType === 1 && length ) { - return true; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v1.10.19 - * http://sizzlejs.com/ - * - * Copyright 2013 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-04-18 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + -(new Date()), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // General-purpose constants - strundefined = typeof undefined, - MAX_NEGATIVE = 1 << 31, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - - pseudos = ":(" + characterEncoding + ")(?:\\((" + - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - rescape = /'|\\/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }; - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } - - if ( documentIsHTML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document (jQuery #6963) - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // QSA path - if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - nid = old = expando; - newContext = context; - newSelector = nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return !!fn( div ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( div.parentNode ) { - div.parentNode.removeChild( div ); - } - // release memory in IE - div = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = attrs.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - ( ~b.sourceIndex || MAX_NEGATIVE ) - - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== strundefined && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, - doc = node ? node.ownerDocument || node : preferredDoc, - parent = doc.defaultView; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - - // Support tests - documentIsHTML = !isXML( doc ); - - // Support: IE>8 - // If iframe document is assigned to "document" variable and if iframe has been reloaded, - // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 - // IE6-8 do not support the defaultView property so parent will be undefined - if ( parent && parent !== parent.top ) { - // IE11 does not have attachEvent, so all must suffer - if ( parent.addEventListener ) { - parent.addEventListener( "unload", function() { - setDocument(); - }, false ); - } else if ( parent.attachEvent ) { - parent.attachEvent( "onunload", function() { - setDocument(); - }); - } - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) - support.attributes = assert(function( div ) { - div.className = "i"; - return !div.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Check if getElementsByClassName can be trusted - support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { - div.innerHTML = "
"; - - // Support: Safari<4 - // Catch class over-caching - div.firstChild.className = "i"; - // Support: Opera<10 - // Catch gEBCN failure to find non-leading classes - return div.getElementsByClassName("i").length === 2; - }); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( div ) { - docElem.appendChild( div ).id = expando; - return !doc.getElementsByName || !doc.getElementsByName( expando ).length; - }); - - // ID find and filter - if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [ m ] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - // Support: IE6/7 - // getElementById is not reliable as a find shortcut - delete Expr.find["ID"]; - - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var elem, - tmp = [], - i = 0, - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( div.querySelectorAll("[msallowclip^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = doc.createElement("input"); - input.setAttribute( "type", "hidden" ); - div.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( div.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully does not implement inclusive descendent - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { - return -1; - } - if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return doc; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[6] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), - // but not by others (comment: 8; processing instruction: 7; etc.) - // nodeType < 6 works because attributes (2) do not appear as children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( (tokens = []) ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (oldCache = outerCache[ dir ]) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); - } else { - // Reuse newcache so results back-propagate to previous elements - outerCache[ dir ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( - // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), - len = elems.length; - - if ( outermost ) { - outermostContext = context !== document && context; - } - - // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !match ) { - match = tokenize( selector ); - } - i = match.length; - while ( i-- ) { - cached = matcherFromTokens( match[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - - // Save selector and tokenization - cached.selector = selector; - } - return cached; -}; - -/** - * A low-level selection function that works with Sizzle's compiled - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile - * @param {Element} context - * @param {Array} [results] - * @param {Array} [seed] A set of elements to match against - */ -select = Sizzle.select = function( selector, context, results, seed ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); - - results = results || []; - - // Try to minimize operations if there is no seed and only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome<14 -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( div1 ) { - // Should return 1, but returns 4 (following) - return div1.compareDocumentPosition( document.createElement("div") ) & 1; -}); - -// Support: IE<8 -// Prevent attribute/property "interpolation" -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( div ) { - div.innerHTML = ""; - return div.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); - } - }); -} - -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( div ) { - div.innerHTML = ""; - div.firstChild.setAttribute( "value", "" ); - return div.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; - } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( div ) { - return div.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - null; - } - }); -} - -return Sizzle; - -})( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - - -var rneedsContext = jQuery.expr.match.needsContext; - -var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); - - - -var risSimple = /^.[^:#\[\.,]*$/; - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - /* jshint -W018 */ - return !!qualifier.call( elem, i, elem ) !== not; - }); - - } - - if ( qualifier.nodeType ) { - return jQuery.grep( elements, function( elem ) { - return ( elem === qualifier ) !== not; - }); - - } - - if ( typeof qualifier === "string" ) { - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - qualifier = jQuery.filter( qualifier, elements ); - } - - return jQuery.grep( elements, function( elem ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; - }); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 && elem.nodeType === 1 ? - jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : - jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - })); -}; - -jQuery.fn.extend({ - find: function( selector ) { - var i, - ret = [], - self = this, - len = self.length; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }) ); - } - - for ( i = 0; i < len; i++ ) { - jQuery.find( selector, self[ i ], ret ); - } - - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); - ret.selector = this.selector ? this.selector + " " + selector : selector; - return ret; - }, - filter: function( selector ) { - return this.pushStack( winnow(this, selector || [], false) ); - }, - not: function( selector ) { - return this.pushStack( winnow(this, selector || [], true) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -}); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -var rootjQuery, - - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - - // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, - - init = jQuery.fn.init = function( selector, context ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - - // scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[1], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { - for ( match in context ) { - // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return typeof rootjQuery.ready !== "undefined" ? - rootjQuery.ready( selector ) : - // Execute immediately if ready is not present - selector( jQuery ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -rootjQuery = jQuery( document ); - - -var rparentsprev = /^(?:parents|prev(?:Until|All))/, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.extend({ - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -jQuery.fn.extend({ - has: function( target ) { - var i, - targets = jQuery( target, this ), - len = targets.length; - - return this.filter(function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( ; i < l; i++ ) { - for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { - // Always skip document fragments - if ( cur.nodeType < 11 && (pos ? - pos.index(cur) > -1 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector(cur, selectors)) ) { - - matched.push( cur ); - break; - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.unique( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) - ); - } -}); - -function sibling( cur, dir ) { - do { - cur = cur[ dir ]; - } while ( cur && cur.nodeType !== 1 ); - - return cur; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - if ( this.length > 1 ) { - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - ret = jQuery.unique( ret ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - } - - return this.pushStack( ret ); - }; -}); -var rnotwhite = (/\S+/g); - - - -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache -function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - }); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : - jQuery.extend( {}, options ); - - var // Flag to know if list is currently firing - firing, - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list was already fired - fired, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // First callback to fire (used internally by add and fireWith) - firingStart, - // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], - // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; - } - } - firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { - list = []; - } else { - self.disable(); - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { - jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && type !== "string" ) { - // Inspect recursively - add( arg ); - } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } - } - }); - } - return this; - }, - // Check if a given callback is in the list. - // If no argument is given, return whether or not list has callbacks attached. - has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); - }, - // Remove all callbacks from the list - empty: function() { - list = []; - firingLength = 0; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( list && ( !fired || stack ) ) { - args = args || []; - args = [ context, args.slice ? args.slice() : args ]; - if ( firing ) { - stack.push( args ); - } else { - fire( args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!fired; - } - }; - - return self; -}; - - -jQuery.extend({ - - Deferred: function( func ) { - var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - deferred.done( arguments ).fail( arguments ); - return this; - }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); - } - }); - }); - fns = null; - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - deferred = {}; - - // Keep pipe for back-compat - promise.pipe = promise.then; - - // Add list-specific methods - jQuery.each( tuples, function( i, tuple ) { - var list = tuple[ 2 ], - stateString = tuple[ 3 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; - - // Handle state - if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); - return this; - }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { - return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( values === progressValues ) { - deferred.notifyWith( contexts, values ); - - } else if ( !(--remaining) ) { - deferred.resolveWith( contexts, values ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -}); - - -// The deferred used on DOM ready -var readyList; - -jQuery.fn.ready = function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; -}; - -jQuery.extend({ - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.triggerHandler ) { - jQuery( document ).triggerHandler( "ready" ); - jQuery( document ).off( "ready" ); - } - } -}); - -/** - * Clean-up method for dom ready events - */ -function detach() { - if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); - - } else { - document.detachEvent( "onreadystatechange", completed ); - window.detachEvent( "onload", completed ); - } -} - -/** - * The ready event handler and self cleanup method - */ -function completed() { - // readyState === "complete" is good enough for us to call the dom ready in oldIE - if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { - detach(); - jQuery.ready(); - } -} - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); - - // Standards-based browsers support DOMContentLoaded - } else if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); - - // If IE event model is used - } else { - // Ensure firing before onload, maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", completed ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", completed ); - - // If IE and not a frame - // continually check to see if the document is ready - var top = false; - - try { - top = window.frameElement == null && document.documentElement; - } catch(e) {} - - if ( top && top.doScroll ) { - (function doScrollCheck() { - if ( !jQuery.isReady ) { - - try { - // Use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - top.doScroll("left"); - } catch(e) { - return setTimeout( doScrollCheck, 50 ); - } - - // detach all dom ready events - detach(); - - // and execute any waiting functions - jQuery.ready(); - } - })(); - } - } - } - return readyList.promise( obj ); -}; - - -var strundefined = typeof undefined; - - - -// Support: IE<9 -// Iteration over object's inherited properties before its own -var i; -for ( i in jQuery( support ) ) { - break; -} -support.ownLast = i !== "0"; - -// Note: most support tests are defined in their respective modules. -// false until the test is run -support.inlineBlockNeedsLayout = false; - -// Execute ASAP in case we need to set body.style.zoom -jQuery(function() { - // Minified: var a,b,c,d - var val, div, body, container; - - body = document.getElementsByTagName( "body" )[ 0 ]; - if ( !body || !body.style ) { - // Return for frameset docs that don't have a body - return; - } - - // Setup - div = document.createElement( "div" ); - container = document.createElement( "div" ); - container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; - body.appendChild( container ).appendChild( div ); - - if ( typeof div.style.zoom !== strundefined ) { - // Support: IE<8 - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; - - support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; - if ( val ) { - // Prevent IE 6 from affecting layout for positioned elements #11048 - // Prevent IE from shrinking the body in IE 7 mode #12869 - // Support: IE<8 - body.style.zoom = 1; - } - } - - body.removeChild( container ); -}); - - - - -(function() { - var div = document.createElement( "div" ); - - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - } - - // Null elements to avoid leaks in IE. - div = null; -})(); - - -/** - * Determines whether an object can have data - */ -jQuery.acceptData = function( elem ) { - var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], - nodeType = +elem.nodeType || 1; - - // Do not set data on non-element DOM nodes because it will not be cleared (#8335). - return nodeType !== 1 && nodeType !== 9 ? - false : - - // Nodes accept data unless otherwise specified; rejection can be conditional - !noData || noData !== true && elem.getAttribute("classid") === noData; -}; - - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /([A-Z])/g; - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - var name; - for ( name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - -function internalData( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var ret, thisCache, - internalKey = jQuery.expando, - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - // Avoid exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( typeof name === "string" ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; -} - -function internalRemoveData( elem, name, pvt ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split(" "); - } - } - } else { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = name.concat( jQuery.map( name, jQuery.camelCase ) ); - } - - i = name.length; - while ( i-- ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject( cache[ id ] ) ) { - return; - } - } - - // Destroy the cache - if ( isNode ) { - jQuery.cleanData( [ elem ], true ); - - // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) - /* jshint eqeqeq: false */ - } else if ( support.deleteExpando || cache != cache.window ) { - /* jshint eqeqeq: true */ - delete cache[ id ]; - - // When all else fails, null - } else { - cache[ id ] = null; - } -} - -jQuery.extend({ - cache: {}, - - // The following elements (space-suffixed to avoid Object.prototype collisions) - // throw uncatchable exceptions if you attempt to set expando properties - noData: { - "applet ": true, - "embed ": true, - // ...but Flash objects (which have this classid) *can* handle expandos - "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data ) { - return internalData( elem, name, data ); - }, - - removeData: function( elem, name ) { - return internalRemoveData( elem, name ); - }, - - // For internal use only. - _data: function( elem, name, data ) { - return internalData( elem, name, data, true ); - }, - - _removeData: function( elem, name ) { - return internalRemoveData( elem, name, true ); - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var i, name, data, - elem = this[0], - attrs = elem && elem.attributes; - - // Special expections of .data basically thwart jQuery.access, - // so implement the relevant behavior ourselves - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE11+ - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice(5) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - return arguments.length > 1 ? - - // Sets one value - this.each(function() { - jQuery.data( this, key, value ); - }) : - - // Gets one value - // Try to fetch any internally stored data first - elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - - -jQuery.extend({ - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray(data) ) { - queue = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return jQuery._data( elem, key ) || jQuery._data( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - jQuery._removeData( elem, type + "queue" ); - jQuery._removeData( elem, key ); - }) - }); - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); - } - - return data === undefined ? - this : - this.each(function() { - var queue = jQuery.queue( this, type, data ); - - // ensure a hooks for this queue - jQuery._queueHooks( this, type ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, obj ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = jQuery._data( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -}); -var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; - -var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; - -var isHidden = function( elem, el ) { - // isHidden might be called from jQuery#filter function; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); - }; - - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - length = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < length; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[0], key ) : emptyGet; -}; -var rcheckableType = (/^(?:checkbox|radio)$/i); - - - -(function() { - // Minified: var a,b,c - var input = document.createElement( "input" ), - div = document.createElement( "div" ), - fragment = document.createDocumentFragment(); - - // Setup - div.innerHTML = "
a"; - - // IE strips leading whitespace when .innerHTML is used - support.leadingWhitespace = div.firstChild.nodeType === 3; - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - support.tbody = !div.getElementsByTagName( "tbody" ).length; - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - support.html5Clone = - document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav>"; - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - input.type = "checkbox"; - input.checked = true; - fragment.appendChild( input ); - support.appendChecked = input.checked; - - // Make sure textarea (and checkbox) defaultValue is properly cloned - // Support: IE6-IE11+ - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // #11217 - WebKit loses check when the name is after the checked attribute - fragment.appendChild( div ); - div.innerHTML = ""; - - // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 - // old WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE<9 - // Opera does not clone events (and typeof div.attachEvent === undefined). - // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() - support.noCloneEvent = true; - if ( div.attachEvent ) { - div.attachEvent( "onclick", function() { - support.noCloneEvent = false; - }); - - div.cloneNode( true ).click(); - } - - // Execute the test only if not already executed in another module. - if (support.deleteExpando == null) { - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - } -})(); - - -(function() { - var i, eventName, - div = document.createElement( "div" ); - - // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) - for ( i in { submit: true, change: true, focusin: true }) { - eventName = "on" + i; - - if ( !(support[ i + "Bubbles" ] = eventName in window) ) { - // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) - div.setAttribute( eventName, "t" ); - support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; - } - } - - // Null elements to avoid leaks in IE. - div = null; -})(); - - -var rformElems = /^(?:input|select|textarea)$/i, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - var tmp, events, t, handleObjIn, - special, eventHandle, handleObj, - handlers, type, namespaces, origType, - elemData = jQuery._data( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; - } - if ( !(eventHandle = elemData.handle) ) { - eventHandle = elemData.handle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - var j, handleObj, tmp, - origCount, t, events, - special, handlers, type, - namespaces, origType, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ); - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery._removeData( elem, "events" ); - } - }, - - trigger: function( event, data, elem, onlyHandlers ) { - var handle, ontype, cur, - bubbleType, special, tmp, i, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; - - cur = tmp = elem = elem || document; - - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf(":") < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && jQuery.acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && - jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - try { - elem[ type ](); - } catch ( e ) { - // IE<9 dies on focus/blur to hidden element (#1486,#12518) - // only reproducible on winXP IE8 native, not IE9 in IE8 mode - } - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); - - var i, ret, handleObj, matched, j, - handlerQueue = [], - args = slice.call( arguments ), - handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { - - // Triggered event must either 1) have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { - - event.handleObj = handleObj; - event.data = handleObj.data; - - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); - - if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var sel, handleObj, matches, i, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { - - /* jshint eqeqeq: false */ - for ( ; cur != this; cur = cur.parentNode || this ) { - /* jshint eqeqeq: true */ - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); - } - - return handlerQueue; - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, copy, - type = event.type, - originalEvent = event, - fixHook = this.fixHooks[ type ]; - - if ( !fixHook ) { - this.fixHooks[ type ] = fixHook = - rmouseEvent.test( type ) ? this.mouseHooks : - rkeyEvent.test( type ) ? this.keyHooks : - {}; - } - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: IE<9 - // Fix target property (#1925) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Support: Chrome 23+, Safari? - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Support: IE<9 - // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) - event.metaKey = !!event.metaKey; - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var body, eventDoc, doc, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - special: { - load: { - // Prevent triggered image.load events from bubbling to window.load - noBubble: true - }, - focus: { - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - try { - this.focus(); - return false; - } catch ( e ) { - // Support: IE<9 - // If we error on focus to hidden element (#1486, #12518), - // let .trigger() run the handlers - } - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, - click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - var name = "on" + type; - - if ( elem.detachEvent ) { - - // #8545, #7054, preventing memory leaks for custom events in IE6-8 - // detachEvent needed property on element, by name of that event, to properly expose it to GC - if ( typeof elem[ name ] === strundefined ) { - elem[ name ] = null; - } - - elem.detachEvent( name, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - // Support: IE < 9, Android < 4.0 - src.returnValue === false ? - returnTrue : - returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - if ( !e ) { - return; - } - - // If preventDefault exists, run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // Support: IE - // Otherwise set the returnValue property of the original event to false - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - if ( !e ) { - return; - } - // If stopPropagation exists, run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - - // Support: IE - // Set the cancelBubble property of the original event to true - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && e.stopImmediatePropagation ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout", - pointerenter: "pointerover", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // For mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !jQuery._data( form, "submitBubbles" ) ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submit_bubble = true; - }); - jQuery._data( form, "submitBubbles", true ); - } - }); - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - // If form was submitted by the user, bubble the event up the tree - if ( event._submit_bubble ) { - delete event._submit_bubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - } - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed && !event.isTrigger ) { - this._just_changed = false; - } - // Allow triggered, simulated change events (#11500) - jQuery.event.simulate( "change", this, event, true ); - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - jQuery._data( elem, "changeBubbles", true ); - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return !rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = jQuery._data( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = jQuery._data( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - jQuery._removeData( doc, fix ); - } else { - jQuery._data( doc, fix, attaches ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var type, origFn; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - var handleObj, type; - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } - } -}); - - -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + - "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", - rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, - rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rtbody = /\s*$/g, - - // We have to close these tags to support XHTML (#13200) - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
", "
" ], - area: [ 1, "", "" ], - param: [ 1, "", "" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - col: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, - // unless wrapped in a div with non-breaking characters in front of it. - _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] - }, - safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement("div") ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -function getAll( context, tag ) { - var elems, elem, - i = 0, - found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : - undefined; - - if ( !found ) { - for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { - if ( !tag || jQuery.nodeName( elem, tag ) ) { - found.push( elem ); - } else { - jQuery.merge( found, getAll( elem, tag ) ); - } - } - } - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], found ) : - found; -} - -// Used in buildFragment, fixes the defaultChecked property -function fixDefaultChecked( elem ) { - if ( rcheckableType.test( elem.type ) ) { - elem.defaultChecked = elem.checked; - } -} - -// Support: IE<8 -// Manipulating tables requires a tbody -function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? - - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : - elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - if ( match ) { - elem.type = match[1]; - } else { - elem.removeAttribute("type"); - } - return elem; -} - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var elem, - i = 0; - for ( ; (elem = elems[i]) != null; i++ ) { - jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); - } -} - -function cloneCopyEvent( src, dest ) { - - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function fixCloneNodeIssues( src, dest ) { - var nodeName, e, data; - - // We do not need to do anything for non-Elements - if ( dest.nodeType !== 1 ) { - return; - } - - nodeName = dest.nodeName.toLowerCase(); - - // IE6-8 copies events bound via attachEvent when using cloneNode. - if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { - data = jQuery._data( dest ); - - for ( e in data.events ) { - jQuery.removeEvent( dest, e, data.handle ); - } - - // Event data gets referenced instead of copied if the expando gets copied too - dest.removeAttribute( jQuery.expando ); - } - - // IE blanks contents when cloning scripts, and tries to evaluate newly-set text - if ( nodeName === "script" && dest.text !== src.text ) { - disableScript( dest ).text = src.text; - restoreScript( dest ); - - // IE6-10 improperly clones children of object elements using classid. - // IE10 throws NoModificationAllowedError if parent is null, #12132. - } else if ( nodeName === "object" ) { - if ( dest.parentNode ) { - dest.outerHTML = src.outerHTML; - } - - // This path appears unavoidable for IE9. When cloning an object - // element in IE9, the outerHTML strategy above is not sufficient. - // If the src has innerHTML and the destination does not, - // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { - dest.innerHTML = src.innerHTML; - } - - } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set - - dest.defaultChecked = dest.checked = src.checked; - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.defaultSelected = dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var destElements, node, clone, i, srcElements, - inPage = jQuery.contains( elem.ownerDocument, elem ); - - if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { - clone = elem.cloneNode( true ); - - // IE<=8 does not properly clone detached, unknown element nodes - } else { - fragmentDiv.innerHTML = elem.outerHTML; - fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); - } - - if ( (!support.noCloneEvent || !support.noCloneChecked) && - (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - // Fix all IE cloning issues - for ( i = 0; (node = srcElements[i]) != null; ++i ) { - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[i] ) { - fixCloneNodeIssues( node, destElements[i] ); - } - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0; (node = srcElements[i]) != null; i++ ) { - cloneCopyEvent( node, destElements[i] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - destElements = srcElements = node = null; - - // Return the cloned set - return clone; - }, - - buildFragment: function( elems, context, scripts, selection ) { - var j, elem, contains, - tmp, tag, tbody, wrap, - l = elems.length, - - // Ensure a safe fragment - safe = createSafeFragment( context ), - - nodes = [], - i = 0; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || safe.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - - tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; - - // Descend through wrappers to the right content - j = wrap[0]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Manually add leading whitespace removed by IE - if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { - nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); - } - - // Remove IE's autoinserted from table fragments - if ( !support.tbody ) { - - // String was a , *may* have spurious - elem = tag === "table" && !rtbody.test( elem ) ? - tmp.firstChild : - - // String was a bare or - wrap[1] === "
" && !rtbody.test( elem ) ? - tmp : - 0; - - j = elem && elem.childNodes.length; - while ( j-- ) { - if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { - elem.removeChild( tbody ); - } - } - } - - jQuery.merge( nodes, tmp.childNodes ); - - // Fix #12392 for WebKit and IE > 9 - tmp.textContent = ""; - - // Fix #12392 for oldIE - while ( tmp.firstChild ) { - tmp.removeChild( tmp.firstChild ); - } - - // Remember the top-level container for proper cleanup - tmp = safe.lastChild; - } - } - } - - // Fix #11356: Clear elements from fragment - if ( tmp ) { - safe.removeChild( tmp ); - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !support.appendChecked ) { - jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); - } - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( safe.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - tmp = null; - - return safe; - }, - - cleanData: function( elems, /* internal */ acceptData ) { - var elem, type, id, data, - i = 0, - internalKey = jQuery.expando, - cache = jQuery.cache, - deleteExpando = support.deleteExpando, - special = jQuery.event.special; - - for ( ; (elem = elems[i]) != null; i++ ) { - if ( acceptData || jQuery.acceptData( elem ) ) { - - id = elem[ internalKey ]; - data = id && cache[ id ]; - - if ( data ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Remove cache only if it was not already removed by jQuery.event.remove - if ( cache[ id ] ) { - - delete cache[ id ]; - - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( deleteExpando ) { - delete elem[ internalKey ]; - - } else if ( typeof elem.removeAttribute !== strundefined ) { - elem.removeAttribute( internalKey ); - - } else { - elem[ internalKey ] = null; - } - - deletedIds.push( id ); - } - } - } - } - } -}); - -jQuery.fn.extend({ - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); - }, null, value, arguments.length ); - }, - - append: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.appendChild( elem ); - } - }); - }, - - prepend: function() { - return this.domManip( arguments, function( elem ) { - if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { - var target = manipulationTarget( this, elem ); - target.insertBefore( elem, target.firstChild ); - } - }); - }, - - before: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - }); - }, - - after: function() { - return this.domManip( arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - }); - }, - - remove: function( selector, keepData /* Internal Use Only */ ) { - var elem, - elems = selector ? jQuery.filter( selector, this ) : this, - i = 0; - - for ( ; (elem = elems[i]) != null; i++ ) { - - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - - return this; - }, - - empty: function() { - var elem, - i = 0; - - for ( ; (elem = this[i]) != null; i++ ) { - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - - // If this is a select, ensure that it displays empty (#12336) - // Support: IE<9 - if ( elem.options && jQuery.nodeName( elem, "select" ) ) { - elem.options.length = 0; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map(function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined ) { - return elem.nodeType === 1 ? - elem.innerHTML.replace( rinlinejQuery, "" ) : - undefined; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - ( support.htmlSerialize || !rnoshimcache.test( value ) ) && - ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { - - value = value.replace( rxhtmlTag, "<$1>" ); - - try { - for (; i < l; i++ ) { - // Remove element nodes and prevent memory leaks - elem = this[i] || {}; - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch(e) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var arg = arguments[ 0 ]; - - // Make the changes, replacing each context element with the new content - this.domManip( arguments, function( elem ) { - arg = this.parentNode; - - jQuery.cleanData( getAll( this ) ); - - if ( arg ) { - arg.replaceChild( elem, this ); - } - }); - - // Force removal if there was no new content (e.g., from empty arguments) - return arg && (arg.length || arg.nodeType) ? this : this.remove(); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, callback ) { - - // Flatten any nested arrays - args = concat.apply( [], args ); - - var first, node, hasScripts, - scripts, doc, fragment, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[0], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[0] = value.call( this, index, self.html() ); - } - self.domManip( args, callback ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( this[i], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); - } - } - } - } - - // Fix #11809: Avoid leaking memory - fragment = first = null; - } - } - - return this; - } -}); - -jQuery.each({ - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - i = 0, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone(true); - jQuery( insert[i] )[ original ]( elems ); - - // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -}); - - -var iframe, - elemdisplay = {}; - -/** - * Retrieve the actual display of a element - * @param {String} name nodeName of the element - * @param {Object} doc Document object - */ -// Called only from within defaultDisplay -function actualDisplay( name, doc ) { - var style, - elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), - - // getDefaultComputedStyle might be reliably used only on attached element - display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? - - // Use of this method is a temporary fix (more like optmization) until something better comes along, - // since it was removed from specification and supported only in FF - style.display : jQuery.css( elem[ 0 ], "display" ); - - // We don't have any data stored on the element, - // so use "detach" method as fast way to get rid of the element - elem.detach(); - - return display; -} - -/** - * Try to determine the default display value of an element - * @param {String} nodeName - */ -function defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - - // Use the already-created iframe if possible - iframe = (iframe || jQuery( "