Skip to content

Commit

Permalink
Refactored namespace sysc into scc (SystemC-Components)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyck committed Oct 4, 2017
1 parent 35379b7 commit f1c733d
Show file tree
Hide file tree
Showing 21 changed files with 74 additions and 71 deletions.
6 changes: 3 additions & 3 deletions incl/sysc/configurer.h → incl/scc/configurer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
#ifndef _SYSC_CONFIGURER_H_
#define _SYSC_CONFIGURER_H_

#include "report.h"
#include "utilities.h"
#include <json/json.h>
#include "scc/report.h"
#include "scc/utilities.h"

namespace sysc {
namespace scc {

class configurer : public sc_core::sc_module {
public:
Expand Down
4 changes: 2 additions & 2 deletions incl/sysc/core/sc_logic_7.h → incl/scc/core/sc_logic_7.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "sysc/utils/sc_iostream.h"
#include "sysc/utils/sc_mempool.h"

namespace sysc {
namespace scc {
namespace sc_dt {

// classes defined in this module
Expand Down Expand Up @@ -290,6 +290,6 @@ extern const sc_logic_7 SC_LOGIC7_Z;
extern const sc_logic_7 SC_LOGIC7_X;

} // namespace sc_dt
} // namespace sysc
} // namespace scc

#endif /* INCL_SYSC_CORE_SC_LOGIC_7_H_ */
6 changes: 3 additions & 3 deletions incl/sysc/ext_attribute.h → incl/scc/ext_attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#ifndef _SYSC_EXT_ATTRIBUTE_H_
#define _SYSC_EXT_ATTRIBUTE_H_

#include "configurer.h"
#include "utilities.h"
#include "scc/configurer.h"
#include "scc/utilities.h"

namespace sysc {
namespace scc {
template <typename T> class ext_attribute : public sc_core::sc_attribute<T> {
public:
using base_type = sc_core::sc_attribute<T>;
Expand Down
4 changes: 2 additions & 2 deletions incl/sysc/initiator_mixin.h → incl/scc/initiator_mixin.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
#ifndef _SYSC_INITIATOR_MIXIN_H__
#define _SYSC_INITIATOR_MIXIN_H__

#include "utilities.h"
#include <functional>
#include <sstream>
#include <tlm>
#include "scc/utilities.h"

namespace sysc {
namespace scc {

template <typename BASE_TYPE, typename TYPES = tlm::tlm_base_protocol_types> class initiator_mixin : public BASE_TYPE {
public:
Expand Down
12 changes: 6 additions & 6 deletions incl/sysc/memory.h → incl/scc/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@
// Needed for the simple_target_socket
#define SC_INCLUDE_DYNAMIC_PROCESSES

#include "report.h"
#include "target_mixin.h"
#include "utilities.h"
#include "scc/report.h"
#include "scc/target_mixin.h"
#include "scc/utilities.h"
#include <tlm.h>
#include <util/sparse_array.h>

namespace sysc {
namespace scc {

// simple memory model
// TODO: add attributes/parameters to configure access time and type (DMI allowed, read only, etc)
template <unsigned long long SIZE, unsigned BUSWIDTH = 32, bool LOG_ACCESS = false>
class memory : public sc_core::sc_module {
public:
sysc::target_mixin<tlm::tlm_target_socket<BUSWIDTH>> target;
scc::target_mixin<tlm::tlm_target_socket<BUSWIDTH>> target;

memory(const sc_core::sc_module_name &nm);

Expand Down Expand Up @@ -126,6 +126,6 @@ inline bool memory<SIZE, BUSWIDTH, LOG_ACCESS>::handle_dmi(tlm::tlm_generic_payl
return true;
}

} // namespace sysc
} // namespace scc

#endif /* _SYSC_MEMORY_H_ */
8 changes: 4 additions & 4 deletions incl/sysc/register.h → incl/scc/register.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
#ifndef _SYSC_REGISTER_H_
#define _SYSC_REGISTER_H_

#include "resetable.h"
#include "resource_access_if.h"
#include "utilities.h"
#include <memory>

#include <functional>
#include <limits>
#include "scc/resetable.h"
#include "scc/resource_access_if.h"
#include "scc/utilities.h"

namespace sysc {
namespace scc {

namespace impl {

Expand Down
8 changes: 4 additions & 4 deletions incl/sysc/report.h → incl/scc/report.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@

#include <iomanip>
#include <sstream>
#include <sysc/utilities.h>
#include <sysc/utils/sc_report.h>
#include <util/logging.h>
#include "scc/utilities.h"

namespace logging {
struct SystemC {};
}
namespace sysc {
namespace scc {

namespace log = logging;
/**
Expand Down Expand Up @@ -96,13 +96,13 @@ template <typename CATEGORY = log::SystemC> class FILELOG_DECLSPEC Logger : publ
#define LOG(LEVEL) \
if (logging::LEVEL <= logging::Log<logging::Output2FILE<logging::SystemC>>::reporting_level() && \
LOG_OUTPUT(SystemC)::stream()) \
sysc::Log<logging::Output2FILE<logging::SystemC>>().get(logging::LEVEL, "SystemC")
scc::Log<logging::Output2FILE<logging::SystemC>>().get(logging::LEVEL, "SystemC")

#ifdef CLOG
#undef CLOG
#endif
#define CLOG(LEVEL, CATEGORY) \
if (logging::LEVEL <= LOGGER(CATEGORY)::reporting_level() && LOG_OUTPUT(CATEGORY)::stream()) \
sysc::Log<logging::Output2FILE<logging::CATEGORY>>().get(logging::LEVEL, #CATEGORY)
scc::Log<logging::Output2FILE<logging::CATEGORY>>().get(logging::LEVEL, #CATEGORY)

#endif /* _SYSC_REPORT_H_ */
6 changes: 3 additions & 3 deletions incl/sysc/resetable.h → incl/scc/resetable.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#ifndef _SYSC_RESETTABLE_H_
#define _SYSC_RESETTABLE_H_

#include "resource_access_if.h"
#include <vector>
#include "scc/resource_access_if.h"

namespace sysc {
namespace scc {

struct resetable {
/**
Expand Down Expand Up @@ -59,6 +59,6 @@ struct resetable {
bool _in_reset = false;
};

} /* namespace sysc */
} /* namespace scc */

#endif /* _SYSC_RESETTABLE_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <cstddef>
#include <cstdint>

namespace sysc {
namespace scc {

struct resource_access_if {
/**
Expand Down
14 changes: 7 additions & 7 deletions incl/sysc/router.h → incl/scc/router.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@
#ifndef _SYSC_ROUTER_H_
#define _SYSC_ROUTER_H_

#include "utilities.h"
#include <util/range_lut.h>
#include "scc/utilities.h"
// pragmas to disable the deprecated warnings for SystemC headers
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#include <scv4tlm/tlm_rec_initiator_socket.h>
#include <scv4tlm/tlm_rec_target_socket.h>
#include <sysc/initiator_mixin.h>
#include <sysc/target_mixin.h>
#include "scc/initiator_mixin.h"
#include "scc/target_mixin.h"
#include <sysc/utils/sc_vector.h>
#include <tlm.h>
#pragma GCC diagnostic pop
#include <limits>

namespace sysc {
namespace scc {

template <unsigned BUSWIDTH = 32> struct router : sc_core::sc_module {
using intor_sckt = sysc::initiator_mixin<scv4tlm::tlm_rec_initiator_socket<BUSWIDTH>>;
using target_sckt = sysc::target_mixin<scv4tlm::tlm_rec_target_socket<BUSWIDTH>>;
using intor_sckt = scc::initiator_mixin<scv4tlm::tlm_rec_initiator_socket<BUSWIDTH>>;
using target_sckt = scc::target_mixin<scv4tlm::tlm_rec_target_socket<BUSWIDTH>>;
/**
*
*/
Expand Down Expand Up @@ -245,6 +245,6 @@ void router<BUSWIDTH>::invalidate_direct_mem_ptr(int id, sc_dt::uint64 start_ran
}
}

} // namespace sysc
} // namespace scc

#endif /* SYSC_AVR_ROUTER_H_ */
File renamed without changes.
4 changes: 2 additions & 2 deletions incl/sysc/target_mixin.h → incl/scc/target_mixin.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
#endif

#include <sstream>
#include <sysc/utilities.h>
#include "scc/utilities.h"
#include <tlm_utils/peq_with_get.h>

namespace sysc {
namespace scc {

template <typename base_type, typename TYPES = tlm::tlm_base_protocol_types> class target_mixin : public base_type {
friend class fw_process;
Expand Down
18 changes: 9 additions & 9 deletions incl/sysc/tlm_target.h → incl/scc/tlm_target.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
#ifndef _SYSC_TLM_TARGET_H_
#define _SYSC_TLM_TARGET_H_

#include "resource_access_if.h"
#include <array>
#include <scv4tlm/tlm_rec_target_socket.h>
#include <sysc/target_mixin.h>
#include <util/range_lut.h>
#include "scc/resource_access_if.h"
#include "scc/target_mixin.h"

namespace sysc {
namespace scc {
/**
* a simple access-width based bus interface (no DMI support)
*/
Expand All @@ -47,7 +47,7 @@ template <unsigned int BUSWIDTH = 32> struct tlm_target {
/**
*
*/
sysc::target_mixin<scv4tlm::tlm_rec_target_socket<BUSWIDTH>> socket;
scc::target_mixin<scv4tlm::tlm_rec_target_socket<BUSWIDTH>> socket;
/**
*
* @param
Expand Down Expand Up @@ -86,7 +86,7 @@ template <unsigned int BUSWIDTH = 32> struct tlm_target {
};

template <unsigned BUSWIDTH = 32> struct target_memory_map_entry {
sysc::tlm_target<BUSWIDTH> *target;
scc::tlm_target<BUSWIDTH> *target;
sc_dt::uint64 start;
sc_dt::uint64 size;
};
Expand All @@ -108,10 +108,10 @@ template <unsigned int BUSWIDTH = 32, unsigned RANGES = 1> struct tlm_multi_rang
util::range_lut<resource_access_if *> socket_map;
};

} /* namespace sysc */
} /* namespace scc */

template <unsigned int BUSWIDTH>
inline sysc::tlm_target<BUSWIDTH>::tlm_target(sc_core::sc_time &clock)
inline scc::tlm_target<BUSWIDTH>::tlm_target(sc_core::sc_time &clock)
: socket("socket")
, clk(clock)
, socket_map(std::make_pair(nullptr, 0)) {
Expand All @@ -121,7 +121,7 @@ inline sysc::tlm_target<BUSWIDTH>::tlm_target(sc_core::sc_time &clock)
}

template <unsigned int BUSWIDTH>
void sysc::tlm_target<BUSWIDTH>::b_tranport_cb(tlm::tlm_generic_payload &gp, sc_core::sc_time &delay) {
void scc::tlm_target<BUSWIDTH>::b_tranport_cb(tlm::tlm_generic_payload &gp, sc_core::sc_time &delay) {
resource_access_if *ra = nullptr;
uint64_t base = 0;
std::tie(ra, base) = socket_map.getEntry(gp.get_address());
Expand Down Expand Up @@ -151,7 +151,7 @@ void sysc::tlm_target<BUSWIDTH>::b_tranport_cb(tlm::tlm_generic_payload &gp, sc_
}

template <unsigned int BUSWIDTH>
unsigned int sysc::tlm_target<BUSWIDTH>::tranport_dbg_cb(tlm::tlm_generic_payload &gp) {
unsigned int scc::tlm_target<BUSWIDTH>::tranport_dbg_cb(tlm::tlm_generic_payload &gp) {
resource_access_if *ra = nullptr;
uint64_t base = 0;
std::tie(ra, base) = socket_map.getEntry(gp.get_address());
Expand Down
4 changes: 2 additions & 2 deletions incl/sysc/traceable.h → incl/scc/traceable.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace sc_core {
class sc_trace_file;
}

namespace sysc {
namespace scc {

class traceable {
public:
Expand All @@ -42,6 +42,6 @@ class traceable {
virtual void trace(sc_core::sc_trace_file *trf) = 0;
};

} /* namespace sysc */
} /* namespace scc */

#endif /* _SYSC_TRACABLE_H_ */
6 changes: 3 additions & 3 deletions incl/sysc/tracer.h → incl/scc/tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef _SYSC_TRACER_H_
#define _SYSC_TRACER_H_

#include "utilities.h"
#include "scc/utilities.h"
#ifdef WITH_SCV
#include <scv.h>
#endif
Expand All @@ -35,7 +35,7 @@ class sc_object;
class sc_trace_file;
}

namespace sysc {
namespace scc {

struct tracer : public sc_core::sc_module {
/**
Expand Down Expand Up @@ -66,6 +66,6 @@ struct tracer : public sc_core::sc_module {
#endif
};

} /* namespace sysc */
} /* namespace scc */

#endif /* _SYSC_TRACER_H_ */
2 changes: 1 addition & 1 deletion incl/sysc/utilities.h → incl/scc/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#ifndef _SYSC_UTILITIES_H_
#define _SYSC_UTILITIES_H_

#include "traceable.h"
#include "scc/traceable.h"

// pragmas to disable the deprecated warnings for SystemC headers
#pragma GCC diagnostic push
Expand Down

0 comments on commit f1c733d

Please sign in to comment.