cpu: Add CPU metadata om the Python classes

The configuration scripts currently hard-code the requirements of each
CPU. This is clearly not optimal as it makes writing new configuration
scripts painful and adding new CPU models requires existing scripts to
be updated. This patch adds the following class methods to the base
CPU and all relevant CPUs:

 * memory_mode -- Return a string describing the current memory mode
                  (invalid/atomic/timing).

 * require_caches -- Does the CPU model require caches?

 * support_take_over -- Does the CPU support CPU handover?
This commit is contained in:
Andreas Sandberg
2013-02-15 17:40:08 -05:00
parent db5c478e70
commit 7cd1fd4324
6 changed files with 85 additions and 28 deletions

View File

@@ -39,6 +39,14 @@ class InOrderCPU(BaseCPU):
cxx_header = "cpu/inorder/cpu.hh"
activity = Param.Unsigned(0, "Initial count")
@classmethod
def memory_mode(cls):
return 'timing'
@classmethod
def require_caches(cls):
return True
threadModel = Param.ThreadModel('SMT', "Multithreading model (SE-MODE only)")
cachePorts = Param.Unsigned(2, "Cache Ports")