Difference between revisions of "Python Parameter Types"

From gem5
Jump to: navigation, search
(Created page with "The information below came from src/python/m5/params.py and src/python/m5/util/convert.py. Reference those files for the most up to date information. {| border="1" cellpadding="…")
 
Line 37: Line 37:
 
  |-
 
  |-
 
  | MemorySize || uint64_t
 
  | MemorySize || uint64_t
  | [value][unit] where value is a base 10 number and unit is one of the following:
+
  | A string formatted as [value][unit] where value is a base 10 number and unit is one of the following:
 
  * PB => pebibytes
 
  * PB => pebibytes
 
  * TB => tebibytes
 
  * TB => tebibytes
Line 82: Line 82:
 
  |-
 
  |-
 
  | Latency || Tick
 
  | Latency || Tick
  | Can be assigned an existing Clock or Frequency parameter, or a string with the format [value][unit] where unit is one of the following:
+
  | Can be assigned an existing Clock or Frequency parameter, or a string with the format [value][unit] where value is a base 10 number and unit is one of the following:
 
  * t => Ticks
 
  * t => Ticks
 
  * ps => picoseconds
 
  * ps => picoseconds
Line 92: Line 92:
 
  |-
 
  |-
 
  | Frequency || Tick
 
  | Frequency || Tick
  | Can be assigned an existing Latency or Clock parameter, or a string with the format [value][unit] where unit is one of the following:
+
  | Can be assigned an existing Latency or Clock parameter, or a string with the format [value][unit] where value is a base 10 number and unit is one of the following:
 
  * THz => terahertz
 
  * THz => terahertz
 
  * GHz => gigahertz
 
  * GHz => gigahertz
Line 101: Line 101:
 
  |-
 
  |-
 
  | Clock || Tick
 
  | Clock || Tick
  | Can be assigned an existing Latency or Frequency parameter, or a string with the format [value][unit] where unit is one of the following:
+
  | Can be assigned an existing Latency or Frequency parameter, or a string with the format [value][unit] where value is a base 10 number and unit is one of the following:
 
  * t => Ticks
 
  * t => Ticks
 
  * ps => picoseconds
 
  * ps => picoseconds
Line 116: Line 116:
 
  |-
 
  |-
 
  | NetworkBandwidth || float
 
  | NetworkBandwidth || float
  | A floating point value specifying bits per second, or a string formatted as [value][unit] where unit is one of the following:
+
  | A floating point value specifying bits per second, or a string formatted as [value][unit] where value is a base 10 number and unit is one of the following:
 
  * Tbps => terabits per second
 
  * Tbps => terabits per second
 
  * Gbps => gigabits per second
 
  * Gbps => gigabits per second
Line 125: Line 125:
 
  |-
 
  |-
 
  | MemoryBandwidth || float
 
  | MemoryBandwidth || float
  | A string formatted as [value][unit] where unit is one of the following:
+
  | A string formatted as [value][unit] where value is a base 10 number and unit is one of the following:
 
  * PB/s => pebibytes per second
 
  * PB/s => pebibytes per second
 
  * TB/s => tebibytes per second
 
  * TB/s => tebibytes per second

Revision as of 03:16, 11 November 2010

The information below came from src/python/m5/params.py and src/python/m5/util/convert.py. Reference those files for the most up to date information.

Python Type Name C++ Type Format Notes
Int int 32 bits
Unsigned unsigned 32 bits
Int8 int8_t
UInt8 uint8_t
Int16 int16_t
UInt16 uint16_t
Int32 int32_t
UInt32 uint32_t
Int64 int64_t
UInt64 uint64_t
Counter Counter
Tick Tick
TcpPort uint16_t
UdpPort uint16_t
Percent int Between 0 and 100.
Float double
MemorySize uint64_t A string formatted as [value][unit] where value is a base 10 number and unit is one of the following:
* PB => pebibytes
* TB => tebibytes
* GB => gibibytes
* MB => mebibytes
* kB => kibibytes
* B => bytes
kibi, mebi, etc. are true powers of 2.
MemorySize32 uint32_t See "MemorySize" above. See "MemorySize" above.
Addr Addr See "MemorySize" above See "MemorySize" above. Also, an addr may be specified as a string with units, or a raw integer value.
Range Range<[type]>, type is int by default Defined as a "start" and "end" or "size" value. Exactly one of "end" or "size" is recognized as a keyword argument. A positional argument will be treated as "end", and "size" arguments are convected to "end" internally by adding to "start" and subtracting one.
AddrRange Range<Addr> See "Range" above.
TickRange Range<Tick> See "Range" above.
Bool bool
EthernetAddr Net::EthAddr Six pairs of 2 digit hex values seperated by ":"s, for instance "01:23:45:67:89:AB" May be set to NextEthernetAddr. All EthernetAddrs set to NextEthernetAddr will be assigned to incremental ethernet addresses starting with 00:90:00:00:00:01.
Time tm May be a Python struct_time, int, long, datetime, or date, the string "Now" or "Today", or a string parseable by Python's strptime with one of the following formats:
* "%a %b %d %H:%M:%S %Z %Y"
* "%a %b %d %H:%M:%S %Z %Y"
* "%Y/%m/%d %H:%M:%S"
* "%Y/%m/%d %H:%M"
* "%Y/%m/%d"
* "%m/%d/%Y %H:%M:%S"
* "%m/%d/%Y %H:%M"
* "%m/%d/%Y"
* "%m/%d/%y %H:%M:%S"
* "%m/%d/%y %H:%M"
* "%m/%d/%y"
subclasses of Enum enum named after the parameter type A string defined as part of the enum This description applies to all enum parameter types which are defined as subclasses of Enum. The possible string values and optionally their mappings are specified in a dict called "map" or a list called "vals" defined as members of the Enum subclass itself.
Latency Tick Can be assigned an existing Clock or Frequency parameter, or a string with the format [value][unit] where value is a base 10 number and unit is one of the following:
* t => Ticks
* ps => picoseconds
* ns => nanoseconds
* us => microseconds
* ms => milliseconds
* s => seconds
Frequency Tick Can be assigned an existing Latency or Clock parameter, or a string with the format [value][unit] where value is a base 10 number and unit is one of the following:
* THz => terahertz
* GHz => gigahertz
* MHz => megahertz
* kHz => kilohertz
* Hz => hertz
The frequency value is converted into a period in units of Ticks when transfered to C++.
Clock Tick Can be assigned an existing Latency or Frequency parameter, or a string with the format [value][unit] where value is a base 10 number and unit is one of the following:
* t => Ticks
* ps => picoseconds
* ns => nanoseconds
* us => microseconds
* ms => milliseconds
* s => seconds
* THz => terahertz
* GHz => gigahertz
* MHz => megahertz
* kHz => kilohertz
* Hz => hertz
This type is like a combination of the Frequency and Latency types described above.
NetworkBandwidth float A floating point value specifying bits per second, or a string formatted as [value][unit] where value is a base 10 number and unit is one of the following:
* Tbps => terabits per second
* Gbps => gigabits per second
* Mbps => megabits per second
* kbps => kilobits per second
* bps => bits per second
The network bandwidth value is converted to Ticks per byte before being transfered to C++.
MemoryBandwidth float A string formatted as [value][unit] where value is a base 10 number and unit is one of the following:
* PB/s => pebibytes per second
* TB/s => tebibytes per second
* GB/s => gibibytes per second
* MB/s => mebibytes per second
* kB/s => kibibytes per second
* B/s => bytes per second
The memory bandwidth value is converted to Ticks per byte before being transferred to C++. kibi, mebi, etc. are true powers of 2.