In SALTO, a resource represents an element of the target architecture that can influence its performance. As a rule of thumb, anything hardware element that can form a bottleneck in instruction scheduling should be represented as a resource.
Resources are classified according to three criteria:
Resources must be named. The choice of names is left to the designer of the description of the architecture, except for the reserved resource name "mem" which always denotes the ``main'' memory (NB: multiple memory resources can be defined.)
A resource is characterized by four properties:
The definition of a resource is made using the def_ress expression with the following syntax:
< def_ress>::=
( def_ress
<res_or_class_name>
[
(type "<type>")0|1
(width <width>)0|1
(limit <limit>)0|1
])
< res_or_class_name>::=
(name "<name>") |
(base_name "<genname>" <first> <last>)
where
The reference to an already defined resource is made using the expression ress:
< resource_ref>::=
( ress
<res_or_class_name>)
The definitions
; general registers r0 to r127 (def_ress (base_name "r" 0 127) [(type "reg") (width 32)]) ; instruction decoders (issue units) (def_ress "issue" [(type "functional_unit") (limit 5)]) ; DSP ALU (def_ress (name "dspalu") [(type "functional_unit") (limit 1) (width 32)])correspond respectively to a set of 128 32-bit registers named "r0" through "r127", a family of five instruction decoders which can be used interchangeably, and a unique DSP ALU with 32-bit data paths (N.B.: the replication limit of 1 must be explicit: the previous functional unit definition used a higher value, which would otherwise have been reused.)
Aliases (alternate names) of resources can be given using the alt_name
expression. Aliases are most frequently used to reflect usage conventions
of resources. The general form of the alias definition is
< alt_name>::=
"<name>" "<alias>")
( alt_name
where
The following are the aliases of the TM1000 registers
; register r2 (alias "rp") contains the return value of a function (alt_name "r2" "rp") ; register r3 (alias "fp") is used as frame pointer by C/C++ programs ; (see restriction in manual) (alt_name "r3" "fp") ; register r4 (alias "sp") is the stack pointer (last word IN USE, growth ; towards 0) (alt_name "r4" "sp") ; register r5 (alias "rv") is the scalar return value register (alt_name "r5" "rv")
Resource classes provide a means of representing resources that are equivalent wrt. the renaming. Therefore, the classes should be defined in such a way that all resource of a class should be fully interchangeable.
A resource can belong to several classes, with different renaming and writability characteristics in each class. A resource class definition uses the following syntax:
< def_class>::=
( def_class
"<class_name>" "<type>"
[
(ress | class
<res_or_class_name>
[
(norename)0|1
(noallocate)0|1
]
)+
])
where
References to an already defined class are made using the class expression:
< class_ref>::=
( class
<res_or_class_name>
)
Below are the definitions of several register classes of the TM architecture:
; read-only registers (def_class "RO_reg" "reg" [(ress (base_name "r" 0 1) [(noallocate) (norename)])]) ; writable registers (def_class "DEST_reg" "reg" [ (ress (base_name "r" 2 127) []) ]) ; all registers (def_class "GP_reg" "reg" [ (class (name "RO_reg")) (class (name "DEST_reg")) ]) ; C call parameters (def_class "PARAM_reg" "reg" [ (ress (base_name "r" 5 8) [(norename)]) ])