The file needs to contain at least the following information:
- Bias range
- Timing information
- Power information
If the user is not interested in these values and does not use them for any fitness functions, please fill those fields with worthless values.
<DATA>
<BiasRange>
<bias>0.0</bias>
...
</BiasRange>
<Delay unit="ns">
<ALU bias="0.0" op="add">12.3</ALU>
...
<SE bias="0.0">4.5</SE>
...
</Delay>
<Power>
<Static>
<PE bias="0.0" unit="mW">1.2</PE>
</Static>
<Dynamic>
<Energy >
</Dynami>
</Power>
<User name="database1">
<param name="key" type=...>...</param>
...
</User>
</DATA>
The top-level element must be only a <DATA> element.
The <BiasRange> element contains several <bias> elements, which are list of available body bias voltage.
The inner text of the <bias> is the bias voltage value (float).
At least one voltage is needed.
The <Delay> element has timing information of ALUs and routing resources for each bias voltage.
If the unit (ps, ns, us, ms) is omitted, ns is used as the default unit.
The child element is either <ALU> or <SE> element.
Both must have a "bias" attribute for bias voltage with which the delay time is associated.
The <ALU> element defines the delay time of the ALU.
It usually depends on the operation (instruction) so that the element has "op" attribute to specify the opcode.
The <SE> element defines the delay time of the switch element.
The <Power> element has two inner elements <Static> and <Dynamic>.
The former contains static power consumption data, and the latter contains parameters for the dynamic power model (Please refer to published papers).
The <Static> defines the static power consumption of a PE for each bias voltage.
A <PE> with a "bias" attribute specifies the value of the static power.
If the unit (pW, nW, uW, mW) is omitted, mW is used as the default unit.
Five parameters are necessary as children elements of the <Dynamic>.
<Energy>: an energy consumption per switching (default unit: pJ)<Propagation>: a propagation factor<Decay>: a decay factor<SE_weight>: weight to propagate switching from predecessor nodes for SEs.<Switching>with "op" attribute: switching count for each operation in ALUs.
In addition to the above parameter, the users can add any parameters with <User> fields.
A <User> elements create a named database, whose name is specified with the "name" attribute.
A parameter in the database is defined with the inner text of a <param> element.
"key" attribute is required for a key string to access the parameter.
The default data type is float.
Other supported types are:
- python primitive types, e.g., int, float, str, etc
- list or dict of the above types for collection types
For example, an integer type of parameter can be defined by
<param name="foo" type="int">123</param>
For the collection types, the data type of their elements is also needed like type=list[int] and type=dict[float].
In addition, the dict type of parameter requires a "key" attribute.
The following example will create a dictionary {"bar": 1, "baz": 2} named "dict_data":
<param name="dict_data" type="dict[int]" key="bar">1</param>
<param name="dict_data" type="dict[int]" key="baz">2</param>
The user-defined parameters can be accessed in the fitness calculation.
The eval method of the evaluation classes gets a sim_params as an argument.
It is an instance of SimParameters class.
It has a getter method getUserdata(name), which returns the database named "name" as a dictionary.
Assuming the above examples,
def eval(CGRA, app, sim_params, individual, **info):
....
userdata = sim_params.getUserdata("database1") # <- get dictionary of user data
x = userdata["foo"] # get 123 of integer
d = userdata["dict_data] # get the dictionary
y = d["bar] # get 1 of integer
z = d["baz"] # get 2 of integer