towards a first functionnal run

This commit is contained in:
The Coriolis Project 2008-03-10 18:07:35 +00:00
parent be5efacffd
commit 751425c2d1
12 changed files with 107 additions and 117 deletions

View File

@ -6,7 +6,8 @@ SET(CMAKE_MODULE_PATH "$ENV{HURRICANE_TOP}/share/cmake_modules/")
FIND_PACKAGE(BISON REQUIRED)
FIND_PACKAGE(FLEX REQUIRED)
find_package(HURRICANE REQUIRED)
FIND_PACKAGE(HURRICANE REQUIRED)
FIND_PACKAGE(CORIOLIS REQUIRED)
#FIND_PACKAGE(Doxygen)
ADD_SUBDIRECTORY(src)

View File

@ -147,16 +147,14 @@ static char* GetPattern(const string& str, const char* pattern)
*/
static void CalculateRdsUnit()
// ***************************
{
static void CalculateRdsUnit() {
using Hurricane::Error;
const char * rdsfilename = getenv("RDS_TECHNO_NAME");
FILE * rdstechnofile;
if(!rdsfilename) {
throw Error("Can't not find macro RDS_TECHNO_FILE");
throw Error("Cannot find macro RDS_TECHNO_NAME");
}
if( !(rdstechnofile = fopen(rdsfilename, "r")) ) {

View File

@ -4,3 +4,5 @@ ${CHAMSIN_SOURCE_DIR}/src/analogic)
ADD_LIBRARY(device SHARED Device.cpp TrMos.cpp TrMos_PlaceRoute.cpp)
TARGET_LINK_LIBRARIES(device analogic dtr hurricane)
INSTALL(TARGETS device DESTINATION /lib)

View File

@ -75,9 +75,7 @@ void Device::_PreDelete()
}
void Device::_PostCreate()
// *******************************
{
void Device::_PostCreate() {
Inherit::_PostCreate();
//CDataBase* database = GetCDataBase();
@ -91,7 +89,6 @@ void Device::_PostCreate()
// Create GenericDtrAccess and DtrAccess
// *************************************
GenericDtrAccess::Instance(DtrAccess::Instance());
}

View File

@ -21,7 +21,6 @@ namespace Hurricane {
class Record;
class Point;
class Transformation;
// class Transformation::Orientation;
class Instance;
}
@ -34,11 +33,9 @@ using Hurricane::Name;
using Hurricane::Record;
using Hurricane::Point;
using Hurricane::Transformation;
//using Hurricane::Transformation::Orientation;
using Hurricane::Instance;
class Device : public Cell {
// *************************
# if !defined(__DOXYGEN_PROCESSOR__)
// Types
@ -46,7 +43,7 @@ class Device : public Cell {
public : typedef Cell Inherit;
// Attributes
// *******************
// **********
// Constructors

View File

@ -25,27 +25,23 @@ namespace DEVICE{
// TrMos implementation
// ****************************************************************************************************
TrMos::TrMos(Library* library, const Name& name)
// **************************************************************************
: Inherit(library, name),
_type('N'),
_isBsConnected(false),
_m(1),
_sourceIsFirst(true),
_hasDummy(false),
_hasRing(true),
_tr1(NULL),
_capaRouting(0)
{
}
TrMos::TrMos(Library* library, const Name& name):
Inherit(library, name),
_type('N'),
_isBsConnected(false),
_m(1),
_sourceIsFirst(true),
_hasDummy(false),
_hasRing(true),
_tr1(NULL),
_capaRouting(0)
{}
TrMos* TrMos::Create(Library* library, const Name & name)
// **************************************************************************
{
TrMos* trmos= new TrMos(library, name);
trmos->_PostCreate();
return trmos;
TrMos* TrMos::Create(Library* library, const Name & name) {
TrMos* trmos= new TrMos(library, name);
trmos->_PostCreate();
return trmos;
}
@ -67,9 +63,7 @@ void TrMos::_PreDelete()
}
void TrMos::_PostCreate()
// *******************************
{
void TrMos::_PostCreate() {
Inherit::_PostCreate();
// do something.
@ -95,9 +89,7 @@ void TrMos::_PostCreate()
}
Transistors TrMos::GetTransistors() const
// **************************************
{
Transistors TrMos::GetTransistors() const {
return GetCollection(_transistorList);
}
@ -106,8 +98,8 @@ void TrMos::Create(const char type, const bool isbsconnected)
// **********************************************************
{
if( _tr1 ) {
throw Error("Can't Create Logical View of TrMos " + GetString(GetName()) + " : "
+ "it has already been created");
throw Error("Can't Create Logical View of TrMos " + GetString(GetName()) +
" : " + "it has already been created");
}
if( (type!=TRANSN) && (type!=TRANSP)) {
@ -142,10 +134,9 @@ void TrMos::Create(const char type, const bool isbsconnected)
// ****************************************************
_tr1 = MetaTransistor::Create(library, Name( GetString(GetName())+"_Mos1" ), _type);
Instance * instance = Instance::Create(this
, Name("Ins_" + GetString(_tr1->GetName()))
, _tr1
);
Instance * instance = Instance::Create(this,
Name("Ins_" + GetString(_tr1->GetName())),
_tr1);
instance->GetPlug(_tr1->GetNet(Name("DRAIN")))->SetNet(drain);
instance->GetPlug(_tr1->GetNet(Name("SOURCE")))->SetNet(source);
@ -165,8 +156,8 @@ void TrMos::Generate(const unsigned m, const bool sourceisfirst, const bool hasr
// *********************************************************************************
{
if( !_tr1 ) {
throw Error("Can't Create Physical View for " + GetString(this)
+ " : " + "Logical view has't been created yet.");
throw Error("Can't Create Physical View for " + GetString(this) +
" : " + "Logical view has't been created yet.");
}
// if( !(_transistorList.empty()) ) {
@ -177,16 +168,16 @@ void TrMos::Generate(const unsigned m, const bool sourceisfirst, const bool hasr
// Check out param of realization.
// *******************************
if( m <= 0 )
throw Error("Can't generate for " + GetString(this) + " : m " + GetString(m)
+ " is invalid.");
throw Error("Can't generate for " + GetString(this) + " : m "
+ GetString(m) + " is invalid.");
if(nbsourcecolumn<1)
throw Error("Can't generate for " + GetString(this) + " : nbsourcecolumn "
+ GetString(nbsourcecolumn) + " is invalid.");
throw Error("Can't generate for " + GetString(this)
+ " : nbsourcecolumn " + GetString(nbsourcecolumn) + " is invalid.");
if(nbdraincolumn<1)
throw Error("Can't generate for" + GetString(this) + " : nbdraincolumn "
+ GetString(nbdraincolumn) + " is invalid.");
throw Error("Can't generate for" + GetString(this) + " : nbdraincolumn "
+ GetString(nbdraincolumn) + " is invalid.");
if(!(_transistorList.empty())) {
@ -201,10 +192,9 @@ void TrMos::Generate(const unsigned m, const bool sourceisfirst, const bool hasr
// *****************************************
Library * library = GetLibrary();
cout << ts << "################################################################" <<endl
<< ts << "#### BEGIN AUTOGENERATON FOR " + _GetTypeName() + " " + GetString(GetName()) + " #####" <<endl
<< ts << "################################################################" <<endl
<< endl;
cout << ts << "################################################################" << endl <<
ts << "#### BEGIN AUTOGENERATON FOR " + _GetTypeName() + " " + GetString(GetName()) + " #####" << endl <<
ts << "################################################################" << endl << endl;
// OpenUpdateSession();
@ -222,10 +212,9 @@ void TrMos::Generate(const unsigned m, const bool sourceisfirst, const bool hasr
_tr1->SetM(_m);
for(unsigned i=0; i<m; i++){
Transistor* finger = Transistor::Create(library
, GetString(_tr1->GetName()) + "_Finger_" + GetString(i)
, _type
);
Transistor* finger = Transistor::Create(library,
GetString(_tr1->GetName()) + "_Finger_" + GetString(i),
_type);
_transistorList.push_back(finger);
Instance::Create(_tr1, Name("Ins_" + GetString(finger->GetName())), finger);
@ -235,8 +224,7 @@ void TrMos::Generate(const unsigned m, const bool sourceisfirst, const bool hasr
cout << "*** Stage 1 : CreateLayout of " + GetString(this) + " finish ***" <<endl;
cout << ts << GetString(_tr1) + " 's M is " + GetString(_tr1->GetM()) + ".\n"
<< ts << GetString(_m) + " Transistors are created.\n"
<<endl;
<< ts << GetString(_m) + " Transistors are created.\n" <<endl;
END_IF

View File

@ -32,3 +32,5 @@ ADD_LIBRARY(dtr SHARED
${DST_SRCS}
DtrAccess.cpp
GenericDtrAccess.cpp)
INSTALL(TARGETS dtr DESTINATION /lib)

View File

@ -34,9 +34,7 @@ DtrAccess::DtrAccess()
}
DtrAccess * DtrAccess::Create()
// *****************************
{
DtrAccess * DtrAccess::Create() {
DtrAccess * dtraccess = new DtrAccess();
dtraccess->_PostCreate();
@ -45,43 +43,43 @@ DtrAccess * DtrAccess::Create()
}
void DtrAccess::_PostCreate()
// **************************
{
const char * dtrfilename = getenv("DTR_FILE");
if(!dtrfilename) {
void DtrAccess::_PostCreate() {
const char* dtrFileName = getenv("DTR_FILE");
if(!dtrFileName) {
throw Error("Can't not get Macro DTR_FILE.");
}
// Use API of DtrParser for get technology informations
// ****************************************************
ParseDtr(dtrfilename, this);
ParseDtr(dtrFileName, this);
// Traduit Micro to RdsUnit
// ************************
map<string, list<double> >::iterator it_rulemap = _label2ruleMap.begin(),
it_end_rulemap = _label2ruleMap.end();
while(it_rulemap!=it_end_rulemap) {
list<double>::iterator m = ((*it_rulemap).second).begin()
, n = ((*it_rulemap).second).end();
while(m!=n) {
_label2RdsRuleMap[(*it_rulemap).first].push_back(ConvertRealToRdsUnit(*m));
m++;
}
it_rulemap++;
for (Label2RuleMap::iterator lrmit = _label2ruleMap.begin();
lrmit != _label2ruleMap.end();
++lrmit) {
for (list<double>::iterator ldit = lrmit->second.begin();
ldit != lrmit->second.end();
++ldit) {
_label2RdsRuleMap[lrmit->first].push_back(ConvertRealToRdsUnit(*ldit));
}
}
// Get Objet Layer from Technology with its name.
// **********************************************
DataBase * db = GetDataBase();
DataBase* db = GetDataBase();
if(!db) throw Error("In GetV1Trans::Generate : can't find DataBase.");
if(!db) {
throw Error("In GetV1Trans::Generate : can't find DataBase.");
}
Technology* tech = db->GetTechnology();
if (!tech) {
throw Error("In GetV1Trans::Generate : can't find Technology.");
}
Technology * tech = db->GetTechnology();
map<string, list<string> >::iterator it_layermap = _label2layerNameMap.begin(),
it_end_layermap = _label2layerNameMap.end();
@ -109,9 +107,7 @@ void DtrAccess::_PostCreate()
}
DtrAccess * DtrAccess::Instance()
// *****************************
{
DtrAccess * DtrAccess::Instance() {
// User or environnement supplies this at startup
// **********************************************
const char * singleton_name = getenv("DTRACCESS_SINGLETON");
@ -120,14 +116,12 @@ DtrAccess * DtrAccess::Instance()
if(!_instance) {
_instance = DtrAccess::Create();
}
}
else {
} else {
if(!_instance){
if( !(_instance=LookUp(string(singleton_name))) ) // if singleton hasn't been registered
_instance = DtrAccess::Create();
}
}
return _instance;
}

View File

@ -16,24 +16,21 @@
namespace Hurricane {
class DtrAccess {
// **************
// Types
// *****
# if !defined(__DOXYGEN_PROCESSOR__)
// Attributes
// **********
private : static DtrAccess * _instance;
private: typedef map<string, list<double> > Label2RuleMap;
private: static DtrAccess * _instance;
private : map<string, list<double> > _label2ruleMap;
private : map<string, list<string> > _label2layerNameMap;
private : map<string, list<double> > _label2electricalMap;
private : map<string, int> _label2modellingMap;
private : map<string, double> _label2simplecapamimMap;
private : map<string, list<long> > _label2RdsRuleMap;
private : map<string, list<Layer*> > _label2layerMap;
private: Label2RuleMap _label2ruleMap;
private: map<string, list<string> > _label2layerNameMap;
private: map<string, list<double> > _label2electricalMap;
private: map<string, int> _label2modellingMap;
private: map<string, double> _label2simplecapamimMap;
private: map<string, list<long> > _label2RdsRuleMap;
private: map<string, list<Layer*> > _label2layerMap;
// For reusability of software

View File

@ -6,7 +6,6 @@
#include "DtrAccess.h"
#include "GenericDtrAccess.h"
//#include "DtrAccess.h"
BEGIN_NAMESPACE_HURRICANE

View File

@ -1,17 +1,29 @@
#include <iostream>
#include "DataBase.h"
#include "Library.h"
USING_NAMESPACE_HURRICANE
#include "Warning.h"
using namespace H;
#include "crlcore/CDataBase.h"
using namespace CRL;
#include "TrMos.h"
using namespace DEVICE;
int main() {
cout << "simple analogic test" << endl;
DataBase* db = DataBase::Create();
Library* rootLibrary = Library::Create(db, Name("RootLibrary"));
Library* workLibrary = Library::Create(rootLibrary, Name("WorkLibrary"));
TrMos* trmos = TrMos::Create(workLibrary, Name("MosTr"));
return 1;
try {
cout << "simple analogic test" << endl;
CDataBase* db = CDataBase::Create();
Library* workLibrary = Library::Create(db->GetRootLibrary(), Name("WorkLibrary"));
TrMos* trmos = TrMos::Create(workLibrary, Name("MosTr"));
exit(0);
} catch (Hurricane::Warning& w) {
cerr << w.What() << endl;
} catch (Hurricane::Error& e) {
cerr << e.What() << endl;
exit (1);
} catch (...) {
cout << "Abnormal termination\n" << endl;
exit(2);
}
}

View File

@ -1,6 +1,9 @@
INCLUDE_DIRECTORIES(${HURRICANE_INCLUDE_DIR}
INCLUDE_DIRECTORIES(${HURRICANE_INCLUDE_DIR} ${CORIOLIS_INCLUDE_DIR}
${CHAMSIN_SOURCE_DIR}/src/analogic ${CHAMSIN_SOURCE_DIR}/src/device)
ADD_EXECUTABLE(atest AnalogicTest.cpp)
TARGET_LINK_LIBRARIES(atest analogic device ${HURRICANE_LIBRARIES})
TARGET_LINK_LIBRARIES(atest analogic device ${HURRICANE_LIBRARIES}
${CORIOLIS_LIBRARIES})
INSTALL(TARGETS atest DESTINATION /bin)