From 153130e5586e18025f7a0f05242ead3a7e2be881 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 23 Mar 2005 13:25:48 -0500 Subject: First step in fixing up parameter handling. Clean up the way ranges work, more fully support metric prefixes for all integer types, and convert memory sized parameters to the MemorySize type. python/m5/config.py: - no more _Param and _ParamProxy stuff. Use the names ParamBase and ParamFactory to hopefully make it clearer what we intend. - Get rid of RangeSize and the old Range class and more fully flesh out the Range class to deal with types of parameters and different kinds of ranges. - Call toInteger on the CheckedInt types so we can use metric prefixes in strings for all integers. - Get rid of the K, M, and G constants. Use the proper type or call one of the functions in the convert package. python/m5/convert.py: Simple way to deal with both floating point and integer strings. python/m5/objects/BaseCache.mpy: python/m5/objects/Ethernet.mpy: This is a MemorySize typed parameter --HG-- extra : convert_revision : 92b4ea662d723abdd6c0a49065b79c25400fac9b --- python/m5/objects/BaseCache.mpy | 2 +- python/m5/objects/Ethernet.mpy | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'python/m5/objects') diff --git a/python/m5/objects/BaseCache.mpy b/python/m5/objects/BaseCache.mpy index 98a422e30..b9986917f 100644 --- a/python/m5/objects/BaseCache.mpy +++ b/python/m5/objects/BaseCache.mpy @@ -23,7 +23,7 @@ simobj BaseCache(BaseMem): "always service demand misses first") protocol = Param.CoherenceProtocol(NULL, "coherence protocol to use") repl = Param.Repl(NULL, "replacement policy") - size = Param.Int("capacity in bytes") + size = Param.MemorySize("capacity in bytes") split = Param.Bool(False, "whether or not this cache is split") split_size = Param.Int(0, "How many ways of the cache belong to CPU/LRU partition") diff --git a/python/m5/objects/Ethernet.mpy b/python/m5/objects/Ethernet.mpy index cd251f36d..3acd8d04d 100644 --- a/python/m5/objects/Ethernet.mpy +++ b/python/m5/objects/Ethernet.mpy @@ -68,8 +68,8 @@ simobj NSGigE(PciDevice): rx_delay = Param.Tick(1000, "Receive Delay") tx_delay = Param.Tick(1000, "Transmit Delay") - rx_fifo_size = Param.Int(131072, "max size in bytes of rxFifo") - tx_fifo_size = Param.Int(131072, "max size in bytes of txFifo") + rx_fifo_size = Param.MemorySize('128kB', "max size in bytes of rxFifo") + tx_fifo_size = Param.MemorySize('128kB', "max size in bytes of txFifo") intr_delay = Param.Tick(0, "Interrupt Delay in microseconds") payload_bus = Param.Bus(NULL, "The IO Bus to attach to for payload") -- cgit v1.2.3 From eeff53841a6cb6c3819b69543fae861fa84cc541 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Thu, 24 Mar 2005 12:24:17 -0500 Subject: Add Frequency and Latency as new parameter types and use them where we can python/m5/config.py: Add two new parameter types: Frequency and Latency. These will soon be an integral part of the tick is picosecond thing. If the value can be converted directly to an integer without any special tricks, we assume that the number is the exact value desired. Otherwise, we convert the number assuming that it is in Hz or s. python/m5/objects/Bus.mpy: Use the new Latency and Frequency types where we can --HG-- extra : convert_revision : b3cff6020db83fb819507c348451c98697d1cf27 --- python/m5/objects/Bus.mpy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/m5/objects') diff --git a/python/m5/objects/Bus.mpy b/python/m5/objects/Bus.mpy index 025d69785..330a2c82b 100644 --- a/python/m5/objects/Bus.mpy +++ b/python/m5/objects/Bus.mpy @@ -2,5 +2,5 @@ from BaseHier import BaseHier simobj Bus(BaseHier): type = 'Bus' - clock_ratio = Param.Int("ratio of CPU to bus frequency") + clock_ratio = Param.Frequency("ratio of CPU to bus frequency") width = Param.Int("bus width in bytes") -- cgit v1.2.3 From 40bab977bc09d6126177ee34c51076ee1fff37f7 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Fri, 25 Mar 2005 22:59:29 -0500 Subject: Better handling of latency/frequency parameter types python/m5/config.py: Addr is slightly different from memory size in that Addr will take non strings. Deal with the fact that the convert.toFoo functions only accept strings. Add RootFrequency as a special type for the Root.frequency parameter which is not scaled. Add ClockPeriod parameter type. python/m5/convert.py: Be more strict about what's allowed. Only accept strings as inputs for these conversion functions. If the user wants to accept something else, they need to deal with the failure and convert other types on their own. python/m5/objects/Bus.mpy: Use the new ClockPeriod parameter type python/m5/objects/Root.mpy: Can't use integers for frequency anymore python/m5/smartdict.py: rename SmartDict.Proxy to just Variable. Create a new class UndefinedVariable that is returned when the user tries to get a variable that is not in the dict. Undefined variable evaluates to false, and will cause an error elsewhere. --HG-- extra : convert_revision : 1d55246fd1af65106f102396234827d6401ef9ce --- python/m5/objects/Bus.mpy | 2 +- python/m5/objects/Root.mpy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'python/m5/objects') diff --git a/python/m5/objects/Bus.mpy b/python/m5/objects/Bus.mpy index 330a2c82b..aa12f757a 100644 --- a/python/m5/objects/Bus.mpy +++ b/python/m5/objects/Bus.mpy @@ -2,5 +2,5 @@ from BaseHier import BaseHier simobj Bus(BaseHier): type = 'Bus' - clock_ratio = Param.Frequency("ratio of CPU to bus frequency") + clock_ratio = Param.ClockPeriod("ratio of CPU to bus frequency") width = Param.Int("bus width in bytes") diff --git a/python/m5/objects/Root.mpy b/python/m5/objects/Root.mpy index 0e531054b..c535bd2dc 100644 --- a/python/m5/objects/Root.mpy +++ b/python/m5/objects/Root.mpy @@ -5,7 +5,7 @@ from Trace import Trace simobj Root(SimObject): type = 'Root' - frequency = Param.Tick(200000000, "tick frequency") + frequency = Param.RootFrequency('200MHz', "tick frequency") output_file = Param.String('cout', "file to dump simulator output to") full_system = Param.Bool("Full system simulation?") hier = HierParams(do_data = False, do_events = True) -- cgit v1.2.3