Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/2861
Change subject: cpu: Add a "nickname" class method which gives each CPU a
friendly name.
......................................................................
cpu: Add a "nickname" class method which gives each CPU a friendly name.
These names then don't have to be managed in CpuConfig.py.
Change-Id: I33a82bb4fd3ad8e44d0af7819c05763e09917530
---
M src/arch/arm/cpu/O3CpuModels.py
M src/cpu/BaseCPU.py
M src/cpu/kvm/BaseKvmCPU.py
M src/cpu/minor/MinorCPU.py
M src/cpu/o3/O3CPU.py
M src/cpu/simple/AtomicSimpleCPU.py
M src/cpu/simple/TimingSimpleCPU.py
M src/cpu/trace/TraceCPU.py
8 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/src/arch/arm/cpu/O3CpuModels.py
b/src/arch/arm/cpu/O3CpuModels.py
index 8a13e6a..c1a6309 100644
--- a/src/arch/arm/cpu/O3CpuModels.py
+++ b/src/arch/arm/cpu/O3CpuModels.py
@@ -107,6 +107,10 @@
instShiftAmt = 2
class O3_ARM_v7a_3(DerivO3CPU):
+ @classmethod
+ def nickname(cls):
+ return 'arm_detailed'
+
LQEntries = 16
SQEntries = 16
LSQDepCheckShift = 0
diff --git a/src/cpu/BaseCPU.py b/src/cpu/BaseCPU.py
index 7b8a615..e7ef2be 100644
--- a/src/cpu/BaseCPU.py
+++ b/src/cpu/BaseCPU.py
@@ -97,6 +97,10 @@
cxx_header = "cpu/base.hh"
@classmethod
+ def nickname(cls):
+ return None
+
+ @classmethod
def export_methods(cls, code):
code('''
void switchOut();
diff --git a/src/cpu/kvm/BaseKvmCPU.py b/src/cpu/kvm/BaseKvmCPU.py
index cc0b28f..d19fefb 100644
--- a/src/cpu/kvm/BaseKvmCPU.py
+++ b/src/cpu/kvm/BaseKvmCPU.py
@@ -47,6 +47,10 @@
abstract = True
@classmethod
+ def nickname(cls):
+ return 'kvm'
+
+ @classmethod
def export_methods(cls, code):
code('''
void dump() const;
diff --git a/src/cpu/minor/MinorCPU.py b/src/cpu/minor/MinorCPU.py
index 5954f7b..fbfc601 100644
--- a/src/cpu/minor/MinorCPU.py
+++ b/src/cpu/minor/MinorCPU.py
@@ -177,6 +177,10 @@
cxx_header = "cpu/minor/cpu.hh"
@classmethod
+ def nickname(cls):
+ return 'minor'
+
+ @classmethod
def memory_mode(cls):
return 'timing'
diff --git a/src/cpu/o3/O3CPU.py b/src/cpu/o3/O3CPU.py
index cab2cf3..893f36f 100644
--- a/src/cpu/o3/O3CPU.py
+++ b/src/cpu/o3/O3CPU.py
@@ -39,6 +39,10 @@
cxx_header = 'cpu/o3/deriv.hh'
@classmethod
+ def nickname(cls):
+ return 'detailed'
+
+ @classmethod
def memory_mode(cls):
return 'timing'
diff --git a/src/cpu/simple/AtomicSimpleCPU.py
b/src/cpu/simple/AtomicSimpleCPU.py
index 04592c6..ef1a29d 100644
--- a/src/cpu/simple/AtomicSimpleCPU.py
+++ b/src/cpu/simple/AtomicSimpleCPU.py
@@ -51,6 +51,10 @@
cxx_header = "cpu/simple/atomic.hh"
@classmethod
+ def nickname(cls):
+ return 'atomic'
+
+ @classmethod
def memory_mode(cls):
return 'atomic'
diff --git a/src/cpu/simple/TimingSimpleCPU.py
b/src/cpu/simple/TimingSimpleCPU.py
index 25149ea..101882b 100644
--- a/src/cpu/simple/TimingSimpleCPU.py
+++ b/src/cpu/simple/TimingSimpleCPU.py
@@ -34,6 +34,10 @@
cxx_header = "cpu/simple/timing.hh"
@classmethod
+ def nickname(cls):
+ return 'timing'
+
+ @classmethod
def memory_mode(cls):
return 'timing'
diff --git a/src/cpu/trace/TraceCPU.py b/src/cpu/trace/TraceCPU.py
index e108b1a..8680948 100644
--- a/src/cpu/trace/TraceCPU.py
+++ b/src/cpu/trace/TraceCPU.py
@@ -48,6 +48,10 @@
cxx_header = "cpu/trace/trace_cpu.hh"
@classmethod
+ def nickname(cls):
+ return 'trace'
+
+ @classmethod
def memory_mode(cls):
return 'timing'
--
To view, visit https://gem5-review.googlesource.com/2861
To unsubscribe, visit https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I33a82bb4fd3ad8e44d0af7819c05763e09917530
Gerrit-Change-Number: 2861
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev