Skip to content

Commit d6043f5

Browse files
committed
cgt: adjust naming to Google-style (excluding method names)
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
1 parent ae0cf47 commit d6043f5

3 files changed

Lines changed: 18 additions & 21 deletions

File tree

src/cgt/src/ClockGating.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ using utl::UniquePtrWithDeleter;
6060
// a forward one to get at this function without angering
6161
// gcc.
6262
namespace abc {
63+
// NOLINTBEGIN(readability-identifier-naming)
6364
extern Abc_Ntk_t* Abc_NtkMulti(Abc_Ntk_t* pNtk,
6465
int nThresh,
6566
int nFaninMax,
@@ -68,6 +69,7 @@ extern Abc_Ntk_t* Abc_NtkMulti(Abc_Ntk_t* pNtk,
6869
int fSimple,
6970
int fFactor);
7071
extern void Abc_FrameSetLibGen(void* pLib);
72+
// NOLINTEND(readability-identifier-naming)
7173
} // namespace abc
7274

7375
namespace cgt {
@@ -270,7 +272,7 @@ static std::vector<sta::Net*> downstreamNets(sta::dbSta* const sta,
270272
bool searchTo(const sta::Vertex* const to_vertex,
271273
const sta::Mode* mode) const final
272274
{
273-
return visited_.find(to_vertex) == visited_.end();
275+
return visited.find(to_vertex) == visited.end();
274276
}
275277
bool searchThru(sta::Edge* edge, const sta::Mode* mode) const override
276278
{
@@ -280,7 +282,7 @@ static std::vector<sta::Net*> downstreamNets(sta::dbSta* const sta,
280282
&& role->genericRole() != sta::TimingRole::latchDtoQ();
281283
}
282284

283-
std::unordered_set<const sta::Vertex*> visited_;
285+
std::unordered_set<const sta::Vertex*> visited;
284286
};
285287

286288
auto network = sta->getDbNetwork();
@@ -305,7 +307,7 @@ static std::vector<sta::Net*> downstreamNets(sta::dbSta* const sta,
305307
visited_nets.insert(net);
306308
nets.push_back(net);
307309
}
308-
pred.visited_.insert(vertex);
310+
pred.visited.insert(vertex);
309311
iter.enqueueAdjacentVertices(vertex);
310312
}
311313
}
@@ -323,7 +325,7 @@ static std::vector<sta::Net*> upstreamNets(sta::dbSta* const sta,
323325
bool searchFrom(const sta::Vertex* const from_vertex,
324326
const sta::Mode* mode) const final
325327
{
326-
return visited_.find(from_vertex) == visited_.end();
328+
return visited.find(from_vertex) == visited.end();
327329
}
328330
bool searchTo(const sta::Vertex* const to_vertex,
329331
const sta::Mode* mode) const final
@@ -338,7 +340,7 @@ static std::vector<sta::Net*> upstreamNets(sta::dbSta* const sta,
338340
&& role->genericRole() != sta::TimingRole::latchDtoQ();
339341
}
340342

341-
std::unordered_set<const sta::Vertex*> visited_;
343+
std::unordered_set<const sta::Vertex*> visited;
342344
};
343345

344346
auto network = sta->getDbNetwork();
@@ -364,7 +366,7 @@ static std::vector<sta::Net*> upstreamNets(sta::dbSta* const sta,
364366
visited_nets.insert(net);
365367
nets.push_back(net);
366368
}
367-
pred.visited_.insert(vertex);
369+
pred.visited.insert(vertex);
368370
iter.enqueueAdjacentVertices(vertex);
369371
}
370372
}

src/cgt/src/ClockGatingImpl.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,13 @@
1111

1212
#include "NetworkBuilder.h"
1313
#include "RandomBits.h"
14+
#include "base/abc/abc.h"
1415
#include "cgt/ClockGating.h"
1516
#include "db_sta/dbSta.hh"
1617
#include "utl/Logger.h"
1718
#include "utl/deleter.h"
1819
#include "utl/unique_name.h"
1920

20-
namespace abc {
21-
using Abc_Ntk_t = struct Abc_Ntk_t_;
22-
using Abc_Obj_t = struct Abc_Obj_t_;
23-
using Vec_Ptr_t = struct Vec_Ptr_t_;
24-
} // namespace abc
25-
2621
namespace odb {
2722
class dbDatabase;
2823
} // namespace odb

src/cgt/src/RandomBits.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ class RandomBits
1313
public:
1414
bool get()
1515
{
16-
if (bits_remaining == 0) {
17-
bit_buffer = generator();
18-
bits_remaining = sizeof(bit_buffer) * 8;
16+
if (bits_remaining_ == 0) {
17+
bit_buffer_ = generator_();
18+
bits_remaining_ = sizeof(bit_buffer_) * 8;
1919
}
2020

21-
bool bit = bit_buffer & 1;
22-
bit_buffer >>= 1;
23-
bits_remaining--;
21+
bool bit = bit_buffer_ & 1;
22+
bit_buffer_ >>= 1;
23+
bits_remaining_--;
2424

2525
return bit;
2626
}
2727

2828
private:
29-
std::mt19937 generator;
30-
uint32_t bit_buffer = 0;
31-
uint32_t bits_remaining = 0;
29+
std::mt19937 generator_;
30+
uint32_t bit_buffer_ = 0;
31+
uint32_t bits_remaining_ = 0;
3232
};
3333

3434
} // namespace cgt

0 commit comments

Comments
 (0)