Specifications
TURBOchannel Bus Support
12.2 TURBOchannel on DEC 3000 Model 500
first byte involved in the transaction. IOC$CRAM_CMD forms a 4 bit mask and
copies it to the MASK field in the CRAM and also to bits 35:32 of the WDATA
field. The byte or word command index is converted to cramcmd$k_wtquad32 and
stored in the COMMAND field of the CRAM, so that IOC$CRAM_IO will generate
a STQ (with the proper mask bits set in bits 35:32 of the data quadword) for all
byte and word length writes. On byte or word length writes, the programmer
must be careful not to overwrite the mask in bits 35:32 of the WDATA field
when loading write data into the CRAM. If the caller specifies a longword write
(cramcmd$k_wtlong32), IOC$CRAM_CMD copies the command index directly
to the COMMAND field. IOC$CRAM_IO will generate a STL for all longword
writes, which causes all 4 bytes of the register data to be written.
The following section contains examples of register reads and writes using
CRAMS. Consider the previous example of the option with two registers, mapped
into sparse space as shown in Figure 12–6 and Figure 12–7.
Figure 12–6 Option Register Layout
Option Register Layout
0
slot base + 4 0000
slot base + 4 0004
ZK−6717A−GE
31
register A
register B
physical address
Figure 12–7 Option Register Layout—Sparse Space
Option Register Layout − Sparse Space
031
register A
register B
base VA
base VA + 8
ZK−6718A−GE
virtual address
mask
mask
To initialize the CRAM for a read to register A, call IOC$CRAM_CMD as follows:
status = ioc$cram_cmd (cramcmd$k_rdlong32,
0,
adp_address,
cram_address);
IOC$CRAM_CMD forms the RBADR field of the CRAM by 1) longword aligning
the byte offset input parameter, and 2) multiplying the longword aligned byte
offset by 2 (to account for sparse space) and 3) adding the longword aligned byte
offset to the value from IDB$Q_CSR. In this example with a byte offset parameter
of zero, the resulting address would be "base VA". Then, to perform the actual
read to register A, call IOC$CRAM_IO as follows:
status = ioc$cram_io (cram_address);
IOC$CRAM_IO will issue a LDL to the address in the RBADR field in the CRAM.
In this example, this will be a LDL to "base VA". The data from register A will be
returned in the RDATA field in the CRAM.
12–7