Skip to content

Commit 50094ca

Browse files
committed
Internals: Add cpplint control file and related cleanups
1 parent 15b32dc commit 50094ca

15 files changed

+60
-12
lines changed

CPPLINT.cfg

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
set noparent
2+
linelength=100
3+
filter=-build/c++11
4+
filter=-build/header_guard
5+
filter=-build/include_order
6+
filter=-build/include_subdir
7+
filter=-readability/inheritance
8+
filter=-readability/nolint
9+
filter=-readability/todo
10+
filter=-runtime/references
11+
filter=-whitespace/blank_line
12+
filter=-whitespace/empty_if_body
13+
filter=-whitespace/indent
14+
filter=-whitespace/newline
15+
filter=-whitespace/braces
16+
filter=-whitespace/parens
17+
filter=-whitespace/todo

include/verilated_cov.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <deque>
3030
#include <fstream>
3131
#include <map>
32+
#include <utility>
3233

3334
//=============================================================================
3435
// VerilatedCovConst

include/verilated_fst_c.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ void VerilatedFst::declare(vluint32_t code, const char* name, int dtypenum, fstV
195195
// If the scope ends with a non-ascii character, it will be 0x80 + fstScopeType
196196
fstWriterSetScope(m_fst, static_cast<fstScopeType>(new_it->back() & 0x7f),
197197
tmpModName.c_str(), nullptr);
198-
} else
198+
} else {
199199
fstWriterSetScope(m_fst, FST_ST_VCD_SCOPE, new_it->c_str(), nullptr);
200-
200+
}
201201
m_curScope.push_back(*new_it);
202202
new_it = tokens.erase(new_it);
203203
}

include/verilated_fst_sc.h

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#include "verilated_sc.h"
2727
#include "verilated_fst_c.h"
2828

29+
#include <string>
30+
2931
//=============================================================================
3032
// VerilatedFstSc
3133
///

include/verilated_funcs.h

+8-6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#error "verilated_funcs.h should only be included by verilated.h"
2929
#endif
3030

31+
#include <string>
32+
3133
//=========================================================================
3234
// Extern functions -- User may override -- See verilated.cpp
3335

@@ -2036,40 +2038,40 @@ static inline WDataOutP VL_CONST_W_2X(int obits, WDataOutP o, EData d1, EData d0
20362038
static inline WDataOutP VL_CONST_W_3X(int obits, WDataOutP o, EData d2, EData d1,
20372039
EData d0) VL_MT_SAFE {
20382040
o[0] = d0; o[1] = d1; o[2] = d2;
2039-
VL_C_END_(obits,3);
2041+
VL_C_END_(obits, 3);
20402042
}
20412043
static inline WDataOutP VL_CONST_W_4X(int obits, WDataOutP o,
20422044
EData d3, EData d2, EData d1, EData d0) VL_MT_SAFE {
20432045
o[0] = d0; o[1] = d1; o[2] = d2; o[3] = d3;
2044-
VL_C_END_(obits,4);
2046+
VL_C_END_(obits, 4);
20452047
}
20462048
static inline WDataOutP VL_CONST_W_5X(int obits, WDataOutP o,
20472049
EData d4,
20482050
EData d3, EData d2, EData d1, EData d0) VL_MT_SAFE {
20492051
o[0] = d0; o[1] = d1; o[2] = d2; o[3] = d3;
20502052
o[4] = d4;
2051-
VL_C_END_(obits,5);
2053+
VL_C_END_(obits, 5);
20522054
}
20532055
static inline WDataOutP VL_CONST_W_6X(int obits, WDataOutP o,
20542056
EData d5, EData d4,
20552057
EData d3, EData d2, EData d1, EData d0) VL_MT_SAFE {
20562058
o[0] = d0; o[1] = d1; o[2] = d2; o[3] = d3;
20572059
o[4] = d4; o[5] = d5;
2058-
VL_C_END_(obits,6);
2060+
VL_C_END_(obits, 6);
20592061
}
20602062
static inline WDataOutP VL_CONST_W_7X(int obits, WDataOutP o,
20612063
EData d6, EData d5, EData d4,
20622064
EData d3, EData d2, EData d1, EData d0) VL_MT_SAFE {
20632065
o[0] = d0; o[1] = d1; o[2] = d2; o[3] = d3;
20642066
o[4] = d4; o[5] = d5; o[6] = d6;
2065-
VL_C_END_(obits,7);
2067+
VL_C_END_(obits, 7);
20662068
}
20672069
static inline WDataOutP VL_CONST_W_8X(int obits, WDataOutP o,
20682070
EData d7, EData d6, EData d5, EData d4,
20692071
EData d3, EData d2, EData d1, EData d0) VL_MT_SAFE {
20702072
o[0] = d0; o[1] = d1; o[2] = d2; o[3] = d3;
20712073
o[4] = d4; o[5] = d5; o[6] = d6; o[7] = d7;
2072-
VL_C_END_(obits,8);
2074+
VL_C_END_(obits, 8);
20732075
}
20742076
//
20752077
static inline WDataOutP VL_CONSTHI_W_1X(int obits, int lsb, WDataOutP obase,

include/verilated_imp.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@
3232
#include "verilated.h"
3333
#include "verilated_syms.h"
3434

35+
#include <algorithm>
3536
#include <deque>
37+
#include <map>
38+
#include <numeric>
3639
#include <set>
40+
#include <string>
41+
#include <utility>
3742
#include <vector>
38-
#include <numeric>
3943
#ifdef VL_THREADED
4044
# include <functional>
4145
# include <queue>

include/verilated_profiler.h

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
#include "verilatedos.h"
2626
#include "verilated.h" // for VerilatedMutex and clang annotations
2727

28+
#include <deque>
29+
#include <string>
30+
2831
// Profile record, private class used only by this header
2932
class VerilatedProfilerRec final {
3033
const std::string m_name; // Hashed name of mtask/etc

include/verilated_threads.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
#include <cstdio>
2828
#include <fstream>
29+
#include <memory>
30+
#include <string>
2931

3032
//=============================================================================
3133
// Globals

include/verilated_trace.h

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "verilated.h"
2828
#include "verilated_trace_defs.h"
2929

30+
#include <memory>
3031
#include <string>
3132
#include <vector>
3233

include/verilated_types.h

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
#error "verilated_types.h should only be included by verilated.h"
2929
#endif
3030

31+
#include <algorithm>
32+
#include <deque>
33+
#include <map>
34+
#include <set>
35+
#include <string>
36+
#include <unordered_set>
37+
#include <utility>
38+
3139
//===================================================================
3240
// String formatters (required by below containers)
3341

include/verilated_vcd_c.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -426,8 +426,9 @@ void VerilatedVcd::dumpHeader() {
426426
case VLT_TRACE_SCOPE_UNION: printStr("union "); break;
427427
default: printStr("module ");
428428
}
429-
} else
429+
} else {
430430
printStr("module ");
431+
}
431432

432433
for (; *np && *np != ' ' && *np != '\t'; np++) {
433434
if (*np == '[') {

include/verilated_vcd_sc.h

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#include "verilated_sc.h"
2727
#include "verilated_vcd_c.h"
2828

29+
#include <string>
30+
2931
//=============================================================================
3032
// VerilatedVcdSc
3133
///

include/verilated_vpi.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@
3333
#include <list>
3434
#include <map>
3535
#include <set>
36+
#include <string>
37+
#include <unordered_set>
38+
#include <utility>
39+
#include <vector>
3640

3741
//======================================================================
3842
// Internal constants

include/verilatedos.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
# define VL_ATTR_NORETURN ///< Attribute that function does not ever return
9393
#endif
9494
#ifndef VL_ATTR_NO_SANITIZE_ALIGN
95-
# define VL_ATTR_NO_SANITIZE_ALIGN ///< Attribute that the function contains intended unaligned access
95+
# define VL_ATTR_NO_SANITIZE_ALIGN ///< Attribute that function contains intended unaligned access
9696
#endif
9797
#ifndef VL_ATTR_PRINTF
9898
# define VL_ATTR_PRINTF(fmtArgNum) ///< Attribute for function with printf format checking
@@ -499,7 +499,7 @@ using ssize_t = uint32_t; ///< signed size_t; returned from read()
499499
# ifdef __x86_64__
500500
# define VL_X86_64 1
501501
# endif
502-
#endif // VL_PORTABLE_ONLY
502+
#endif // VL_PORTABLE_ONLY
503503
// clang-format on
504504

505505
//=========================================================================

src/V3Simulate.h

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include <deque>
4444
#include <sstream>
4545
#include <stack>
46+
#include <string>
4647
#include <unordered_map>
4748
#include <vector>
4849

0 commit comments

Comments
 (0)