Browse Source

Added clang-format formatting

Eyck Jentzsch 2 years ago
parent
commit
cab7505af9

+ 2
- 2
.clang-format View File

@@ -36,13 +36,13 @@ BraceWrapping:
36 36
 BreakBeforeBinaryOperators: None
37 37
 BreakBeforeBraces: Attach
38 38
 BreakBeforeTernaryOperators: true
39
-BreakConstructorInitializersBeforeComma: false
39
+BreakConstructorInitializersBeforeComma: true
40 40
 BreakAfterJavaFieldAnnotations: false
41 41
 BreakStringLiterals: true
42 42
 ColumnLimit:     120
43 43
 CommentPragmas:  '^ IWYU pragma:'
44 44
 ConstructorInitializerAllOnOneLineOrOnePerLine: false
45
-ConstructorInitializerIndentWidth: 4
45
+ConstructorInitializerIndentWidth: 0
46 46
 ContinuationIndentWidth: 4
47 47
 Cpp11BracedListStyle: true
48 48
 DerivePointerAlignment: false

+ 3
- 3
incl/scv4tlm/tlm2_recorder.h View File

@@ -48,7 +48,7 @@ template <typename TYPES = tlm::tlm_base_protocol_types> struct tlm2_extensions_
48 48
      */
49 49
     virtual void recordEndTx(scv_tr_handle &handle, typename TYPES::tlm_payload_type &payload) = 0;
50 50
 
51
-    virtual ~tlm2_extensions_recording_if()= default;
51
+    virtual ~tlm2_extensions_recording_if() = default;
52 52
 };
53 53
 /*! \brief The TLM2 transaction recorder
54 54
  *
@@ -105,7 +105,7 @@ public:
105 105
           nb_bw_trHandle(3), nb_txRespHandle(3), dmi_streamHandle(NULL), dmi_trGetHandle(NULL),
106 106
           dmi_trInvalidateHandle(NULL), extensionRecording(NULL) {}
107 107
 
108
-    virtual ~tlm2_recorder() override{
108
+    virtual ~tlm2_recorder() override {
109 109
         delete b_streamHandle;
110 110
         delete b_streamHandleTimed;
111 111
         for (size_t i = 0; i < b_trTimedHandle.size(); ++i) delete b_trTimedHandle[i];
@@ -224,7 +224,7 @@ private:
224 224
             }
225 225
             return (tlm_recording_payload *)ptr;
226 226
         }
227
-        void free(tlm::tlm_generic_payload *trans) override{
227
+        void free(tlm::tlm_generic_payload *trans) override {
228 228
             trans->reset();
229 229
             if (!empties) {
230 230
                 empties = new access;

+ 3
- 7
incl/scv4tlm/tlm_gp_data.h View File

@@ -28,13 +28,9 @@ struct tlm_gp_data {
28 28
     //---------------
29 29
 
30 30
     // Default constructor
31
-    tlm_gp_data()
32
-        : m_extensions(tlm::max_num_extensions()) {
33
-    }
31
+    tlm_gp_data() : m_extensions(tlm::max_num_extensions()) {}
34 32
 
35
-    explicit tlm_gp_data(tlm::tlm_mm_interface *mm)
36
-        : m_extensions(tlm::max_num_extensions()) {
37
-    }
33
+    explicit tlm_gp_data(tlm::tlm_mm_interface *mm) : m_extensions(tlm::max_num_extensions()) {}
38 34
 
39 35
     int get_ref_count() const { return m_ref_count; }
40 36
 
@@ -146,7 +142,7 @@ public:
146 142
                 if (byte_enable_length == 8 && data_length % 8 == 0) {
147 143
                     // Optimized implementation copies 64-bit words by masking
148 144
                     for (unsigned int i = 0; i < data_length; i += 8) {
149
-                        using u = sc_dt::uint64*;
145
+                        using u = sc_dt::uint64 *;
150 146
                         *reinterpret_cast<u>(&data[i]) &= ~*reinterpret_cast<u>(byte_enable);
151 147
                         *reinterpret_cast<u>(&data[i]) |=
152 148
                             *reinterpret_cast<u>(&other.get_data_ptr()[i]) & *reinterpret_cast<u>(byte_enable);

+ 6
- 6
incl/scv4tlm/tlm_rec_initiator_socket.h View File

@@ -51,16 +51,16 @@ class tlm_rec_initiator_socket : public tlm::tlm_initiator_socket<BUSWIDTH, TYPE
51 51
 
52 52
 public:
53 53
     using fw_interface_type = tlm::tlm_fw_transport_if<TYPES>;
54
-    using bw_interface_type =tlm::tlm_bw_transport_if<TYPES> ;
54
+    using bw_interface_type = tlm::tlm_bw_transport_if<TYPES>;
55 55
     using port_type = sc_core::sc_port<fw_interface_type, N
56 56
 #if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
57
-                             ,POL
57
+                                       ,
58
+                                       POL
58 59
 #endif
59
-                             >
60
-        ;
60
+                                       >;
61 61
     using export_type = sc_core::sc_export<bw_interface_type>;
62
-    using base_target_socket_type = tlm::tlm_base_target_socket_b<BUSWIDTH, fw_interface_type, bw_interface_type> ;
63
-    using base_type = tlm::tlm_base_initiator_socket_b<BUSWIDTH, fw_interface_type, bw_interface_type> ;
62
+    using base_target_socket_type = tlm::tlm_base_target_socket_b<BUSWIDTH, fw_interface_type, bw_interface_type>;
63
+    using base_type = tlm::tlm_base_initiator_socket_b<BUSWIDTH, fw_interface_type, bw_interface_type>;
64 64
 
65 65
     tlm_rec_initiator_socket()
66 66
         : tlm::tlm_initiator_socket<BUSWIDTH, TYPES, N

+ 3
- 3
incl/scv4tlm/tlm_rec_target_socket.h View File

@@ -54,10 +54,10 @@ public:
54 54
     using bw_interface_type = tlm::tlm_bw_transport_if<TYPES>;
55 55
     using port_type = sc_core::sc_port<bw_interface_type, N
56 56
 #if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
57
-                             ,
58
-                             POL
57
+                                       ,
58
+                                       POL
59 59
 #endif
60
-                             >;
60
+                                       >;
61 61
 
62 62
     using export_type = sc_core::sc_export<fw_interface_type>;
63 63
     using base_initiator_socket_type = tlm::tlm_base_initiator_socket_b<BUSWIDTH, fw_interface_type, bw_interface_type>;

+ 1
- 0
incl/sysc/register.h View File

@@ -26,6 +26,7 @@
26 26
 #include "resetable.h"
27 27
 #include "resource_access_if.h"
28 28
 #include "utilities.h"
29
+#include <memory>
29 30
 
30 31
 #include <functional>
31 32
 #include <limits>

+ 2
- 2
incl/sysc/target_mixin.h View File

@@ -32,9 +32,9 @@ template <typename base_type, typename TYPES = tlm::tlm_base_protocol_types> cla
32 32
 
33 33
 public:
34 34
     using transaction_type = typename TYPES::tlm_payload_type;
35
-    using phase_type = typename TYPES::tlm_phase_type ;
35
+    using phase_type = typename TYPES::tlm_phase_type;
36 36
     using sync_enum_type = tlm::tlm_sync_enum;
37
-    using fw_interface_type = tlm::tlm_fw_transport_if<TYPES> ;
37
+    using fw_interface_type = tlm::tlm_fw_transport_if<TYPES>;
38 38
     using bw_interface_type = tlm::tlm_bw_transport_if<TYPES>;
39 39
 
40 40
 public:

+ 1
- 1
incl/sysc/tlm_target.h View File

@@ -92,7 +92,7 @@ template <unsigned BUSWIDTH = 32> struct target_memory_map_entry {
92 92
 };
93 93
 
94 94
 template <unsigned int BUSWIDTH = 32, unsigned RANGES = 1> struct tlm_multi_rangetarget : public tlm_target<BUSWIDTH> {
95
-    using this_type =  tlm_multi_rangetarget<BUSWIDTH, RANGES>;
95
+    using this_type = tlm_multi_rangetarget<BUSWIDTH, RANGES>;
96 96
 
97 97
     tlm_multi_rangetarget(sc_core::sc_time &clock, std::array<addr_range, RANGES> addr_rngs)
98 98
         : tlm_target<BUSWIDTH>(clock), addr_ranges(addr_rngs) {}

+ 1
- 1
incl/util/logging.h View File

@@ -36,11 +36,11 @@
36 36
 #define _UTIL_LOGGING_H_
37 37
 
38 38
 #include <cassert>
39
+#include <cstdio>
39 40
 #include <cstring>
40 41
 #include <iterator>
41 42
 #include <mutex>
42 43
 #include <sstream>
43
-#include <cstdio>
44 44
 #include <string>
45 45
 #include <sys/time.h>
46 46
 #include <vector>

+ 3
- 3
incl/util/range_lut.h View File

@@ -135,12 +135,12 @@ template <typename T> inline void range_lut<T>::addEntry(T i, uint64_t base_addr
135 135
 
136 136
 template <typename T> inline bool range_lut<T>::removeEntry(T i) {
137 137
     auto start = lut.begin();
138
-    while(start->second.index != i && start != lut.end()) start++;
138
+    while (start->second.index != i && start != lut.end()) start++;
139 139
     if (start != lut.end()) {
140
-        if(start->second.type == SINGLE_BYTE_RANGE){
140
+        if (start->second.type == SINGLE_BYTE_RANGE) {
141 141
             lut.erase(start);
142 142
         } else {
143
-            auto  end = start+2;
143
+            auto end = start + 2;
144 144
             lut.erase(start, end);
145 145
         }
146 146
         return true;

+ 1
- 1
src/report.cpp View File

@@ -12,7 +12,7 @@ using namespace sc_core;
12 12
 
13 13
 static const std::string compose_message(const sc_report &rep) {
14 14
     std::stringstream os;
15
-    auto* srr = dynamic_cast<sr_report *>(const_cast<sc_report *>(&rep));
15
+    auto *srr = dynamic_cast<sr_report *>(const_cast<sc_report *>(&rep));
16 16
     if (srr) {
17 17
         for (std::vector<v::pair>::const_iterator iter = srr->pairs.begin(); iter != srr->pairs.end(); iter++) {
18 18
             os << '[' << iter->name << ':';

+ 2
- 1
src/scv_tr_sqlite/scv_tr_sqlite.cpp View File

@@ -117,7 +117,8 @@ static void dbCb(const scv_tr_db &_scv_tr_db, scv_tr_db::callback_reason reason,
117 117
             // my_sqlite_file_name << endl;
118 118
             db.exec("CREATE TABLE  IF NOT EXISTS " STREAM_TABLE
119 119
                     "(id INTEGER  NOT nullptr PRIMARY KEY, name TEXT, kind TEXT);");
120
-            db.exec("CREATE TABLE  IF NOT EXISTS " GENERATOR_TABLE "(id INTEGER  NOT nullptr PRIMARY KEY, stream INTEGER "
120
+            db.exec("CREATE TABLE  IF NOT EXISTS " GENERATOR_TABLE
121
+                    "(id INTEGER  NOT nullptr PRIMARY KEY, stream INTEGER "
121 122
                     "REFERENCES " STREAM_TABLE "(id), name TEXT, begin_attr INTEGER, end_attr INTEGER);");
122 123
             db.exec("CREATE TABLE  IF NOT EXISTS " TX_TABLE "(id INTEGER  NOT nullptr PRIMARY KEY, generator INTEGER "
123 124
                     "REFERENCES " GENERATOR_TABLE "(id), stream INTEGER REFERENCES " STREAM_TABLE

+ 3
- 3
src/tracer.cpp View File

@@ -119,7 +119,7 @@ void tracer::try_trace_signal(sc_core::sc_object *obj) {
119 119
 #undef GEN_TRACE
120 120
 #define GEN_TRACE(X)                                                                                                   \
121 121
     {                                                                                                                  \
122
-        auto* sig = dynamic_cast<sc_core::sc_signal<X> *>(obj);                                       \
122
+        auto *sig = dynamic_cast<sc_core::sc_signal<X> *>(obj);                                                        \
123 123
         if (sig) sc_core::sc_trace(trf, sig->read(), std::string(sig->name()));                                        \
124 124
     }
125 125
     GEN_TRACE_STD;
@@ -130,7 +130,7 @@ void tracer::try_trace_port(sc_core::sc_object *obj) {
130 130
 #undef GEN_TRACE
131 131
 #define GEN_TRACE(X)                                                                                                   \
132 132
     {                                                                                                                  \
133
-        auto* in_port = dynamic_cast<sc_core::sc_in<X> *>(obj);                                           \
133
+        auto *in_port = dynamic_cast<sc_core::sc_in<X> *>(obj);                                                        \
134 134
         if (in_port) {                                                                                                 \
135 135
             sc_core::sc_trace(trf, *in_port, std::string(in_port->name()));                                            \
136 136
             return;                                                                                                    \
@@ -141,7 +141,7 @@ void tracer::try_trace_port(sc_core::sc_object *obj) {
141 141
 #undef GEN_TRACE
142 142
 #define GEN_TRACE(X)                                                                                                   \
143 143
     {                                                                                                                  \
144
-        auto* io_port = dynamic_cast<sc_core::sc_inout<X> *>(obj);                                     \
144
+        auto *io_port = dynamic_cast<sc_core::sc_inout<X> *>(obj);                                                     \
145 145
         if (io_port) {                                                                                                 \
146 146
             sc_core::sc_trace(trf, *io_port, std::string(io_port->name()));                                            \
147 147
             return;                                                                                                    \