Browse Source

Added clang-format formatting

pull/6/head
Eyck Jentzsch 2 years ago
parent
commit
cab7505af9

+ 2
- 2
.clang-format View File

@@ -36,13 +36,13 @@ BraceWrapping:
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializersBeforeComma: true
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
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_
*/
virtual void recordEndTx(scv_tr_handle &handle, typename TYPES::tlm_payload_type &payload) = 0;

virtual ~tlm2_extensions_recording_if()= default;
virtual ~tlm2_extensions_recording_if() = default;
};
/*! \brief The TLM2 transaction recorder
*
@@ -105,7 +105,7 @@ public:
nb_bw_trHandle(3), nb_txRespHandle(3), dmi_streamHandle(NULL), dmi_trGetHandle(NULL),
dmi_trInvalidateHandle(NULL), extensionRecording(NULL) {}

virtual ~tlm2_recorder() override{
virtual ~tlm2_recorder() override {
delete b_streamHandle;
delete b_streamHandleTimed;
for (size_t i = 0; i < b_trTimedHandle.size(); ++i) delete b_trTimedHandle[i];
@@ -224,7 +224,7 @@ private:
}
return (tlm_recording_payload *)ptr;
}
void free(tlm::tlm_generic_payload *trans) override{
void free(tlm::tlm_generic_payload *trans) override {
trans->reset();
if (!empties) {
empties = new access;

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

@@ -28,13 +28,9 @@ struct tlm_gp_data {
//---------------

// Default constructor
tlm_gp_data()
: m_extensions(tlm::max_num_extensions()) {
}
tlm_gp_data() : m_extensions(tlm::max_num_extensions()) {}

explicit tlm_gp_data(tlm::tlm_mm_interface *mm)
: m_extensions(tlm::max_num_extensions()) {
}
explicit tlm_gp_data(tlm::tlm_mm_interface *mm) : m_extensions(tlm::max_num_extensions()) {}

int get_ref_count() const { return m_ref_count; }

@@ -146,7 +142,7 @@ public:
if (byte_enable_length == 8 && data_length % 8 == 0) {
// Optimized implementation copies 64-bit words by masking
for (unsigned int i = 0; i < data_length; i += 8) {
using u = sc_dt::uint64*;
using u = sc_dt::uint64 *;
*reinterpret_cast<u>(&data[i]) &= ~*reinterpret_cast<u>(byte_enable);
*reinterpret_cast<u>(&data[i]) |=
*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

public:
using fw_interface_type = tlm::tlm_fw_transport_if<TYPES>;
using bw_interface_type =tlm::tlm_bw_transport_if<TYPES> ;
using bw_interface_type = tlm::tlm_bw_transport_if<TYPES>;
using port_type = sc_core::sc_port<fw_interface_type, N
#if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
,POL
,
POL
#endif
>
;
>;
using export_type = sc_core::sc_export<bw_interface_type>;
using base_target_socket_type = tlm::tlm_base_target_socket_b<BUSWIDTH, fw_interface_type, bw_interface_type> ;
using base_type = tlm::tlm_base_initiator_socket_b<BUSWIDTH, fw_interface_type, bw_interface_type> ;
using base_target_socket_type = tlm::tlm_base_target_socket_b<BUSWIDTH, fw_interface_type, bw_interface_type>;
using base_type = tlm::tlm_base_initiator_socket_b<BUSWIDTH, fw_interface_type, bw_interface_type>;

tlm_rec_initiator_socket()
: tlm::tlm_initiator_socket<BUSWIDTH, TYPES, N

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

@@ -54,10 +54,10 @@ public:
using bw_interface_type = tlm::tlm_bw_transport_if<TYPES>;
using port_type = sc_core::sc_port<bw_interface_type, N
#if !(defined SYSTEMC_VERSION & SYSTEMC_VERSION <= 20050714)
,
POL
,
POL
#endif
>;
>;

using export_type = sc_core::sc_export<fw_interface_type>;
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 @@
#include "resetable.h"
#include "resource_access_if.h"
#include "utilities.h"
#include <memory>

#include <functional>
#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

public:
using transaction_type = typename TYPES::tlm_payload_type;
using phase_type = typename TYPES::tlm_phase_type ;
using phase_type = typename TYPES::tlm_phase_type;
using sync_enum_type = tlm::tlm_sync_enum;
using fw_interface_type = tlm::tlm_fw_transport_if<TYPES> ;
using fw_interface_type = tlm::tlm_fw_transport_if<TYPES>;
using bw_interface_type = tlm::tlm_bw_transport_if<TYPES>;

public:

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

@@ -92,7 +92,7 @@ template <unsigned BUSWIDTH = 32> struct target_memory_map_entry {
};

template <unsigned int BUSWIDTH = 32, unsigned RANGES = 1> struct tlm_multi_rangetarget : public tlm_target<BUSWIDTH> {
using this_type = tlm_multi_rangetarget<BUSWIDTH, RANGES>;
using this_type = tlm_multi_rangetarget<BUSWIDTH, RANGES>;

tlm_multi_rangetarget(sc_core::sc_time &clock, std::array<addr_range, RANGES> addr_rngs)
: tlm_target<BUSWIDTH>(clock), addr_ranges(addr_rngs) {}

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

@@ -36,11 +36,11 @@
#define _UTIL_LOGGING_H_

#include <cassert>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <mutex>
#include <sstream>
#include <cstdio>
#include <string>
#include <sys/time.h>
#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

template <typename T> inline bool range_lut<T>::removeEntry(T i) {
auto start = lut.begin();
while(start->second.index != i && start != lut.end()) start++;
while (start->second.index != i && start != lut.end()) start++;
if (start != lut.end()) {
if(start->second.type == SINGLE_BYTE_RANGE){
if (start->second.type == SINGLE_BYTE_RANGE) {
lut.erase(start);
} else {
auto end = start+2;
auto end = start + 2;
lut.erase(start, end);
}
return true;

+ 1
- 1
src/report.cpp View File

@@ -12,7 +12,7 @@ using namespace sc_core;

static const std::string compose_message(const sc_report &rep) {
std::stringstream os;
auto* srr = dynamic_cast<sr_report *>(const_cast<sc_report *>(&rep));
auto *srr = dynamic_cast<sr_report *>(const_cast<sc_report *>(&rep));
if (srr) {
for (std::vector<v::pair>::const_iterator iter = srr->pairs.begin(); iter != srr->pairs.end(); iter++) {
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,
// my_sqlite_file_name << endl;
db.exec("CREATE TABLE IF NOT EXISTS " STREAM_TABLE
"(id INTEGER NOT nullptr PRIMARY KEY, name TEXT, kind TEXT);");
db.exec("CREATE TABLE IF NOT EXISTS " GENERATOR_TABLE "(id INTEGER NOT nullptr PRIMARY KEY, stream INTEGER "
db.exec("CREATE TABLE IF NOT EXISTS " GENERATOR_TABLE
"(id INTEGER NOT nullptr PRIMARY KEY, stream INTEGER "
"REFERENCES " STREAM_TABLE "(id), name TEXT, begin_attr INTEGER, end_attr INTEGER);");
db.exec("CREATE TABLE IF NOT EXISTS " TX_TABLE "(id INTEGER NOT nullptr PRIMARY KEY, generator INTEGER "
"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) {
#undef GEN_TRACE
#define GEN_TRACE(X) \
{ \
auto* sig = dynamic_cast<sc_core::sc_signal<X> *>(obj); \
auto *sig = dynamic_cast<sc_core::sc_signal<X> *>(obj); \
if (sig) sc_core::sc_trace(trf, sig->read(), std::string(sig->name())); \
}
GEN_TRACE_STD;
@@ -130,7 +130,7 @@ void tracer::try_trace_port(sc_core::sc_object *obj) {
#undef GEN_TRACE
#define GEN_TRACE(X) \
{ \
auto* in_port = dynamic_cast<sc_core::sc_in<X> *>(obj); \
auto *in_port = dynamic_cast<sc_core::sc_in<X> *>(obj); \
if (in_port) { \
sc_core::sc_trace(trf, *in_port, std::string(in_port->name())); \
return; \
@@ -141,7 +141,7 @@ void tracer::try_trace_port(sc_core::sc_object *obj) {
#undef GEN_TRACE
#define GEN_TRACE(X) \
{ \
auto* io_port = dynamic_cast<sc_core::sc_inout<X> *>(obj); \
auto *io_port = dynamic_cast<sc_core::sc_inout<X> *>(obj); \
if (io_port) { \
sc_core::sc_trace(trf, *io_port, std::string(io_port->name())); \
return; \

Loading…
Cancel
Save