Take account of fixed placement in Bookshelf & Ispd 05 parser.
This commit is contained in:
parent
c8bcfdf174
commit
e364edca52
|
@ -1,15 +1,9 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Software.
|
||||
// Copyright (c) UPMC/LIP6 2010-2010, All Rights Reserved
|
||||
// Copyright (c) UPMC/LIP6 2010-2014, All Rights Reserved
|
||||
//
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// +-----------------------------------------------------------------+
|
||||
// | C O R I O L I S |
|
||||
// | ICCAD04 IBM Standard Cell Benchmarks |
|
||||
// | |
|
||||
|
@ -17,10 +11,7 @@
|
|||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./Iccad04Lefdef.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
// +-----------------------------------------------------------------+
|
||||
|
||||
|
||||
#include <cstdio>
|
||||
|
|
|
@ -111,6 +111,29 @@ namespace {
|
|||
}
|
||||
|
||||
|
||||
Transformation toTransformation ( Bookshelf::Node* node )
|
||||
{
|
||||
DbU::Unit x = DbU::fromLambda( node->getX ()*pitch );
|
||||
DbU::Unit y = DbU::fromLambda( node->getY ()*pitch );
|
||||
DbU::Unit width = DbU::fromLambda( node->getWidth ()*pitch );
|
||||
DbU::Unit height = DbU::fromLambda( node->getHeight()*pitch );
|
||||
|
||||
|
||||
switch (node->getOrientation()) {
|
||||
case Bookshelf::Orientation::Disabled:
|
||||
case Bookshelf::Orientation::N: return Transformation( x , y , Transformation::Orientation::ID );
|
||||
case Bookshelf::Orientation::W: return Transformation( x , y+width , Transformation::Orientation::R1 );
|
||||
case Bookshelf::Orientation::S: return Transformation( x+width , y+height, Transformation::Orientation::R2 );
|
||||
case Bookshelf::Orientation::E: return Transformation( x+height, y , Transformation::Orientation::R3 );
|
||||
case Bookshelf::Orientation::FN: return Transformation( x+width , y , Transformation::Orientation::MX );
|
||||
case Bookshelf::Orientation::FW: return Transformation( x+height, y+width , Transformation::Orientation::XR );
|
||||
case Bookshelf::Orientation::FS: return Transformation( x , y+height, Transformation::Orientation::MY );
|
||||
case Bookshelf::Orientation::FE: return Transformation( x+height, y+width , Transformation::Orientation::YR );
|
||||
}
|
||||
return Transformation();
|
||||
}
|
||||
|
||||
|
||||
} // End of anonymous namespace.
|
||||
|
||||
|
||||
|
@ -162,6 +185,9 @@ namespace CRL {
|
|||
}
|
||||
|
||||
Instance* instance = Instance::create( cell, node->getName(), master );
|
||||
instance->setTransformation( toTransformation(node) );
|
||||
if (node->isFixed())
|
||||
instance->setPlacementStatus( Instance::PlacementStatus::FIXED );
|
||||
|
||||
for ( auto ipin : node->getPins() ) {
|
||||
Name netName = ipin.second->getNet()->getName();
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Software.
|
||||
// Copyright (c) UPMC/LIP6 2010-2010, All Rights Reserved
|
||||
// Copyright (c) UPMC/LIP6 2010-2014, All Rights Reserved
|
||||
//
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// +-----------------------------------------------------------------+
|
||||
// | C O R I O L I S |
|
||||
// | C a d e n c e D E F I m p o r t e r |
|
||||
// | |
|
||||
|
@ -17,10 +11,7 @@
|
|||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./DefImport.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
// +-----------------------------------------------------------------+
|
||||
|
||||
|
||||
#include <cstdio>
|
||||
|
|
|
@ -2,14 +2,9 @@
|
|||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Software.
|
||||
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
|
||||
// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved
|
||||
//
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// +-----------------------------------------------------------------+
|
||||
// | C O R I O L I S |
|
||||
// | Alliance / Hurricane Interface |
|
||||
// | |
|
||||
|
@ -20,12 +15,7 @@
|
|||
// | E-mail : Damien.Dupuis@lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./DefParser.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// | * 2007-03-26 : To be compliant with LEFDEF 5.6 |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
// +-----------------------------------------------------------------+
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -300,8 +300,11 @@ namespace Etesian {
|
|||
getCell()->flattenNets( Cell::BuildRings );
|
||||
|
||||
// Coloquinte circuit description data-structures.
|
||||
size_t instancesNb = getCell()->getLeafInstanceOccurrences().getSize();
|
||||
vector<Transformation> idsToTransf ( instancesNb );
|
||||
|
||||
_circuit = new Coloquinte::circuit();
|
||||
_circuit->cells .resize( getCell()->getLeafInstanceOccurrences().getSize() );
|
||||
_circuit->cells .resize( instancesNb );
|
||||
_circuit->hypernets.resize( getCell()->getNets().getSize() );
|
||||
|
||||
cmess1 << " - Converting Instances (Bookshelf nodes)" << endl;
|
||||
|
@ -322,6 +325,7 @@ namespace Etesian {
|
|||
Coloquinte::circuit_coordinate cellSize ( masterCell->getAbutmentBox().getWidth () / DbU::fromLambda(5.0)
|
||||
, masterCell->getAbutmentBox().getHeight() / DbU::fromLambda(5.0) );
|
||||
_cellsToIds.insert( make_pair(instanceName,cellId) );
|
||||
idsToTransf[cellId] = (*ioccurrence).getPath().getTransformation();
|
||||
|
||||
dots.dot();
|
||||
//cerr << instanceName << " " << (int)instance->getPlacementStatus().getCode()
|
||||
|
@ -331,6 +335,8 @@ namespace Etesian {
|
|||
_circuit->cells[cellId].sizes = cellSize;
|
||||
_circuit->cells[cellId].area = cellSize.cast<Coloquinte::cell_area>().prod();
|
||||
_circuit->cells[cellId].movable = not instance->isFixed() and instance->isTerminal();
|
||||
if (not _circuit->cells[cellId].movable)
|
||||
cerr << "FIXED (movable=false):" << instance << endl;
|
||||
//_circuit->cells[cellId].movable = (instance->getPlacementStatus() == Instance::PlacementStatus::UNPLACED);
|
||||
|
||||
cellId++;
|
||||
|
@ -392,10 +398,15 @@ namespace Etesian {
|
|||
_circuit->position_overlays[0].y_pos = Coloquinte::circuit_vector( _cellsToIds.size() );
|
||||
|
||||
for ( auto ipair : _cellsToIds ) {
|
||||
Coloquinte::circuit_coordinate position = Coloquinte::circuit_coordinate::Zero();
|
||||
Coloquinte::circuit_coordinate position ( idsToTransf[ipair.second].getTx() / DbU::fromLambda(5.0)
|
||||
, idsToTransf[ipair.second].getTy() / DbU::fromLambda(5.0) );
|
||||
position += _circuit->cells[ipair.second].get_sizes() / 2;
|
||||
_circuit->position_overlays[0].x_pos[ipair.second] = position.x();
|
||||
_circuit->position_overlays[0].y_pos[ipair.second] = position.y();
|
||||
|
||||
if (not _circuit->cells[ipair.second].movable) {
|
||||
cerr << "Fixed cell @" << position.x() << "x" << position.y() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Temporarily force the circuit size.
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace Bookshelf {
|
|||
if ( (_width != 0.0) or (_height != 0.0) ) {
|
||||
o << " " << std::setw(10) << std::right << _width << " " << std::setw(10) << std::right << _height;
|
||||
}
|
||||
if ( _terminal ) o << " terminal";
|
||||
if ( flags & Terminal ) o << " terminal";
|
||||
if ( _symmetry != Symmetry::Disabled ) {
|
||||
o << " :";
|
||||
if ( _symmetry & Symmetry::R90 ) o << " R90";
|
||||
|
@ -83,6 +83,7 @@ namespace Bookshelf {
|
|||
if ( _orientation == Orientation::FS ) o << " FS";
|
||||
if ( _orientation == Orientation::FW ) o << " FW";
|
||||
}
|
||||
if ( flags & Fixed ) o << " /FIXED";
|
||||
o << std::endl;
|
||||
}
|
||||
}
|
||||
|
@ -100,9 +101,8 @@ namespace Bookshelf {
|
|||
if ( node->_symmetry & Symmetry::Y ) o << " Y";
|
||||
if ( node->_symmetry & Symmetry::R90 ) o << " R90";
|
||||
}
|
||||
if ( node->_terminal ) {
|
||||
o << " terminal";
|
||||
}
|
||||
if ( node->_flags & Node::Terminal ) o << " terminal";
|
||||
if ( node->_flags & Node::Fixed ) o << " /FIXED";
|
||||
|
||||
return o;
|
||||
}
|
||||
|
|
|
@ -533,6 +533,7 @@ namespace Bookshelf {
|
|||
{
|
||||
unsigned int orientation = Orientation::N;
|
||||
bool orientationToken = false;
|
||||
unsigned int flags = 0;
|
||||
double x = 0;
|
||||
double y = 0;
|
||||
|
||||
|
@ -544,6 +545,10 @@ namespace Bookshelf {
|
|||
for ( size_t itoken=1 ; itoken<_tokens.size() ; ++itoken ) {
|
||||
//std::cerr << "F:" << _tokens[itoken] << " ";
|
||||
if ( orientationToken ) {
|
||||
if (itoken+1 < _tokens.size()) {
|
||||
if ( _keywordCompare("/FIXED",_tokens[itoken+1]) == 0 ) flags |= Node::Fixed;
|
||||
}
|
||||
|
||||
if ( _keywordCompare("N" ,_tokens[itoken]) == 0 ) { orientation |= Orientation::N; continue; }
|
||||
if ( _keywordCompare("E" ,_tokens[itoken]) == 0 ) { orientation |= Orientation::E; continue; }
|
||||
if ( _keywordCompare("S" ,_tokens[itoken]) == 0 ) { orientation |= Orientation::S; continue; }
|
||||
|
@ -572,6 +577,7 @@ namespace Bookshelf {
|
|||
node->setX ( x );
|
||||
node->setY ( y );
|
||||
node->setOrientation ( orientation );
|
||||
node->setFlags ( flags );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -41,13 +41,16 @@ namespace Bookshelf {
|
|||
|
||||
|
||||
class Node {
|
||||
public:
|
||||
enum Flag { NoFlags=0x0000, Terminal=0x0001, Fixed=0x0002 };
|
||||
public:
|
||||
inline Node ( const std::string& name
|
||||
, double width =0.0
|
||||
, double height =0.0
|
||||
, unsigned int symmetry=Symmetry::Disabled
|
||||
, bool terminal=false );
|
||||
, unsigned int flags =NoFlags );
|
||||
inline bool isTerminal () const;
|
||||
inline bool isFixed () const;
|
||||
inline const std::string& getName () const;
|
||||
inline double getWidth () const;
|
||||
inline double getHeight () const;
|
||||
|
@ -58,6 +61,8 @@ namespace Bookshelf {
|
|||
Pin* getPin ( size_t id ) const;
|
||||
inline std::map<size_t,Pin*>& getPins ();
|
||||
void addPin ( Pin* );
|
||||
inline void setFlags ( unsigned int flags );
|
||||
inline void unsetFlags ( unsigned int flags );
|
||||
inline void setX ( double );
|
||||
inline void setY ( double );
|
||||
inline void setOrientation ( unsigned int );
|
||||
|
@ -71,7 +76,7 @@ namespace Bookshelf {
|
|||
double _x;
|
||||
double _y;
|
||||
unsigned int _orientation;
|
||||
bool _terminal;
|
||||
unsigned int _flags;
|
||||
std::map<size_t,Pin*> _pins;
|
||||
};
|
||||
|
||||
|
@ -80,7 +85,7 @@ namespace Bookshelf {
|
|||
, double width
|
||||
, double height
|
||||
, unsigned int symmetry
|
||||
, bool terminal
|
||||
, unsigned int flags
|
||||
)
|
||||
: _name (name)
|
||||
, _width (width)
|
||||
|
@ -89,7 +94,7 @@ namespace Bookshelf {
|
|||
, _x (0.0)
|
||||
, _y (0.0)
|
||||
, _orientation(Orientation::Disabled)
|
||||
, _terminal (terminal)
|
||||
, _flags (flags)
|
||||
{
|
||||
// std::cerr << "Node::Node() "
|
||||
// << (void*)this
|
||||
|
@ -102,7 +107,8 @@ namespace Bookshelf {
|
|||
// << ">." << std::endl;
|
||||
}
|
||||
|
||||
inline bool Node::isTerminal () const { return _terminal; }
|
||||
inline bool Node::isTerminal () const { return _flags&Terminal; }
|
||||
inline bool Node::isFixed () const { return _flags&Fixed; }
|
||||
inline const std::string& Node::getName () const { return _name; }
|
||||
inline double Node::getWidth () const { return _width; }
|
||||
inline double Node::getHeight () const { return _height; }
|
||||
|
@ -111,6 +117,8 @@ namespace Bookshelf {
|
|||
inline unsigned int Node::getSymmetry () const { return _symmetry; }
|
||||
inline unsigned int Node::getOrientation () const { return _orientation; }
|
||||
inline std::map<size_t,Pin*>& Node::getPins () { return _pins; }
|
||||
inline void Node::setFlags ( unsigned int flags ) { _flags |= flags; }
|
||||
inline void Node::unsetFlags ( unsigned int flags ) { _flags &= ~flags; }
|
||||
inline void Node::setX ( double x ) { _x=x; }
|
||||
inline void Node::setY ( double y ) { _y=y; }
|
||||
inline void Node::setOrientation ( unsigned int orient ) { _orientation=orient; }
|
||||
|
|
Loading…
Reference in New Issue