ST20-C1 STMICROELECTRONICS [STMicroelectronics], ST20-C1 Datasheet - Page 57

no-image

ST20-C1

Manufacturer Part Number
ST20-C1
Description
Instruction Set Reference Manual
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
The data items from each vector are read from memory in turn and the products
formed between corresponding pairs from the two vectors. Each of these products is
added into the running accumulator value. The instruction completes with 3 values in
the stack - the final accum ulator value and the two updated data pointers.
Four control values are held in the status register, as shown in Table 5.2.
These values are initialized by the smacinit instruction. The smacinit instruction takes
a packed control word in Areg, extracts the control fields and loads these into the
status register. For smacinit , Areg is organized as shown in Table 5.3.
These status register values are global and are not saved when a process is times-
liced or descheduled. If more than one process is performing short multiply accumu-
late loops then the values should be reloaded by the process code using smacinit
after each timeslice and stop instruction.
5.3.1
The X vector buffer size is determined by the mac_buffer control field, which may take
the values 0 to 7. When mac_buffer is 0, then no address wrapping takes place, i.e.
the buffer is assumed to be of infinite size. Otherwise, the buffer size is 2
as shown in Table 5.3. The X buffer must be aligned to a multiple of its own size, so a
buffer of N bytes must start at an address whose value is a multiple of N bytes.
5.3.2
The mac_count control field in the status register deter mines the number of multiply-
accumulate steps for smacloop . This is an unsigned 8-bit integer. The value zero
signifies 256 steps; otherwise the value of mac_count is the number of steps.
mac_count
mac_buffer
mac_scale
mac_mode
Field
X buffer size
Number of steps
mac_count
mac_buffer
mac_scale
mac_mode
Size
8 bits The number of steps (from 1 to 256 items).
3 bits The size code for the data buffer within which the data vector lies.
2 bits Shift control for scaling coefficient v alues.
1 bit
Field
Accumulator format - 0 indicates 16-bit (short) and 1 indicates 32-bit (long) value.
Table 5.2 smacloop status register fields
Table 5.3 smacinit Areg format
Size
8 bits
3 bits
2 bits
1 bit
Least significant
bit
11
13
0
8
Meaning
Most significant
5 Multiply accumulate
bit
10
12
13
7
mac_buffer+2
57/205
,

Related parts for ST20-C1