diff --git a/CMakeLists.txt b/CMakeLists.txt index 07025626..25845d68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -449,6 +449,13 @@ target_include_directories(OpenSTA ${CUDD_INCLUDE} ) +target_compile_options(OpenSTA + PRIVATE + $<$:-Wall -Wextra -pedantic -Wcast-qual -Wredundant-decls -Wformat-security> + $<$:-Wall -Wextra -pedantic -Wcast-qual -Wredundant-decls -Wformat-security> + $<$:-Wall -Wextra -pedantic -Wcast-qual -Wredundant-decls -Wformat-security> + ) + # Disable compiler specific extensions like gnu++11. set_target_properties(OpenSTA PROPERTIES CXX_EXTENSIONS OFF) target_compile_features(OpenSTA PUBLIC cxx_std_11) @@ -465,13 +472,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${STA_HOME}/app) # lib name results in "No rule to make target ../depend. add_executable(sta app/Main.cc) -target_compile_options(sta - PRIVATE - $<$:-Wall -Wextra -pedantic -Wcast-qual -Wredundant-decls -Wformat-security> - $<$:-Wall -Wextra -pedantic -Wcast-qual -Wredundant-decls -Wformat-security> - $<$:-Wall -Wextra -pedantic -Wcast-qual -Wredundant-decls -Wformat-security> - ) - target_link_libraries(sta sta_swig OpenSTA diff --git a/graph/DelayNormal1.cc b/graph/DelayNormal1.cc index 3b2f5edb..add714dd 100644 --- a/graph/DelayNormal1.cc +++ b/graph/DelayNormal1.cc @@ -57,6 +57,12 @@ Delay::Delay() : { } +Delay::Delay(const Delay &delay) : + mean_(delay.mean_), + sigma2_(delay.sigma2_) +{ +} + Delay::Delay(float mean) : mean_(mean), sigma2_(0.0) diff --git a/graph/DelayNormal2.cc b/graph/DelayNormal2.cc index 883aa306..407bc174 100644 --- a/graph/DelayNormal2.cc +++ b/graph/DelayNormal2.cc @@ -57,6 +57,13 @@ Delay::Delay() : { } +Delay::Delay(const Delay &delay) : + mean_(delay.mean_) +{ + sigma2_[EarlyLate::earlyIndex()] = delay.sigma2_[EarlyLate::earlyIndex()]; + sigma2_[EarlyLate::lateIndex()] = delay.sigma2_[EarlyLate::lateIndex()]; +} + Delay::Delay(float mean) : mean_(mean), sigma2_{0.0, 0.0} diff --git a/include/sta/ArrayTable.hh b/include/sta/ArrayTable.hh index e50f01dc..c3c14fa5 100644 --- a/include/sta/ArrayTable.hh +++ b/include/sta/ArrayTable.hh @@ -67,12 +67,12 @@ private: template ArrayTable::ArrayTable() : size_(0), + free_block_idx_(block_idx_null), + free_idx_(object_idx_null), blocks_size_(0), blocks_capacity_(1024), blocks_(new ArrayBlock*[blocks_capacity_]), - prev_blocks_(nullptr), - free_block_idx_(block_idx_null), - free_idx_(object_idx_null) + prev_blocks_(nullptr) { } @@ -88,7 +88,7 @@ template void ArrayTable::deleteBlocks() { - for (int i = 0; i < blocks_size_; i++) + for (size_t i = 0; i < blocks_size_; i++) delete blocks_[i]; } diff --git a/include/sta/DelayNormal1.hh b/include/sta/DelayNormal1.hh index b25529c7..d2df2e2a 100644 --- a/include/sta/DelayNormal1.hh +++ b/include/sta/DelayNormal1.hh @@ -28,6 +28,7 @@ class Delay { public: Delay(); + Delay(const Delay &delay); Delay(float mean); Delay(float mean, float sigma2); diff --git a/include/sta/DelayNormal2.hh b/include/sta/DelayNormal2.hh index 44f3d278..52c5a2c3 100644 --- a/include/sta/DelayNormal2.hh +++ b/include/sta/DelayNormal2.hh @@ -28,6 +28,7 @@ class Delay { public: Delay(); + Delay(const Delay &delay); Delay(float mean); Delay(float mean, float sigma2_early, diff --git a/network/Network.cc b/network/Network.cc index 412afcfb..e282e114 100644 --- a/network/Network.cc +++ b/network/Network.cc @@ -936,7 +936,7 @@ Network::findInstPinsMatching(const Instance *instance, } void -Network::location(const Pin *pin, +Network::location(const Pin *, // Return values. double &x, double &y, diff --git a/sdc/Sdc.cc b/sdc/Sdc.cc index 5d10c387..d196d570 100644 --- a/sdc/Sdc.cc +++ b/sdc/Sdc.cc @@ -1540,7 +1540,6 @@ Sdc::removeClockLatency(const Clock *clk, void Sdc::deleteClockLatency(ClockLatency *latency) { - const Pin *pin = latency->pin(); clk_latencies_.erase(latency); delete latency; } diff --git a/search/CheckCapacitanceLimits.cc b/search/CheckCapacitanceLimits.cc index 65c53a4b..e1d44286 100644 --- a/search/CheckCapacitanceLimits.cc +++ b/search/CheckCapacitanceLimits.cc @@ -204,7 +204,6 @@ CheckCapacitanceLimits::checkCapacitance(const Pin *pin, float &limit) const { const DcalcAnalysisPt *dcalc_ap = corner->findDcalcAnalysisPt(min_max); - const OperatingConditions *op_cond = dcalc_ap->operatingConditions(); GraphDelayCalc *dcalc = sta_->graphDelayCalc(); float cap = dcalc->loadCap(pin, dcalc_ap); @@ -248,7 +247,6 @@ CheckCapacitanceLimits::pinCapacitanceLimitViolations(Instance *inst, PinSeq *violators) { const Network *network = sta_->network(); - const Sim *sim = sta_->sim(); InstancePinIterator *pin_iter = network->pinIterator(inst); while (pin_iter->hasNext()) { Pin *pin = pin_iter->next(); @@ -292,7 +290,6 @@ CheckCapacitanceLimits::pinMinCapacitanceLimitSlack(Instance *inst, float &min_slack) { const Network *network = sta_->network(); - const Sim *sim = sta_->sim(); InstancePinIterator *pin_iter = network->pinIterator(inst); while (pin_iter->hasNext()) { Pin *pin = pin_iter->next(); @@ -320,7 +317,6 @@ CheckCapacitanceLimits::checkPin(Pin *pin) const Sim *sim = sta_->sim(); const Sdc *sdc = sta_->sdc(); const Graph *graph = sta_->graph(); - Search *search = sta_->search(); Vertex *vertex = graph->pinLoadVertex(pin); return network->direction(pin)->isAnyOutput() && !sim->logicZeroOne(pin) diff --git a/search/CheckFanoutLimits.cc b/search/CheckFanoutLimits.cc index b5c2ae42..9e169af5 100644 --- a/search/CheckFanoutLimits.cc +++ b/search/CheckFanoutLimits.cc @@ -226,7 +226,6 @@ CheckFanoutLimits::pinFanoutLimitViolations(Instance *inst, PinSeq *violators) { const Network *network = sta_->network(); - const Sim *sim = sta_->sim(); InstancePinIterator *pin_iter = network->pinIterator(inst); while (pin_iter->hasNext()) { Pin *pin = pin_iter->next(); diff --git a/search/PathVertex.cc b/search/PathVertex.cc index d26b32ab..fa2f2956 100644 --- a/search/PathVertex.cc +++ b/search/PathVertex.cc @@ -267,7 +267,8 @@ PathVertex::setRequired(const Required &required, int arrival_count = tag_group->arrivalCount(); if (!vertex_->hasRequireds()) { Arrival *new_arrivals = graph->makeArrivals(vertex_, arrival_count * 2); - memcpy(new_arrivals, arrivals, arrival_count * sizeof(Arrival)); + for (int i = 0; i < arrival_count; i++) + new_arrivals[i] =arrivals[i]; vertex_->setHasRequireds(true); arrivals = new_arrivals; } diff --git a/search/Power.cc b/search/Power.cc index 57d3ca18..dc3e2344 100644 --- a/search/Power.cc +++ b/search/Power.cc @@ -840,7 +840,6 @@ Power::findInputDuty(const Pin *to_pin, InternalPower *pwr) { - const char *related_pg_pin = pwr->relatedPgPin(); const LibertyPort *from_port = pwr->relatedPort(); if (from_port) { const Pin *from_pin = network_->findPin(inst, from_port); @@ -889,28 +888,6 @@ isPositiveUnate(const LibertyCell *cell, //////////////////////////////////////////////////////////////// -static bool -isPortRef(FuncExpr *expr, - const LibertyPort *port) -{ - return (expr->op() == FuncExpr::op_port - && expr->port() == port) - || (expr->op() == FuncExpr::op_not - && expr->left()->op() == FuncExpr::op_port - && expr->left()->port() == port); -} - -static FuncExpr * -negate(FuncExpr *expr) -{ - if (expr->op() == FuncExpr::op_not) - return expr->left()->copy(); - else - return FuncExpr::makeNot(expr->copy()); -} - -//////////////////////////////////////////////////////////////// - void Power::findLeakagePower(const Instance *, LibertyCell *cell,