Hash -> size_t
This commit is contained in:
parent
e16696c347
commit
30a5abebc6
|
|
@ -38,12 +38,10 @@ if(NOT CMAKE_BUILD_TYPE)
|
|||
endif()
|
||||
|
||||
# Compiler specific options.
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES AppleClang|Clang)
|
||||
set(STA_COMPILE_OPTIONS -Wall -Wcast-qual -Wunused-parameter -Wredundant-decls -Wno-deprecated-register)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(STA_COMPILE_OPTIONS -Wall -Wcast-qual -Wunused-parameter -Wredundant-decls)
|
||||
# Note -Wno-deprecated-register is to suppress bison errors.
|
||||
if ((CMAKE_CXX_COMPILER_ID MATCHES AppleClang|Clang)
|
||||
OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
|
||||
set(STA_COMPILE_OPTIONS -Wall -Wextra -pedantic -Wcast-qual -Wredundant-decls -Wformat-security -Wno-deprecated-register)
|
||||
endif()
|
||||
|
||||
message(STATUS "System name: ${CMAKE_SYSTEM_NAME}")
|
||||
|
|
|
|||
|
|
@ -46,10 +46,7 @@ staMain(Sta *sta,
|
|||
Sta::setSta(sta);
|
||||
sta->makeComponents();
|
||||
|
||||
int thread_count = 1;
|
||||
bool threads_exists = false;
|
||||
parseThreadsArg(argc, argv, thread_count, threads_exists);
|
||||
if (threads_exists)
|
||||
int thread_count = parseThreadsArg(argc, argv);
|
||||
sta->setThreadCount(thread_count);
|
||||
|
||||
staSetupAppInit(argc, argv, swig_init, tcl_inits);
|
||||
|
|
@ -58,25 +55,20 @@ staMain(Sta *sta,
|
|||
Tcl_Main(1, argv, staTclAppInit);
|
||||
}
|
||||
|
||||
void
|
||||
parseThreadsArg(int argc,
|
||||
char **argv,
|
||||
int &thread_count,
|
||||
bool &exists)
|
||||
int
|
||||
parseThreadsArg(int &argc,
|
||||
char *argv[])
|
||||
{
|
||||
char *thread_arg = findCmdLineKey(argc, argv, "-threads");
|
||||
if (thread_arg) {
|
||||
if (stringEqual(thread_arg, "max")) {
|
||||
thread_count = processorCount();
|
||||
exists = true;
|
||||
}
|
||||
else if (isDigits(thread_arg)) {
|
||||
thread_count = atoi(thread_arg);
|
||||
exists = true;
|
||||
}
|
||||
if (stringEqual(thread_arg, "max"))
|
||||
return processorCount();
|
||||
else if (isDigits(thread_arg))
|
||||
return atoi(thread_arg);
|
||||
else
|
||||
fprintf(stderr,"Warning: -threads must be max or a positive integer.\n");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Set globals to pass to staTclAppInit.
|
||||
|
|
|
|||
|
|
@ -63,17 +63,9 @@ findCmdLineKey(int &argc,
|
|||
|
||||
void
|
||||
showUsage(const char *prog);
|
||||
void
|
||||
parseThreadsArg(int argc,
|
||||
char **argv,
|
||||
int &threads,
|
||||
bool &exists);
|
||||
void
|
||||
parseCmdsArg(int argc,
|
||||
char **argv,
|
||||
bool &native_cmds,
|
||||
bool &compatibility_cmds);
|
||||
|
||||
int
|
||||
parseThreadsArg(int &argc,
|
||||
char *argv[]);
|
||||
void
|
||||
sourceTclFile(const char *filename,
|
||||
bool echo,
|
||||
|
|
|
|||
|
|
@ -699,7 +699,7 @@ Graph::makeArcDelayPools(ArcIndex arc_count,
|
|||
}
|
||||
|
||||
// Leave some room for edits.
|
||||
unsigned annot_size = arc_count * 1.2;
|
||||
int annot_size = arc_count * 1.2;
|
||||
arc_delay_annotated_.resize(annot_size * ap_count);
|
||||
}
|
||||
}
|
||||
|
|
@ -731,9 +731,9 @@ Graph::makeEdgeArcDelays(Edge *edge)
|
|||
}
|
||||
edge->setArcDelays(arc_index);
|
||||
// Make sure there is room for delay_annotated flags.
|
||||
unsigned max_annot_index = (arc_index + arc_count) * ap_count_;
|
||||
size_t max_annot_index = (arc_index + arc_count) * ap_count_;
|
||||
if (max_annot_index >= arc_delay_annotated_.size()) {
|
||||
unsigned size = max_annot_index * 1.2;
|
||||
size_t size = max_annot_index * 1.2;
|
||||
arc_delay_annotated_.resize(size);
|
||||
}
|
||||
removeDelayAnnotated(edge);
|
||||
|
|
@ -817,7 +817,7 @@ Graph::arcDelayAnnotated(Edge *edge,
|
|||
DcalcAPIndex ap_index) const
|
||||
{
|
||||
if (arc_delay_annotated_.size()) {
|
||||
unsigned index = (edge->arcDelays() + arc->index()) * ap_count_ + ap_index;
|
||||
size_t index = (edge->arcDelays() + arc->index()) * ap_count_ + ap_index;
|
||||
if (index >= arc_delay_annotated_.size())
|
||||
internalError("arc_delay_annotated array bounds exceeded");
|
||||
return arc_delay_annotated_[index];
|
||||
|
|
@ -832,7 +832,7 @@ Graph::setArcDelayAnnotated(Edge *edge,
|
|||
DcalcAPIndex ap_index,
|
||||
bool annotated)
|
||||
{
|
||||
unsigned index = (edge->arcDelays() + arc->index()) * ap_count_ + ap_index;
|
||||
size_t index = (edge->arcDelays() + arc->index()) * ap_count_ + ap_index;
|
||||
if (index >= arc_delay_annotated_.size())
|
||||
internalError("arc_delay_annotated array bounds exceeded");
|
||||
arc_delay_annotated_[index] = annotated;
|
||||
|
|
@ -843,7 +843,7 @@ Graph::wireDelayAnnotated(Edge *edge,
|
|||
const TransRiseFall *tr,
|
||||
DcalcAPIndex ap_index) const
|
||||
{
|
||||
unsigned index = (edge->arcDelays() + TimingArcSet::wireArcIndex(tr)) * ap_count_
|
||||
size_t index = (edge->arcDelays() + TimingArcSet::wireArcIndex(tr)) * ap_count_
|
||||
+ ap_index;
|
||||
if (index >= arc_delay_annotated_.size())
|
||||
internalError("arc_delay_annotated array bounds exceeded");
|
||||
|
|
@ -856,7 +856,7 @@ Graph::setWireDelayAnnotated(Edge *edge,
|
|||
DcalcAPIndex ap_index,
|
||||
bool annotated)
|
||||
{
|
||||
unsigned index = (edge->arcDelays() + TimingArcSet::wireArcIndex(tr)) * ap_count_
|
||||
size_t index = (edge->arcDelays() + TimingArcSet::wireArcIndex(tr)) * ap_count_
|
||||
+ ap_index;
|
||||
if (index >= arc_delay_annotated_.size())
|
||||
internalError("arc_delay_annotated array bounds exceeded");
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ CycleAcctingLess::operator()(const CycleAccting *acct1,
|
|||
&& acct1->target()->index() < acct2->target()->index());
|
||||
}
|
||||
|
||||
Hash
|
||||
size_t
|
||||
CycleAcctingHash::operator()(const CycleAccting *acct) const
|
||||
{
|
||||
return hashSum(acct->src()->index(), acct->target()->index());
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public:
|
|||
class CycleAcctingHash
|
||||
{
|
||||
public:
|
||||
Hash operator()(const CycleAccting *acct) const;
|
||||
size_t operator()(const CycleAccting *acct) const;
|
||||
};
|
||||
|
||||
class CycleAcctingEqual
|
||||
|
|
|
|||
|
|
@ -292,16 +292,16 @@ ExceptionPath::fromThruToPriority(ExceptionFrom *from,
|
|||
return priority;
|
||||
}
|
||||
|
||||
Hash
|
||||
size_t
|
||||
ExceptionPath::hash() const
|
||||
{
|
||||
return hash(nullptr);
|
||||
}
|
||||
|
||||
Hash
|
||||
size_t
|
||||
ExceptionPath::hash(ExceptionPt *missing_pt) const
|
||||
{
|
||||
Hash hash = typePriority();
|
||||
size_t hash = typePriority();
|
||||
int pot = 32;
|
||||
ExceptionPtIterator pt_iter(this);
|
||||
while (pt_iter.hasNext()) {
|
||||
|
|
@ -942,7 +942,7 @@ ExceptionPt::ExceptionPt(const TransRiseFallBoth *tr,
|
|||
|
||||
// ExceptionPt initialization functions set hash_ and incrementally
|
||||
// maintain the value.
|
||||
Hash
|
||||
size_t
|
||||
ExceptionPt::hash() const
|
||||
{
|
||||
return hash_;
|
||||
|
|
@ -1040,7 +1040,7 @@ ExceptionFromTo::findHash()
|
|||
{
|
||||
hash_ = 0;
|
||||
if (pins_) {
|
||||
Hash hash = 0;
|
||||
size_t hash = 0;
|
||||
PinSet::Iterator pin_iter(pins_);
|
||||
while (pin_iter.hasNext()) {
|
||||
const Pin *pin = pin_iter.next();
|
||||
|
|
@ -1049,7 +1049,7 @@ ExceptionFromTo::findHash()
|
|||
hash_ += hash * hash_pin;
|
||||
}
|
||||
if (clks_) {
|
||||
Hash hash = 0;
|
||||
size_t hash = 0;
|
||||
ClockSet::Iterator clk_iter(clks_);
|
||||
while (clk_iter.hasNext()) {
|
||||
Clock *clk = clk_iter.next();
|
||||
|
|
@ -1058,7 +1058,7 @@ ExceptionFromTo::findHash()
|
|||
hash_ += hash * hash_clk;
|
||||
}
|
||||
if (insts_) {
|
||||
Hash hash = 0;
|
||||
size_t hash = 0;
|
||||
InstanceSet::Iterator inst_iter(insts_);
|
||||
while (inst_iter.hasNext()) {
|
||||
Instance *inst = inst_iter.next();
|
||||
|
|
@ -1931,7 +1931,7 @@ ExceptionThru::findHash()
|
|||
{
|
||||
hash_ = 0;
|
||||
if (pins_) {
|
||||
Hash hash = 0;
|
||||
size_t hash = 0;
|
||||
PinSet::Iterator pin_iter(pins_);
|
||||
while (pin_iter.hasNext()) {
|
||||
const Pin *pin = pin_iter.next();
|
||||
|
|
@ -1940,7 +1940,7 @@ ExceptionThru::findHash()
|
|||
hash_ += hash * hash_pin;
|
||||
}
|
||||
if (nets_) {
|
||||
Hash hash = 0;
|
||||
size_t hash = 0;
|
||||
NetSet::Iterator net_iter(nets_);
|
||||
while (net_iter.hasNext()) {
|
||||
Net *net = net_iter.next();
|
||||
|
|
@ -1949,7 +1949,7 @@ ExceptionThru::findHash()
|
|||
hash_ += hash * hash_net;
|
||||
}
|
||||
if (insts_) {
|
||||
Hash hash = 0;
|
||||
size_t hash = 0;
|
||||
InstanceSet::Iterator inst_iter(insts_);
|
||||
while (inst_iter.hasNext()) {
|
||||
Instance *inst = inst_iter.next();
|
||||
|
|
@ -2373,7 +2373,7 @@ ExceptionState::isComplete() const
|
|||
&& exception_->to() == nullptr;
|
||||
}
|
||||
|
||||
Hash
|
||||
size_t
|
||||
ExceptionState::hash() const
|
||||
{
|
||||
return hashSum(exception_->hash(), index_);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
#include "DisallowCopyAssign.hh"
|
||||
#include "Error.hh"
|
||||
#include "Set.hh"
|
||||
#include "Hash.hh"
|
||||
#include "SdcCmdComment.hh"
|
||||
#include "SdcClass.hh"
|
||||
|
||||
|
|
@ -95,8 +94,8 @@ public:
|
|||
static int fromThruToPriority(ExceptionFrom *from,
|
||||
ExceptionThruSeq *thrus,
|
||||
ExceptionTo *to);
|
||||
Hash hash() const;
|
||||
Hash hash(ExceptionPt *missing_pt) const;
|
||||
size_t hash() const;
|
||||
size_t hash(ExceptionPt *missing_pt) const;
|
||||
// Mergeable properties (independent of exception points).
|
||||
virtual bool mergeable(ExceptionPath *exception) const = 0;
|
||||
bool mergeablePts(ExceptionPath *exception) const;
|
||||
|
|
@ -336,7 +335,7 @@ public:
|
|||
virtual InstanceSet *instances() = 0;
|
||||
virtual NetSet *nets() = 0;
|
||||
virtual EdgePinsSet *edges() = 0;
|
||||
Hash hash() const;
|
||||
size_t hash() const;
|
||||
virtual int nameCmp(ExceptionPt *pt, const Network *network) const = 0;
|
||||
virtual void mergeInto(ExceptionPt *pt) = 0;
|
||||
// All pins and instance/net pins.
|
||||
|
|
@ -361,14 +360,14 @@ protected:
|
|||
bool own_pts_;
|
||||
// Hash is cached because there may be many objects to speed up
|
||||
// exception merging.
|
||||
Hash hash_;
|
||||
size_t hash_;
|
||||
|
||||
// Maximum number of objects for asString() to show.
|
||||
static const int as_string_max_objects_;
|
||||
static const Hash hash_clk = 3;
|
||||
static const Hash hash_pin = 5;
|
||||
static const Hash hash_net = 7;
|
||||
static const Hash hash_inst = 11;
|
||||
static const size_t hash_clk = 3;
|
||||
static const size_t hash_pin = 5;
|
||||
static const size_t hash_net = 7;
|
||||
static const size_t hash_inst = 11;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ExceptionPt);
|
||||
|
|
@ -645,7 +644,7 @@ public:
|
|||
ExceptionThru *nextThru() const { return next_thru_; }
|
||||
ExceptionState *nextState() const { return next_state_; }
|
||||
void setNextState(ExceptionState *next_state);
|
||||
Hash hash() const;
|
||||
size_t hash() const;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ExceptionState);
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ PinPairEqual::operator()(const PinPair *pair1,
|
|||
&& pair1->second == pair2->second;
|
||||
}
|
||||
|
||||
Hash
|
||||
size_t
|
||||
PinPairHash::operator()(const PinPair *pair) const
|
||||
{
|
||||
Hash hash = hash_init_value;
|
||||
size_t hash = hash_init_value;
|
||||
hashIncr(hash, hashPtr(pair->first));
|
||||
hashIncr(hash, hashPtr(pair->second));
|
||||
return hash;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ typedef Set<PinPair*, PinPairLess> PinPairSet;
|
|||
class PinPairHash
|
||||
{
|
||||
public:
|
||||
Hash operator()(const PinPair *pair) const;
|
||||
size_t operator()(const PinPair *pair) const;
|
||||
};
|
||||
|
||||
class PinPairEqual
|
||||
|
|
|
|||
10
sdc/Sdc.cc
10
sdc/Sdc.cc
|
|
@ -4905,9 +4905,9 @@ void
|
|||
Sdc::recordMergeHash(ExceptionPath *exception,
|
||||
ExceptionPt *missing_pt)
|
||||
{
|
||||
Hash hash = exception->hash(missing_pt);
|
||||
size_t hash = exception->hash(missing_pt);
|
||||
debugPrint3(debug_, "exception_merge", 3,
|
||||
"record merge hash %u %s missing %s\n",
|
||||
"record merge hash %zu %s missing %s\n",
|
||||
hash,
|
||||
exception->asString(network_),
|
||||
missing_pt->asString(network_));
|
||||
|
|
@ -5120,7 +5120,7 @@ Sdc::findMergeMatch(ExceptionPath *exception)
|
|||
ExceptionPtIterator missing_pt_iter(exception);
|
||||
while (missing_pt_iter.hasNext()) {
|
||||
ExceptionPt *missing_pt = missing_pt_iter.next();
|
||||
Hash hash = exception->hash(missing_pt);
|
||||
size_t hash = exception->hash(missing_pt);
|
||||
ExceptionPathSet *matches = exception_merge_hash_.findKey(hash);
|
||||
if (matches) {
|
||||
ExceptionPathSet::Iterator match_iter(matches);
|
||||
|
|
@ -5341,9 +5341,9 @@ void
|
|||
Sdc::unrecordMergeHash(ExceptionPath *exception,
|
||||
ExceptionPt *missing_pt)
|
||||
{
|
||||
Hash hash = exception->hash(missing_pt);
|
||||
size_t hash = exception->hash(missing_pt);
|
||||
debugPrint3(debug_, "exception_merge", 3,
|
||||
"unrecord merge hash %u %s missing %s\n",
|
||||
"unrecord merge hash %zu %s missing %s\n",
|
||||
hash,
|
||||
exception->asString(network_),
|
||||
missing_pt->asString(network_));
|
||||
|
|
|
|||
|
|
@ -1260,7 +1260,7 @@ protected:
|
|||
const Corner *corner,
|
||||
const MinMax *min_max) const;
|
||||
void removeClockGroups(ClockGroups *groups);
|
||||
void ensureClkGroupExclusions();;
|
||||
void ensureClkGroupExclusions();
|
||||
void makeClkGroupExclusions(ClockGroups *clk_groups);
|
||||
void makeClkGroupExclusions1(ClockGroupSet *groups);
|
||||
void makeClkGroupExclusions(ClockGroupSet *groups);
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ ClkInfo::refsFilter(const StaState *sta) const
|
|||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
Hash
|
||||
size_t
|
||||
ClkInfoHash::operator()(const ClkInfo *clk_info)
|
||||
{
|
||||
return clk_info->hash();
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public:
|
|||
bool refsFilter(const StaState *sta) const;
|
||||
// This clk_info/tag is used for a generated clock source path.
|
||||
bool isGenClkSrcPath() const { return is_gen_clk_src_path_; }
|
||||
Hash hash() const { return hash_; }
|
||||
size_t hash() const { return hash_; }
|
||||
|
||||
protected:
|
||||
void findHash(const StaState *sta);
|
||||
|
|
@ -83,7 +83,7 @@ private:
|
|||
ClockUncertainties *uncertainties_;
|
||||
Arrival insertion_;
|
||||
float latency_;
|
||||
Hash hash_;
|
||||
size_t hash_;
|
||||
unsigned int is_propagated_:1;
|
||||
unsigned int is_gen_clk_src_path_:1;
|
||||
unsigned int is_pulse_clk_:1;
|
||||
|
|
@ -106,7 +106,7 @@ protected:
|
|||
class ClkInfoHash
|
||||
{
|
||||
public:
|
||||
Hash operator()(const ClkInfo *clk_info);
|
||||
size_t operator()(const ClkInfo *clk_info);
|
||||
};
|
||||
|
||||
class ClkInfoEqual
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ typedef Vector<LibertyLibrary*> LibertySeq;
|
|||
class Corners : public StaState
|
||||
{
|
||||
public:
|
||||
explicit Corners(StaState *sta);;
|
||||
explicit Corners(StaState *sta);
|
||||
virtual ~Corners();
|
||||
void clear();
|
||||
int count() const;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#include "Stats.hh"
|
||||
#include "Debug.hh"
|
||||
#include "Report.hh"
|
||||
#include "Hash.hh"
|
||||
#include "Network.hh"
|
||||
#include "PortDirection.hh"
|
||||
#include "Graph.hh"
|
||||
|
|
@ -1283,10 +1282,10 @@ ClockPinPairLess::operator()(const ClockPinPair &pair1,
|
|||
class ClockPinPairHash
|
||||
{
|
||||
public:
|
||||
Hash operator()(const ClockPinPair &pair) const;
|
||||
size_t operator()(const ClockPinPair &pair) const;
|
||||
};
|
||||
|
||||
Hash
|
||||
size_t
|
||||
ClockPinPairHash::operator()(const ClockPinPair &pair) const
|
||||
{
|
||||
return hashSum(pair.first->index(), hashPtr(pair.second));
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@ protected:
|
|||
string descriptionField(Vertex *vertex);
|
||||
bool reportClkPath() const;
|
||||
string clkName(const Clock *clk,
|
||||
bool inverted);;
|
||||
bool inverted);
|
||||
bool hasExtInputDriver(const Pin *pin,
|
||||
const TransRiseFall *tr,
|
||||
const MinMax *min_max);
|
||||
|
|
@ -504,7 +504,7 @@ protected:
|
|||
// Return value.
|
||||
PathRef &ref_path);
|
||||
const char *asRisingFalling(const TransRiseFall *tr);
|
||||
const char *asRiseFall(const TransRiseFall *tr);;
|
||||
const char *asRiseFall(const TransRiseFall *tr);
|
||||
|
||||
// Path options.
|
||||
ReportPathFormat format_;
|
||||
|
|
|
|||
|
|
@ -2811,7 +2811,7 @@ Search::reportTagGroups() const
|
|||
tag_group->reportArrivalMap(this);
|
||||
}
|
||||
}
|
||||
Hash long_hash = tag_group_set_->longestBucketHash();
|
||||
size_t long_hash = tag_group_set_->longestBucketHash();
|
||||
report_->print("Longest hash bucket length %lu hash=%lu\n",
|
||||
tag_group_set_->bucketLength(long_hash),
|
||||
long_hash);
|
||||
|
|
@ -2927,8 +2927,8 @@ Search::reportTags() const
|
|||
tag->hash() % tag_set_->capacity(),
|
||||
tag->asString(false, this)) ;
|
||||
}
|
||||
Hash long_hash = tag_set_->longestBucketHash();
|
||||
printf("Longest hash bucket length %d hash=%u\n",
|
||||
size_t long_hash = tag_set_->longestBucketHash();
|
||||
printf("Longest hash bucket length %d hash=%zu\n",
|
||||
tag_set_->bucketLength(long_hash),
|
||||
long_hash);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
#include "Set.hh"
|
||||
#include "Map.hh"
|
||||
#include "UnorderedMap.hh"
|
||||
#include "Hash.hh"
|
||||
#include "StringSet.hh"
|
||||
#include "Delay.hh"
|
||||
#include "NetworkClass.hh"
|
||||
|
|
@ -77,7 +76,7 @@ class TagMatchHash
|
|||
public:
|
||||
TagMatchHash(bool match_crpr_clk_pin,
|
||||
const StaState *sta);
|
||||
Hash operator()(const Tag *tag) const;
|
||||
size_t operator()(const Tag *tag) const;
|
||||
|
||||
protected:
|
||||
bool match_crpr_clk_pin_;
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ Tag::findHash()
|
|||
hashIncr(match_hash_, clk_info_->isGenClkSrcPath());
|
||||
}
|
||||
|
||||
Hash
|
||||
size_t
|
||||
Tag::matchHash(bool match_crpr_clk_pin) const
|
||||
{
|
||||
if (match_crpr_clk_pin)
|
||||
|
|
@ -317,8 +317,8 @@ tagCmp(const Tag *tag1,
|
|||
if (path_ap_index1 > path_ap_index2)
|
||||
return 1;
|
||||
|
||||
Hash clk_info1 = tag1->clkInfo()->hash();
|
||||
Hash clk_info2 = tag2->clkInfo()->hash();
|
||||
size_t clk_info1 = tag1->clkInfo()->hash();
|
||||
size_t clk_info2 = tag2->clkInfo()->hash();
|
||||
if (clk_info1 < clk_info2)
|
||||
return -1;
|
||||
if (clk_info1 > clk_info2)
|
||||
|
|
@ -650,7 +650,7 @@ tagStateEqualCrpr(const Tag *tag1,
|
|||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
Hash
|
||||
size_t
|
||||
TagHash::operator()(const Tag *tag)
|
||||
{
|
||||
return tag->hash();
|
||||
|
|
@ -670,7 +670,7 @@ TagMatchHash::TagMatchHash(bool match_crpr_clk_pin,
|
|||
{
|
||||
}
|
||||
|
||||
Hash
|
||||
size_t
|
||||
TagMatchHash::operator()(const Tag *tag) const
|
||||
{
|
||||
return tag->matchHash(match_crpr_clk_pin_);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
#include "DisallowCopyAssign.hh"
|
||||
#include "Vector.hh"
|
||||
#include "Set.hh"
|
||||
#include "Hash.hh"
|
||||
#include "SearchClass.hh"
|
||||
#include "SdcClass.hh"
|
||||
#include "Transition.hh"
|
||||
|
|
@ -79,8 +78,8 @@ public:
|
|||
bool isLoop() const { return is_loop_; }
|
||||
bool isFilter() const { return is_filter_; }
|
||||
bool isSegmentStart() const { return is_segment_start_; }
|
||||
Hash hash() const { return hash_; }
|
||||
Hash matchHash(bool match_crpr_clk_pin) const;
|
||||
size_t hash() const { return hash_; }
|
||||
size_t matchHash(bool match_crpr_clk_pin) const;
|
||||
|
||||
protected:
|
||||
void findHash();
|
||||
|
|
@ -91,8 +90,8 @@ private:
|
|||
ClkInfo *clk_info_;
|
||||
InputDelay *input_delay_;
|
||||
ExceptionStateSet *states_;
|
||||
Hash hash_;
|
||||
Hash match_hash_;
|
||||
size_t hash_;
|
||||
size_t match_hash_;
|
||||
bool is_clk_:1;
|
||||
bool is_filter_:1;
|
||||
bool is_loop_:1;
|
||||
|
|
@ -121,7 +120,7 @@ public:
|
|||
class TagHash
|
||||
{
|
||||
public:
|
||||
Hash operator()(const Tag *tag);
|
||||
size_t operator()(const Tag *tag);
|
||||
};
|
||||
|
||||
class TagEqual
|
||||
|
|
|
|||
|
|
@ -58,10 +58,10 @@ TagGroup::~TagGroup()
|
|||
delete arrival_map_;
|
||||
}
|
||||
|
||||
Hash
|
||||
size_t
|
||||
TagGroup::arrivalMapHash(ArrivalMap *arrival_map)
|
||||
{
|
||||
Hash hash = 0;
|
||||
size_t hash = 0;
|
||||
ArrivalMap::Iterator arrival_iter(arrival_map);
|
||||
while (arrival_iter.hasNext()) {
|
||||
Tag *tag;
|
||||
|
|
@ -338,7 +338,7 @@ TagGroupBldr::copyArrivals(TagGroup *tag_group,
|
|||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
Hash
|
||||
size_t
|
||||
TagGroupHash::operator()(const TagGroup *group) const
|
||||
{
|
||||
return group->hash();
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include "Iterator.hh"
|
||||
#include "MinMax.hh"
|
||||
#include "Transition.hh"
|
||||
#include "Hash.hh"
|
||||
#include "GraphClass.hh"
|
||||
#include "SearchClass.hh"
|
||||
#include "Tag.hh"
|
||||
|
|
@ -47,7 +46,7 @@ public:
|
|||
TagGroup(TagGroupBldr *tag_bldr);
|
||||
~TagGroup();
|
||||
TagGroupIndex index() const { return index_; }
|
||||
Hash hash() const { return hash_; }
|
||||
size_t hash() const { return hash_; }
|
||||
void report(const StaState *sta) const;
|
||||
void reportArrivalMap(const StaState *sta) const;
|
||||
bool hasClkTag() const { return has_clk_tag_; }
|
||||
|
|
@ -67,11 +66,11 @@ public:
|
|||
bool hasTag(Tag *tag) const;
|
||||
|
||||
protected:
|
||||
Hash arrivalMapHash(ArrivalMap *arrival_map);
|
||||
size_t arrivalMapHash(ArrivalMap *arrival_map);
|
||||
|
||||
// tag -> arrival index
|
||||
ArrivalMap *arrival_map_;
|
||||
Hash hash_;
|
||||
size_t hash_;
|
||||
unsigned int index_:tag_group_index_bits;
|
||||
unsigned int has_clk_tag_:1;
|
||||
unsigned int has_genclk_src_tag_:1;
|
||||
|
|
@ -86,7 +85,7 @@ private:
|
|||
class TagGroupHash
|
||||
{
|
||||
public:
|
||||
Hash operator()(const TagGroup *tag) const;
|
||||
size_t operator()(const TagGroup *tag) const;
|
||||
};
|
||||
|
||||
class TagGroupEqual
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public:
|
|||
const char *gnd_name,
|
||||
const StaState *sta);
|
||||
~WritePathSpice();
|
||||
void writeSpice();;
|
||||
void writeSpice();
|
||||
|
||||
private:
|
||||
void writeHeader();
|
||||
|
|
@ -228,7 +228,7 @@ class SubcktEndsMissing : public StaException
|
|||
{
|
||||
public:
|
||||
SubcktEndsMissing(const char *cell_name,
|
||||
const char *subckt_filename);;
|
||||
const char *subckt_filename);
|
||||
const char *what() const throw();
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@
|
|||
|
||||
namespace sta {
|
||||
|
||||
Hash
|
||||
size_t
|
||||
hashString(const char *str)
|
||||
{
|
||||
unsigned hash = hash_init_value;
|
||||
size_t hash = hash_init_value;
|
||||
size_t length = strlen(str);
|
||||
for (size_t i = 0; i < length; i++)
|
||||
hash = ((hash << 5) + hash) ^ str[i];
|
||||
|
|
|
|||
18
util/Hash.hh
18
util/Hash.hh
|
|
@ -17,26 +17,26 @@
|
|||
#ifndef STA_HASH_H
|
||||
#define STA_HASH_H
|
||||
|
||||
#include <stddef.h> // size_t
|
||||
#include <cstddef>
|
||||
|
||||
namespace sta {
|
||||
|
||||
typedef unsigned int Hash;
|
||||
using std::size_t;
|
||||
|
||||
const Hash hash_init_value = 5381;
|
||||
const size_t hash_init_value = 5381;
|
||||
|
||||
// Dan Bernstein, comp.lang.c.
|
||||
inline Hash
|
||||
hashSum(Hash hash,
|
||||
Hash add)
|
||||
inline size_t
|
||||
hashSum(size_t hash,
|
||||
size_t add)
|
||||
{
|
||||
// hash * 31 ^ add.
|
||||
return ((hash << 5) + hash) ^ add;
|
||||
}
|
||||
|
||||
inline void
|
||||
hashIncr(Hash &hash,
|
||||
Hash add)
|
||||
hashIncr(size_t &hash,
|
||||
size_t add)
|
||||
{
|
||||
// hash * 31 ^ add.
|
||||
hash = ((hash << 5) + hash) ^ add;
|
||||
|
|
@ -49,7 +49,7 @@ nextMersenne(size_t n)
|
|||
}
|
||||
|
||||
// Sadly necessary until c++ std::hash works for char *.
|
||||
Hash
|
||||
size_t
|
||||
hashString(const char *str);
|
||||
|
||||
} // namespace
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#define STA_HASHSET_H
|
||||
|
||||
#include <stddef.h> // size_t
|
||||
#include "Hash.hh"
|
||||
|
||||
namespace sta {
|
||||
|
||||
|
|
@ -51,8 +50,8 @@ public:
|
|||
void clear();
|
||||
void deleteContentsClear();
|
||||
int longestBucketLength() const;
|
||||
Hash longestBucketHash() const;
|
||||
int bucketLength(Hash hash) const;
|
||||
size_t longestBucketHash() const;
|
||||
int bucketLength(size_t hash) const;
|
||||
|
||||
void
|
||||
deleteContents()
|
||||
|
|
@ -424,11 +423,11 @@ HashSet<KEY, HASH, EQUAL>::longestBucketLength() const
|
|||
}
|
||||
|
||||
template <class KEY, class HASH, class EQUAL>
|
||||
Hash
|
||||
size_t
|
||||
HashSet<KEY, HASH, EQUAL>::longestBucketHash() const
|
||||
{
|
||||
int longest = 0;
|
||||
Hash longest_hash = 0;
|
||||
size_t longest_hash = 0;
|
||||
for (size_t hash = 0; hash < capacity_; hash++) {
|
||||
int length = bucketLength(hash);
|
||||
if (length > longest) {
|
||||
|
|
@ -441,7 +440,7 @@ HashSet<KEY, HASH, EQUAL>::longestBucketHash() const
|
|||
|
||||
template <class KEY, class HASH, class EQUAL>
|
||||
int
|
||||
HashSet<KEY, HASH, EQUAL>::bucketLength(Hash hash) const
|
||||
HashSet<KEY, HASH, EQUAL>::bucketLength(size_t hash) const
|
||||
{
|
||||
int length = 0;
|
||||
for (HashSetBucket<KEY> *bucket = table_[hash];
|
||||
|
|
|
|||
Loading…
Reference in New Issue