Skip to content

Commit 186fb51

Browse files
committed
del: replace our gem5 with origin
1 parent 9a8bf1a commit 186fb51

7 files changed

Lines changed: 71 additions & 94 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ build/
44
m5out/
55

66
*.json
7+
*.o

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
url = https://github.com/riscv-software-src/riscv-isa-sim
44
[submodule "host/gem5/gem5"]
55
path = host/gem5/gem5
6-
url = https://github.com/DangoSys/gem5.git
6+
url = https://github.com/gem5/gem5.git

host/gem5/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
test/
2+
*.o

host/gem5/BebopInOCPU/BaseBebopInOCPU.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class BebopInODefaultFloatSimdFU(BebopInOFU):
5252
"FloatMultAcc",
5353
"FloatDiv",
5454
"FloatSqrt",
55-
"Bf16Cvt",
5655
"SimdAdd",
5756
"SimdAddAcc",
5857
"SimdAlu",
@@ -89,24 +88,13 @@ class BebopInODefaultFloatSimdFU(BebopInOFU):
8988
"SimdSha256Hash2",
9089
"SimdShaSigma2",
9190
"SimdShaSigma3",
92-
"SimdSha3",
93-
"SimdSm4e",
94-
"SimdCrc",
91+
"SimdPredAlu",
9592
"Matrix",
9693
"MatrixMov",
9794
"MatrixOP",
9895
"SimdExt",
9996
"SimdFloatExt",
100-
"SimdFloatCvt",
10197
"SimdConfig",
102-
"SimdDotProd",
103-
"SimdBf16Add",
104-
"SimdBf16Cmp",
105-
"SimdBf16Cvt",
106-
"SimdBf16DotProd",
107-
"SimdBf16MatMultAcc",
108-
"SimdBf16Mult",
109-
"SimdBf16MultAcc",
11098
]
11199
)
112100

@@ -151,7 +139,7 @@ class BebopInODefaultMemFU(BebopInOFU):
151139

152140

153141
class BebopInODefaultMiscFU(BebopInOFU):
154-
opClasses = bebopMakeOpClassSet(["InstPrefetch", "System"])
142+
opClasses = bebopMakeOpClassSet(["InstPrefetch"])
155143
opLat = 1
156144

157145

host/gem5/BebopInOCPU/execute.cc

Lines changed: 61 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -869,86 +869,77 @@ Execute::tryPCEvents(ThreadID thread_id)
869869
void
870870
Execute::doInstCommitAccounting(BebopInODynInstPtr inst)
871871
{
872-
assert(!inst->isFault());
873-
bool is_nop = inst->staticInst->isNop();
874-
const ThreadID tid = inst->id.threadId;
875-
MinorThread *thread = cpu.threads[tid];
876-
const bool in_user_mode = thread->getIsaPtr()->inUserMode();
877-
878-
/* Increment the many and various inst and op counts in the
879-
* thread and system */
880-
if (!inst->staticInst->isMicroop() || inst->staticInst->isLastMicroop())
881-
{
882-
thread->numInst++;
883-
thread->threadStats.numInsts++;
884-
cpu.commitStats[tid]->numInsts++;
885-
cpu.executeStats[tid]->numInsts++;
886-
cpu.baseStats.numInsts++;
887-
if (in_user_mode) {
888-
cpu.commitStats[tid]->numUserInsts++;
889-
}
890-
891-
if (!is_nop) {
892-
cpu.commitStats[inst->id.threadId]->numInstsNotNOP++;
893-
}
894-
895-
/* Act on events related to instruction counts */
896-
thread->comInstEventQueue.serviceEvents(thread->numInst);
897-
}
872+
assert(!inst->isFault());
873+
874+
bool is_nop = inst->staticInst->isNop();
875+
const ThreadID tid = inst->id.threadId;
876+
MinorThread *thread = cpu.threads[tid];
877+
878+
/* Increment the many and various inst and op counts in the
879+
* thread and system */
880+
if (!inst->staticInst->isMicroop() || inst->staticInst->isLastMicroop())
881+
{
882+
thread->numInst++;
883+
thread->threadStats.numInsts++;
884+
cpu.commitStats[tid]->numInsts++;
885+
cpu.executeStats[tid]->numInsts++;
886+
cpu.baseStats.numInsts++;
898887

899-
thread->numOp++;
900-
thread->threadStats.numOps++;
901888
if (!is_nop) {
902-
cpu.commitStats[tid]->numOpsNotNOP++;
889+
cpu.commitStats[tid]->numInstsNotNOP++;
903890
}
904891

905-
if (inst->staticInst->isMemRef()) {
906-
cpu.executeStats[tid]->numMemRefs++;
907-
cpu.commitStats[tid]->numMemRefs++;
908-
thread->threadStats.numMemRefs++;
909-
}
910-
if (inst->staticInst->isLoad()) {
911-
cpu.executeStats[tid]->numLoadInsts++;
912-
cpu.commitStats[tid]->numLoadInsts++;
913-
}
892+
/* Act on events related to instruction counts */
893+
thread->comInstEventQueue.serviceEvents(thread->numInst);
894+
}
914895

915-
if (inst->staticInst->isStore() || inst->staticInst->isAtomic()) {
916-
cpu.commitStats[tid]->numStoreInsts++;
917-
}
918-
if (inst->staticInst->isInteger()) {
919-
cpu.commitStats[tid]->numIntInsts++;
920-
}
896+
thread->numOp++;
897+
thread->threadStats.numOps++;
898+
cpu.commitStats[tid]->numOps++;
921899

922-
if (inst->staticInst->isFloating()) {
923-
cpu.commitStats[tid]->numFpInsts++;
924-
}
900+
if (!is_nop) {
901+
cpu.commitStats[tid]->numOpsNotNOP++;
902+
}
925903

926-
if (inst->staticInst->isVector()) {
927-
cpu.commitStats[tid]->numVecInsts++;
928-
}
929-
if (inst->staticInst->isControl()) {
930-
cpu.executeStats[tid]->numBranches++;
931-
}
932-
if (inst->staticInst->isCall() || inst->staticInst->isReturn()) {
933-
cpu.commitStats[tid]->numCallsReturns++;
934-
}
935-
if (inst->staticInst->isCall()) {
936-
cpu.commitStats[tid]->functionCalls++;
937-
}
904+
if (inst->staticInst->isMemRef()) {
905+
cpu.executeStats[tid]->numMemRefs++;
906+
cpu.commitStats[tid]->numMemRefs++;
907+
thread->threadStats.numMemRefs++;
908+
}
938909

939-
cpu.commitStats[tid]->numOps++;
940-
cpu.commitStats[tid]
941-
->committedInstType[inst->staticInst->opClass()]++;
942-
cpu.commitStats[tid]->updateComCtrlStats(inst->staticInst);
943-
if (in_user_mode) {
944-
cpu.commitStats[tid]->numUserOps++;
945-
}
910+
if (inst->staticInst->isLoad()) {
911+
cpu.executeStats[tid]->numLoadInsts++;
912+
cpu.commitStats[tid]->numLoadInsts++;
913+
}
914+
915+
if (inst->staticInst->isStore() || inst->staticInst->isAtomic()) {
916+
cpu.commitStats[tid]->numStoreInsts++;
917+
}
918+
919+
if (inst->staticInst->isInteger()) {
920+
cpu.commitStats[tid]->numIntInsts++;
921+
}
922+
923+
if (inst->staticInst->isFloating()) {
924+
cpu.commitStats[tid]->numFpInsts++;
925+
}
926+
927+
if (inst->staticInst->isVector()) {
928+
cpu.commitStats[tid]->numVecInsts++;
929+
}
930+
931+
if (inst->staticInst->isControl()) {
932+
cpu.executeStats[tid]->numBranches++;
933+
}
934+
935+
cpu.commitStats[tid]->committedInstType[inst->staticInst->opClass()]++;
936+
cpu.commitStats[tid]->updateComCtrlStats(inst->staticInst);
946937

947-
/* Set the CP SeqNum to the numOps commit number */
948-
if (inst->traceData)
949-
inst->traceData->setCPSeq(thread->numOp);
938+
/* Set the CP SeqNum to the numOps commit number */
939+
if (inst->traceData)
940+
inst->traceData->setCPSeq(thread->numOp);
950941

951-
cpu.probeInstCommit(inst->staticInst, inst->pc->instAddr());
942+
cpu.probeInstCommit(inst->staticInst, inst->pc->instAddr());
952943
}
953944

954945
bool

host/gem5/install-gem5.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,8 @@ pip install scons
2222
# export PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
2323
# scons build/RISCV/gem5.opt -j $(nproc) LIBS="absl_log_internal_check_op \
2424

25-
cd ${GEM5_ROOT}
26-
# We dont need this step now
27-
# Apply the patch to gem5
28-
git apply ${SCRIPT_DIR}/bebop.patch
29-
# We need to update the patch in this way if we make changes to gem5
30-
# git add -A && git diff --cached > ../bebop.patch
31-
3225
# Build gem5
26+
cd ${GEM5_ROOT}
3327
export PKG_CONFIG_PATH=${CONDA_PREFIX:-}/lib/pkgconfig:${PKG_CONFIG_PATH:-}
3428
BEBOP_IPC_LIB=${IPC_BUILD_LIB}/libbebop_ipc.a \
3529
BEBOP_IPC_INCLUDE=${IPC_INCLUDE} \
@@ -52,4 +46,5 @@ BEBOP_IPC_LIB=${IPC_BUILD_LIB}/libbebop_ipc.a \
5246
# because simpoint source code has some bugs, so we patch it here
5347
SIMPOINT_DIR="${GEM5_ROOT}/../simpoint"
5448
cd ${SIMPOINT_DIR}
49+
make clean
5550
make

host/gem5/simpoint/analysiscode/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CPPFLAGS = -Wall -pedantic -pedantic-errors -O3
1+
CPPFLAGS = -Wall -pedantic -pedantic-errors -O3 -fPIE
22

33
CXX = g++
44

@@ -21,7 +21,7 @@ DEPENDENCIES = $(SOURCES:.cpp=.d)
2121
# SimpointOptions takes forever to compile with optimizations on, so we simply
2222
# do it without optimizations (shouldn't affect the run-time of the program)
2323
SimpointOptions.o:
24-
$(CXX) -Wall -pedantic -pedantic-errors -o SimpointOptions.o -c SimpointOptions.cpp
24+
$(CXX) $(CPPFLAGS) -o SimpointOptions.o -c SimpointOptions.cpp
2525

2626
# If the target is not "clean", then include the dependencies (which also makes
2727
# them as necessary)

0 commit comments

Comments
 (0)