Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
akashlevy committed Nov 21, 2024
2 parents d87926c + 70d52c2 commit 3b7f344
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 34 deletions.
Binary file modified doc/OpenSTA.odt
Binary file not shown.
Binary file modified doc/OpenSTA.pdf
Binary file not shown.
3 changes: 0 additions & 3 deletions include/sta/Liberty.hh
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,6 @@ public:
void setIsMacro(bool is_macro);
bool isMemory() const { return is_memory_; }
void setIsMemory(bool is_memory);
bool hasMemory() const { return has_memory_; }
void setHasMemory(bool has_memory);
bool isPad() const { return is_pad_; }
void setIsPad(bool is_pad);
bool isClockCell() const { return is_clock_cell_; }
Expand Down Expand Up @@ -593,7 +591,6 @@ protected:
LibertyLibrary *liberty_library_;
float area_;
bool dont_use_;
bool has_memory_;
bool is_macro_;
bool is_memory_;
bool is_pad_;
Expand Down
6 changes: 0 additions & 6 deletions liberty/Liberty.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1077,12 +1077,6 @@ LibertyCell::setIsMemory(bool is_memory)
is_memory_ = is_memory;
}

void
LibertyCell::setHasMemory(bool has_memory)
{
has_memory_ = has_memory;
}

void
LibertyCell::setIsPad(bool is_pad)
{
Expand Down
4 changes: 2 additions & 2 deletions liberty/LibertyReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ LibertyReader::defineVisitors()

// Memory
defineGroupVisitor("memory", &LibertyReader::beginMemory,
&LibertyReader::endMemory);
&LibertyReader::endMemory);

// Register/latch
defineGroupVisitor("ff", &LibertyReader::beginFF, &LibertyReader::endFF);
Expand Down Expand Up @@ -3863,7 +3863,7 @@ void
LibertyReader::beginMemory(LibertyGroup *)
{
if (cell_) {
cell_->setHasMemory(true);
cell_->setIsMemory(true);
}
}

Expand Down
3 changes: 3 additions & 0 deletions parasitics/SpefReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "SpefReader.hh"

#include "Zlib.hh"
#include "Stats.hh"
#include "Report.hh"
#include "Debug.hh"
#include "StringUtil.hh"
Expand Down Expand Up @@ -64,6 +65,7 @@ readSpefFile(const char *filename,
// Use zlib to uncompress gzip'd files automagically.
gzFile stream = gzopen(filename, "rb");
if (stream) {
Stats stats(sta->debug(), sta->report());
SpefReader reader(filename, stream, instance, ap,
pin_cap_included, keep_coupling_caps, coupling_cap_factor,
reduce, corner, min_max, sta);
Expand All @@ -73,6 +75,7 @@ readSpefFile(const char *filename,
success = (::SpefParse_parse() == 0);
gzclose(stream);
spef_reader = nullptr;
stats.report("Read spef");
}
else
throw FileNotReadable(filename);
Expand Down
5 changes: 5 additions & 0 deletions power/Power.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <cmath> // abs

#include "cudd.h"
#include "Stats.hh"
#include "Debug.hh"
#include "EnumNameMap.hh"
#include "Hash.hh"
Expand Down Expand Up @@ -233,6 +234,7 @@ Power::power(const Corner *corner,
pad.clear();

ensureActivities();
Stats stats(debug_, report_);
LeafInstanceIterator *inst_iter = network_->leafInstanceIterator();
while (inst_iter->hasNext()) {
Instance *inst = inst_iter->next();
Expand All @@ -255,6 +257,7 @@ Power::power(const Corner *corner,
}
}
delete inst_iter;
stats.report("Find power");
}

bool
Expand Down Expand Up @@ -617,6 +620,7 @@ Power::ensureActivities()
// No need to propagate activites if global activity is set.
if (!global_activity_.isSet()) {
if (!activities_valid_) {
Stats stats(debug_, report_);
// Clear existing activities.
activity_map_.clear();
seq_activity_map_.clear();
Expand Down Expand Up @@ -646,6 +650,7 @@ Power::ensureActivities()
pass, visitor.maxChange());
pass++;
}
stats.report("Find power activities");
activities_valid_ = true;
}
}
Expand Down
3 changes: 3 additions & 0 deletions power/VcdReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "VcdReader.hh"

#include "Zlib.hh"
#include "Stats.hh"
#include "Report.hh"
#include "Error.hh"
#include "StringUtil.hh"
Expand Down Expand Up @@ -79,6 +80,7 @@ VcdReader::read(const char *filename)
vcd_ = &vcd;
stream_ = gzopen(filename, "r");
if (stream_) {
Stats stats(debug_, report_);
filename_ = filename;
file_line_ = 1;
stmt_line_ = 1;
Expand Down Expand Up @@ -113,6 +115,7 @@ VcdReader::read(const char *filename)
token = getToken();
}
gzclose(stream_);
stats.report("Read VCD");
}
else
throw FileNotReadable(filename);
Expand Down
10 changes: 2 additions & 8 deletions search/Property.cc
Original file line number Diff line number Diff line change
Expand Up @@ -722,11 +722,8 @@ getProperty(const LibertyCell *cell,
return PropertyValue(cell->isBuffer());
else if (stringEqual(property, "is_inverter"))
return PropertyValue(cell->isInverter());
else if (stringEqual(property, "is_memory")
|| stringEqual(property, "is_memory_cell"))
else if (stringEqual(property, "is_memory"))
return PropertyValue(cell->isMemory());
else if (stringEqual(property, "has_memory"))
return PropertyValue(cell->hasMemory());
else if (stringEqual(property, "dont_use"))
return PropertyValue(cell->dontUse());
else if (stringEqual(property, "area"))
Expand Down Expand Up @@ -974,11 +971,8 @@ getProperty(const Instance *inst,
return PropertyValue(liberty_cell && liberty_cell->isInverter());
else if (stringEqual(property, "is_macro"))
return PropertyValue(liberty_cell && liberty_cell->isMacro());
else if (stringEqual(property, "is_memory")
|| stringEqual(property, "is_memory_cell"))
else if (stringEqual(property, "is_memory"))
return PropertyValue(liberty_cell && liberty_cell->isMemory());
else if (stringEqual(property, "has_memory"))
return PropertyValue(liberty_cell && liberty_cell->hasMemory());
else
throw PropertyUnknown("instance", property);
}
Expand Down
11 changes: 0 additions & 11 deletions test/get_has_memory.tcl

This file was deleted.

4 changes: 2 additions & 2 deletions test/get_has_memory.ok → test/get_is_memory.ok
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[get_cells -filter has_memory]
[get_cells -filter is_memory]
sram_inst
[get_lib_cells -filter has_memory]
[get_lib_cells -filter is_memory]
gf180mcu_fd_ip_sram__sram128x8m8wm1__ff_125C_1v98/gf180mcu_fd_ip_sram__sram128x8m8wm1
11 changes: 11 additions & 0 deletions test/get_is_memory.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Tests whether the is_memory attribute works for cells and libcells
read_liberty gf180mcu_sram.lib.gz
read_liberty asap7_small.lib.gz
read_verilog get_is_memory.v
link get_is_memory

# Test that the is_memory attribute is set correctly for cells
puts {[get_cells -filter is_memory]}
report_object_full_names [get_cells -filter is_memory]
puts {[get_lib_cells -filter is_memory]}
report_object_full_names [get_lib_cells -filter is_memory]
2 changes: 1 addition & 1 deletion test/get_has_memory.v → test/get_is_memory.v
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module get_has_memory (
module get_is_memory (
input CLK,
input CEN,
input GWEN,
Expand Down
Binary file added test/gf180mcu_sram.lib.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion test/regression_vars.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ record_sta_tests {
extras
liberty_arcs_one2one_1
liberty_arcs_one2one_2
get_has_memory
get_is_memory
get_filter
get_property_flags
get_noargs
Expand Down

0 comments on commit 3b7f344

Please sign in to comment.