Inspector for AbutmentType
This commit is contained in:
parent
2d08ea4f63
commit
b558804b3c
|
@ -72,7 +72,19 @@ Record* Transistor::Polarity::_getRecord() const {
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
Transistor::Transistor(Library* library, const Name& name, const Polarity& polarity, DbU::Unit l, DbU::Unit w):
|
string Transistor::AbutmentType::_getString() const {
|
||||||
|
return getString(&_code);
|
||||||
|
}
|
||||||
|
|
||||||
|
Record* Transistor::AbutmentType::_getRecord() const {
|
||||||
|
Record* record = new Record(getString(this));
|
||||||
|
record->add(getSlot("Code", &_code));
|
||||||
|
return record;
|
||||||
|
}
|
||||||
|
|
||||||
|
Transistor::Transistor(Library* library, const Name& name,
|
||||||
|
const Polarity& polarity, DbU::Unit l, DbU::Unit w,
|
||||||
|
const AbutmentType& abutmentType):
|
||||||
Cell(library, name),
|
Cell(library, name),
|
||||||
_drain(NULL),
|
_drain(NULL),
|
||||||
_source(NULL),
|
_source(NULL),
|
||||||
|
@ -80,7 +92,7 @@ Transistor::Transistor(Library* library, const Name& name, const Polarity& polar
|
||||||
_bulk(NULL),
|
_bulk(NULL),
|
||||||
_anonymous(NULL),
|
_anonymous(NULL),
|
||||||
_polarity(polarity),
|
_polarity(polarity),
|
||||||
_abutmentType(),
|
_abutmentType(abutmentType),
|
||||||
_l(l),
|
_l(l),
|
||||||
_w(w),
|
_w(w),
|
||||||
_source20(NULL), _source22(NULL),
|
_source20(NULL), _source22(NULL),
|
||||||
|
@ -90,9 +102,11 @@ Transistor::Transistor(Library* library, const Name& name, const Polarity& polar
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Transistor* Transistor::create(Library* library, const Name& name, const Polarity& polarity,
|
Transistor* Transistor::create(Library* library, const Name& name,
|
||||||
DbU::Unit l, DbU::Unit w) {
|
const Polarity& polarity,
|
||||||
Transistor* transistor = new Transistor(library, name, polarity, l, w);
|
DbU::Unit l, DbU::Unit w,
|
||||||
|
const AbutmentType& abutmentType) {
|
||||||
|
Transistor* transistor = new Transistor(library, name, polarity, l, w, abutmentType);
|
||||||
|
|
||||||
transistor->_postCreate();
|
transistor->_postCreate();
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,26 @@ class Transistor : public Cell {
|
||||||
enum Code {N=0, P=1};
|
enum Code {N=0, P=1};
|
||||||
|
|
||||||
Polarity(const Code& code): _code(code) {}
|
Polarity(const Code& code): _code(code) {}
|
||||||
|
|
||||||
operator const Code&() const { return _code; };
|
operator const Code&() const { return _code; };
|
||||||
string _getString() const;
|
string _getString() const;
|
||||||
Record* _getRecord() const;
|
Record* _getRecord() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Polarity() {}
|
||||||
|
Code _code;
|
||||||
|
};
|
||||||
|
|
||||||
|
class AbutmentType {
|
||||||
|
public:
|
||||||
|
enum Code {INTERNAL=0, LEFT=1, RIGHT=2, SINGLE=3};
|
||||||
|
|
||||||
|
AbutmentType(const Code& code): _code(code) {}
|
||||||
|
operator const Code&() const { return _code; };
|
||||||
|
string _getString() const;
|
||||||
|
Record* _getRecord() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
AbutmentType() {}
|
||||||
Code _code;
|
Code _code;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -28,19 +43,19 @@ class Transistor : public Cell {
|
||||||
static const Name BulkName;
|
static const Name BulkName;
|
||||||
static const Name AnonymousName;
|
static const Name AnonymousName;
|
||||||
|
|
||||||
enum AbutmentType { INTERNAL=0, LEFT=1, RIGHT=2, SINGLE=3};
|
|
||||||
|
|
||||||
static Transistor* create(Library* library, const Name& name,
|
static Transistor* create(Library* library, const Name& name,
|
||||||
const Polarity& polarity,
|
const Polarity& polarity,
|
||||||
DbU::Unit l, DbU::Unit w);
|
DbU::Unit l, DbU::Unit w,
|
||||||
|
const AbutmentType& abutmentType=AbutmentType::SINGLE);
|
||||||
void createLayout();
|
void createLayout();
|
||||||
|
|
||||||
bool isNmos() const { return _polarity == Polarity::N; };
|
bool isNmos() const { return _polarity == Polarity::N; };
|
||||||
bool isPmos() const { return _polarity == Polarity::P; };
|
bool isPmos() const { return _polarity == Polarity::P; };
|
||||||
bool isInternal() const { return _abutmentType == INTERNAL; };
|
bool isInternal() const { return _abutmentType == AbutmentType::INTERNAL; };
|
||||||
bool isLeft() const { return _abutmentType == LEFT; };
|
bool isLeft() const { return _abutmentType == AbutmentType::LEFT; };
|
||||||
bool isRight() const { return _abutmentType == RIGHT; };
|
bool isRight() const { return _abutmentType == AbutmentType::RIGHT; };
|
||||||
bool isSingle() const { return _abutmentType == SINGLE; };
|
bool isSingle() const { return _abutmentType == AbutmentType::SINGLE; };
|
||||||
|
|
||||||
virtual Record* _getRecord() const;
|
virtual Record* _getRecord() const;
|
||||||
|
|
||||||
|
@ -64,7 +79,8 @@ class Transistor : public Cell {
|
||||||
|
|
||||||
Transistor(Library* library, const Name& name,
|
Transistor(Library* library, const Name& name,
|
||||||
const Polarity& polarity,
|
const Polarity& polarity,
|
||||||
DbU::Unit l, DbU::Unit w);
|
DbU::Unit l, DbU::Unit w,
|
||||||
|
const AbutmentType& abutmentType);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -85,7 +101,26 @@ template<> inline Hurricane::Record* getRecord<const Hurricane::Transistor::Pola
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<> inline std::string getString<const Hurricane::Transistor::AbutmentType::Code*>
|
||||||
|
(const Hurricane::Transistor::AbutmentType::Code* object ) {
|
||||||
|
switch (*object) {
|
||||||
|
case Hurricane::Transistor::AbutmentType::INTERNAL: return "INTERNAL";
|
||||||
|
case Hurricane::Transistor::AbutmentType::LEFT: return "LEFT";
|
||||||
|
case Hurricane::Transistor::AbutmentType::RIGHT: return "RIGHT";
|
||||||
|
case Hurricane::Transistor::AbutmentType::SINGLE: return "SINGLE";
|
||||||
|
default: return "ABNORMAL";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<> inline Hurricane::Record* getRecord<const Hurricane::Transistor::AbutmentType::Code*>
|
||||||
|
(const Hurricane::Transistor::AbutmentType::Code* object) {
|
||||||
|
Hurricane::Record* record = new Hurricane::Record(getString(object));
|
||||||
|
record->add(getSlot("Code", (unsigned int*)object));
|
||||||
|
return record;
|
||||||
|
}
|
||||||
|
|
||||||
INSPECTOR_P_SUPPORT(Hurricane::Transistor);
|
INSPECTOR_P_SUPPORT(Hurricane::Transistor);
|
||||||
INSPECTOR_P_SUPPORT(Hurricane::Transistor::Polarity);
|
INSPECTOR_P_SUPPORT(Hurricane::Transistor::Polarity);
|
||||||
|
INSPECTOR_P_SUPPORT(Hurricane::Transistor::AbutmentType);
|
||||||
|
|
||||||
#endif // TRANSISTOR_H
|
#endif // TRANSISTOR_H
|
||||||
|
|
Loading…
Reference in New Issue