Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/cgt/src/ClockGating.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ using utl::UniquePtrWithDeleter;
// a forward one to get at this function without angering
// gcc.
namespace abc {
// NOLINTBEGIN(readability-identifier-naming)
extern Abc_Ntk_t* Abc_NtkMulti(Abc_Ntk_t* pNtk,
int nThresh,
int nFaninMax,
Expand All @@ -68,6 +69,7 @@ extern Abc_Ntk_t* Abc_NtkMulti(Abc_Ntk_t* pNtk,
int fSimple,
int fFactor);
extern void Abc_FrameSetLibGen(void* pLib);
// NOLINTEND(readability-identifier-naming)
} // namespace abc

namespace cgt {
Expand Down Expand Up @@ -270,7 +272,7 @@ static std::vector<sta::Net*> downstreamNets(sta::dbSta* const sta,
bool searchTo(const sta::Vertex* const to_vertex,
const sta::Mode* mode) const final
{
return visited_.find(to_vertex) == visited_.end();
return visited.find(to_vertex) == visited.end();
}
bool searchThru(sta::Edge* edge, const sta::Mode* mode) const override
{
Expand All @@ -280,7 +282,7 @@ static std::vector<sta::Net*> downstreamNets(sta::dbSta* const sta,
&& role->genericRole() != sta::TimingRole::latchDtoQ();
}

std::unordered_set<const sta::Vertex*> visited_;
std::unordered_set<const sta::Vertex*> visited;
};

auto network = sta->getDbNetwork();
Expand All @@ -305,7 +307,7 @@ static std::vector<sta::Net*> downstreamNets(sta::dbSta* const sta,
visited_nets.insert(net);
nets.push_back(net);
}
pred.visited_.insert(vertex);
pred.visited.insert(vertex);
iter.enqueueAdjacentVertices(vertex);
}
}
Expand All @@ -323,7 +325,7 @@ static std::vector<sta::Net*> upstreamNets(sta::dbSta* const sta,
bool searchFrom(const sta::Vertex* const from_vertex,
const sta::Mode* mode) const final
{
return visited_.find(from_vertex) == visited_.end();
return visited.find(from_vertex) == visited.end();
}
bool searchTo(const sta::Vertex* const to_vertex,
const sta::Mode* mode) const final
Expand All @@ -338,7 +340,7 @@ static std::vector<sta::Net*> upstreamNets(sta::dbSta* const sta,
&& role->genericRole() != sta::TimingRole::latchDtoQ();
}

std::unordered_set<const sta::Vertex*> visited_;
std::unordered_set<const sta::Vertex*> visited;
};

auto network = sta->getDbNetwork();
Expand All @@ -364,7 +366,7 @@ static std::vector<sta::Net*> upstreamNets(sta::dbSta* const sta,
visited_nets.insert(net);
nets.push_back(net);
}
pred.visited_.insert(vertex);
pred.visited.insert(vertex);
iter.enqueueAdjacentVertices(vertex);
}
}
Expand Down
7 changes: 1 addition & 6 deletions src/cgt/src/ClockGatingImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@

#include "NetworkBuilder.h"
#include "RandomBits.h"
#include "base/abc/abc.h"
Comment thread
maliberty marked this conversation as resolved.
#include "cgt/ClockGating.h"
#include "db_sta/dbSta.hh"
#include "utl/Logger.h"
#include "utl/deleter.h"
#include "utl/unique_name.h"

namespace abc {
using Abc_Ntk_t = struct Abc_Ntk_t_;
using Abc_Obj_t = struct Abc_Obj_t_;
using Vec_Ptr_t = struct Vec_Ptr_t_;
} // namespace abc

namespace odb {
class dbDatabase;
} // namespace odb
Expand Down
18 changes: 9 additions & 9 deletions src/cgt/src/RandomBits.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ class RandomBits
public:
bool get()
{
if (bits_remaining == 0) {
bit_buffer = generator();
bits_remaining = sizeof(bit_buffer) * 8;
if (bits_remaining_ == 0) {
bit_buffer_ = generator_();
bits_remaining_ = sizeof(bit_buffer_) * 8;
}

bool bit = bit_buffer & 1;
bit_buffer >>= 1;
bits_remaining--;
bool bit = bit_buffer_ & 1;
bit_buffer_ >>= 1;
bits_remaining_--;

return bit;
}

private:
std::mt19937 generator;
uint32_t bit_buffer = 0;
uint32_t bits_remaining = 0;
std::mt19937 generator_;
uint32_t bit_buffer_ = 0;
uint32_t bits_remaining_ = 0;
};

} // namespace cgt
Loading