Skip to content

Commit 8681b71

Browse files
committed
cpu: Implement decoupled front-end
This commit comprises most of the changes to add the decoupled front-end. Here just the most important bits: - Creates a new pipeline stage called BAC (Branch and Address Calculation). - The branch predictor is moved to the new stage and with it all the functionality related to it. (e.g. squashing is done in BAC) - The BAC stage contains two parts the branch predictor part and the next PC calculation. Both can be decoupled and connected with the fetch target queue. Note: this commit will not commit as the BPU must be updated. Change-Id: Ieb9b6d3cd6cfbdc2408b5e2c341af20650dd1b3c Signed-off-by: David Schall <david.schall@ed.ac.uk>
1 parent 9bed724 commit 8681b71

File tree

13 files changed

+1859
-148
lines changed

13 files changed

+1859
-148
lines changed

src/arch/arm/decoder.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (c) 2012-2014,2018, 2021 Arm Limited
3+
* Copyright (c) 2023 The University of Edinburgh
34
* All rights reserved
45
*
56
* The license below extends only to copyright in the software and shall

src/arch/x86/decoder.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
/*
2+
* Copyright (c) 2022-2023 The University of Edinburgh
3+
* All rights reserved
4+
*
5+
* The license below extends only to copyright in the software and shall
6+
* not be construed as granting a license to any other intellectual
7+
* property including but not limited to intellectual property relating
8+
* to a hardware implementation of the functionality of the software
9+
* licensed hereunder. You may use the software subject to the license
10+
* terms below provided that you ensure that this notice is replicated
11+
* unmodified and in its entirety in all distributions of the software,
12+
* modified or unmodified, in source code or in binary form.
13+
*
214
* Copyright (c) 2011 Google
315
* All rights reserved.
416
*

src/cpu/o3/BaseO3CPU.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright (c) 2016, 2019 ARM Limited
2+
# Copyright (c) 2022-2023 The University of Edinburgh
23
# All rights reserved.
34
#
45
# The license below extends only to copyright in the software and shall
@@ -83,6 +84,8 @@ def support_take_over(cls):
8384
)
8485
cacheLoadPorts = Param.Unsigned(200, "Cache Ports. Constrains loads only.")
8586

87+
# Backward pipeline delays
88+
fetchToBacDelay = Param.Cycles(1, "Fetch to Branch address calc. delay")
8689
decodeToFetchDelay = Param.Cycles(1, "Decode to fetch delay")
8790
renameToFetchDelay = Param.Cycles(1, "Rename to fetch delay")
8891
iewToFetchDelay = Param.Cycles(1, "Issue/Execute/Writeback to fetch delay")
@@ -98,6 +101,9 @@ def support_take_over(cls):
98101
1, "Issue/Execute/Writeback to decode delay"
99102
)
100103
commitToDecodeDelay = Param.Cycles(1, "Commit to decode delay")
104+
105+
# Forward pipeline delays
106+
bacToFetchDelay = Param.Cycles(1, "Branch address calc. to fetch delay")
101107
fetchToDecodeDelay = Param.Cycles(1, "Fetch to decode delay")
102108
decodeWidth = Param.Unsigned(8, "Decode width")
103109

@@ -192,3 +198,18 @@ def support_take_over(cls):
192198
TournamentBP(numThreads=Parent.numThreads), "Branch Predictor"
193199
)
194200
needsTSO = Param.Bool(False, "Enable TSO Memory model")
201+
202+
numFTQEntries = Param.Unsigned(
203+
8, "Number of entries in the Fetch target queue."
204+
)
205+
fetchTargetWidth = Param.Unsigned(
206+
32,
207+
"Max width (bytes) of Fetch target. "
208+
"Determines the maximum search width per cycle",
209+
)
210+
minInstSize = Param.Unsigned(
211+
1,
212+
"Minimum instruction size (bytes). Determines the granularity "
213+
"of the instruction minimum search width per cycle",
214+
)
215+
decoupledFrontEnd = Param.Bool(False, "Enables the decoupled front-end")

src/cpu/o3/SConscript

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# -*- mode:python -*-
2-
2+
#
3+
# Copyright (c) 2023 The University of Edinburgh
4+
# All rights reserved.
5+
#
6+
# The license below extends only to copyright in the software and shall
7+
# not be construed as granting a license to any other intellectual
8+
# property including but not limited to intellectual property relating
9+
# to a hardware implementation of the functionality of the software
10+
# licensed hereunder. You may use the software subject to the license
11+
# terms below provided that you ensure that this notice is replicated
12+
# unmodified and in its entirety in all distributions of the software,
13+
# modified or unmodified, in source code or in binary form.
14+
#
315
# Copyright (c) 2006 The Regents of The University of Michigan
416
# All rights reserved.
517
#
@@ -36,6 +48,7 @@ if not env['CONF']['USE_NULL_ISA']:
3648
SimObject('BaseO3CPU.py', sim_objects=['BaseO3CPU'], enums=[
3749
'SMTFetchPolicy', 'SMTQueuePolicy', 'CommitPolicy'])
3850

51+
Source('bac.cc')
3952
Source('commit.cc')
4053
Source('cpu.cc')
4154
Source('decode.cc')
@@ -58,6 +71,7 @@ if not env['CONF']['USE_NULL_ISA']:
5871
Source('thread_context.cc')
5972
Source('thread_state.cc')
6073

74+
DebugFlag('BAC')
6175
DebugFlag('CommitRate')
6276
DebugFlag('FTQ')
6377
DebugFlag('IEW')
@@ -72,7 +86,8 @@ if not env['CONF']['USE_NULL_ISA']:
7286
DebugFlag('StoreSet')
7387
DebugFlag('Writeback')
7488

75-
CompoundFlag('O3CPUAll', [ 'Fetch', 'Decode', 'Rename', 'IEW', 'Commit',
89+
CompoundFlag('O3CPUAll', [ 'BAC', 'FTQ', 'Fetch', 'Decode', 'Rename',
90+
'IEW', 'Commit',
7691
'IQ', 'ROB', 'FreeList', 'LSQ', 'LSQUnit', 'StoreSet', 'MemDepUnit',
7792
'DynInst', 'O3CPU', 'Activity', 'Scoreboard', 'Writeback' ])
7893

0 commit comments

Comments
 (0)