mirror of
https://github.com/verilator/verilator.git
synced 2024-12-29 10:47: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
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInLineCommentPrefix:
|
||||
Minimum: 0
|
||||
Maximum: -1
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp11
|
||||
|
@ -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))
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user