diff --git a/Makefile.in b/Makefile.in index 93d3ef247..8b89d5d1e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -462,11 +462,12 @@ analyzer-include: CLANGFORMAT = clang-format CLANGFORMAT_FLAGS = -i +CLANGFORMAT_FILES = $(CPPCHECK_CPP) $(CPPCHECK_H) $(CPPCHECK_YL) test_regress/t/*.c* clang-format: @$(CLANGFORMAT) --version | egrep 10.0 > /dev/null \ || echo "*** You are not using clang-format 10.0, indents may differ from master's ***" - $(CLANGFORMAT) $(CLANGFORMAT_FLAGS) $(CPPCHECK_CPP) $(CPPCHECK_H) $(CPPCHECK_YL) + $(CLANGFORMAT) $(CLANGFORMAT_FLAGS) $(CLANGFORMAT_FILES) ftp: info diff --git a/test_regress/t/t_dpi_arg_inout_type.cpp b/test_regress/t/t_dpi_arg_inout_type.cpp index a51d3aef4..a5c346d8f 100644 --- a/test_regress/t/t_dpi_arg_inout_type.cpp +++ b/test_regress/t/t_dpi_arg_inout_type.cpp @@ -13,6 +13,7 @@ #include #include +// clang-format off #if defined(NCSC) // Used by NC's svdpi.h to pick up svLogicVecVal with _.aval and _.bval fields, // rather than the IEEE 1800-2005 version which has _.a and _.b fields. @@ -46,6 +47,7 @@ typedef uint64_t sv_longint_unsigned_t; #else # error "Unknown simulator for DPI test" #endif +// clang-format on //====================================================================== // Implementations of imported functions diff --git a/test_regress/t/t_dpi_arg_input_type.cpp b/test_regress/t/t_dpi_arg_input_type.cpp index 6f179d7e9..1593e1dfc 100644 --- a/test_regress/t/t_dpi_arg_input_type.cpp +++ b/test_regress/t/t_dpi_arg_input_type.cpp @@ -13,6 +13,7 @@ #include #include +// clang-format off #if defined(NCSC) // Used by NC's svdpi.h to pick up svLogicVecVal with _.aval and _.bval fields, // rather than the IEEE 1800-2005 version which has _.a and _.b fields. @@ -51,6 +52,7 @@ typedef uint64_t sv_longint_unsigned_t; #else # error "Unknown simulator for DPI test" #endif +// clang-format on //====================================================================== // Implementations of imported functions diff --git a/test_regress/t/t_dpi_arg_output_type.cpp b/test_regress/t/t_dpi_arg_output_type.cpp index 40161ed25..cf127ee6e 100644 --- a/test_regress/t/t_dpi_arg_output_type.cpp +++ b/test_regress/t/t_dpi_arg_output_type.cpp @@ -13,6 +13,7 @@ #include #include +// clang-format off #if defined(NCSC) // Used by NC's svdpi.h to pick up svLogicVecVal with _.aval and _.bval fields, // rather than the IEEE 1800-2005 version which has _.a and _.b fields. @@ -46,6 +47,7 @@ typedef uint64_t sv_longint_unsigned_t; # else # error "Unknown simulator for DPI test" #endif +// clang-format on //====================================================================== // Implementations of imported functions diff --git a/test_regress/t/t_dpi_context_c.cpp b/test_regress/t/t_dpi_context_c.cpp index 2d1a8fbe4..50534b8e9 100644 --- a/test_regress/t/t_dpi_context_c.cpp +++ b/test_regress/t/t_dpi_context_c.cpp @@ -14,6 +14,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # ifdef T_DPI_CONTEXT_NOOPT # include "Vt_dpi_context_noopt__Dpi.h" @@ -31,6 +32,7 @@ #ifdef VERILATOR # include "verilated.h" #endif +// clang-format on #ifdef NEED_EXTERNS extern "C" { @@ -126,7 +128,7 @@ int dpic_restore() { unsigned dpic_getcontext() { svScope scope = svGetScope(); - printf("%%Info: svGetScope returned scope (%p) with name %s\n", + printf("%%Info: svGetScope returned scope (%p) with name %s\n", // scope, svGetNameFromScope(scope)); return (unsigned)(uintptr_t)scope; } diff --git a/test_regress/t/t_dpi_display_c.cpp b/test_regress/t/t_dpi_display_c.cpp index 0be29e589..41d292027 100644 --- a/test_regress/t/t_dpi_display_c.cpp +++ b/test_regress/t/t_dpi_display_c.cpp @@ -14,6 +14,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # include "Vt_dpi_display__Dpi.h" #elif defined(VCS) @@ -23,6 +24,7 @@ #else # error "Unknown simulator for DPI test" #endif +// clang-format on #ifdef NEED_EXTERNS extern "C" { @@ -31,12 +33,12 @@ extern void dpii_display_call(const char* c); } #endif +// clang-format off #ifndef VL_PRINTF # define VL_PRINTF printf #endif +// clang-format on //====================================================================== -void dpii_display_call(const char* c) { - VL_PRINTF("dpii_display_call: '%s'\n", c); -} +void dpii_display_call(const char* c) { VL_PRINTF("dpii_display_call: '%s'\n", c); } diff --git a/test_regress/t/t_dpi_export_c.cpp b/test_regress/t/t_dpi_export_c.cpp index e858de367..bcebfce0f 100644 --- a/test_regress/t/t_dpi_export_c.cpp +++ b/test_regress/t/t_dpi_export_c.cpp @@ -13,6 +13,7 @@ #include #include "svdpi.h" +// clang-format off #ifdef _WIN32 # define T_PRI64 "I64" #else // Linux or compliant Unix flavors @@ -34,6 +35,7 @@ #else # error "Unknown simulator for DPI test" #endif +// clang-format on #ifdef NEED_EXTERNS @@ -67,6 +69,7 @@ extern void dpix_t_time(const svLogicVecVal* i, svLogicVecVal* o); //====================================================================== +// clang-format off #define CHECK_RESULT(type, got, exp) \ if ((got) != (exp)) { \ printf("%%Error: %s:%d:", __FILE__, __LINE__); \ @@ -77,6 +80,7 @@ extern void dpix_t_time(const svLogicVecVal* i, svLogicVecVal* o); printf(" EXP = %" T_PRI64 "x\n", u.l); \ return __LINE__; \ } +// clang-format on #define CHECK_RESULT_NNULL(got) \ if (!(got)) { \ printf("%%Error: %s:%d: GOT = %p EXP = !NULL\n", __FILE__, __LINE__, (got)); \ @@ -107,9 +111,9 @@ int dpix_run_tests() { #ifdef VERILATOR static int didDump = 0; if (didDump++ == 0) { -# ifdef TEST_VERBOSE +#ifdef TEST_VERBOSE Verilated::internalsDump(); -# endif +#endif } #endif @@ -183,7 +187,9 @@ int dpix_run_tests() { CHECK_RESULT(svLogic, o, 0); } { - svLogicVecVal i[1]; i[0].aval = 0x12; i[0].bval = 0; + svLogicVecVal i[1]; + i[0].aval = 0x12; + i[0].bval = 0; svLogicVecVal o[1]; dpix_t_reg15(i, o); CHECK_RESULT(int, o[0].aval, (~i[0].aval) & 0x7fff); @@ -191,9 +197,12 @@ int dpix_run_tests() { } { svLogicVecVal i[3]; - i[0].aval = 0x72912312; i[0].bval = 0; - i[1].aval = 0xab782a12; i[1].bval = 0; - i[2].aval = 0x8a413bd9; i[2].bval = 0; + i[0].aval = 0x72912312; + i[0].bval = 0; + i[1].aval = 0xab782a12; + i[1].bval = 0; + i[2].aval = 0x8a413bd9; + i[2].bval = 0; svLogicVecVal o[3]; dpix_t_reg95(i, o); CHECK_RESULT(int, o[0].aval, ~i[0].aval); @@ -206,8 +215,10 @@ int dpix_run_tests() { #if !defined(VCS) && !defined(CADENCE) { svLogicVecVal i[2]; - i[0].aval = 0x72912312; i[0].bval = 0; - i[1].aval = 0xab782a12; i[1].bval = 0; + i[0].aval = 0x72912312; + i[0].bval = 0; + i[1].aval = 0xab782a12; + i[1].bval = 0; svLogicVecVal o[2]; dpix_t_time(i, o); CHECK_RESULT(int, o[0].aval, ~i[0].aval); diff --git a/test_regress/t/t_dpi_export_context_bad.cpp b/test_regress/t/t_dpi_export_context_bad.cpp index 86e6fcc1f..a42ceff51 100644 --- a/test_regress/t/t_dpi_export_context_bad.cpp +++ b/test_regress/t/t_dpi_export_context_bad.cpp @@ -11,6 +11,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # include "Vt_dpi_export_context_bad__Dpi.h" #elif defined(VCS) @@ -20,6 +21,7 @@ #else # error "Unknown simulator for DPI test" #endif +// clang-format on #ifdef NEED_EXTERNS extern "C" { diff --git a/test_regress/t/t_dpi_imp_gen_c.cpp b/test_regress/t/t_dpi_imp_gen_c.cpp index f7a6b5d1a..15a03eea5 100644 --- a/test_regress/t/t_dpi_imp_gen_c.cpp +++ b/test_regress/t/t_dpi_imp_gen_c.cpp @@ -15,6 +15,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # include "Vt_dpi_imp_gen__Dpi.h" #elif defined(VCS) @@ -24,6 +25,7 @@ #else # error "Unknown simulator for DPI test" #endif +// clang-format on #ifdef NEED_EXTERNS extern "C" { diff --git a/test_regress/t/t_dpi_import_c.cpp b/test_regress/t/t_dpi_import_c.cpp index e23a2a599..2771b70f1 100644 --- a/test_regress/t/t_dpi_import_c.cpp +++ b/test_regress/t/t_dpi_import_c.cpp @@ -15,6 +15,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # include "Vt_dpi_import__Dpi.h" #elif defined(VCS) @@ -24,6 +25,7 @@ #else # error "Unknown simulator for DPI test" #endif +// clang-format on typedef struct { int a; diff --git a/test_regress/t/t_dpi_lib_c.cpp b/test_regress/t/t_dpi_lib_c.cpp index 04ad63bad..7113909ce 100644 --- a/test_regress/t/t_dpi_lib_c.cpp +++ b/test_regress/t/t_dpi_lib_c.cpp @@ -16,6 +16,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # include "Vt_dpi_lib__Dpi.h" #elif defined(VCS) @@ -25,6 +26,7 @@ #else # error "Unknown simulator for DPI test" #endif +// clang-format on #ifdef NEED_EXTERNS extern "C" { diff --git a/test_regress/t/t_dpi_open_c.cpp b/test_regress/t/t_dpi_open_c.cpp index 806555f74..b4aa42c56 100644 --- a/test_regress/t/t_dpi_open_c.cpp +++ b/test_regress/t/t_dpi_open_c.cpp @@ -16,6 +16,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # include "Vt_dpi_open__Dpi.h" #elif defined(VCS) @@ -27,6 +28,7 @@ #else # error "Unknown simulator for DPI test" #endif +// clang-format on #ifdef NEED_EXTERNS extern "C" { @@ -90,11 +92,13 @@ extern int dpii_failure(); int failure = 0; int dpii_failure() { return failure; } +// clang-format off #ifdef _WIN32 # define T_PRI64 "I64" #else // Linux or compliant Unix flavors # define T_PRI64 "ll" #endif +// clang-format on #define CHECK_RESULT_HEX(got, exp) \ do { \ diff --git a/test_regress/t/t_dpi_open_query.cpp b/test_regress/t/t_dpi_open_query.cpp index 21f7eab1c..021e6ef53 100644 --- a/test_regress/t/t_dpi_open_query.cpp +++ b/test_regress/t/t_dpi_open_query.cpp @@ -9,10 +9,9 @@ // //************************************************************************* -// clang-format off - #include "svdpi.h" +// clang-format off #if defined(VERILATOR) // Verilator # include "Vt_dpi_open_query__Dpi.h" #elif defined(VCS) // VCS @@ -24,7 +23,6 @@ #else # error "Unknown simulator for DPI test" #endif - // clang-format on //====================================================================== diff --git a/test_regress/t/t_dpi_openfirst_c.cpp b/test_regress/t/t_dpi_openfirst_c.cpp index 0a18aa736..3b60a4129 100644 --- a/test_regress/t/t_dpi_openfirst_c.cpp +++ b/test_regress/t/t_dpi_openfirst_c.cpp @@ -16,6 +16,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # include "Vt_dpi_openfirst__Dpi.h" #elif defined(VCS) @@ -25,6 +26,7 @@ #else # error "Unknown simulator for DPI test" #endif +// clang-format on #ifdef NEED_EXTERNS extern "C" { diff --git a/test_regress/t/t_dpi_qw_c.cpp b/test_regress/t/t_dpi_qw_c.cpp index 802f87991..01a927848 100644 --- a/test_regress/t/t_dpi_qw_c.cpp +++ b/test_regress/t/t_dpi_qw_c.cpp @@ -23,6 +23,7 @@ void poke_value(int i) { printf("poke_value(%d)\n", i); +// clang-format off #ifdef VERILATOR static int didDump = 0; if (didDump++ == 0) { @@ -31,6 +32,7 @@ void poke_value(int i) { # endif } #endif + // clang-format on svScope scope = svGetScopeFromName("top.t.a"); if (scope == NULL) { diff --git a/test_regress/t/t_dpi_result_type.cpp b/test_regress/t/t_dpi_result_type.cpp index 1ecbf0d94..21ea9e772 100644 --- a/test_regress/t/t_dpi_result_type.cpp +++ b/test_regress/t/t_dpi_result_type.cpp @@ -15,6 +15,7 @@ #include "svdpi.h" +// clang-format off #if defined(VERILATOR) // Verilator # include "Vt_dpi_result_type__Dpi.h" typedef long long sv_longint_t; @@ -41,6 +42,7 @@ typedef uint64_t sv_longint_unsigned_t; #else # error "Unknown simulator for DPI test" #endif +// clang-format on //====================================================================== // Implementations of imported functions diff --git a/test_regress/t/t_dpi_shortcircuit_c.cpp b/test_regress/t/t_dpi_shortcircuit_c.cpp index 211231a8a..dad4af8aa 100644 --- a/test_regress/t/t_dpi_shortcircuit_c.cpp +++ b/test_regress/t/t_dpi_shortcircuit_c.cpp @@ -15,6 +15,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # if defined(T_DPI_SHORTCIRCUIT) # include "Vt_dpi_shortcircuit__Dpi.h" @@ -30,6 +31,7 @@ #else # error "Unknown simulator for DPI test" #endif +// clang-format on #ifdef NEED_EXTERNS extern "C" { diff --git a/test_regress/t/t_dpi_string_c.cpp b/test_regress/t/t_dpi_string_c.cpp index b357c65b6..ba6583d79 100644 --- a/test_regress/t/t_dpi_string_c.cpp +++ b/test_regress/t/t_dpi_string_c.cpp @@ -15,6 +15,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # include "Vt_dpi_string__Dpi.h" #elif defined(VCS) @@ -24,6 +25,7 @@ #else # error "Unknown simulator for DPI test" #endif +// clang-format on #ifdef NEED_EXTERNS extern "C" { diff --git a/test_regress/t/t_dpi_sys_c.cpp b/test_regress/t/t_dpi_sys_c.cpp index 6e904fad1..156609f16 100644 --- a/test_regress/t/t_dpi_sys_c.cpp +++ b/test_regress/t/t_dpi_sys_c.cpp @@ -14,6 +14,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # include "Vt_dpi_sys__Dpi.h" #elif defined(VCS) @@ -23,6 +24,7 @@ #else # error "Unknown simulator for DPI test" #endif +// clang-format on #ifdef NEED_EXTERNS extern "C" { diff --git a/test_regress/t/t_dpi_threads_c.cpp b/test_regress/t/t_dpi_threads_c.cpp index 3f06f2d64..0b2900352 100644 --- a/test_regress/t/t_dpi_threads_c.cpp +++ b/test_regress/t/t_dpi_threads_c.cpp @@ -17,6 +17,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # ifdef T_DPI_THREADS_COLLIDE # include "Vt_dpi_threads_collide__Dpi.h" @@ -30,6 +31,7 @@ #else # error "Unknown simulator for DPI test" #endif +// clang-format on #ifdef NEED_EXTERNS extern "C" { diff --git a/test_regress/t/t_dpi_vams.cpp b/test_regress/t/t_dpi_vams.cpp index 0abce4a58..4722f8636 100644 --- a/test_regress/t/t_dpi_vams.cpp +++ b/test_regress/t/t_dpi_vams.cpp @@ -11,6 +11,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # include "Vt_dpi_vams__Dpi.h" #elif defined(VCS) @@ -20,6 +21,7 @@ #else # error "Unknown simulator for DPI test" #endif +// clang-format on #ifdef NEED_EXTERNS extern "C" { diff --git a/test_regress/t/t_dpi_var.cpp b/test_regress/t/t_dpi_var.cpp index dad42dcc1..bbab2e36c 100644 --- a/test_regress/t/t_dpi_var.cpp +++ b/test_regress/t/t_dpi_var.cpp @@ -120,11 +120,13 @@ int main(int argc, char** argv, char** env) { VM_PREFIX* topp = new VM_PREFIX(""); // Note null name - we're flattening it out +// clang-format off #ifdef VERILATOR # ifdef TEST_VERBOSE Verilated::scopesDump(); # endif #endif + // clang-format on topp->eval(); topp->clk = 0; diff --git a/test_regress/t/t_embed1_c.cpp b/test_regress/t/t_embed1_c.cpp index 78ae95cb0..51ffbe375 100644 --- a/test_regress/t/t_embed1_c.cpp +++ b/test_regress/t/t_embed1_c.cpp @@ -16,6 +16,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # include "Vt_embed1__Dpi.h" #elif defined(VCS) @@ -25,6 +26,7 @@ #else # error "Unknown simulator for DPI test" #endif +// clang-format on #include "verilated.h" @@ -80,14 +82,9 @@ void t_embed_child_eval() { __modelp->eval(); } -void t_embed_child_io_eval(unsigned char clk, - unsigned char bit_in, - const svBitVecVal* vec_in, - const svBitVecVal* wide_in, - unsigned char is_ref, - unsigned char* bit_out, - svBitVecVal* vec_out, - svBitVecVal* wide_out, +void t_embed_child_io_eval(unsigned char clk, unsigned char bit_in, const svBitVecVal* vec_in, + const svBitVecVal* wide_in, unsigned char is_ref, + unsigned char* bit_out, svBitVecVal* vec_out, svBitVecVal* wide_out, unsigned char* did_init_out) { VL_DEBUG_IF(VL_PRINTF(" t_embed1_child_io_eval\n");); Vt_embed1_child* __modelp = __get_modelp(); diff --git a/test_regress/t/t_flag_ldflags_c.cpp b/test_regress/t/t_flag_ldflags_c.cpp index fa62acc3f..6b32be9b9 100644 --- a/test_regress/t/t_flag_ldflags_c.cpp +++ b/test_regress/t/t_flag_ldflags_c.cpp @@ -14,6 +14,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # include "Vt_flag_ldflags__Dpi.h" #else @@ -28,5 +29,6 @@ #ifndef CFLAGS2_FROM_CMDLINE # error "CFLAGS2_FROM_CMDLINE not set - not passed down?" #endif +// clang-format on void dpii_c_library() {} diff --git a/test_regress/t/t_leak.cpp b/test_regress/t/t_leak.cpp index 6bb6cfe28..8553bfccd 100644 --- a/test_regress/t/t_leak.cpp +++ b/test_regress/t/t_leak.cpp @@ -30,13 +30,12 @@ long long get_memory_usage() { int ps_ign; vluint64_t ps_vsize, ps_rss; - int items = fscanf(fp, ("%d (%*[^) ]) %*1s %d %*d %*d %*d %*d %u" - " %u %u %u %u %d %d %d %d" - " %*d %*d %*u %*u %d %" VL_PRI64 "u %" VL_PRI64 "u "), - &ps_ign, &ps_ign, &ps_ign, - &ps_ign, &ps_ign, &ps_ign, &ps_ign, - &ps_ign, &ps_ign, &ps_ign, &ps_ign, - &ps_ign, &ps_vsize, &ps_rss); + int items = fscanf(fp, + ("%d (%*[^) ]) %*1s %d %*d %*d %*d %*d %u" + " %u %u %u %u %d %d %d %d" + " %*d %*d %*u %*u %d %" VL_PRI64 "u %" VL_PRI64 "u "), + &ps_ign, &ps_ign, &ps_ign, &ps_ign, &ps_ign, &ps_ign, &ps_ign, &ps_ign, + &ps_ign, &ps_ign, &ps_ign, &ps_ign, &ps_vsize, &ps_rss); fclose(fp); if (items >= 14) { return ps_vsize; @@ -79,7 +78,7 @@ int main(int argc, char* argv[]) { } vluint64_t leaked = get_memory_usage() - firstUsage; - if (leaked > 64*1024) { // Have to allow some slop for this code. + if (leaked > 64 * 1024) { // Have to allow some slop for this code. printf("Leaked %" VL_PRI64 "d bytes, or ~ %" VL_PRI64 "d bytes/construt\n", // leaked, leaked / loops); vl_fatal(__FILE__, __LINE__, "top", "Leaked memory\n"); diff --git a/test_regress/t/t_mem_multi_io2.cpp b/test_regress/t/t_mem_multi_io2.cpp index c12e8330a..145b02ba3 100644 --- a/test_regress/t/t_mem_multi_io2.cpp +++ b/test_regress/t/t_mem_multi_io2.cpp @@ -48,15 +48,17 @@ int main() #endif // loop through every possibility and check the result +// clang-format off #ifdef SYSTEMC_VERSION sc_start(1, SC_NS); -# define ASSIGN(s,v) s.write(v) -# define READ(s) s.read() +# define ASSIGN(s, v) s.write(v) +# define READ(s) s.read() #else tb->eval(); -# define ASSIGN(s,v) tb->s = (v) -# define READ(s) tb->s +# define ASSIGN(s, v) tb->s = (v) +# define READ(s) tb->s #endif + // clang-format on ASSIGN(i3, 13); for (int i = 0; i < 4; i++) { diff --git a/test_regress/t/t_mem_slot.cpp b/test_regress/t/t_mem_slot.cpp index 7d367925e..86d3b984e 100644 --- a/test_regress/t/t_mem_slot.cpp +++ b/test_regress/t/t_mem_slot.cpp @@ -46,9 +46,9 @@ int main(int argc, char* argv[]) { Verilated::debug(0); - /* clear all bits in the array */ + // clear all bits in the array for (slot = 0; slot < 3; slot++) - for (bit = 0; bit < 2; bit++) + for (bit = 0; bit < 2; bit++) // StepSim(sim, slot, bit, 0, 0); printf("\nTesting\n"); diff --git a/test_regress/t/t_protect_ids_c.cpp b/test_regress/t/t_protect_ids_c.cpp index 36198253e..484ba07b8 100644 --- a/test_regress/t/t_protect_ids_c.cpp +++ b/test_regress/t/t_protect_ids_c.cpp @@ -15,6 +15,7 @@ //====================================================================== +// clang-format off #if defined(VERILATOR) # ifdef T_PROTECT_IDS_KEY # include "Vt_protect_ids_key__Dpi.h" @@ -32,6 +33,7 @@ #ifdef NEED_EXTERNS # error "Not supported" #endif +// clang-format on //====================================================================== diff --git a/test_regress/t/t_trace_cat.cpp b/test_regress/t/t_trace_cat.cpp index f1f5aed79..b4a9c6125 100644 --- a/test_regress/t/t_trace_cat.cpp +++ b/test_regress/t/t_trace_cat.cpp @@ -50,7 +50,7 @@ int main(int argc, char** argv, char** env) { top->trace(tfp, 99); tfp->open(trace_name()); #else -# error "Unknown test" +#error "Unknown test" #endif } tfp->dump((unsigned int)(main_time)); diff --git a/test_regress/t/t_trace_public_func.cpp b/test_regress/t/t_trace_public_func.cpp index 8f4de6e76..c43a13dbc 100644 --- a/test_regress/t/t_trace_public_func.cpp +++ b/test_regress/t/t_trace_public_func.cpp @@ -9,6 +9,7 @@ #include #include +// clang-format off #include VM_PREFIX_INCLUDE #ifdef T_TRACE_PUBLIC_FUNC_VLT # include "Vt_trace_public_func_vlt_t.h" @@ -17,6 +18,7 @@ # include "Vt_trace_public_func_t.h" # include "Vt_trace_public_func_glbl.h" #endif +// clang-format on unsigned long long main_time = 0; double sc_time_stamp() { return (double)main_time; } diff --git a/test_regress/t/t_trace_public_sig.cpp b/test_regress/t/t_trace_public_sig.cpp index 7733c2eca..2c996203f 100644 --- a/test_regress/t/t_trace_public_sig.cpp +++ b/test_regress/t/t_trace_public_sig.cpp @@ -9,6 +9,7 @@ #include #include +// clang-format off #include VM_PREFIX_INCLUDE #ifdef T_TRACE_PUBLIC_SIG_VLT # include "Vt_trace_public_sig_vlt_t.h" @@ -17,6 +18,7 @@ # include "Vt_trace_public_sig_t.h" # include "Vt_trace_public_sig_glbl.h" #endif +// clang-format on unsigned long long main_time = 0; double sc_time_stamp() { return (double)main_time; } diff --git a/test_regress/t/t_trace_two_cc.cpp b/test_regress/t/t_trace_two_cc.cpp index e339c6a24..3cfd0ef46 100644 --- a/test_regress/t/t_trace_two_cc.cpp +++ b/test_regress/t/t_trace_two_cc.cpp @@ -6,6 +6,7 @@ // Version 2.0. // SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 +// clang-format off #include "verilatedos.h" #include VM_PREFIX_INCLUDE #include "Vt_trace_two_b.h" @@ -17,6 +18,7 @@ # include "verilated_vcd_c.h" # endif #endif +// clang-format on // Compile in place #include "Vt_trace_two_b.cpp" @@ -39,6 +41,7 @@ int main(int argc, char** argv, char** env) { ap = new VM_PREFIX("topa"); bp = new Vt_trace_two_b("topb"); +// clang-format off #ifdef TEST_HDR_TRACE Verilated::traceEverOn(true); # ifdef TEST_FST @@ -53,6 +56,7 @@ int main(int argc, char** argv, char** env) { tfp->open(VL_STRINGIFY(TEST_OBJ_DIR) "/simx.vcd"); # endif #endif + // clang-format on #ifdef TEST_HDR_TRACE ap->eval_step(); diff --git a/test_regress/t/t_trace_two_sc.cpp b/test_regress/t/t_trace_two_sc.cpp index 66e145145..ebfffc68d 100644 --- a/test_regress/t/t_trace_two_sc.cpp +++ b/test_regress/t/t_trace_two_sc.cpp @@ -6,6 +6,7 @@ // Version 2.0. // SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 +// clang-format off #include "verilatedos.h" #include VM_PREFIX_INCLUDE #include "Vt_trace_two_b.h" @@ -13,6 +14,7 @@ #ifdef TEST_HDR_TRACE # include "verilated_vcd_sc.h" #endif +// clang-format on // Compile in place #include "Vt_trace_two_b.cpp" diff --git a/test_regress/t/t_vpi_time_cb.cpp b/test_regress/t/t_vpi_time_cb.cpp index c0a170ac2..210abb609 100644 --- a/test_regress/t/t_vpi_time_cb.cpp +++ b/test_regress/t/t_vpi_time_cb.cpp @@ -167,7 +167,9 @@ static int _end_of_sim_cb(p_cb_data cb_data) { extern "C" #endif + // clang-format off void vpi_compat_bootstrap(void) { + // clang-format on t_cb_data cb_data; bzero(&cb_data, sizeof(cb_data)); @@ -197,11 +199,13 @@ int main(int argc, char** argv, char** env) { VM_PREFIX* topp = new VM_PREFIX(""); // Note null name - we're flattening it out +// clang-format off #ifdef VERILATOR # ifdef TEST_VERBOSE Verilated::scopesDump(); # endif #endif + // clang-format on #if VM_TRACE Verilated::traceEverOn(true); diff --git a/test_regress/t/t_vpi_zero_time_cb.cpp b/test_regress/t/t_vpi_zero_time_cb.cpp index a553bec45..54303e04f 100644 --- a/test_regress/t/t_vpi_zero_time_cb.cpp +++ b/test_regress/t/t_vpi_zero_time_cb.cpp @@ -117,7 +117,9 @@ static int _end_of_sim_cb(p_cb_data cb_data) { extern "C" #endif + // clang-format off void vpi_compat_bootstrap(void) { + // clang-format on t_cb_data cb_data; bzero(&cb_data, sizeof(cb_data)); @@ -147,11 +149,13 @@ int main(int argc, char** argv, char** env) { VM_PREFIX* topp = new VM_PREFIX(""); // Note null name - we're flattening it out +// clang-format off #ifdef VERILATOR # ifdef TEST_VERBOSE Verilated::scopesDump(); # endif #endif + // clang-format on #if VM_TRACE Verilated::traceEverOn(true);