mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Style: Update clang-format config to make formatted code consistent between versions. No functional change (#4520)
This commit is contained in:
parent
d2c72a7f21
commit
be45a9b7d5
@ -112,6 +112,9 @@ SpacesBeforeTrailingComments: 2
|
|||||||
SpacesInAngles: false
|
SpacesInAngles: false
|
||||||
SpacesInContainerLiterals: true
|
SpacesInContainerLiterals: true
|
||||||
SpacesInCStyleCastParentheses: false
|
SpacesInCStyleCastParentheses: false
|
||||||
|
SpacesInLineCommentPrefix:
|
||||||
|
Minimum: 0
|
||||||
|
Maximum: -1
|
||||||
SpacesInParentheses: false
|
SpacesInParentheses: false
|
||||||
SpacesInSquareBrackets: false
|
SpacesInSquareBrackets: false
|
||||||
Standard: Cpp11
|
Standard: Cpp11
|
||||||
|
@ -344,8 +344,8 @@ uint64_t vl_time_pow10(int n) VL_PURE;
|
|||||||
|
|
||||||
// Output clean
|
// Output clean
|
||||||
// EMIT_RULE: VL_CLEAN: oclean=clean; obits=lbits;
|
// EMIT_RULE: VL_CLEAN: oclean=clean; obits=lbits;
|
||||||
#define VL_CLEAN_II(obits, lbits, lhs) ((lhs)&VL_MASK_I(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))
|
#define VL_CLEAN_QQ(obits, lbits, lhs) ((lhs) & (VL_MASK_Q(obits)))
|
||||||
|
|
||||||
// EMIT_RULE: VL_ASSIGNCLEAN: oclean=clean; obits==lbits;
|
// EMIT_RULE: VL_ASSIGNCLEAN: oclean=clean; obits==lbits;
|
||||||
#define VL_ASSIGNCLEAN_W(obits, owp, lwp) VL_CLEAN_WW((obits), (owp), (lwp))
|
#define VL_ASSIGNCLEAN_W(obits, owp, lwp) VL_CLEAN_WW((obits), (owp), (lwp))
|
||||||
|
@ -314,8 +314,7 @@ void V3Number::create(const char* sourcep) {
|
|||||||
|
|
||||||
case 'o':
|
case 'o':
|
||||||
case 'c': {
|
case 'c': {
|
||||||
switch (std::tolower(*cp)) {
|
switch (std::tolower(*cp)) { // clang-format off
|
||||||
// clang-format off
|
|
||||||
case '0': setBit(obit++, 0); setBit(obit++, 0); setBit(obit++, 0); break;
|
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 '1': setBit(obit++, 1); setBit(obit++, 0); setBit(obit++, 0); break;
|
||||||
case '2': setBit(obit++, 0); setBit(obit++, 1); 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': {
|
case 'h': {
|
||||||
switch (std::tolower(*cp)) {
|
switch (std::tolower(*cp)) { // clang-format off
|
||||||
// clang-format off
|
|
||||||
case '0': setBit(obit++,0); setBit(obit++,0); setBit(obit++,0); setBit(obit++,0); break;
|
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 '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;
|
case '2': setBit(obit++,0); setBit(obit++,1); setBit(obit++,0); setBit(obit++,0); break;
|
||||||
|
@ -33,7 +33,7 @@ void poke_value(int i) {
|
|||||||
const char* const scopeNamep = svGetNameFromScope(svGetScope());
|
const char* const scopeNamep = svGetNameFromScope(svGetScope());
|
||||||
printf("svGetNameFromScope=\"%s\"\n", scopeNamep);
|
printf("svGetNameFromScope=\"%s\"\n", scopeNamep);
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#ifdef VERILATOR
|
#ifdef VERILATOR
|
||||||
static int didDump = 0;
|
static int didDump = 0;
|
||||||
if (didDump++ == 0) {
|
if (didDump++ == 0) {
|
||||||
|
@ -121,7 +121,7 @@ int main(int argc, char** argv) {
|
|||||||
// Note null name - we're flattening it out
|
// Note null name - we're flattening it out
|
||||||
""}};
|
""}};
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#ifdef VERILATOR
|
#ifdef VERILATOR
|
||||||
# ifdef TEST_VERBOSE
|
# ifdef TEST_VERBOSE
|
||||||
contextp->scopesDump();
|
contextp->scopesDump();
|
||||||
|
@ -48,7 +48,7 @@ int main()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// loop through every possibility and check the result
|
// loop through every possibility and check the result
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#ifdef SYSTEMC_VERSION
|
#ifdef SYSTEMC_VERSION
|
||||||
sc_start(1, SC_NS);
|
sc_start(1, SC_NS);
|
||||||
# define ASSIGN(s, v) s.write(v)
|
# define ASSIGN(s, v) s.write(v)
|
||||||
|
@ -37,7 +37,7 @@ int main(int argc, char** argv) {
|
|||||||
ap = new VM_PREFIX{contextp.get(), "topa"};
|
ap = new VM_PREFIX{contextp.get(), "topa"};
|
||||||
bp = new Vt_trace_two_b{contextp.get(), "topb"};
|
bp = new Vt_trace_two_b{contextp.get(), "topb"};
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#ifdef TEST_HDR_TRACE
|
#ifdef TEST_HDR_TRACE
|
||||||
contextp->traceEverOn(true);
|
contextp->traceEverOn(true);
|
||||||
# ifdef TEST_FST
|
# ifdef TEST_FST
|
||||||
|
@ -108,21 +108,20 @@ int main()
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
#ifdef SYSTEMC_VERSION
|
#ifdef SYSTEMC_VERSION
|
||||||
sc_start(1, SC_NS);
|
sc_start(1, SC_NS);
|
||||||
#else
|
#else
|
||||||
tb->eval();
|
tb->eval();
|
||||||
#endif
|
#endif
|
||||||
// This testcase is testing multi-thread safe VL_ASSIGN_SBW and VL_ASSIGN_WSB macros.
|
// 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.
|
// Testbench is assigning different number of bits from VlWide input_var variable to different
|
||||||
// Values around multiple of 30 (i.e. BITS_PER_DIGIT defined in SystemC sc_nbdefs.h) are tested with the special care, since
|
// inputs. Values around multiple of 30 (i.e. BITS_PER_DIGIT defined in SystemC sc_nbdefs.h)
|
||||||
// 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).
|
// are tested with the special care, since it is the value by which the data_ptr of sc_biguint
|
||||||
// Correctness of the output is compared against the 'old' macro, which is correct but has multi-threaded issue since it's using range function.
|
// underlying data type is increased by (and not expected 32, as width of uint32_t).
|
||||||
// Second part is testing VL_ASSIGN_WSB in a reverse way, it is reading signals from the previous test,
|
// Correctness of the output is compared against the 'old' macro, which is correct but has
|
||||||
// and comparing the output with (fraction) of VlWide input_var variable.
|
// 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
|
||||||
// clang-format on
|
// with (fraction) of VlWide input_var variable.
|
||||||
VL_ASSIGN_SBW(29, i_29_s, input_var);
|
VL_ASSIGN_SBW(29, i_29_s, input_var);
|
||||||
VL_ASSIGN_SBW_MT_ISSUE(29, i_29_old_s, input_var);
|
VL_ASSIGN_SBW_MT_ISSUE(29, i_29_old_s, input_var);
|
||||||
VL_ASSIGN_SBW(30, i_30_s, input_var);
|
VL_ASSIGN_SBW(30, i_30_s, input_var);
|
||||||
|
@ -35,11 +35,9 @@ int main(int argc, char** argv) {
|
|||||||
// Note null name - we're flattening it out
|
// Note null name - we're flattening it out
|
||||||
""}};
|
""}};
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
#ifdef TEST_VERBOSE
|
#ifdef TEST_VERBOSE
|
||||||
contextp->scopesDump();
|
contextp->scopesDump();
|
||||||
#endif
|
#endif
|
||||||
// clang-format on
|
|
||||||
|
|
||||||
#if VM_TRACE
|
#if VM_TRACE
|
||||||
contextp->traceEverOn(true);
|
contextp->traceEverOn(true);
|
||||||
|
@ -116,7 +116,7 @@ int main(int argc, char** argv) {
|
|||||||
// Note null name - we're flattening it out
|
// Note null name - we're flattening it out
|
||||||
""}};
|
""}};
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#ifdef VERILATOR
|
#ifdef VERILATOR
|
||||||
# ifdef TEST_VERBOSE
|
# ifdef TEST_VERBOSE
|
||||||
contextp->scopesDump();
|
contextp->scopesDump();
|
||||||
|
Loading…
Reference in New Issue
Block a user