^/v for arc display

This commit is contained in:
James Cherry 2018-10-02 16:20:18 -07:00
parent 1154fb89fd
commit e68203dcf4
5 changed files with 49 additions and 23 deletions

View File

@ -146,7 +146,7 @@ TransRiseFallBoth::TransRiseFallBoth(const char *name,
int sdf_triple_index,
TransRiseFall *as_rise_fall) :
name_(name),
short_name_(short_name),
short_name_(stringCopy(short_name)),
sdf_triple_index_(sdf_triple_index),
as_rise_fall_(as_rise_fall)
{
@ -182,6 +182,12 @@ TransRiseFallBoth::matches(const Transition *tr) const
&& tr == Transition::fall());
}
void
TransRiseFallBoth::setShortName(const char *short_name)
{
short_name_ = stringCopy(short_name);
}
////////////////////////////////////////////////////////////////
TransitionMap *Transition::transition_map_;
@ -218,7 +224,26 @@ Transition::init()
tr_X0_ = new Transition("X0", "X0", TransRiseFall::fall(), 9);
tr_XZ_ = new Transition("XZ", "XZ", NULL, 10);
tr_ZX_ = new Transition("ZX", "ZX", NULL, 11);
rise_fall_ = new Transition("*", "**", NULL, -1);
rise_fall_ = new Transition("*", "**", NULL, -1);
}
Transition::Transition(const char *name,
const char *init_final,
TransRiseFall *as_rise_fall,
int sdf_triple_index) :
name_(stringCopy(name)),
init_final_(init_final),
as_rise_fall_(as_rise_fall),
sdf_triple_index_(sdf_triple_index)
{
(*transition_map_)[name_] = this;
(*transition_map_)[init_final_] = this;
max_index_ = max(sdf_triple_index, max_index_);
}
Transition::~Transition()
{
stringDelete(name_);
}
void
@ -243,20 +268,6 @@ Transition::destroy()
}
}
Transition::Transition(const char *name,
const char *init_final,
TransRiseFall *as_rise_fall,
int sdf_triple_index) :
name_(name),
init_final_(init_final),
as_rise_fall_(as_rise_fall),
sdf_triple_index_(sdf_triple_index)
{
(*transition_map_)[name_] = this;
(*transition_map_)[init_final_] = this;
max_index_ = max(sdf_triple_index, max_index_);
}
bool
Transition::matches(const Transition *tr) const
{
@ -275,6 +286,12 @@ Transition::asRiseFallBoth() const
return reinterpret_cast<const TransRiseFallBoth*>(as_rise_fall_);
}
void
Transition::setName(const char *name)
{
name_ = stringCopy(name);
}
////////////////////////////////////////////////////////////////
TransRiseFallIterator::TransRiseFallIterator(const TransRiseFallBoth *tr)

View File

@ -89,6 +89,7 @@ public:
const char *asString() const { return short_name_; }
const char *name() const { return name_; }
const char *shortName() const { return short_name_; }
void setShortName(const char *short_name);
int index() const { return sdf_triple_index_; }
bool matches(const TransRiseFall *tr) const;
bool matches(const Transition *tr) const;
@ -138,6 +139,7 @@ public:
static Transition *trX0() { return tr_X0_; }
static Transition *trXZ() { return tr_XZ_; }
static Transition *trZX() { return tr_ZX_; }
void setName(const char *name);
// Matches rise and fall.
static Transition *riseFall() { return rise_fall_; }
const char *asString() const { return name_; }
@ -157,6 +159,12 @@ private:
const char *init_final,
TransRiseFall *as_rise_fall,
int sdf_triple_index);
~Transition();
const char *name_;
const char *init_final_;
TransRiseFall *as_rise_fall_;

View File

@ -93,12 +93,8 @@ Unit::asString(float value,
int digits) const
{
// Special case INF because it blows up otherwise.
if (abs(value) >= INF * .1) {
if (value > 0.0)
return "INF";
else
return "-INF";
}
if (abs(value) >= INF * .1)
return (value > 0.0) ? "INF" : "-INF";
else {
float scaled_value = value / scale_;
// prevent "-0.00" on slowaris

View File

@ -2425,6 +2425,12 @@ set_rise_fall_short_names(const char *rise_short_name,
{
TransRiseFall::rise()->setShortName(rise_short_name);
TransRiseFall::fall()->setShortName(fall_short_name);
TransRiseFallBoth::rise()->setShortName(rise_short_name);
TransRiseFallBoth::fall()->setShortName(fall_short_name);
Transition::rise()->setName(rise_short_name);
Transition::fall()->setName(fall_short_name);
}
const char *

View File

@ -61,7 +61,6 @@ class LibertyCell;
typedef Vector<VerilogNet*> VerilogNetSeq;
typedef Vector<VerilogStmt*> VerilogStmtSeq;
typedef Vector<const char*> StringSeq;
typedef Map<const char*, VerilogDcl*, CharPtrLess> VerilogDclMap;
typedef Vector<VerilogDclArg*> VerilogDclArgSeq;
typedef Map<Cell*, VerilogModule*> VerilogModuleMap;