8000 Apply 'make format' · verilator/verilator@600de33 · GitHub
[go: up one dir, main page]

Skip to content 10000

Commit 600de33

Browse files
author
github action
committed
Apply 'make format'
1 parent 648efe9 commit 600de33

File tree

2 files changed

+55
-44
lines changed

2 files changed

+55
-44
lines changed

include/verilated_saif_c.cpp

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ void VerilatedSaifActivityVar::emitBit(const uint64_t time, const CData newval)
7272
}
7373

7474
VL_ATTR_ALWINLINE
75-
void VerilatedSaifActivityVar::emitWData(const uint64_t time, const WData* newvalp, const uint32_t bits) {
75+
void VerilatedSaifActivityVar::emitWData(const uint64_t time, const WData* newvalp,
76+
const uint32_t bits) {
7677
assert(m_lastTime <= time);
7778
const uint64_t dt = time - m_lastTime;
7879
for (std::size_t i = 0; i < std::min(m_width, bits); ++i) {
@@ -121,7 +122,7 @@ void VerilatedSaif::open(const char* filename) VL_MT_SAFE_EXCLUDES(m_mutex) {
121122
if (isOpen()) return;
122123

123124
// Set member variables
124-
m_filename = filename; // "" is ok, as someone may overload open
125+
m_filename = filename; // "" is ok, as someone may overload open
125126

126127
initializeSaifFileContents();
127128

@@ -144,9 +145,7 @@ void VerilatedSaif::initializeSaifFileContents() {
144145
printStr(")\n");
145146
}
146147

147-
bool VerilatedSaif::preChangeDump() {
148-
return isOpen();
149-
}
148+
bool VerilatedSaif::preChangeDump() { return isOpen(); }
150149

151150
void VerilatedSaif::emitTimeChange(uint64_t timeui) { m_time = timeui; }
152151

@@ -359,8 +358,9 @@ void VerilatedSaif::popPrefix() {
359358
m_prefixStack.pop_back();
360359
}
361360

362-
void VerilatedSaif::declare(const uint32_t code, const char* name, const char* wirep, const bool array,
363-
const int arraynum, const bool bussed, const int msb, const int lsb) {
361+
void VerilatedSaif::declare(const uint32_t code, const char* name, const char* wirep,
362+
const bool array, const int arraynum, const bool bussed, const int msb,
363+
const int lsb) {
364364
const int bits = ((msb > lsb) ? (msb - lsb) : (lsb - msb)) + 1;
365365

366366
const std::string hierarchicalName = m_prefixStack.back().first + name;
@@ -390,35 +390,41 @@ void VerilatedSaif::declare(const uint32_t code, const char* name, const char* w
390390
m_activityArena.back().data() + bitsIdx});
391391
}
392392

393-
void VerilatedSaif::declEvent(const uint32_t code, const uint32_t fidx, const char* name, const int dtypenum,
394-
const VerilatedTraceSigDirection, const VerilatedTraceSigKind,
395-
const VerilatedTraceSigType, const bool array, const int arraynum) {
393+
void VerilatedSaif::declEvent(const uint32_t code, const uint32_t fidx, const char* name,
394+
const int dtypenum, const VerilatedTraceSigDirection,
395+
const VerilatedTraceSigKind, const VerilatedTraceSigType,
396+
const bool array, const int arraynum) {
396397
declare(code, name, "event", array, arraynum, false, 0, 0);
397398
}
398399

399-
void VerilatedSaif::declBit(const uint32_t code, const uint32_t fidx, const char* name, const int dtypenum,
400-
const VerilatedTraceSigDirection, const VerilatedTraceSigKind,
401-
const VerilatedTraceSigType, const bool array, const int arraynum) {
400+
void VerilatedSaif::declBit(const uint32_t code, const uint32_t fidx, const char* name,
401+
const int dtypenum, const VerilatedTraceSigDirection,
402+
const VerilatedTraceSigKind, const VerilatedTraceSigType,
403+
const bool array, const int arraynum) {
402404
declare(code, name, "wire", array, arraynum, false, 0, 0);
403405
}
404-
void VerilatedSaif::declBus(const uint32_t code, const uint32_t fidx, const char* name, const int dtypenum,
405-
const VerilatedTraceSigDirection, const VerilatedTraceSigKind,
406-
const VerilatedTraceSigType, const bool array, const int arraynum, const int msb, const int lsb) {
406+
void VerilatedSaif::declBus(const uint32_t code, const uint32_t fidx, const char* name,
407+
const int dtypenum, const VerilatedTraceSigDirection,
408+
const VerilatedTraceSigKind, const VerilatedTraceSigType,
409+
const bool array, const int arraynum, const int msb, const int lsb) {
407410
declare(code, name, "wire", array, arraynum, true, msb, lsb);
408411
}
409-
void VerilatedSaif::declQuad(const uint32_t code, const uint32_t fidx, const char* name, const int dtypenum,
410-
const VerilatedTraceSigDirection, const VerilatedTraceSigKind,
411-
const VerilatedTraceSigType, const bool array, const int arraynum, const int msb, const int lsb) {
412+
void VerilatedSaif::declQuad(const uint32_t code, const uint32_t fidx, const char* name,
413+
const int dtypenum, const VerilatedTraceSigDirection,
414+
const VerilatedTraceSigKind, const VerilatedTraceSigType,
415+
const bool array, const int arraynum, const int msb, const int lsb) {
412416
declare(code, name, "wire", array, arraynum, true, msb, lsb);
413417
}
414-
void VerilatedSaif::declArray(const uint32_t code, const uint32_t fidx, const char* name, const int dtypenum,
415-
const VerilatedTraceSigDirection, const VerilatedTraceSigKind,
416-
const VerilatedTraceSigType, const bool array, const int arraynum, const int msb, const int lsb) {
418+
void VerilatedSaif::declArray(const uint32_t code, const uint32_t fidx, const char* name,
419+
const int dtypenum, const VerilatedTraceSigDirection,
420+
const VerilatedTraceSigKind, const VerilatedTraceSigType,
421+
const bool array, const int arraynum, const int msb, const int lsb) {
417422
declare(code, name, "wire", array, arraynum, true, msb, lsb);
418423
}
419-
void VerilatedSaif::declDouble(const uint32_t code, const uint32_t fidx, const char* name, const int dtypenum,
420-
const VerilatedTraceSigDirection, const VerilatedTraceSigKind,
421-
const VerilatedTraceSigType, const bool array, const int arraynum) {
424+
void VerilatedSaif::declDouble(const uint32_t code, const uint32_t fidx, const char* name,
425+
const int dtypenum, const VerilatedTraceSigDirection,
426+
const VerilatedTraceSigKind, const VerilatedTraceSigType,
427+
const bool array, const int arraynum) {
422428
declare(code, name, "real", array, arraynum, false, 63, 0);
423429
}
424430

include/verilated_saif_c.h

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ class VerilatedSaifFile;
3636
3737
class VerilatedSaifActivityBit final {
3838
// MEMBERS
39-
bool m_lastVal = false; // last emitted activity bit value
40-
uint64_t m_highTime = 0; // total time when bit was high
41-
size_t m_transitions = 0; // total number of bit transitions
39+
bool m_lastVal = false; // last emitted activity bit value
40+
uint64_t m_highTime = 0; // total time when bit was high
41+
size_t m_transitions = 0; // total number of bit transitions
4242

4343
public:
4444
// METHODS
@@ -60,9 +60,9 @@ class VerilatedSaifActivityBit final {
6060

6161
class VerilatedSaifActivityVar final {
6262
// MEMBERS
63-
uint64_t m_lastTime{0}; // last time when variable value was updated
64-
VerilatedSaifActivityBit* m_bits; // pointer to variable bits objects
65-
uint32_t m_width; // width of variable (in bits)
63+
uint64_t m_lastTime{0}; // last time when variable value was updated
64+
VerilatedSaifActivityBit* m_bits; // pointer to variable bits objects
65+
uint32_t m_width; // width of variable (in bits)
6666

6767
public:
6868
// CONSTRUCTORS
@@ -106,10 +106,11 @@ class VerilatedSaifActivityVar final {
106106

107107
class VerilatedSaifActivityScope final {
108108
// MEMBERS
109-
std::string m_scopeName{}; // name of the activity scope
110-
std::vector<int32_t> m_childScopesIndices{}; // array indices of child scopes
111-
std::vector<std::pair<uint32_t, std::string>> m_childActivities{}; // children signals codes mapped to their names in the current scope
112-
int32_t m_parentScopeIndex{-1}; // array index of parent scope
109+
std::string m_scopeName{}; // name of the activity scope
110+
std::vector<int32_t> m_childScopesIndices{}; // array indices of child scopes
111+
std::vector<std::pair<uint32_t, std::string>>
112+
m_childActivities{}; // children signals codes mapped to their names in the current scope
113+
int32_t m_parentScopeIndex{-1}; // array index of parent scope
113114

114115
public:
115116
// CONSTRUCTORS
@@ -165,16 +166,18 @@ class VerilatedSaif VL_NOT_FINAL : public VerilatedTrace<VerilatedSaif, Verilate
165166
bool m_isOpen = false; // True indicates open file
166167
std::string m_filename; // Filename we're writing to (if open)
167168

168-
int m_indent = 0; // indentation size in spaces
169+
int m_indent = 0; // indentation size in spaces
169170

170-
int32_t m_currentScope{-1}; // currently active scope
171-
std::vector<VerilatedSaifActivityScope> m_scopes{}; // array of declared scopes
172-
std::vector<int32_t> m_topScopes{}; // array of top scopes
171+
int32_t m_currentScope{-1}; // currently active scope
172+
std::vector<VerilatedSaifActivityScope> m_scopes{}; // array of declared scopes
173+
std::vector<int32_t> m_topScopes{}; // array of top scopes
173174

174-
std::unordered_map<uint32_t, VerilatedSaifActivityVar> m_activity; // map of variables codes mapped to their activity objects
175-
std::vector<std::vector<VerilatedSaifActivityBit>> m_activityArena; // memory pool for signals bits objects
175+
std::unordered_map<uint32_t, VerilatedSaifActivityVar>
176+
m_activity; // map of variables codes mapped to their activity objects
177+
std::vector<std::vector<VerilatedSaifActivityBit>>
178+
m_activityArena; // memory pool for signals bits objects
176179

177-
uint64_t m_time{0}; // total time of the currently traced simulation
180+
uint64_t m_time{0}; // total time of the currently traced simulation
178181

179182
// stack of declared scopes combined names
180183
std::vector<std::pair<std::string, VerilatedTracePrefixType>> m_prefixStack{
@@ -238,7 +241,8 @@ class VerilatedSaif VL_NOT_FINAL : public VerilatedTrace<VerilatedSaif, Verilate
238241

239242
// ACCESSORS
240243
// Set size in bytes after which new file should be created.
241-
void rolloverSize(uint64_t size) VL_MT_SAFE { /* noop */ }
244+
void rolloverSize(uint64_t size) VL_MT_SAFE { /* noop */
245+
}
242246

243247
// METHODS - All must be thread safe
244248
// Open the file; call isOpen() to see if errors
@@ -378,7 +382,8 @@ class VerilatedSaifC VL_NOT_FINAL : public VerilatedTraceBaseC {
378382
/// "cat" to be used to combine the header plus any number of data files.
379383
void openNext(bool incFilename = true) VL_MT_SAFE { m_sptrace.openNext(incFilename); }
380384

381-
void rolloverSize(size_t size) VL_MT_SAFE { /* noop */ }
385+
void rolloverSize(size_t size) VL_MT_SAFE { /* noop */
386+
}
382387

383388
/// Close dump
384389
void close() VL_MT_SAFE {

0 commit comments

Comments
 (0)
0