From 03e97a9375495a3c31b8d86bcb86ce6e29190e98 Mon Sep 17 00:00:00 2001 From: pbrazzle Date: Sun, 28 Jan 2024 18:09:34 -0500 Subject: [PATCH] Moved more files into Simple --- src/Event/EventQueue.h | 13 ------------- src/Memory/Event/CommandEventQueue.h | 13 ++++--------- src/Memory/MemoryFactory.cpp | 2 +- src/MemoryTypes/CMakeLists.txt | 12 +----------- src/MemoryTypes/{ => Simple}/Bank.cpp | 2 +- .../MemoryTypes => src/MemoryTypes/Simple}/Bank.h | 2 +- src/MemoryTypes/Simple/Bank/SimpleBank.h | 2 +- src/MemoryTypes/Simple/CMakeLists.txt | 6 +++++- {include => src}/MemoryTypes/Simple/FaultModel.h | 0 src/MemoryTypes/{ => Simple}/Interconnect.cpp | 2 +- .../MemoryTypes/Simple}/Interconnect.h | 2 +- .../Simple/Interconnect/SimpleInterconnect.h | 2 +- src/MemoryTypes/{ => Simple}/MemoryController.cpp | 2 +- .../MemoryTypes/Simple}/MemoryController.h | 2 +- .../Simple/MemoryController/SimpleController.h | 2 +- src/MemoryTypes/Simple/MemorySystem/SimpleSystem.h | 2 +- src/MemoryTypes/{ => Simple}/Rank.cpp | 2 +- .../MemoryTypes => src/MemoryTypes/Simple}/Rank.h | 2 +- src/MemoryTypes/Simple/Rank/SimpleRank.h | 2 +- .../MemoryTypes/Simple}/SubArray.h | 0 src/MemoryTypes/Simple/SubArray/SimpleSubArray.h | 2 +- src/{Memory => Utils}/ConfigParser.h | 0 22 files changed, 25 insertions(+), 49 deletions(-) delete mode 100644 src/Event/EventQueue.h rename src/MemoryTypes/{ => Simple}/Bank.cpp (96%) rename {include/MemoryTypes => src/MemoryTypes/Simple}/Bank.h (91%) rename {include => src}/MemoryTypes/Simple/FaultModel.h (100%) rename src/MemoryTypes/{ => Simple}/Interconnect.cpp (95%) rename {include/MemoryTypes => src/MemoryTypes/Simple}/Interconnect.h (91%) rename src/MemoryTypes/{ => Simple}/MemoryController.cpp (78%) rename {include/MemoryTypes => src/MemoryTypes/Simple}/MemoryController.h (95%) rename src/MemoryTypes/{ => Simple}/Rank.cpp (83%) rename {include/MemoryTypes => src/MemoryTypes/Simple}/Rank.h (92%) rename {include/MemoryTypes => src/MemoryTypes/Simple}/SubArray.h (100%) rename src/{Memory => Utils}/ConfigParser.h (100%) diff --git a/src/Event/EventQueue.h b/src/Event/EventQueue.h deleted file mode 100644 index 0f1945fc..00000000 --- a/src/Event/EventQueue.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include - -namespace NVM::Event { - -class EventQueue { - public: - - virtual bool issue() = 0; -}; - -} \ No newline at end of file diff --git a/src/Memory/Event/CommandEventQueue.h b/src/Memory/Event/CommandEventQueue.h index dbaea1ce..422bf914 100644 --- a/src/Memory/Event/CommandEventQueue.h +++ b/src/Memory/Event/CommandEventQueue.h @@ -1,14 +1,11 @@ #pragma once -#include "Event/EventQueue.h" - -#include #include +#include namespace NVM::Memory { -template -class CommandEventQueue : public NVM::Event::EventQueue { +template class CommandEventQueue { public: using Cmd = std::function; @@ -24,9 +21,7 @@ class CommandEventQueue : public NVM::Event::EventQueue { return false; } - void enqueue(Cmd cmd) { - commands.push(cmd); - } + void enqueue(Cmd cmd) { commands.push(cmd); } bool isEmpty() const { return commands.empty(); } @@ -35,4 +30,4 @@ class CommandEventQueue : public NVM::Event::EventQueue { std::queue commands; }; -} \ No newline at end of file +} // namespace NVM::Memory \ No newline at end of file diff --git a/src/Memory/MemoryFactory.cpp b/src/Memory/MemoryFactory.cpp index 035b20c3..2b59aa3d 100644 --- a/src/Memory/MemoryFactory.cpp +++ b/src/Memory/MemoryFactory.cpp @@ -1,6 +1,5 @@ #include "Memory/MemoryFactory.h" -#include "Memory/ConfigParser.h" #include "MemoryTypes/Simple/Bank/SimpleBank.h" #include "MemoryTypes/Simple/Interconnect/SimpleInterconnect.h" #include "MemoryTypes/Simple/MemoryController/SimpleController.h" @@ -8,6 +7,7 @@ #include "MemoryTypes/Simple/Rank/SimpleRank.h" #include "MemoryTypes/Simple/SubArray/SimpleSubArray.h" #include "MemoryTypes/Simple/Timing/Timer/ConfigurableTimer.h" +#include "Utils/ConfigParser.h" using namespace NVM::Memory; diff --git a/src/MemoryTypes/CMakeLists.txt b/src/MemoryTypes/CMakeLists.txt index f0267ae1..8502d8d6 100644 --- a/src/MemoryTypes/CMakeLists.txt +++ b/src/MemoryTypes/CMakeLists.txt @@ -1,11 +1 @@ -set(MEMORY_SOURCES - MemoryController.cpp - Interconnect.cpp - Rank.cpp - Bank.cpp ) - -add_subdirectory(Simple) - -add_library(RTSim_MemoryType ${MEMORY_SOURCES}) -target_include_directories(RTSim_MemoryType PUBLIC ${RTSIM_DIR}/include PRIVATE ${RTSIM_DIR}/src) -target_link_libraries(RTSim_MemoryType PUBLIC RTSim_MemoryType_Simple RTSim_Logging RTSim_Modeling RTSim_Scheduling RTSim_Parsing RTSim_Timing RTSim_Stats) \ No newline at end of file +add_subdirectory(Simple) \ No newline at end of file diff --git a/src/MemoryTypes/Bank.cpp b/src/MemoryTypes/Simple/Bank.cpp similarity index 96% rename from src/MemoryTypes/Bank.cpp rename to src/MemoryTypes/Simple/Bank.cpp index a6619460..90a9811d 100644 --- a/src/MemoryTypes/Bank.cpp +++ b/src/MemoryTypes/Simple/Bank.cpp @@ -1,4 +1,4 @@ -#include "MemoryTypes/Bank.h" +#include "MemoryTypes/Simple/Bank.h" using namespace NVM::Memory; diff --git a/include/MemoryTypes/Bank.h b/src/MemoryTypes/Simple/Bank.h similarity index 91% rename from include/MemoryTypes/Bank.h rename to src/MemoryTypes/Simple/Bank.h index 654d3635..51c946fc 100644 --- a/include/MemoryTypes/Bank.h +++ b/src/MemoryTypes/Simple/Bank.h @@ -1,7 +1,7 @@ #pragma once #include "Command.h" -#include "MemoryTypes/SubArray.h" +#include "MemoryTypes/Simple/SubArray.h" #include diff --git a/src/MemoryTypes/Simple/Bank/SimpleBank.h b/src/MemoryTypes/Simple/Bank/SimpleBank.h index e7158ceb..dd6ad261 100644 --- a/src/MemoryTypes/Simple/Bank/SimpleBank.h +++ b/src/MemoryTypes/Simple/Bank/SimpleBank.h @@ -1,6 +1,6 @@ #pragma once -#include "MemoryTypes/Bank.h" +#include "MemoryTypes/Simple/Bank.h" namespace NVM::Memory { diff --git a/src/MemoryTypes/Simple/CMakeLists.txt b/src/MemoryTypes/Simple/CMakeLists.txt index 3e6e7e2d..042b7052 100644 --- a/src/MemoryTypes/Simple/CMakeLists.txt +++ b/src/MemoryTypes/Simple/CMakeLists.txt @@ -4,6 +4,10 @@ add_subdirectory(Scheduling) add_subdirectory(Timing) set(MEMORY_SOURCES + MemoryController.cpp + Interconnect.cpp + Rank.cpp + Bank.cpp FaultModel.cpp Bank/SimpleBank.cpp Interconnect/SimpleInterconnect.cpp @@ -14,4 +18,4 @@ set(MEMORY_SOURCES add_library(RTSim_MemoryType_Simple ${MEMORY_SOURCES}) target_include_directories(RTSim_MemoryType_Simple PUBLIC ${RTSIM_DIR}/include PRIVATE ${RTSIM_DIR}/src) -target_link_libraries(RTSim_MemoryType_Simple PUBLIC RTSim_MemoryType RTSim_Logging RTSim_Modeling RTSim_Scheduling RTSim_Parsing RTSim_Timing RTSim_Stats) \ No newline at end of file +target_link_libraries(RTSim_MemoryType_Simple PUBLIC RTSim_Logging RTSim_Modeling RTSim_Scheduling RTSim_Parsing RTSim_Timing RTSim_Stats) \ No newline at end of file diff --git a/include/MemoryTypes/Simple/FaultModel.h b/src/MemoryTypes/Simple/FaultModel.h similarity index 100% rename from include/MemoryTypes/Simple/FaultModel.h rename to src/MemoryTypes/Simple/FaultModel.h diff --git a/src/MemoryTypes/Interconnect.cpp b/src/MemoryTypes/Simple/Interconnect.cpp similarity index 95% rename from src/MemoryTypes/Interconnect.cpp rename to src/MemoryTypes/Simple/Interconnect.cpp index 77d7e197..8cb79766 100644 --- a/src/MemoryTypes/Interconnect.cpp +++ b/src/MemoryTypes/Simple/Interconnect.cpp @@ -1,4 +1,4 @@ -#include "MemoryTypes/Interconnect.h" +#include "MemoryTypes/Simple/Interconnect.h" using namespace NVM::Memory; diff --git a/include/MemoryTypes/Interconnect.h b/src/MemoryTypes/Simple/Interconnect.h similarity index 91% rename from include/MemoryTypes/Interconnect.h rename to src/MemoryTypes/Simple/Interconnect.h index 88457cf9..07c6f857 100644 --- a/include/MemoryTypes/Interconnect.h +++ b/src/MemoryTypes/Simple/Interconnect.h @@ -1,6 +1,6 @@ #pragma once -#include "MemoryTypes/Rank.h" +#include "MemoryTypes/Simple/Rank.h" #include diff --git a/src/MemoryTypes/Simple/Interconnect/SimpleInterconnect.h b/src/MemoryTypes/Simple/Interconnect/SimpleInterconnect.h index f2ad80c9..cd77d6e3 100644 --- a/src/MemoryTypes/Simple/Interconnect/SimpleInterconnect.h +++ b/src/MemoryTypes/Simple/Interconnect/SimpleInterconnect.h @@ -1,6 +1,6 @@ #pragma once -#include "MemoryTypes/Interconnect.h" +#include "MemoryTypes/Simple/Interconnect.h" namespace NVM::Memory { diff --git a/src/MemoryTypes/MemoryController.cpp b/src/MemoryTypes/Simple/MemoryController.cpp similarity index 78% rename from src/MemoryTypes/MemoryController.cpp rename to src/MemoryTypes/Simple/MemoryController.cpp index 05fd2ba2..0e86b10d 100644 --- a/src/MemoryTypes/MemoryController.cpp +++ b/src/MemoryTypes/Simple/MemoryController.cpp @@ -1,4 +1,4 @@ -#include "MemoryTypes/MemoryController.h" +#include "MemoryTypes/Simple/MemoryController.h" using namespace NVM::Memory; diff --git a/include/MemoryTypes/MemoryController.h b/src/MemoryTypes/Simple/MemoryController.h similarity index 95% rename from include/MemoryTypes/MemoryController.h rename to src/MemoryTypes/Simple/MemoryController.h index 7bc2e6e9..710dc6bc 100644 --- a/include/MemoryTypes/MemoryController.h +++ b/src/MemoryTypes/Simple/MemoryController.h @@ -1,6 +1,6 @@ #pragma once -#include "MemoryTypes/Interconnect.h" +#include "MemoryTypes/Simple/Interconnect.h" #include diff --git a/src/MemoryTypes/Simple/MemoryController/SimpleController.h b/src/MemoryTypes/Simple/MemoryController/SimpleController.h index 2565e96b..024f1138 100644 --- a/src/MemoryTypes/Simple/MemoryController/SimpleController.h +++ b/src/MemoryTypes/Simple/MemoryController/SimpleController.h @@ -1,6 +1,6 @@ #pragma once -#include "MemoryTypes/MemoryController.h" +#include "MemoryTypes/Simple/MemoryController.h" #include "MemoryTypes/Simple/Modeling/System/SimpleSystem.h" #include "MemoryTypes/Simple/Parsing/Parser/SimpleParser.h" #include "MemoryTypes/Simple/Scheduling/Scheduler/RBScheduler.h" diff --git a/src/MemoryTypes/Simple/MemorySystem/SimpleSystem.h b/src/MemoryTypes/Simple/MemorySystem/SimpleSystem.h index df0965e9..a9467d2b 100644 --- a/src/MemoryTypes/Simple/MemorySystem/SimpleSystem.h +++ b/src/MemoryTypes/Simple/MemorySystem/SimpleSystem.h @@ -1,7 +1,7 @@ #pragma once #include "Memory/MemorySystem.h" -#include "MemoryTypes/MemoryController.h" +#include "MemoryTypes/Simple/MemoryController.h" #include #include diff --git a/src/MemoryTypes/Rank.cpp b/src/MemoryTypes/Simple/Rank.cpp similarity index 83% rename from src/MemoryTypes/Rank.cpp rename to src/MemoryTypes/Simple/Rank.cpp index e60f409d..b1f090bb 100644 --- a/src/MemoryTypes/Rank.cpp +++ b/src/MemoryTypes/Simple/Rank.cpp @@ -1,4 +1,4 @@ -#include "MemoryTypes/Rank.h" +#include "MemoryTypes/Simple/Rank.h" using namespace NVM::Memory; diff --git a/include/MemoryTypes/Rank.h b/src/MemoryTypes/Simple/Rank.h similarity index 92% rename from include/MemoryTypes/Rank.h rename to src/MemoryTypes/Simple/Rank.h index c85d3bdb..d6da2b1f 100644 --- a/include/MemoryTypes/Rank.h +++ b/src/MemoryTypes/Simple/Rank.h @@ -1,7 +1,7 @@ #pragma once #include "Command.h" -#include "MemoryTypes/Bank.h" +#include "MemoryTypes/Simple/Bank.h" #include diff --git a/src/MemoryTypes/Simple/Rank/SimpleRank.h b/src/MemoryTypes/Simple/Rank/SimpleRank.h index 62d7f4cd..cc1ccb88 100644 --- a/src/MemoryTypes/Simple/Rank/SimpleRank.h +++ b/src/MemoryTypes/Simple/Rank/SimpleRank.h @@ -1,6 +1,6 @@ #pragma once -#include "MemoryTypes/Rank.h" +#include "MemoryTypes/Simple/Rank.h" namespace NVM::Memory { diff --git a/include/MemoryTypes/SubArray.h b/src/MemoryTypes/Simple/SubArray.h similarity index 100% rename from include/MemoryTypes/SubArray.h rename to src/MemoryTypes/Simple/SubArray.h diff --git a/src/MemoryTypes/Simple/SubArray/SimpleSubArray.h b/src/MemoryTypes/Simple/SubArray/SimpleSubArray.h index 7aa356e5..6e40a21b 100644 --- a/src/MemoryTypes/Simple/SubArray/SimpleSubArray.h +++ b/src/MemoryTypes/Simple/SubArray/SimpleSubArray.h @@ -2,7 +2,7 @@ #include "Memory/Timing/CommandTimer.h" #include "MemoryTypes/Simple/FaultModel.h" -#include "MemoryTypes/SubArray.h" +#include "MemoryTypes/Simple/SubArray.h" #include diff --git a/src/Memory/ConfigParser.h b/src/Utils/ConfigParser.h similarity index 100% rename from src/Memory/ConfigParser.h rename to src/Utils/ConfigParser.h