write_sdf -include_typ
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
4235b43d42
commit
a23d5e5390
BIN
doc/OpenSTA.odt
BIN
doc/OpenSTA.odt
Binary file not shown.
BIN
doc/OpenSTA.pdf
BIN
doc/OpenSTA.pdf
Binary file not shown.
|
|
@ -753,7 +753,8 @@ public:
|
||||||
float slew);
|
float slew);
|
||||||
void writeSdf(const char *filename,
|
void writeSdf(const char *filename,
|
||||||
Corner *corner,
|
Corner *corner,
|
||||||
char sdf_divider,
|
char divider,
|
||||||
|
bool include_typ,
|
||||||
int digits,
|
int digits,
|
||||||
bool gzip,
|
bool gzip,
|
||||||
bool no_timestamp,
|
bool no_timestamp,
|
||||||
|
|
|
||||||
|
|
@ -110,15 +110,16 @@ report_annotated_check_cmd(bool report_setup,
|
||||||
void
|
void
|
||||||
write_sdf_cmd(char *filename,
|
write_sdf_cmd(char *filename,
|
||||||
Corner *corner,
|
Corner *corner,
|
||||||
char sdf_divider,
|
char divider,
|
||||||
int digits,
|
bool include_typ,
|
||||||
|
int digits,
|
||||||
bool gzip,
|
bool gzip,
|
||||||
bool no_timestamp,
|
bool no_timestamp,
|
||||||
bool no_version)
|
bool no_version)
|
||||||
{
|
{
|
||||||
cmdLinkedNetwork();
|
cmdLinkedNetwork();
|
||||||
Sta *sta = Sta::sta();
|
Sta *sta = Sta::sta();
|
||||||
sta->writeSdf(filename, corner, sdf_divider, digits, gzip,
|
sta->writeSdf(filename, corner, divider, include_typ, digits, gzip,
|
||||||
no_timestamp, no_version);
|
no_timestamp, no_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
14
sdf/Sdf.tcl
14
sdf/Sdf.tcl
|
|
@ -140,13 +140,13 @@ proc_redirect report_annotated_check {
|
||||||
}
|
}
|
||||||
|
|
||||||
define_cmd_args "write_sdf" \
|
define_cmd_args "write_sdf" \
|
||||||
{[-corner corner_name] [-divider /|.] [-digits digits]\
|
{[-corner corner_name] [-divider /|.] [-include_typ]\
|
||||||
[-gzip] [-no_timestamp] [-no_version] filename}
|
[-digits digits] [-gzip] [-no_timestamp] [-no_version] filename}
|
||||||
|
|
||||||
proc_redirect write_sdf {
|
proc_redirect write_sdf {
|
||||||
parse_key_args "write_sdf" args \
|
parse_key_args "write_sdf" args \
|
||||||
keys {-corner -divider -digits -significant_digits} \
|
keys {-corner -divider -digits -significant_digits} \
|
||||||
flags {-gzip -no_timestamp -no_version}
|
flags {-include_typ -gzip -no_timestamp -no_version}
|
||||||
check_argc_eq1 "write_sdf" $args
|
check_argc_eq1 "write_sdf" $args
|
||||||
set corner [parse_corner keys]
|
set corner [parse_corner keys]
|
||||||
set filename [file nativename [lindex $args 0]]
|
set filename [file nativename [lindex $args 0]]
|
||||||
|
|
@ -160,16 +160,14 @@ proc_redirect write_sdf {
|
||||||
set digits 3
|
set digits 3
|
||||||
if [info exists keys(-digits)] {
|
if [info exists keys(-digits)] {
|
||||||
set digits $keys(-digits)
|
set digits $keys(-digits)
|
||||||
|
check_positive_integer "-digits" $digits
|
||||||
}
|
}
|
||||||
if [info exists keys(-significant_digits)] {
|
|
||||||
set digits $keys(-significant_digits)
|
|
||||||
}
|
|
||||||
check_positive_integer "-digits" $digits
|
|
||||||
|
|
||||||
|
set include_typ [info exists flags(-include_typ)]
|
||||||
set no_timestamp [info exists flags(-no_timestamp)]
|
set no_timestamp [info exists flags(-no_timestamp)]
|
||||||
set no_version [info exists flags(-no_version)]
|
set no_version [info exists flags(-no_version)]
|
||||||
set gzip [info exists flags(-gzip)]
|
set gzip [info exists flags(-gzip)]
|
||||||
write_sdf_cmd $filename $corner $divider $digits $gzip \
|
write_sdf_cmd $filename $corner $divider $include_typ $digits $gzip \
|
||||||
$no_timestamp $no_version
|
$no_timestamp $no_version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,8 @@ public:
|
||||||
void write(const char *filename,
|
void write(const char *filename,
|
||||||
Corner *corner,
|
Corner *corner,
|
||||||
char sdf_divider,
|
char sdf_divider,
|
||||||
int digits,
|
bool include_typ,
|
||||||
|
int digits,
|
||||||
bool gzip,
|
bool gzip,
|
||||||
bool no_timestamp,
|
bool no_timestamp,
|
||||||
bool no_version);
|
bool no_version);
|
||||||
|
|
@ -94,10 +95,10 @@ protected:
|
||||||
float min_period);
|
float min_period);
|
||||||
const char *sdfEdge(const Transition *tr);
|
const char *sdfEdge(const Transition *tr);
|
||||||
void writeArcDelays(Edge *edge);
|
void writeArcDelays(Edge *edge);
|
||||||
void writeSdfTuple(RiseFallMinMax &delays,
|
void writeSdfTriple(RiseFallMinMax &delays,
|
||||||
RiseFall *rf);
|
RiseFall *rf);
|
||||||
void writeSdfTuple(float min_delay,
|
void writeSdfTriple(float min,
|
||||||
float max_delay);
|
float max);
|
||||||
void writeSdfDelay(double delay);
|
void writeSdfDelay(double delay);
|
||||||
char *sdfPortName(const Pin *pin);
|
char *sdfPortName(const Pin *pin);
|
||||||
char *sdfPathName(const Pin *pin);
|
char *sdfPathName(const Pin *pin);
|
||||||
|
|
@ -108,6 +109,7 @@ private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(SdfWriter);
|
DISALLOW_COPY_AND_ASSIGN(SdfWriter);
|
||||||
|
|
||||||
char sdf_divider_;
|
char sdf_divider_;
|
||||||
|
bool include_typ_;
|
||||||
float timescale_;
|
float timescale_;
|
||||||
|
|
||||||
char sdf_escape_;
|
char sdf_escape_;
|
||||||
|
|
@ -124,6 +126,7 @@ void
|
||||||
writeSdf(const char *filename,
|
writeSdf(const char *filename,
|
||||||
Corner *corner,
|
Corner *corner,
|
||||||
char sdf_divider,
|
char sdf_divider,
|
||||||
|
bool include_typ,
|
||||||
int digits,
|
int digits,
|
||||||
bool gzip,
|
bool gzip,
|
||||||
bool no_timestamp,
|
bool no_timestamp,
|
||||||
|
|
@ -131,7 +134,7 @@ writeSdf(const char *filename,
|
||||||
StaState *sta)
|
StaState *sta)
|
||||||
{
|
{
|
||||||
SdfWriter writer(sta);
|
SdfWriter writer(sta);
|
||||||
writer.write(filename, corner, sdf_divider, digits, gzip,
|
writer.write(filename, corner, sdf_divider, include_typ, digits, gzip,
|
||||||
no_timestamp, no_version);
|
no_timestamp, no_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -152,12 +155,14 @@ void
|
||||||
SdfWriter::write(const char *filename,
|
SdfWriter::write(const char *filename,
|
||||||
Corner *corner,
|
Corner *corner,
|
||||||
char sdf_divider,
|
char sdf_divider,
|
||||||
|
bool include_typ,
|
||||||
int digits,
|
int digits,
|
||||||
bool gzip,
|
bool gzip,
|
||||||
bool no_timestamp,
|
bool no_timestamp,
|
||||||
bool no_version)
|
bool no_version)
|
||||||
{
|
{
|
||||||
sdf_divider_ = sdf_divider;
|
sdf_divider_ = sdf_divider;
|
||||||
|
include_typ_ = include_typ;
|
||||||
if (delay_format_ == nullptr)
|
if (delay_format_ == nullptr)
|
||||||
delay_format_ = new char[10];
|
delay_format_ = new char[10];
|
||||||
sprintf(delay_format_, "%%.%df", digits);
|
sprintf(delay_format_, "%%.%df", digits);
|
||||||
|
|
@ -428,45 +433,49 @@ SdfWriter::writeArcDelays(Edge *edge)
|
||||||
if (delays.hasValue(RiseFall::rise(), MinMax::min())
|
if (delays.hasValue(RiseFall::rise(), MinMax::min())
|
||||||
&& delays.hasValue(RiseFall::fall(), MinMax::min())) {
|
&& delays.hasValue(RiseFall::fall(), MinMax::min())) {
|
||||||
// Rise and fall.
|
// Rise and fall.
|
||||||
writeSdfTuple(delays, RiseFall::rise());
|
writeSdfTriple(delays, RiseFall::rise());
|
||||||
// Merge rise/fall values if they are the same.
|
// Merge rise/fall values if they are the same.
|
||||||
if (!(fuzzyEqual(delays.value(RiseFall::rise(), MinMax::min()),
|
if (!(fuzzyEqual(delays.value(RiseFall::rise(), MinMax::min()),
|
||||||
delays.value(RiseFall::fall(), MinMax::min()))
|
delays.value(RiseFall::fall(), MinMax::min()))
|
||||||
&& fuzzyEqual(delays.value(RiseFall::rise(), MinMax::max()),
|
&& fuzzyEqual(delays.value(RiseFall::rise(), MinMax::max()),
|
||||||
delays.value(RiseFall::fall(),MinMax::max())))) {
|
delays.value(RiseFall::fall(),MinMax::max())))) {
|
||||||
gzprintf(stream_, " ");
|
gzprintf(stream_, " ");
|
||||||
writeSdfTuple(delays, RiseFall::fall());
|
writeSdfTriple(delays, RiseFall::fall());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (delays.hasValue(RiseFall::rise(), MinMax::min()))
|
else if (delays.hasValue(RiseFall::rise(), MinMax::min()))
|
||||||
// Rise only.
|
// Rise only.
|
||||||
writeSdfTuple(delays, RiseFall::rise());
|
writeSdfTriple(delays, RiseFall::rise());
|
||||||
else if (delays.hasValue(RiseFall::fall(), MinMax::min())) {
|
else if (delays.hasValue(RiseFall::fall(), MinMax::min())) {
|
||||||
// Fall only.
|
// Fall only.
|
||||||
gzprintf(stream_, "() ");
|
gzprintf(stream_, "() ");
|
||||||
writeSdfTuple(delays, RiseFall::fall());
|
writeSdfTriple(delays, RiseFall::fall());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SdfWriter::writeSdfTuple(RiseFallMinMax &delays,
|
SdfWriter::writeSdfTriple(RiseFallMinMax &delays,
|
||||||
RiseFall *rf)
|
RiseFall *rf)
|
||||||
{
|
{
|
||||||
gzprintf(stream_, "(");
|
float min = delays.value(rf, MinMax::min());
|
||||||
writeSdfDelay(delays.value(rf, MinMax::min()));
|
float max = delays.value(rf, MinMax::max());
|
||||||
gzprintf(stream_, "::");
|
writeSdfTriple(min, max);
|
||||||
writeSdfDelay(delays.value(rf, MinMax::max()));
|
|
||||||
gzprintf(stream_, ")");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SdfWriter::writeSdfTuple(float min_delay,
|
SdfWriter::writeSdfTriple(float min,
|
||||||
float max_delay)
|
float max)
|
||||||
{
|
{
|
||||||
gzprintf(stream_, "(");
|
gzprintf(stream_, "(");
|
||||||
writeSdfDelay(min_delay);
|
writeSdfDelay(min);
|
||||||
gzprintf(stream_, "::");
|
if (include_typ_) {
|
||||||
writeSdfDelay(max_delay);
|
gzprintf(stream_, ":");
|
||||||
|
writeSdfDelay((min + max) / 2.0);
|
||||||
|
gzprintf(stream_, ":");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
gzprintf(stream_, "::");
|
||||||
|
writeSdfDelay(max);
|
||||||
gzprintf(stream_, ")");
|
gzprintf(stream_, ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -677,7 +686,7 @@ SdfWriter::writeCheck(Edge *edge,
|
||||||
|
|
||||||
ArcDelay min_delay = graph_->arcDelay(edge, arc, arc_delay_min_index_);
|
ArcDelay min_delay = graph_->arcDelay(edge, arc, arc_delay_min_index_);
|
||||||
ArcDelay max_delay = graph_->arcDelay(edge, arc, arc_delay_max_index_);
|
ArcDelay max_delay = graph_->arcDelay(edge, arc, arc_delay_max_index_);
|
||||||
writeSdfTuple(delayAsFloat(min_delay), delayAsFloat(max_delay));
|
writeSdfTriple(delayAsFloat(min_delay), delayAsFloat(max_delay));
|
||||||
|
|
||||||
gzprintf(stream_, ")\n");
|
gzprintf(stream_, ")\n");
|
||||||
}
|
}
|
||||||
|
|
@ -691,7 +700,7 @@ SdfWriter::writeWidthCheck(const Pin *pin,
|
||||||
gzprintf(stream_, " (WIDTH (%s %s) ",
|
gzprintf(stream_, " (WIDTH (%s %s) ",
|
||||||
sdfEdge(hi_low->asTransition()),
|
sdfEdge(hi_low->asTransition()),
|
||||||
sdfPortName(pin));
|
sdfPortName(pin));
|
||||||
writeSdfTuple(min_width, max_width);
|
writeSdfTriple(min_width, max_width);
|
||||||
gzprintf(stream_, ")\n");
|
gzprintf(stream_, ")\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -701,7 +710,7 @@ SdfWriter::writePeriodCheck(const Pin *pin,
|
||||||
{
|
{
|
||||||
gzprintf(stream_, " (PERIOD %s ",
|
gzprintf(stream_, " (PERIOD %s ",
|
||||||
sdfPortName(pin));
|
sdfPortName(pin));
|
||||||
writeSdfTuple(min_period, min_period);
|
writeSdfTriple(min_period, min_period);
|
||||||
gzprintf(stream_, ")\n");
|
gzprintf(stream_, ")\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,8 @@ class Corner;
|
||||||
void
|
void
|
||||||
writeSdf(const char *filename,
|
writeSdf(const char *filename,
|
||||||
Corner *corner,
|
Corner *corner,
|
||||||
char sdf_divider,
|
char divider,
|
||||||
|
bool include_typ,
|
||||||
int digits,
|
int digits,
|
||||||
bool gzip,
|
bool gzip,
|
||||||
bool no_timestamp,
|
bool no_timestamp,
|
||||||
|
|
|
||||||
|
|
@ -3524,15 +3524,16 @@ Sta::setAnnotatedSlew(Vertex *vertex,
|
||||||
void
|
void
|
||||||
Sta::writeSdf(const char *filename,
|
Sta::writeSdf(const char *filename,
|
||||||
Corner *corner,
|
Corner *corner,
|
||||||
char sdf_divider,
|
char divider,
|
||||||
int digits,
|
bool include_typ,
|
||||||
|
int digits,
|
||||||
bool gzip,
|
bool gzip,
|
||||||
bool no_timestamp,
|
bool no_timestamp,
|
||||||
bool no_version)
|
bool no_version)
|
||||||
{
|
{
|
||||||
findDelays();
|
findDelays();
|
||||||
sta::writeSdf(filename, corner, sdf_divider, digits, gzip, no_timestamp,
|
sta::writeSdf(filename, corner, divider, include_typ, digits, gzip,
|
||||||
no_version, this);
|
no_timestamp, no_version, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue