Style: Update clang-format config to make formatted code consistent between versions. No functional change (#4520)

This commit is contained in:
Anthony Donlon 2023-09-27 03:05:57 +08:00 committed by GitHub
parent d2c72a7f21
commit be45a9b7d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 20 additions and 22 deletions

View File

@ -112,6 +112,9 @@ SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 0
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11

View File

@ -344,8 +344,8 @@ uint64_t vl_time_pow10(int n) VL_PURE;
// Output clean
// EMIT_RULE: VL_CLEAN: oclean=clean; obits=lbits;
#define VL_CLEAN_II(obits, lbits, lhs) ((lhs)&VL_MASK_I(obits))
#define VL_CLEAN_QQ(obits, lbits, lhs) ((lhs)&VL_MASK_Q(obits))
#define VL_CLEAN_II(obits, lbits, lhs) ((lhs) & (VL_MASK_I(obits)))
#define VL_CLEAN_QQ(obits, lbits, lhs) ((lhs) & (VL_MASK_Q(obits)))
// EMIT_RULE: VL_ASSIGNCLEAN: oclean=clean; obits==lbits;
#define VL_ASSIGNCLEAN_W(obits, owp, lwp) VL_CLEAN_WW((obits), (owp), (lwp))

View File

@ -314,8 +314,7 @@ void V3Number::create(const char* sourcep) {
case 'o':
case 'c': {
switch (std::tolower(*cp)) {
// clang-format off
switch (std::tolower(*cp)) { // clang-format off
case '0': setBit(obit++, 0); setBit(obit++, 0); setBit(obit++, 0); break;
case '1': setBit(obit++, 1); setBit(obit++, 0); setBit(obit++, 0); break;
case '2': setBit(obit++, 0); setBit(obit++, 1); setBit(obit++, 0); break;
@ -335,8 +334,7 @@ void V3Number::create(const char* sourcep) {
}
case 'h': {
switch (std::tolower(*cp)) {
// clang-format off
switch (std::tolower(*cp)) { // clang-format off
case '0': setBit(obit++,0); setBit(obit++,0); setBit(obit++,0); setBit(obit++,0); break;
case '1': setBit(obit++,1); setBit(obit++,0); setBit(obit++,0); setBit(obit++,0); break;
case '2': setBit(obit++,0); setBit(obit++,1); setBit(obit++,0); setBit(obit++,0); break;

View File

@ -33,7 +33,7 @@ void poke_value(int i) {
const char* const scopeNamep = svGetNameFromScope(svGetScope());
printf("svGetNameFromScope=\"%s\"\n", scopeNamep);
// clang-format off
// clang-format off
#ifdef VERILATOR
static int didDump = 0;
if (didDump++ == 0) {

View File

@ -121,7 +121,7 @@ int main(int argc, char** argv) {
// Note null name - we're flattening it out
""}};
// clang-format off
// clang-format off
#ifdef VERILATOR
# ifdef TEST_VERBOSE
contextp->scopesDump();

View File

@ -48,7 +48,7 @@ int main()
#endif
// loop through every possibility and check the result
// clang-format off
// clang-format off
#ifdef SYSTEMC_VERSION
sc_start(1, SC_NS);
# define ASSIGN(s, v) s.write(v)

View File

@ -37,7 +37,7 @@ int main(int argc, char** argv) {
ap = new VM_PREFIX{contextp.get(), "topa"};
bp = new Vt_trace_two_b{contextp.get(), "topb"};
// clang-format off
// clang-format off
#ifdef TEST_HDR_TRACE
contextp->traceEverOn(true);
# ifdef TEST_FST

View File

@ -108,21 +108,20 @@ int main()
#endif
// clang-format off
#ifdef SYSTEMC_VERSION
sc_start(1, SC_NS);
#else
tb->eval();
#endif
// This testcase is testing multi-thread safe VL_ASSIGN_SBW and VL_ASSIGN_WSB macros.
// Testbench is assigning different number of bits from VlWide input_var variable to different inputs.
// Values around multiple of 30 (i.e. BITS_PER_DIGIT defined in SystemC sc_nbdefs.h) are tested with the special care, since
// it is the value by which the data_ptr of sc_biguint underlying data type is increased by (and not expected 32, as width of uint32_t).
// Correctness of the output is compared against the 'old' macro, which is correct but has multi-threaded issue since it's using range function.
// Second part is testing VL_ASSIGN_WSB in a reverse way, it is reading signals from the previous test,
// and comparing the output with (fraction) of VlWide input_var variable.
// clang-format on
// Testbench is assigning different number of bits from VlWide input_var variable to different
// inputs. Values around multiple of 30 (i.e. BITS_PER_DIGIT defined in SystemC sc_nbdefs.h)
// are tested with the special care, since it is the value by which the data_ptr of sc_biguint
// underlying data type is increased by (and not expected 32, as width of uint32_t).
// Correctness of the output is compared against the 'old' macro, which is correct but has
// multi-threaded issue since it's using range function. Second part is testing VL_ASSIGN_WSB
// in a reverse way, it is reading signals from the previous test, and comparing the output
// with (fraction) of VlWide input_var variable.
VL_ASSIGN_SBW(29, i_29_s, input_var);
VL_ASSIGN_SBW_MT_ISSUE(29, i_29_old_s, input_var);
VL_ASSIGN_SBW(30, i_30_s, input_var);

View File

@ -35,11 +35,9 @@ int main(int argc, char** argv) {
// Note null name - we're flattening it out
""}};
// clang-format off
#ifdef TEST_VERBOSE
contextp->scopesDump();
#endif
// clang-format on
#if VM_TRACE
contextp->traceEverOn(true);

View File

@ -116,7 +116,7 @@ int main(int argc, char** argv) {
// Note null name - we're flattening it out
""}};
// clang-format off
// clang-format off
#ifdef VERILATOR
# ifdef TEST_VERBOSE
contextp->scopesDump();