Skip to content

Commit 0a1d7b4

Browse files
Reorganized Core Directory (#239)
Added several subdirectories to the `core` directory to created new libraries for each "unit" to make the repo easier to navigate.
1 parent e370d4f commit 0a1d7b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+127
-122
lines changed

CMakeLists.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,8 @@ include_directories (SYSTEM fsl)
6666
include_directories (SYSTEM mavis)
6767
include_directories (SYSTEM stf_lib)
6868

69-
# Mavis, the Core, MSS, the simulator and Fusion
70-
69+
# Mavis
7170
add_subdirectory (mavis)
72-
add_subdirectory (core)
73-
add_subdirectory (mss)
7471

7572
# Tell FSL to use the top mavis submodule, instead of fsl's submodule
7673
set(FSL_MAVIS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/mavis")
@@ -79,6 +76,10 @@ add_subdirectory (fsl)
7976
# Add STF library to the build
8077
add_subdirectory (${STF_LIB_BASE})
8178

79+
# The Core and MSS
80+
add_subdirectory (core)
81+
add_subdirectory (mss)
82+
8283
# Add testing, but do not build as part of the 'all' target
8384
add_subdirectory (test EXCLUDE_FROM_ALL)
8485

@@ -87,7 +88,7 @@ add_executable(olympia
8788
sim/OlympiaSim.cpp
8889
sim/main.cpp
8990
)
90-
target_link_libraries (olympia core mss SPARTA::sparta mavis ${STF_LINK_LIBS})
91+
target_link_libraries (olympia core mss SPARTA::sparta ${STF_LINK_LIBS})
9192
if (CMAKE_BUILD_TYPE MATCHES "^[Rr]elease")
9293
target_compile_options (core PUBLIC -flto)
9394
target_compile_options (mss PUBLIC -flto)

core/CMakeLists.txt

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
project (core)
22
add_library(core
3-
FusionDecode.cpp
43
Core.cpp
5-
SimpleBranchPred.cpp
6-
ICache.cpp
7-
Fetch.cpp
8-
Decode.cpp
9-
VectorUopGenerator.cpp
10-
Rename.cpp
11-
Dispatch.cpp
12-
Dispatcher.cpp
13-
Execute.cpp
14-
ExecutePipe.cpp
15-
Inst.cpp
16-
InstArchInfo.cpp
17-
InstGroup.cpp
18-
InstGenerator.cpp
19-
IssueQueue.cpp
204
ROB.cpp
21-
LSU.cpp
225
MMU.cpp
23-
DCache.cpp
24-
MavisUnit.cpp
256
Preloader.cpp
267
CPU.cpp
278
CPUFactory.cpp
289
CPUTopology.cpp
2910
)
11+
12+
add_library(instgen
13+
Inst.cpp
14+
InstArchInfo.cpp
15+
InstGroup.cpp
16+
InstGenerator.cpp
17+
)
18+
19+
target_link_libraries(instgen stf zstd mavis)
20+
3021
get_property(SPARTA_INCLUDE_PROP TARGET SPARTA::sparta PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
3122
target_include_directories(core SYSTEM PRIVATE ${SPARTA_INCLUDE_PROP})
23+
24+
add_subdirectory(fetch)
25+
add_subdirectory(decode)
26+
add_subdirectory(rename)
27+
add_subdirectory(dispatch)
28+
add_subdirectory(execute)
29+
add_subdirectory(vector)
30+
add_subdirectory(lsu)
31+
32+
target_link_libraries(core fetch decode rename dispatch execute vector lsu instgen)

core/CPUFactories.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
#include "sparta/simulation/ResourceFactory.hpp"
77
#include "Core.hpp"
8-
#include "ICache.hpp"
9-
#include "Fetch.hpp"
10-
#include "Decode.hpp"
11-
#include "VectorUopGenerator.hpp"
12-
#include "Rename.hpp"
13-
#include "Dispatch.hpp"
14-
#include "Execute.hpp"
15-
#include "LSU.hpp"
8+
#include "fetch/ICache.hpp"
9+
#include "fetch/Fetch.hpp"
10+
#include "decode/Decode.hpp"
11+
#include "vector/VectorUopGenerator.hpp"
12+
#include "rename/Rename.hpp"
13+
#include "dispatch/Dispatch.hpp"
14+
#include "execute/Execute.hpp"
15+
#include "lsu/LSU.hpp"
1616
#include "MMU.hpp"
1717
#include "SimpleTLB.hpp"
1818
#include "BIU.hpp"
@@ -21,8 +21,8 @@
2121
#include "ROB.hpp"
2222
#include "FlushManager.hpp"
2323
#include "Preloader.hpp"
24-
#include "MavisUnit.hpp"
25-
#include "IssueQueue.hpp"
24+
#include "decode/MavisUnit.hpp"
25+
#include "execute/IssueQueue.hpp"
2626

2727
namespace olympia{
2828

core/Inst.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
#include "InstArchInfo.hpp"
1717
#include "CoreTypes.hpp"
18-
#include "VectorConfig.hpp"
18+
#include "vector/VectorConfig.hpp"
1919
#include "MiscUtils.hpp"
2020

2121
#include <cstdint>

core/InstGenerator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <memory>
1212

1313
#include "Inst.hpp"
14-
#include "MavisUnit.hpp"
14+
#include "decode/MavisUnit.hpp"
1515
#include "sparta/utils/SpartaAssert.hpp"
1616

1717
#include "stf-inc/stf_inst_reader.hpp"

core/MMU.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,4 @@ namespace olympia {
7979
"Number of TLB misses", sparta::Counter::COUNT_NORMAL
8080
};
8181
};
82-
}
82+
}

core/decode/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
add_library(decode
2+
FusionDecode.cpp
3+
Decode.cpp
4+
MavisUnit.cpp
5+
)
6+
target_link_libraries(decode instgen)

core/Decode.cpp renamed to core/decode/Decode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// <Decode.cpp> -*- C++ -*-
22

3-
#include "Decode.hpp"
4-
#include "VectorUopGenerator.hpp"
3+
#include "decode/Decode.hpp"
4+
#include "vector/VectorUopGenerator.hpp"
55
#include "fsl_api/FusionTypes.h"
66

77
#include "sparta/events/StartupEvent.hpp"

core/Decode.hpp renamed to core/decode/Decode.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "CoreTypes.hpp"
66
#include "FlushManager.hpp"
77
#include "InstGroup.hpp"
8-
#include "MavisUnit.hpp"
8+
#include "decode/MavisUnit.hpp"
99

1010
#include "fsl_api/FieldExtractor.h"
1111
#include "fsl_api/Fusion.h"
File renamed without changes.

0 commit comments

Comments
 (0)