ConcreteCell/Port pointers to corresponding liberty
This commit is contained in:
parent
dd8153c7f9
commit
96fcf1d8b2
|
|
@ -871,6 +871,7 @@ LibertyCell::LibertyCell(LibertyLibrary *library,
|
||||||
higher_drive_(nullptr),
|
higher_drive_(nullptr),
|
||||||
lower_drive_(nullptr)
|
lower_drive_(nullptr)
|
||||||
{
|
{
|
||||||
|
liberty_cell_ = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
LibertyCell::~LibertyCell()
|
LibertyCell::~LibertyCell()
|
||||||
|
|
@ -1874,6 +1875,7 @@ LibertyPort::LibertyPort(LibertyCell *cell,
|
||||||
is_pll_feedback_pin_(false),
|
is_pll_feedback_pin_(false),
|
||||||
is_disabled_constraint_(false)
|
is_disabled_constraint_(false)
|
||||||
{
|
{
|
||||||
|
liberty_port_ = this;
|
||||||
min_pulse_width_[TransRiseFall::riseIndex()] = 0.0;
|
min_pulse_width_[TransRiseFall::riseIndex()] = 0.0;
|
||||||
min_pulse_width_[TransRiseFall::fallIndex()] = 0.0;
|
min_pulse_width_[TransRiseFall::fallIndex()] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,7 @@ ConcreteCell::ConcreteCell(ConcreteLibrary *library,
|
||||||
library_(library),
|
library_(library),
|
||||||
name_(stringCopy(name)),
|
name_(stringCopy(name)),
|
||||||
filename_(stringCopy(filename)),
|
filename_(stringCopy(filename)),
|
||||||
|
liberty_cell_(nullptr),
|
||||||
port_bit_count_(0),
|
port_bit_count_(0),
|
||||||
is_leaf_(is_leaf)
|
is_leaf_(is_leaf)
|
||||||
{
|
{
|
||||||
|
|
@ -134,6 +135,12 @@ ConcreteCell::setName(const char *name)
|
||||||
name_ = name_cpy;
|
name_ = name_cpy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ConcreteCell::setLibertyCell(LibertyCell *cell)
|
||||||
|
{
|
||||||
|
liberty_cell_ = cell;
|
||||||
|
}
|
||||||
|
|
||||||
ConcretePort *
|
ConcretePort *
|
||||||
ConcreteCell::makePort(const char *name)
|
ConcreteCell::makePort(const char *name)
|
||||||
{
|
{
|
||||||
|
|
@ -422,6 +429,7 @@ ConcretePort::ConcretePort(ConcreteCell *cell,
|
||||||
name_(stringCopy(name)),
|
name_(stringCopy(name)),
|
||||||
cell_(cell),
|
cell_(cell),
|
||||||
direction_(PortDirection::unknown()),
|
direction_(PortDirection::unknown()),
|
||||||
|
liberty_port_(nullptr),
|
||||||
pin_index_(-1),
|
pin_index_(-1),
|
||||||
is_bundle_(is_bundle),
|
is_bundle_(is_bundle),
|
||||||
is_bus_(is_bus),
|
is_bus_(is_bus),
|
||||||
|
|
@ -447,6 +455,12 @@ ConcretePort::cell() const
|
||||||
return reinterpret_cast<Cell*>(cell_);
|
return reinterpret_cast<Cell*>(cell_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ConcretePort::setLibertyPort(LibertyPort *port)
|
||||||
|
{
|
||||||
|
liberty_port_ = port;
|
||||||
|
}
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
ConcretePort::busName() const
|
ConcretePort::busName() const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ class ConcreteCell;
|
||||||
class ConcretePort;
|
class ConcretePort;
|
||||||
class ConcreteCellPortBitIterator;
|
class ConcreteCellPortBitIterator;
|
||||||
class PatternMatch;
|
class PatternMatch;
|
||||||
|
class LibertyCell;
|
||||||
|
class LibertyPort;
|
||||||
|
|
||||||
typedef Map<const char*, ConcreteCell*, CharPtrLess> ConcreteCellMap;
|
typedef Map<const char*, ConcreteCell*, CharPtrLess> ConcreteCellMap;
|
||||||
typedef Vector<ConcretePort*> ConcretePortSeq;
|
typedef Vector<ConcretePort*> ConcretePortSeq;
|
||||||
|
|
@ -89,6 +91,8 @@ public:
|
||||||
virtual ConcreteLibrary *library() const { return library_; }
|
virtual ConcreteLibrary *library() const { return library_; }
|
||||||
virtual const char *name() const { return name_; }
|
virtual const char *name() const { return name_; }
|
||||||
virtual const char *filename() const { return filename_; }
|
virtual const char *filename() const { return filename_; }
|
||||||
|
LibertyCell *libertyCell() { return liberty_cell_; }
|
||||||
|
void setLibertyCell(LibertyCell *cell);
|
||||||
virtual int portBitCount() const { return port_bit_count_; }
|
virtual int portBitCount() const { return port_bit_count_; }
|
||||||
virtual ConcretePort *findPort(const char *name) const;
|
virtual ConcretePort *findPort(const char *name) const;
|
||||||
virtual void findPortsMatching(const PatternMatch *pattern,
|
virtual void findPortsMatching(const PatternMatch *pattern,
|
||||||
|
|
@ -139,6 +143,7 @@ protected:
|
||||||
const char *name_;
|
const char *name_;
|
||||||
// Filename is optional.
|
// Filename is optional.
|
||||||
const char *filename_;
|
const char *filename_;
|
||||||
|
LibertyCell *liberty_cell_;
|
||||||
// Non-bus and bus ports (but no expanded bus bit ports).
|
// Non-bus and bus ports (but no expanded bus bit ports).
|
||||||
ConcretePortSeq ports_;
|
ConcretePortSeq ports_;
|
||||||
ConcretePortMap port_map_;
|
ConcretePortMap port_map_;
|
||||||
|
|
@ -162,6 +167,8 @@ public:
|
||||||
virtual Cell *cell() const;
|
virtual Cell *cell() const;
|
||||||
virtual ConcreteLibrary *library() const { return cell_->library(); }
|
virtual ConcreteLibrary *library() const { return cell_->library(); }
|
||||||
virtual PortDirection *direction() const { return direction_; }
|
virtual PortDirection *direction() const { return direction_; }
|
||||||
|
LibertyPort *libertyPort() { return liberty_port_; }
|
||||||
|
void setLibertyPort(LibertyPort *port);
|
||||||
virtual void setDirection(PortDirection *dir);
|
virtual void setDirection(PortDirection *dir);
|
||||||
// Bundles are groups of related ports that do not use
|
// Bundles are groups of related ports that do not use
|
||||||
// bus notation.
|
// bus notation.
|
||||||
|
|
@ -209,6 +216,7 @@ protected:
|
||||||
const char *name_;
|
const char *name_;
|
||||||
ConcreteCell *cell_;
|
ConcreteCell *cell_;
|
||||||
PortDirection *direction_;
|
PortDirection *direction_;
|
||||||
|
LibertyPort *liberty_port_;
|
||||||
int pin_index_;
|
int pin_index_;
|
||||||
bool is_bundle_;
|
bool is_bundle_;
|
||||||
bool is_bus_;
|
bool is_bus_;
|
||||||
|
|
|
||||||
|
|
@ -550,7 +550,7 @@ LibertyCell *
|
||||||
ConcreteNetwork::libertyCell(Cell *cell) const
|
ConcreteNetwork::libertyCell(Cell *cell) const
|
||||||
{
|
{
|
||||||
ConcreteCell *ccell = reinterpret_cast<ConcreteCell*>(cell);
|
ConcreteCell *ccell = reinterpret_cast<ConcreteCell*>(cell);
|
||||||
return dynamic_cast<LibertyCell*>(ccell);
|
return ccell->libertyCell();
|
||||||
}
|
}
|
||||||
|
|
||||||
Cell *
|
Cell *
|
||||||
|
|
@ -743,7 +743,7 @@ LibertyPort *
|
||||||
ConcreteNetwork::libertyPort(Port *port) const
|
ConcreteNetwork::libertyPort(Port *port) const
|
||||||
{
|
{
|
||||||
ConcretePort *cport = reinterpret_cast<ConcretePort*>(port);
|
ConcretePort *cport = reinterpret_cast<ConcretePort*>(port);
|
||||||
return dynamic_cast<LibertyPort*>(cport);
|
return cport->libertyPort();
|
||||||
}
|
}
|
||||||
|
|
||||||
PortDirection *
|
PortDirection *
|
||||||
|
|
|
||||||
|
|
@ -539,8 +539,9 @@ VerilogReader::makeModuleInst(const char *module_name,
|
||||||
const int line)
|
const int line)
|
||||||
{
|
{
|
||||||
Cell *cell = network_->findAnyCell(module_name);
|
Cell *cell = network_->findAnyCell(module_name);
|
||||||
LibertyCell *liberty_cell = network_->libertyCell(cell);
|
LibertyCell *liberty_cell = nullptr;
|
||||||
VerilogInst *inst;
|
if (cell)
|
||||||
|
liberty_cell = network_->libertyCell(cell);
|
||||||
// Instances of liberty with scalar ports are special cased
|
// Instances of liberty with scalar ports are special cased
|
||||||
// to reduce the memory footprint of the verilog parser.
|
// to reduce the memory footprint of the verilog parser.
|
||||||
if (liberty_cell
|
if (liberty_cell
|
||||||
|
|
@ -573,7 +574,8 @@ VerilogReader::makeModuleInst(const char *module_name,
|
||||||
delete vpin;
|
delete vpin;
|
||||||
net_port_ref_scalar_net_count_--;
|
net_port_ref_scalar_net_count_--;
|
||||||
}
|
}
|
||||||
inst = new VerilogLibertyInst(liberty_cell, inst_name, net_names, line);
|
VerilogInst *inst = new VerilogLibertyInst(liberty_cell, inst_name,
|
||||||
|
net_names, line);
|
||||||
stringDelete(module_name);
|
stringDelete(module_name);
|
||||||
delete pins;
|
delete pins;
|
||||||
if (report_stmt_stats_) {
|
if (report_stmt_stats_) {
|
||||||
|
|
@ -581,17 +583,18 @@ VerilogReader::makeModuleInst(const char *module_name,
|
||||||
inst_lib_count_++;
|
inst_lib_count_++;
|
||||||
inst_lib_net_arrays_ += port_count;
|
inst_lib_net_arrays_ += port_count;
|
||||||
}
|
}
|
||||||
|
return inst;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
inst = new VerilogModuleInst(module_name, inst_name, pins, line);
|
VerilogInst *inst = new VerilogModuleInst(module_name, inst_name, pins, line);
|
||||||
if (report_stmt_stats_) {
|
if (report_stmt_stats_) {
|
||||||
inst_module_names_ += strlen(module_name) + 1;
|
inst_module_names_ += strlen(module_name) + 1;
|
||||||
inst_names_ += strlen(inst_name) + 1;
|
inst_names_ += strlen(inst_name) + 1;
|
||||||
inst_mod_count_++;
|
inst_mod_count_++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return inst;
|
return inst;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
VerilogReader::hasScalarNamedPortRefs(LibertyCell *liberty_cell,
|
VerilogReader::hasScalarNamedPortRefs(LibertyCell *liberty_cell,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue