Clean policy of netlist (vst) and layout (ap) views recursive loading.

* Bug: In CRL::VstParserGrammar & VstParserScanner, when loading the
    instances models, we where loading both logical & physical views.
    This was causing cases of reentrency of the parser, with reset
    of the lexer static dictionary, leading to memory corruption.
      Now the identifiers are stored in the YaccState of each
    parsed cell and we only recursively call for the logical view.
* Change: In CRL::ApParser::_parseInstance(), recursively load the
    physical views as they are no longer loaded by the Vst parser.
* Change: In CRL::AllianceFramework::getCell(), sets the
    TerminalNetlist flag from the state (mode 'C' in CATAL) onto
    the cell.
* Change: In EtesianEngine::loadLeafcelllayouts(), new functions to
    load the layouts of the leaf cells if only the netlist has been
    loaded.
This commit is contained in:
Jean-Paul Chaput 2020-04-17 11:28:47 +02:00
parent 5a4d23f8fd
commit 010d9a3782
9 changed files with 323 additions and 312 deletions

View File

@ -380,7 +380,7 @@ namespace CRL {
if (state->getCell() == NULL) { if (state->getCell() == NULL) {
state->setCell ( Cell::create( _libraries[ _environment.getLIBRARIES().getIndex() ]->getLibrary() , name ) ); state->setCell ( Cell::create( _libraries[ _environment.getLIBRARIES().getIndex() ]->getLibrary() , name ) );
state->getCell ()->put( CatalogProperty::create(state) ); state->getCell ()->put( CatalogProperty::create(state) );
state->getCell ()->setTerminalNetlist( false ); state->getCell ()->setTerminalNetlist( state->isTerminalNetlist() );
createCell = true; createCell = true;
} }

View File

@ -646,20 +646,20 @@ namespace {
void ApParser::_parseInstance () void ApParser::_parseInstance ()
{ {
static DbU::Unit XINS, YINS; static DbU::Unit XINS, YINS;
static Name masterCellName; static Name masterCellName;
static Name instanceName; static Name instanceName;
static Name orientName; static Name orientName;
static Transformation::Orientation static Transformation::Orientation
orient = Transformation::Orientation::ID; orient = Transformation::Orientation::ID;
static Name NOSYM = "NOSYM"; static Name NOSYM = "NOSYM";
static Name SYM_X = "SYM_X"; static Name SYM_X = "SYM_X";
static Name SYM_Y = "SYM_Y"; static Name SYM_Y = "SYM_Y";
static Name SYMXY = "SYMXY"; static Name SYMXY = "SYMXY";
static Name ROT_P = "ROT_P"; static Name ROT_P = "ROT_P";
static Name ROT_M = "ROT_M"; static Name ROT_M = "ROT_M";
static Name SY_RM = "SY_RM"; static Name SY_RM = "SY_RM";
static Name SY_RP = "SY_RP"; static Name SY_RP = "SY_RP";
static string padreal = "padreal"; static string padreal = "padreal";
vector<char*> fields = _splitString ( _rawLine+2, ',' ); vector<char*> fields = _splitString ( _rawLine+2, ',' );
if ( fields.size() < 5 ) if ( fields.size() < 5 )
@ -680,18 +680,27 @@ namespace {
else if (orientName == "SYM_Y") orient = Transformation::Orientation::MY; else if (orientName == "SYM_Y") orient = Transformation::Orientation::MY;
else if (orientName == "SY_RP") orient = Transformation::Orientation::YR; else if (orientName == "SY_RP") orient = Transformation::Orientation::YR;
else else
_printError ( false, "Unknown orientation (%s).", getString(orientName).c_str() ); _printError( false, "Unknown orientation (%s).", getString(orientName).c_str() );
Instance* instance = _cell->getInstance ( instanceName ); Instance* instance = _cell->getInstance( instanceName );
if (instance) { if (instance) {
instance->setTransformation Cell* masterCell = instance->getMasterCell();
( getTransformation( instance->getMasterCell()->getAbutmentBox() bool hasLayout = not masterCell->getAbutmentBox().isEmpty();
, XINS if (not hasLayout) {
, YINS AllianceFramework::get()->getCell( getString(masterCell->getName()), Catalog::State::Physical );
, orient hasLayout = not masterCell->getAbutmentBox().isEmpty();
) }
);
instance->setPlacementStatus( Instance::PlacementStatus::FIXED ); if (hasLayout) {
instance->setTransformation
( getTransformation( masterCell->getAbutmentBox()
, XINS
, YINS
, orient
)
);
instance->setPlacementStatus( Instance::PlacementStatus::FIXED );
}
} else { } else {
bool ignoreInstance = _framework->isPad( _cell ); bool ignoreInstance = _framework->isPad( _cell );
Catalog::State* instanceState = _framework->getCatalog()->getState( masterCellName ); Catalog::State* instanceState = _framework->getCatalog()->getState( masterCellName );
@ -781,7 +790,6 @@ namespace {
_state = catalogProperty->getState (); _state = catalogProperty->getState ();
_state->setPhysical ( true ); _state->setPhysical ( true );
if ( _state->isTerminalNetlist() ) _cell->setTerminalNetlist ( true );
if ( _framework->isPad(_cell) ) _state->setPad ( true ); if ( _framework->isPad(_cell) ) _state->setPad ( true );
IoFile fileStream ( cellPath ); IoFile fileStream ( cellPath );

View File

@ -1,63 +1,33 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Project. // This file is part of the Coriolis Software.
// Copyright (C) Laboratoire LIP6 - Departement ASIM // Copyright (c) UPMC 2008-2020, All Rights Reserved
// Universite Pierre et Marie Curie
// //
// Main contributors : // +-----------------------------------------------------------------+
// Christophe Alexandre <Christophe.Alexandre@lip6.fr> // | C O R I O L I S |
// Sophie Belloeil <Sophie.Belloeil@lip6.fr> // | Alliance / Hurricane Interface |
// Hugo Clément <Hugo.Clement@lip6.fr> // | |
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr> // | Author : Jean-Paul CHAPUT |
// Damien Dupuis <Damien.Dupuis@lip6.fr> // | E-mail : Jean-Paul.Chaput@lip6.fr |
// Christian Masson <Christian.Masson@lip6.fr> // | =============================================================== |
// Marek Sroka <Marek.Sroka@lip6.fr> // | C++ Header : "./alliance/vst/Vst.h" |
// // +-----------------------------------------------------------------+
// The Coriolis Project is free software; you can redistribute it
// and/or modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version.
//
// The Coriolis Project is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with the Coriolis Project; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
// License-Tag
// Authors-Tag
// ===================================================================
#pragma once
# include <string> #include <string>
namespace Hurricane { namespace Hurricane {
class Cell; class Cell;
} }
#ifndef __VST_H__
#define __VST_H__
namespace CRL { namespace CRL {
using namespace std;
using namespace Hurricane;
// ------------------------------------------------------------------- void vstParser ( const std::string cellPath, Hurricane::Cell* );
// functions. void vstDriver ( const std::string cellPath, Hurricane::Cell* , unsigned int& saveState);
void vstParser ( const string cellPath, Cell* cell );
void vstDriver ( const string cellPath, Cell* cell, unsigned int& saveState);
} }
# endif

View File

@ -0,0 +1,172 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC 2020-2020, 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 |
// | =============================================================== |
// | C++ Header : "./alliance/vst/VstParser.h" |
// +-----------------------------------------------------------------+
#pragma once
#include <string>
#include <vector>
#include <map>
#include <hurricane/Name.h>
#include <hurricane/Entity.h>
namespace Hurricane {
class Net;
class Cell;
class Instance;
}
#include <crlcore/Catalog.h>
namespace Vst {
extern void incVhdLineNumber ();
enum TokenConstants { VhdlTo = 1
, VhdlDownto = 2
, VhdlPlus = 3
, VhdlMinus = 4
, VhdlBus = 5
};
class Constraint {
public:
inline Constraint ();
public:
inline int getFrom () const;
inline int getTo () const;
inline bool IsSet () const;
inline void Set ( int from, unsigned int direction, int to );
inline void UnSet () { _set = false; }
inline void Init ( int& index );
inline void Next ( int& index );
inline bool End ( int index );
private:
int _from;
int _to;
bool _set;
};
inline Constraint::Constraint ()
: _from(0), _to(0), _set(false)
{ }
inline int Constraint::getFrom () const { return _from; }
inline int Constraint::getTo () const { return _to; }
inline bool Constraint::IsSet () const { return _set; }
inline void Constraint::Init ( int& index ) { index = _from; };
inline void Constraint::Set ( int from, unsigned int direction, int to )
{ _set = true; _from = from; _to = to; }
inline void Constraint::Next ( int& index )
{ (_from < _to) ? index++ : index--; }
inline bool Constraint::End ( int index )
{
if ( _from < _to ) return index <= _to;
return index >= _to;
}
typedef std::vector<Hurricane::Net*> PinVector;
typedef std::map<Hurricane::Name,PinVector> VectorMap;
typedef std::map<Hurricane::Cell*,VectorMap,Hurricane::Entity::CompareById> CellVectorMap;
class YaccState {
public:
std::string _vhdFileName;
int _vhdLineNumber;
int _errorCount;
int _maxErrors;
std::vector<std::string*> _lexIdentifiers;
std::deque<Hurricane::Name> _cellQueue;
CRL::Catalog::State* _state;
Hurricane::Cell* _cell;
Hurricane::Cell* _masterCell;
Hurricane::Instance* _instance;
Constraint _constraint;
std::vector<std::string*> _identifiersList;
CellVectorMap _cellVectorMap;
PinVector _instanceNets;
PinVector _masterNets;
bool _masterPort;
bool _firstPass;
bool _behavioral;
bool _ieeeVhdl;
bool _ieeeWarned;
public:
inline YaccState ( const std::string& vhdFileName );
inline ~YaccState ();
inline bool pushCell ( Hurricane::Name );
inline std::string* addLexIdentifier ( const char* );
};
YaccState::YaccState ( const std::string& vhdFileName )
: _vhdFileName (vhdFileName)
, _vhdLineNumber (1)
, _errorCount (0)
, _maxErrors (10)
, _lexIdentifiers ()
, _cellQueue ()
, _state (NULL)
, _cell (NULL)
, _masterCell (NULL)
, _instance (NULL)
, _constraint ()
, _identifiersList()
, _cellVectorMap ()
, _instanceNets ()
, _masterNets ()
, _masterPort (true)
, _firstPass (true)
, _behavioral (false)
, _ieeeVhdl (false)
, _ieeeWarned (false)
{ }
inline YaccState::~YaccState ()
{ for ( std::string* s : _lexIdentifiers ) delete s; }
inline bool YaccState::pushCell ( Hurricane::Name cellName )
{
for ( size_t i=0 ; i<_cellQueue.size(); ++i ) {
if (_cellQueue[i] == cellName) return false;
}
_cellQueue.push_back( cellName );
return true;
}
inline std::string* YaccState::addLexIdentifier ( const char* identifier )
{
_lexIdentifiers.push_back( new std::string(identifier) );
return _lexIdentifiers.back();
}
class YaccStateStack : public std::vector<YaccState*> {
public:
inline YaccState* operator->() { return back(); };
inline void pop_back () { delete back (); std::vector<YaccState*>::pop_back (); }
};
extern YaccStateStack states;
} // Vst namespace.

View File

@ -40,6 +40,7 @@ using namespace Hurricane;
#include "crlcore/AllianceFramework.h" #include "crlcore/AllianceFramework.h"
#include "crlcore/NetExtension.h" #include "crlcore/NetExtension.h"
#include "Vst.h" #include "Vst.h"
#include "VstParser.h"
using namespace CRL; using namespace CRL;
@ -48,6 +49,7 @@ using namespace CRL;
#define yytext VSTtext #define yytext VSTtext
#define yywrap VSTwrap #define yywrap VSTwrap
#define yyin VSTin #define yyin VSTin
#define YYDEBUG 0
extern int yylex (); extern int yylex ();
@ -65,137 +67,15 @@ namespace {
namespace Vst { namespace Vst {
extern void incVhdLineNumber ();
extern void ClearIdentifiers ();
void checkForIeee ( bool ieeeEnabled );
enum TokenConstants { VhdlTo = 1
, VhdlDownto = 2
, VhdlPlus = 3
, VhdlMinus = 4
, VhdlBus = 5
};
class Constraint {
private:
int _from;
int _to;
bool _set;
public:
Constraint () : _from(0), _to(0), _set(false) { };
public:
int getFrom () const { return _from; }
int getTo () const { return _to; }
bool IsSet () const { return _set; }
void Set ( int from, unsigned int direction, int to );
void UnSet () { _set = false; }
void Init ( int& index ) { index = _from; };
void Next ( int& index );
bool End ( int index );
};
void Constraint::Set ( int from, unsigned int direction, int to )
{
_set = true;
_from = from;
_to = to;
}
void Constraint::Next ( int& index )
{
if ( _from < _to ) index++;
else index--;
}
bool Constraint::End ( int index )
{
if ( _from < _to ) return index <= _to;
return index >= _to;
}
typedef vector<Net*> PinVector;
typedef map<Name,PinVector> VectorMap;
typedef map<Cell*,VectorMap,Entity::CompareById> CellVectorMap;
class YaccState {
public:
string _vhdFileName;
int _vhdLineNumber;
int _errorCount;
int _maxErrors;
deque<Name> _cellQueue;
Catalog::State* _state;
Cell* _cell;
Cell* _masterCell;
Instance* _instance;
Constraint _constraint;
vector<string*> _identifiersList;
CellVectorMap _cellVectorMap;
PinVector _instanceNets;
PinVector _masterNets;
bool _masterPort;
bool _firstPass;
bool _behavioral;
bool _ieeeVhdl;
bool _ieeeWarned;
public:
YaccState ( const string& vhdFileName )
: _vhdFileName (vhdFileName)
, _vhdLineNumber (1)
, _errorCount (0)
, _maxErrors (10)
, _cellQueue ()
, _state (NULL)
, _cell (NULL)
, _masterCell (NULL)
, _instance (NULL)
, _constraint ()
, _identifiersList()
, _cellVectorMap ()
, _instanceNets ()
, _masterNets ()
, _masterPort (true)
, _firstPass (true)
, _behavioral (false)
, _ieeeVhdl (false)
, _ieeeWarned (false)
{ }
bool pushCell ( Name );
};
bool YaccState::pushCell ( Name cellName )
{
for ( size_t i=0 ; i<_cellQueue.size(); ++i ) {
if (_cellQueue[i] == cellName) return false;
}
_cellQueue.push_back( cellName );
return true;
}
class YaccStateStack : public vector<YaccState*> {
public:
YaccState* operator->() { return back(); };
void pop_back () { delete back (); vector<YaccState*>::pop_back (); }
};
YaccStateStack states; YaccStateStack states;
AllianceFramework* framework; AllianceFramework* framework;
void Error ( int code, const string& name ); void checkForIeee ( bool ieeeEnabled );
Net* getNet ( Cell* cell, const string& name ); void Error ( int code, const string& name );
void SetNetType ( Net* net ); Net* getNet ( Cell* cell, const string& name );
void SetNetType ( Net* net );
} // Vst namespace. } // Vst namespace.
@ -681,10 +561,11 @@ component_declaration
: COMPONENT : COMPONENT
Identifier Identifier
{ if (Vst::states->_firstPass) { { if (Vst::states->_firstPass) {
if (not Vst::framework->getCell(*$2,Catalog::State::Views|Catalog::State::InMemory)) if (not Vst::framework->getCell(*$2,Catalog::State::Logical|Catalog::State::InMemory))
Vst::states->pushCell( *$2 ); Vst::states->pushCell( *$2 );
} else { } else {
Vst::states->_masterCell = Vst::framework->getCell ( *$2, Catalog::State::Views ); Vst::states->_masterCell = Vst::framework->getCell ( *$2, Catalog::State::Logical );
cerr.flush();
} }
} }
.generic_clause. .generic_clause.
@ -775,7 +656,7 @@ component_instantiation_statement
: a_label : a_label
simple_name simple_name
{ if (not Vst::states->_firstPass) { { if (not Vst::states->_firstPass) {
Vst::states->_masterCell = Vst::framework->getCell( *$2, Catalog::State::Views|Catalog::State::InMemory ); Vst::states->_masterCell = Vst::framework->getCell( *$2, Catalog::State::Logical|Catalog::State::InMemory );
if (not Vst::states->_masterCell) { if (not Vst::states->_masterCell) {
ostringstream message; ostringstream message;
message << "CParsVst() VHDL Parser - File:<" << Vst::states->_vhdFileName message << "CParsVst() VHDL Parser - File:<" << Vst::states->_vhdFileName
@ -787,7 +668,7 @@ component_instantiation_statement
Vst::states->_instance = Instance::create( Vst::states->_cell, *$1, Vst::states->_masterCell ); Vst::states->_instance = Instance::create( Vst::states->_cell, *$1, Vst::states->_masterCell );
Vst::states->_cell->setTerminalNetlist( false ); Vst::states->_cell->setTerminalNetlist( false );
} else { } else {
if (not Vst::framework->getCell(*$2,Catalog::State::Views|Catalog::State::InMemory)) { if (not Vst::framework->getCell(*$2,Catalog::State::Logical|Catalog::State::InMemory)) {
if (Vst::states->pushCell(*$2)) { if (Vst::states->pushCell(*$2)) {
ostringstream message; ostringstream message;
message << "CParsVst() VHDL Parser - File:<" << Vst::states->_vhdFileName message << "CParsVst() VHDL Parser - File:<" << Vst::states->_vhdFileName
@ -1218,7 +1099,7 @@ namespace {
ostringstream formatted; ostringstream formatted;
formatted << "CParsVst() - VHDL Parser, File:<" << Vst::states->_vhdFileName formatted << "CParsVst() - VHDL Parser, File:<" << Vst::states->_vhdFileName
<< ">, Line:" << Vst::states->_vhdLineNumber << "\n " << ">, Line:" << Vst::states->_vhdLineNumber << "\n "
<< message << " before " << yytext << ".\n"; << message << " before keyword or identifier \"" << yytext << "\".\n";
throw Hurricane::Error( formatted.str() ); throw Hurricane::Error( formatted.str() );
return 0; return 0;
} }
@ -1231,7 +1112,7 @@ namespace Vst {
void incVhdLineNumber () void incVhdLineNumber ()
{ ++states->_vhdLineNumber; } { ++(states->_vhdLineNumber); }
// --------------------------------------------------------------- // ---------------------------------------------------------------
@ -1397,12 +1278,13 @@ void vstParser ( const string cellPath, Cell *cell )
// 1.0 step: Build the ordered list of model (Cell) required by the instances. // 1.0 step: Build the ordered list of model (Cell) required by the instances.
yyin = ccell.getFile (); yyin = ccell.getFile ();
if ( !firstCall ) yyrestart ( VSTin ); if ( !firstCall ) yyrestart ( VSTin );
//yydebug = 0;
yyparse (); yyparse ();
// 1.5 step: Load, in order, the model Cells (recursive). // 1.5 step: Load, in order, the model Cells (recursive).
while ( !Vst::states->_cellQueue.empty() ) { while ( !Vst::states->_cellQueue.empty() ) {
if ( !Vst::framework->getCell ( getString(Vst::states->_cellQueue.front()) if ( !Vst::framework->getCell ( getString(Vst::states->_cellQueue.front())
, Catalog::State::Views , Catalog::State::Logical
, Vst::states->_state->getDepth()-1) ) { , Vst::states->_state->getDepth()-1) ) {
throw Error ( "CParsVst() VHDL Parser:\n" throw Error ( "CParsVst() VHDL Parser:\n"
" Unable to find cell \"%s\", please check your <./coriolis2/settings.py>.\n" " Unable to find cell \"%s\", please check your <./coriolis2/settings.py>.\n"
@ -1426,7 +1308,6 @@ void vstParser ( const string cellPath, Cell *cell )
UpdateSession::open (); UpdateSession::open ();
yyparse (); yyparse ();
UpdateSession::close (); UpdateSession::close ();
Vst::ClearIdentifiers ();
Vst::states.pop_back(); Vst::states.pop_back();
ccell.close (); ccell.close ();

View File

@ -23,25 +23,17 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
# include <string.h> #include <string.h>
# include <iostream> #include <iostream>
# include <string> #include <string>
# include <vector> #include <vector>
# include <map> #include <map>
using namespace std; using namespace std;
# include "VstParserGrammar.hpp" #include "VstParser.h"
#include "VstParserGrammar.hpp"
namespace Vst {
extern void ClearIdentifiers ();
extern void incVhdLineNumber ();
}
namespace { namespace {
@ -175,29 +167,7 @@ namespace {
} }
class Identifiers : public vector<string*> {
public:
~Identifiers ();
void clear ();
};
Identifiers::~Identifiers () {
for ( unsigned int i=0 ; i < size() ; i++ )
delete (*this)[i];
}
void Identifiers::clear () {
for ( unsigned int i=0 ; i < size() ; i++ )
delete (*this)[i];
vector<string*>::clear ();
}
VHDLKeywords vhdlKeywords; VHDLKeywords vhdlKeywords;
Identifiers identifiers;
char* lower ( char* str ); char* lower ( char* str );
@ -259,37 +229,29 @@ base_specifier (B|b|O|o|X|x)
\/ { return Slash; } \/ { return Slash; }
{letter}(_?{letter_or_digit})* { {letter}(_?{letter_or_digit})* {
VHDLKeywords::iterator it = vhdlKeywords.find ( lower(yytext) ); VHDLKeywords::iterator it = vhdlKeywords.find( lower(yytext) );
if (it != vhdlKeywords.end()) { return it->second; }
if ( it != vhdlKeywords.end() ) { return it->second; } VSTlval._text = Vst::states->addLexIdentifier( yytext );
VSTlval._text = new string ( yytext );
identifiers.push_back ( VSTlval._text );
return Identifier; return Identifier;
} }
({decimal_literal})|({base}#{based_integer}(\.{based_integer})?#({exponent})?)|({base}:{based_integer}(\.{based_integer})?:({exponent})?) { ({decimal_literal})|({base}#{based_integer}(\.{based_integer})?#({exponent})?)|({base}:{based_integer}(\.{based_integer})?:({exponent})?) {
VSTlval._text = new string ( yytext ); VSTlval._text = Vst::states->addLexIdentifier( yytext );
identifiers.push_back ( VSTlval._text );
return AbstractLit; return AbstractLit;
} }
'({graphic_character}|\"|\%)' { '({graphic_character}|\"|\%)' {
VSTlval._text = new string ( yytext ); VSTlval._text = Vst::states->addLexIdentifier( yytext );
identifiers.push_back ( VSTlval._text );
return CharacterLit; return CharacterLit;
} }
(\"({graphic_character}|(\"\")|\%)*\")|(\%({graphic_character}|(\%\%)|\")*\%) { (\"({graphic_character}|(\"\")|\%)*\")|(\%({graphic_character}|(\%\%)|\")*\%) {
VSTlval._text = new string ( yytext ); VSTlval._text = Vst::states->addLexIdentifier( yytext );
identifiers.push_back ( VSTlval._text );
return StringLit; return StringLit;
} }
{base_specifier}(\"{extended_digit}(_?{extended_digit})*\"|\%{extended_digit}(_?{extended_digit})*\%) { {base_specifier}(\"{extended_digit}(_?{extended_digit})*\"|\%{extended_digit}(_?{extended_digit})*\%) {
VSTlval._text = new string ( yytext ); VSTlval._text = Vst::states->addLexIdentifier( yytext );
identifiers.push_back ( VSTlval._text );
return BitStringLit; return BitStringLit;
} }
@ -304,16 +266,6 @@ base_specifier (B|b|O|o|X|x)
int yywrap () { return 1; } int yywrap () { return 1; }
namespace Vst {
void ClearIdentifiers ()
{ identifiers.clear (); }
} // Vst namespace.
namespace { namespace {

View File

@ -311,6 +311,8 @@ namespace Etesian {
} }
} }
_sliceHeight = getCellGauge()->getSliceHeight(); _sliceHeight = getCellGauge()->getSliceHeight();
loadLeafCellLayouts();
} }
@ -383,6 +385,12 @@ namespace Etesian {
instanceNb += 1; instanceNb += 1;
} }
if (cellLength == 0) {
throw Error( "EtesianEngine::setDefaultAb(): Null surface area computed for \"%s\" (are physical views loaded?)."
, getString(getCell()->getName()).c_str()
);
}
if (cellLength < 0) if (cellLength < 0)
throw Error( "EtesianEngine::setDefaultAb(): Negative surface area computed for \"%s\" (bad bloat profile?)." throw Error( "EtesianEngine::setDefaultAb(): Negative surface area computed for \"%s\" (bad bloat profile?)."
, getString(getCell()->getName()).c_str() , getString(getCell()->getName()).c_str()
@ -393,6 +401,12 @@ namespace Etesian {
double gcellLength = cellLength*(1.0+spaceMargin) / DbU::toLambda( getSliceHeight() ); double gcellLength = cellLength*(1.0+spaceMargin) / DbU::toLambda( getSliceHeight() );
if (gcellLength == 0.0) {
throw Error( "EtesianEngine::setDefaultAb(): Null g-length for \"%s\" (are you using the right gauge?)."
, getString(getCell()->getName()).c_str()
);
}
double rows = 0.0; double rows = 0.0;
//setFixedAbHeight( 0 ); //setFixedAbHeight( 0 );
if (getFixedAbHeight()) rows = getFixedAbHeight() / getSliceHeight(); if (getFixedAbHeight()) rows = getFixedAbHeight() / getSliceHeight();
@ -458,8 +472,8 @@ namespace Etesian {
} else { } else {
bool isFullyPlaced = true; bool isFullyPlaced = true;
for ( Instance* subInstance : masterCell->getInstances() ) { for ( Instance* subInstance : masterCell->getInstances() ) {
if ( (instance->getPlacementStatus() != Instance::PlacementStatus::PLACED) if ( (subInstance->getPlacementStatus() != Instance::PlacementStatus::PLACED)
and (instance->getPlacementStatus() != Instance::PlacementStatus::FIXED ) ) { and (subInstance->getPlacementStatus() != Instance::PlacementStatus::FIXED ) ) {
isFullyPlaced = false; isFullyPlaced = false;
break; break;
} }
@ -965,6 +979,18 @@ namespace Etesian {
} }
void EtesianEngine::loadLeafCellLayouts ()
{
AllianceFramework* af = AllianceFramework::get();
for ( Occurrence occurrence : getCell()->getTerminalNetlistInstanceOccurrences(getBlockInstance()) ) {
Instance* instance = static_cast<Instance*>(occurrence.getEntity());
Cell* masterCell = instance->getMasterCell();
af->getCell( getString(masterCell->getName()), Catalog::State::Physical );
}
}
void EtesianEngine::place () void EtesianEngine::place ()
{ {
if (getBlockCell()->isPlaced()) { if (getBlockCell()->isPlaced()) {

View File

@ -56,48 +56,49 @@ namespace Etesian {
public: public:
typedef ToolEngine Super; typedef ToolEngine Super;
public: public:
static const Name& staticGetName (); static const Name& staticGetName ();
static EtesianEngine* create ( Cell* ); static EtesianEngine* create ( Cell* );
static EtesianEngine* get ( const Cell* ); static EtesianEngine* get ( const Cell* );
public: public:
virtual Configuration* getConfiguration (); virtual Configuration* getConfiguration ();
virtual const Configuration* getConfiguration () const; virtual const Configuration* getConfiguration () const;
virtual const Name& getName () const; virtual const Name& getName () const;
inline RoutingGauge* getGauge () const; inline RoutingGauge* getGauge () const;
inline CellGauge* getCellGauge () const; inline CellGauge* getCellGauge () const;
inline DbU::Unit getHorizontalPitch () const; inline DbU::Unit getHorizontalPitch () const;
inline DbU::Unit getVerticalPitch () const; inline DbU::Unit getVerticalPitch () const;
inline DbU::Unit getSliceHeight () const; inline DbU::Unit getSliceHeight () const;
inline DbU::Unit getSliceStep () const; inline DbU::Unit getSliceStep () const;
inline DbU::Unit getFixedAbHeight () const; inline DbU::Unit getFixedAbHeight () const;
inline Effort getPlaceEffort () const; inline Effort getPlaceEffort () const;
inline GraphicUpdate getUpdateConf () const; inline GraphicUpdate getUpdateConf () const;
inline Density getSpreadingConf () const; inline Density getSpreadingConf () const;
inline double getSpaceMargin () const; inline double getSpaceMargin () const;
inline double getAspectRatio () const; inline double getAspectRatio () const;
inline const FeedCells& getFeedCells () const; inline const FeedCells& getFeedCells () const;
inline Hurricane::CellViewer* getViewer () const; inline Hurricane::CellViewer* getViewer () const;
inline void setViewer ( Hurricane::CellViewer* ); inline void setViewer ( Hurricane::CellViewer* );
inline Cell* getBlockCell () const; inline Cell* getBlockCell () const;
inline Instance* getBlockInstance () const; inline Instance* getBlockInstance () const;
inline void setBlock ( Instance* ); inline void setBlock ( Instance* );
inline void setFixedAbHeight ( DbU::Unit ); inline void setFixedAbHeight ( DbU::Unit );
void setDefaultAb (); void setDefaultAb ();
void adjustSliceHeight (); void adjustSliceHeight ();
void resetPlacement (); void resetPlacement ();
void toColoquinte (); void loadLeafCellLayouts ();
void preplace (); void toColoquinte ();
void roughLegalize ( float minDisruption, unsigned options ); void preplace ();
void globalPlace ( float initPenalty, float minDisruption, float targetImprovement, float minInc, float maxInc, unsigned options=0 ); void roughLegalize ( float minDisruption, unsigned options );
void detailedPlace ( int iterations, int effort, unsigned options=0 ); void globalPlace ( float initPenalty, float minDisruption, float targetImprovement, float minInc, float maxInc, unsigned options=0 );
void place (); void detailedPlace ( int iterations, int effort, unsigned options=0 );
inline void useFeed ( Cell* ); void place ();
size_t findYSpin (); inline void useFeed ( Cell* );
void addFeeds (); size_t findYSpin ();
inline void selectBloat ( std::string ); void addFeeds ();
virtual Record* _getRecord () const; inline void selectBloat ( std::string );
virtual std::string _getString () const; virtual Record* _getRecord () const;
virtual std::string _getTypeName () const; virtual std::string _getString () const;
virtual std::string _getTypeName () const;
private: private:
// Attributes. // Attributes.
static Name _toolName; static Name _toolName;

View File

@ -153,6 +153,7 @@ namespace Katana {
using Hurricane::Cell; using Hurricane::Cell;
using Hurricane::Instance; using Hurricane::Instance;
using CRL::System; using CRL::System;
using CRL::Catalog;
using CRL::AllianceFramework; using CRL::AllianceFramework;
using CRL::addMeasure; using CRL::addMeasure;
using CRL::Measures; using CRL::Measures;
@ -203,10 +204,10 @@ namespace Katana {
void KatanaEngine::_postCreate () void KatanaEngine::_postCreate ()
{ {
Super::_postCreate (); Super::_postCreate();
// Flute: load POWV9.dat & POST9.dat // Flute: load POWV9.dat & POST9.dat
Flute::readLUT( System::getPath("coriolis_top").toString() ); Flute::readLUT( System::getPath( "coriolis_top" ).toString() );
} }