PARAMLIB - The Parameter Library
The parameter library is used to create the type definitions of parameters
used by the project. HASE supplies five built-in types (integer,
floating-point, string, unsigned int and char)
from which more complex types can be created, for example structures,
enumerated and ranges. Once types have been defined in the parameter library,
instances of these types can then be created in the
GLOBALS section and
within entity declarations in the ENTITYLIB.
ENUM ( typename, [ enumerate : icon, ... ] )
STRUCT ( typename, [ reference_parameter , ... ] )
INSTR ( typename, [ (tag, reference_parameter ) , ... ] , class_enum )
BIT ( typename, no_of_bits )
LINK ( typename, [ ( tag, reference_parameter : icon), ... ] )
ARRAY ( typename, type_of_elements )
Enum - Enumerated Type Parameter
- ENUM ( typename, [ enumerate : icon, ... ] )
The ENUM declaration enables the creation of an enumerated type similar to those found
in C & C++. It provides a means of enumerating a finite set of elements.
- typename: str - The name of the enumerated type, used when creating
instances.
- enumerate: str - A unique label for each part of the set.
- icon: str - The file name of the icon of the associated enumerate.
Note that this does not need to include a full path name as it is assumed that the
icon is in the bitmaps sub-directory of the current projects working
directory (as specified in the preamble). Also the .btm and .gif extensions
can be missed off the icon name as these are automatically added (gif files are searched
for first).
Example:
ENUM ( cache_state, [ cache_hit : hit_icon, cache_miss : miss_icon ] )
Struct - Structure Parameter - STRUCT ( typename, [ reference_parameter , ... ] )
The STRUCT construct allows the creation of data structures, similar to the struct declaration in C & C++.
This mechanism provides a means to aggregate variables of different types.
- typename: str - The name of the structure, used when creating instances.
- ref_parameter: - See the reference section.
Example:
STRUCT ( Data_Packet, [ RINT (Packet_No, 0) , RINT (Packet_Data, 0) ] )
Instr - Instruction Parameter - INSTR ( typename, [ (tag, reference_parameter ) , ... ] , class_enum )
Instruction sets are typically defined in architecture manuals as being divided into several different
classes such as load/store, ALU and control instructions. The INSTR construct allows an instruction set,
which groups instructions into different classes, to be defined within HASE.
- typename: str - The name of the instruction set, used when creating instances.
- tag: str - The tag component supplies the name of a class of instructions.
- reference_parameter: - See the reference section.
- class_enum: str - The name assigned to the list of instruction classes.
Example:
INSTR ( instr_set, [ (LOAD, RSTRUCT( ld_format, ld_field ) ,
STORE, RSTRUCT( st_format, st_field ),
ALU, RSTRUCT (alu_format, alu_field ) ] , instruction_class )
Bit - Bit Parameter - BIT ( typename, no_of_bits )
The BIT construct allows a bit type to be defined. This is similar to the integer type except that the value
is displayed as a bit pattern.
- typename: str - The name of the bit type, used when creating instances.
- no_of_bits: int - The number of bits to be used when representing the integer value.
Example:
BIT ( Register_Contents, 32 )
Link - LINK ( typename, [ ( tag , reference_parameter : icon), ... ] )
- typename: str - The name of the link parameter, used when creating instances and
assigning types to individual ports.
- tag: str - A tag, which has an associated parameter, allows different types of messages
to be passed down the same link. A 'send' function is created for each link parameter tag, which can then
be used to send information of the associated parameter type to another entity. See the HASE manual for
a definition of and example uses of the 'send' functions.
- reference_parameter: - The definition of a message type that is associated with a tag.
See the reference section.
- icon: str - The file name of the icon of the associated enumerate. Note that this does
not need to include a full path name as it is assumed that the icon is in the bitmaps
sub-directory of the current projects working directory (as specified in the preamble). Also the .btm and
.gif extensions can be missed off the icon name as these are automatically added
(gif files are searched for first).
Example:
LINK ( DLink, [ ( MEM_R, RINT ( Address, 0) ),
( MEM_W, RSTRUCT ( Info, I ) : PktIcon ) ] )