using ramulator dram simulator
This commit is contained in:
@@ -51,8 +51,7 @@ public:
|
||||
peer_ = peer;
|
||||
}
|
||||
|
||||
void unbind() {
|
||||
assert(peer_ == nullptr);
|
||||
void unbind() {
|
||||
peer_ = nullptr;
|
||||
}
|
||||
|
||||
@@ -292,12 +291,16 @@ public:
|
||||
}
|
||||
|
||||
template <typename Impl, typename... Args>
|
||||
typename SimObject<Impl>::Ptr CreateObject(Args&&... args) {
|
||||
typename SimObject<Impl>::Ptr create_object(Args&&... args) {
|
||||
auto obj = std::make_shared<Impl>(SimContext{}, std::forward<Args>(args)...);
|
||||
objects_.push_back(obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
void release_object(const SimObjectBase::Ptr& object) {
|
||||
objects_.remove(object);
|
||||
}
|
||||
|
||||
template <typename Pkt>
|
||||
void schedule(const typename SimCallEvent<Pkt>::Func& callback,
|
||||
const Pkt& pkt,
|
||||
@@ -352,7 +355,7 @@ private:
|
||||
events_.emplace_back(evt);
|
||||
}
|
||||
|
||||
std::vector<SimObjectBase::Ptr> objects_;
|
||||
std::list<SimObjectBase::Ptr> objects_;
|
||||
std::list<SimEventBase::Ptr> events_;
|
||||
uint64_t cycles_;
|
||||
|
||||
@@ -369,7 +372,7 @@ inline SimObjectBase::SimObjectBase(const SimContext&, const char* name)
|
||||
template <typename Impl>
|
||||
template <typename... Args>
|
||||
typename SimObject<Impl>::Ptr SimObject<Impl>::Create(Args&&... args) {
|
||||
return SimPlatform::instance().CreateObject<Impl>(std::forward<Args>(args)...);
|
||||
return SimPlatform::instance().create_object<Impl>(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <typename Pkt>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <fixed.h>
|
||||
#include <cocogfx/include/fixed.h>
|
||||
#include <bitmanip.h>
|
||||
|
||||
using namespace cocogfx;
|
||||
|
||||
@@ -11,4 +11,42 @@ void unused(Args&&...) {}
|
||||
#define __unused(...) unused(__VA_ARGS__)
|
||||
|
||||
// return file extension
|
||||
const char* fileExtension(const char* filepath);
|
||||
const char* fileExtension(const char* filepath);
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define DISABLE_WARNING_PUSH __pragma(warning(push))
|
||||
#define DISABLE_WARNING_POP __pragma(warning(pop))
|
||||
#define DISABLE_WARNING_UNUSED_PARAMETER \
|
||||
__pragma(warning(disable : 4100))
|
||||
#define DISABLE_WARNING_UNREFERENCED_FUNCTION __pragma(warning(disable : 4505))
|
||||
#define DISABLE_WARNING_ANONYMOUS_STRUCT __pragma(warning(disable : 4201))
|
||||
#define DISABLE_WARNING_UNUSED_VARIABLE __pragma(warning(disable : 4189))
|
||||
#elif defined(__GNUC__)
|
||||
#define DISABLE_WARNING_PUSH _Pragma("GCC diagnostic push")
|
||||
#define DISABLE_WARNING_POP _Pragma("GCC diagnostic pop")
|
||||
#define DISABLE_WARNING_UNUSED_PARAMETER \
|
||||
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")
|
||||
#define DISABLE_WARNING_UNREFERENCED_FUNCTION \
|
||||
_Pragma("GCC diagnostic ignored \"-Wunused-function\"")
|
||||
#define DISABLE_WARNING_ANONYMOUS_STRUCT \
|
||||
_Pragma("GCC diagnostic ignored \"-Wpedantic\"")
|
||||
#define DISABLE_WARNING_UNUSED_VARIABLE \
|
||||
_Pragma("GCC diagnostic ignored \"-Wunused-but-set-variable\"")
|
||||
#elif defined(__clang__)
|
||||
#define DISABLE_WARNING_PUSH _Pragma("clang diagnostic push")
|
||||
#define DISABLE_WARNING_POP _Pragma("clang diagnostic pop")
|
||||
#define DISABLE_WARNING_UNUSED_PARAMETER \
|
||||
_Pragma("clang diagnostic ignored \"-Wunused-parameter\"")
|
||||
#define DISABLE_WARNING_UNREFERENCED_FUNCTION \
|
||||
_Pragma("clang diagnostic ignored \"-Wunused-function\"")
|
||||
#define DISABLE_WARNING_ANONYMOUS_STRUCT \
|
||||
_Pragma("clang diagnostic ignored \"-Wgnu-anonymous-struct\"")
|
||||
#define DISABLE_WARNING_UNUSED_VARIABLE \
|
||||
_Pragma("clang diagnostic ignored \"-Wunused-but-set-variable\"")
|
||||
#else
|
||||
#define DISABLE_WARNING_PUSH
|
||||
#define DISABLE_WARNING_POP
|
||||
#define DISABLE_WARNING_UNUSED_PARAMETER
|
||||
#define DISABLE_WARNING_UNREFERENCED_FUNCTION
|
||||
#define DISABLE_WARNING_ANONYMOUS_STRUCT
|
||||
#endif
|
||||
Reference in New Issue
Block a user