Avago Technologies LSI53C1010 User Manual
Page 210

9-12
SCRIPTS Programming Topics
9.3.1.3 Asynchronous SCSI Receive
If the DMA FIFO size is set to the default size, check the DFIFO and
DBC registers and calculate if there are bytes left in the DMA FIFO. To
make this calculation, subtract the seven least significant bits of the DBC
register from the 7-bit value of the DFIFO register. AND the result with
0x7F for a byte count between zero and the FIFO size.
If the DMA FIFO size is set to the extended size, subtract the 10 least
significant bits of the DBC register from the 10-bit value of the DMA FIFO
Byte Offset Counter, which consists of bits [1:0] in the CTEST5 register
and bits [7:0] of the DMA FIFO register. AND the result with 0x3FF for a
byte count between zero and the FIFO size.
Read bit 7 in the SSTAT0 and SSTAT2 registers to determine if any bytes
are left in the SIDL register. If bit 7 is set in the SSTAT0 or SSTAT2
register then the least significant byte or the most significant byte is full,
respectively.
If any wide transfers have been performed using the Chained Move
instruction, read the Wide SCSI Receive bit (SCNTL2, bit 0) to determine
whether a byte is left in the SWIDE register.
9.3.1.4 Synchronous SCSI Receive
If the DMA FIFO size is set to the default size, subtract the seven least
significant bits of the DBC register from the 7-bit value of the DFIFO
register. AND the result with 0x7F for a byte count between zero and the
FIFO size.
If the DMA FIFO size is set to the extended size, subtract the 10 least
significant bits of the DBC register from the 10-bit value of the DMA FIFO
Byte Offset Counter, which consists of bits [1:0] in the CTEST5 register
and bits [7:0] of the DMA FIFO register. AND the result with 0x3FF for a
byte count between zero and the FIFO size.
Read the SSTAT1 register, bit 4 of the SSTAT2 register for extended
FIFO size and the binary representation of the number of valid bytes in
the SCSI FIFO, to determine if any bytes are left in the SCSI FIFO.
If any wide transfers have been performed using the Chained Move
instruction, read the Wide SCSI Receive bit (SCNTL2, bit 0) to determine
whether a byte is left in the SWIDE register.