Merge remote-tracking branch 'upstream/master' into sta_update_upstream_lvf_stuff

This commit is contained in:
dsengupta0628 2026-03-19 15:26:54 +00:00
commit b58fb44657
8 changed files with 41 additions and 24 deletions

View File

@ -223,6 +223,14 @@ delayAsString(const Delay &delay,
sta->units()->timeUnit()->digits(), sta);
}
std::string
delayAsString(const Delay &delay,
int digits,
const StaState *sta)
{
return delayAsString(delay, EarlyLate::late(), digits, sta);
}
std::string
delayAsString(const Delay &delay,
const EarlyLate *early_late,

View File

@ -63,6 +63,10 @@ public:
void setSkewness(float skewness);
void operator=(float delay);
// This allows applications that do not support statistical timing
// to treat Delays as floats without explicitly converting with
// delayAsFloat.
operator float() const { return mean(); }
private:
std::array<float, 4> values_;
@ -203,9 +207,15 @@ void
delaySetMean(Delay &delay,
float mean);
// early_late == late
std::string
delayAsString(const Delay &delay,
const StaState *sta);
// early_late == late
std::string
delayAsString(const Delay &delay,
int digits,
const StaState *sta);
std::string
delayAsString(const Delay &delay,
const EarlyLate *early_late,

View File

@ -138,13 +138,13 @@ public:
}
// Log output to filename until logEnd is called.
virtual void logBegin(std::string_view filename);
virtual void logBegin(std::string filename);
virtual void logEnd();
// Redirect output to filename until redirectFileEnd is called.
virtual void redirectFileBegin(std::string_view filename);
virtual void redirectFileBegin(std::string filename);
// Redirect append output to filename until redirectFileEnd is called.
virtual void redirectFileAppendBegin(std::string_view filename);
virtual void redirectFileAppendBegin(std::string filename);
virtual void redirectFileEnd();
// Redirect output to a string until redirectStringEnd is called.
virtual void redirectStringBegin();

View File

@ -44,10 +44,10 @@ class ReportTcl : public Report
public:
ReportTcl();
virtual ~ReportTcl();
void logBegin(std::string_view filename) override;
void logBegin(std::string filename) override;
void logEnd() override;
void redirectFileBegin(std::string_view filename) override;
void redirectFileAppendBegin(std::string_view filename) override;
void redirectFileBegin(std::string filename) override;
void redirectFileAppendBegin(std::string filename) override;
void redirectFileEnd() override;
void redirectStringBegin() override;
const char *redirectStringEnd() override;

View File

@ -24,7 +24,9 @@
#pragma once
#include "LibertyLocation.hh"
#include <string>
#include <istream>
#include "LibertyParse.hh"
#ifndef __FLEX_LEXER_H

View File

@ -50,8 +50,8 @@ Path::Path() :
Path::Path(const Path *path) :
prev_path_(path ? path->prev_path_ : nullptr),
arrival_(path ? path->arrival_ : 0.0),
required_(path ? path->required_ : 0.0),
arrival_(path ? path->arrival_ : delay_zero),
required_(path ? path->required_ : delay_zero),
vertex_id_(path ? path->vertex_id_ : vertex_id_null),
tag_index_(path ? path->tag_index_ : tag_index_null),
is_enum_(path ? path->is_enum_ : false),

View File

@ -185,12 +185,11 @@ Report::isSuppressed(int id)
////////////////////////////////////////////////////////////////
void
Report::logBegin(std::string_view filename)
Report::logBegin(std::string filename)
{
std::string filename_str(filename);
log_stream_ = fopen(filename_str.c_str(), "w");
log_stream_ = fopen(filename.c_str(), "w");
if (log_stream_ == nullptr)
throw FileNotWritable(std::move(filename_str));
throw FileNotWritable(std::move(filename));
}
void
@ -202,21 +201,19 @@ Report::logEnd()
}
void
Report::redirectFileBegin(std::string_view filename)
Report::redirectFileBegin(std::string filename)
{
std::string filename_str(filename);
redirect_stream_ = fopen(filename_str.c_str(), "w");
redirect_stream_ = fopen(filename.c_str(), "w");
if (redirect_stream_ == nullptr)
throw FileNotWritable(std::move(filename_str));
throw FileNotWritable(std::move(filename));
}
void
Report::redirectFileAppendBegin(std::string_view filename)
Report::redirectFileAppendBegin(std::string filename)
{
std::string filename_str(filename);
redirect_stream_ = fopen(filename_str.c_str(), "a");
redirect_stream_ = fopen(filename.c_str(), "a");
if (redirect_stream_ == nullptr)
throw FileNotWritable(std::move(filename_str));
throw FileNotWritable(std::move(filename));
}
void

View File

@ -183,7 +183,7 @@ ReportTcl::flush()
// Tcl_Main can eval multiple commands before the flushing the command
// output, so the log/redirect commands must force a flush.
void
ReportTcl::logBegin(std::string_view filename)
ReportTcl::logBegin(std::string filename)
{
flush();
Report::logBegin(filename);
@ -197,14 +197,14 @@ ReportTcl::logEnd()
}
void
ReportTcl::redirectFileBegin(std::string_view filename)
ReportTcl::redirectFileBegin(std::string filename)
{
flush();
Report::redirectFileBegin(filename);
}
void
ReportTcl::redirectFileAppendBegin(std::string_view filename)
ReportTcl::redirectFileAppendBegin(std::string filename)
{
flush();
Report::redirectFileAppendBegin(filename);