-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cpu-o3: IQ with regfile read port arbitration and
move scheduler to one config python file
- Loading branch information
Showing
11 changed files
with
453 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
|
||
|
||
from m5.SimObject import SimObject | ||
from m5.params import * | ||
from m5.objects.FuncUnit import * | ||
from m5.objects.FuncUnitConfig import * | ||
from m5.objects.FUPool import * | ||
|
||
# must be consistent with issue_queue.cc | ||
maxTotalRFPorts = (1 << 6) - 1 | ||
# portid, priority | ||
def IntRD(id, p): | ||
# [7:6] [5:2] [1:0] | ||
assert id < 16 | ||
assert p < 4 | ||
ret = (0 << 6) | (id << 2) | (p) | ||
return ret | ||
|
||
def FpRD(id, p): | ||
# [7:6] [5:2] [1:0] | ||
assert id < 16 | ||
assert p < 4 | ||
ret = (1 << 6) | (id << 2) | (p) | ||
return ret | ||
|
||
class ECoreScheduler(Scheduler): | ||
IQs = [ | ||
IssueQue(name='intIQ0' , inports=2, size=2*12, oports=[ | ||
IssuePort(fu=[IntALU(), IntBRU()]), | ||
IssuePort(fu=[IntALU(), IntBRU()]) | ||
]), | ||
IssueQue(name='intIQ1' , inports=2, size=2*12, oports=[ | ||
IssuePort(fu=[IntALU(), IntBRU()]), | ||
IssuePort(fu=[IntALU(), IntBRU()]) | ||
]), | ||
IssueQue(name='intIQ2' , inports=2, size=2*12, oports=[ | ||
IssuePort(fu=[IntMult(), IntDiv(), IntMisc()]) | ||
]), | ||
IssueQue(name='memIQ0' , inports=2, size=2*16, oports=[ | ||
IssuePort(fu=[ReadPort()]) | ||
]), | ||
IssueQue(name='memIQ1' , inports=2, size=2*16, oports=[ | ||
IssuePort(fu=[RdWrPort()]) | ||
]), | ||
IssueQue(name='fpIQ0' , inports=2, size=18, oports=[ | ||
IssuePort(fu=[FP_ALU(), FP_MAC()]), | ||
IssuePort(fu=[FP_ALU(), FP_MAC()]) | ||
], scheduleToExecDelay=3), | ||
IssueQue(name='fpIQ1' , inports=2, size=18, oports=[ | ||
IssuePort(fu=[FP_MISC(), FP_SLOW()]) | ||
], scheduleToExecDelay=3), | ||
IssueQue(name='vecIQ0' , inports=2, size=16, oports=[ | ||
IssuePort(fu=[SIMD_Unit()]), | ||
IssuePort(fu=[SIMD_Unit()]) | ||
], scheduleToExecDelay=3), | ||
] | ||
xbarWakeup = True | ||
|
||
class ECore2ReadScheduler(Scheduler): | ||
IQs = [ | ||
IssueQue(name='intIQ0' , inports=2, size=2*12, oports=[ | ||
IssuePort(fu=[IntALU(), IntBRU()]), | ||
IssuePort(fu=[IntALU(), IntBRU()]) | ||
]), | ||
IssueQue(name='intIQ1' , inports=2, size=2*12, oports=[ | ||
IssuePort(fu=[IntALU(), IntBRU()]), | ||
IssuePort(fu=[IntALU(), IntBRU()]) | ||
]), | ||
IssueQue(name='intIQ2' , inports=2, size=2*12, oports=[ | ||
IssuePort(fu=[IntMult(), IntDiv(), IntMisc()]) | ||
]), | ||
IssueQue(name='memIQ0' , inports=2, size=2*16, oports=[ | ||
IssuePort(fu=[ReadPort()]), | ||
IssuePort(fu=[ReadPort()]) | ||
]), | ||
IssueQue(name='memIQ1' , inports=2, size=2*16, oports=[ | ||
IssuePort(fu=[WritePort()]) | ||
]), | ||
IssueQue(name='fpIQ0' , inports=2, size=18, oports=[ | ||
IssuePort(fu=[FP_ALU(), FP_MAC()]), | ||
IssuePort(fu=[FP_ALU(), FP_MAC()]) | ||
], scheduleToExecDelay=3), | ||
IssueQue(name='fpIQ1' , inports=2, size=18, oports=[ | ||
IssuePort(fu=[FP_MISC()]) | ||
], scheduleToExecDelay=3), | ||
IssueQue(name='fpIQ4' , inports=2, size=18, oports=[ | ||
IssuePort(fu=[FP_SLOW()]) | ||
], scheduleToExecDelay=3), | ||
IssueQue(name='vecIQ0' , inports=2, size=16, oports=[ | ||
IssuePort(fu=[SIMD_Unit()]), | ||
IssuePort(fu=[SIMD_Unit()]) | ||
], scheduleToExecDelay=3), | ||
] | ||
xbarWakeup = True | ||
|
||
|
||
class KunminghuScheduler(Scheduler): | ||
IQs = [ | ||
IssueQue(name='intIQ0', inports=2, size=2*12, oports=[ | ||
IssuePort(fu=[IntALU(), IntMult()], rp=[IntRD(0, 0), IntRD(1, 0)]), | ||
IssuePort(fu=[IntBRU()], rp=[IntRD(6, 1), IntRD(7, 1)]) | ||
]), | ||
IssueQue(name='intIQ1', inports=2, size=2*12, oports=[ | ||
IssuePort(fu=[IntALU(), IntMult()], rp=[IntRD(2, 0), IntRD(3, 0)]), | ||
IssuePort(fu=[IntBRU()], rp=[IntRD(4, 1), IntRD(5, 1)]) | ||
]), | ||
IssueQue(name='intIQ2', inports=2, size=2*12, oports=[ | ||
IssuePort(fu=[IntALU()], rp=[IntRD(4, 0), IntRD(5, 0)]), | ||
IssuePort(fu=[IntBRU(), IntMisc()], rp=[IntRD(2, 1), IntRD(3, 1)]) | ||
]), | ||
IssueQue(name='intIQ3', inports=2, size=2*12, oports=[ | ||
IssuePort(fu=[IntALU()], rp=[IntRD(6, 0), IntRD(7, 0)]), | ||
IssuePort(fu=[IntDiv()], rp=[IntRD(0, 1), IntRD(1, 1)]) | ||
]), | ||
IssueQue(name='load0', inports=1, size=16, oports=[ | ||
IssuePort(fu=[ReadPort()], rp=[IntRD(8, 0)]) | ||
]), | ||
IssueQue(name='load1', inports=1, size=16, oports=[ | ||
IssuePort(fu=[ReadPort()], rp=[IntRD(9, 0)]) | ||
]), | ||
IssueQue(name='load2', inports=1, size=16, oports=[ | ||
IssuePort(fu=[ReadPort()], rp=[IntRD(10, 0)]) | ||
]), | ||
IssueQue(name='store0', inports=1, size=16, oports=[ | ||
IssuePort(fu=[WritePort()], rp=[IntRD(7, 2), IntRD(5,2), FpRD(12,0)]) | ||
]), | ||
IssueQue(name='store1', inports=1, size=16, oports=[ | ||
IssuePort(fu=[WritePort()], rp=[IntRD(6, 2), IntRD(3,2), FpRD(13,0)]) | ||
]), | ||
IssueQue(name='fpIQ0', inports=2, size=18, oports=[ | ||
IssuePort(fu=[FP_ALU(), FP_MISC(), FP_MAC()], rp=[FpRD(0,0), FpRD(1, 0), FpRD(2,0)]) | ||
], scheduleToExecDelay=3), | ||
IssueQue(name='fpIQ1', inports=2, size=18, oports=[ | ||
IssuePort(fu=[FP_ALU(), FP_MAC()], rp=[FpRD(3,0), FpRD(4,0), FpRD(5,0)]) | ||
], scheduleToExecDelay=3), | ||
IssueQue(name='fpIQ2', inports=2, size=18, oports=[ | ||
IssuePort(fu=[FP_ALU(), FP_MAC()], rp=[FpRD(6,0), FpRD(7,0), FpRD(8,0)]) | ||
], scheduleToExecDelay=3), | ||
IssueQue(name='fpIQ3', inports=2, size=18, oports=[ | ||
IssuePort(fu=[FP_ALU(), FP_MAC()], rp=[FpRD(9,0), FpRD(10,0), FpRD(11,0)]) | ||
], scheduleToExecDelay=3), | ||
IssueQue(name='fpIQ4', inports=2, size=18, oports=[ | ||
IssuePort(fu=[FP_SLOW()], rp=[FpRD(2,1), FpRD(5,1)]), | ||
IssuePort(fu=[FP_SLOW()], rp=[FpRD(8,1), FpRD(11,1)]), | ||
], scheduleToExecDelay=3), | ||
IssueQue(name='vecIQ0', inports=5, size=16+16+10, oports=[ | ||
IssuePort(fu=[SIMD_Unit()]), | ||
IssuePort(fu=[SIMD_Unit()]), | ||
IssuePort(fu=[SIMD_Unit()]), | ||
IssuePort(fu=[SIMD_Unit()]), | ||
IssuePort(fu=[SIMD_Unit()]) | ||
], scheduleToExecDelay=3), | ||
] | ||
__int_bank = ['intIQ0', 'intIQ1', 'intIQ2', 'intIQ3', 'load0', 'load1', 'load2', 'store0', 'store1'] | ||
__fp_bank = ['fpIQ0', 'fpIQ1', 'fpIQ2', 'fpIQ3', 'fpIQ4', 'store0', 'store1'] | ||
specWakeupNetwork = [ | ||
SpecWakeupChannel(srcIQ='intIQ0', dstIQ=__int_bank), | ||
SpecWakeupChannel(srcIQ='intIQ1', dstIQ=__int_bank), | ||
SpecWakeupChannel(srcIQ='intIQ2', dstIQ=__int_bank), | ||
SpecWakeupChannel(srcIQ='intIQ3', dstIQ=__int_bank), | ||
SpecWakeupChannel(srcIQ='fpIQ0', dstIQ=__fp_bank), | ||
SpecWakeupChannel(srcIQ='fpIQ1', dstIQ=__fp_bank), | ||
SpecWakeupChannel(srcIQ='fpIQ2', dstIQ=__fp_bank), | ||
SpecWakeupChannel(srcIQ='fpIQ3', dstIQ=__fp_bank), | ||
# SpecWakeupChannel(srcIQ='fpIQ4', dstIQ=__fp_bank), | ||
SpecWakeupChannel(srcIQ='load0', dstIQ=__int_bank), | ||
SpecWakeupChannel(srcIQ='load1', dstIQ=__int_bank), | ||
SpecWakeupChannel(srcIQ='load2', dstIQ=__int_bank), | ||
] | ||
|
||
|
||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
# self.disableAllRegArb() | ||
|
||
def disableAllRegArb(self): | ||
print("Disable regfile arbitration") | ||
for iq in self.IQs: | ||
for port in iq.oports: | ||
port.rp.clear() | ||
|
||
DefaultScheduler = KunminghuScheduler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.