Word# | BITS | Name | Description | Note |
---|---|---|---|---|
0 | [31:0] | TID[31:0] | Transaction ID | (echoed back) |
1 | [29:0] | Address[31:2] | Start Address | Always 32-bit aligned |
1 | [31:30] | OP-Code | Operation Code | 0x0=Read, 0x1=Write,
|
2 | [31:0] | WriteData[31:0] or ReadCount[8:0] | First Write or Read request counter | Up to 2^9 words per transactions |
... | ... | ... | ... | |
N-1 | [31:0] | WriteData[31:0] | Last Write | |
N | [31:0] | Don't Care | Don't Care |
Word# | BITS | Name | Description | Note |
---|---|---|---|---|
0 | [31:0] | TID[31:0] | Transaction ID | (echoed back) |
1 | [29:0] | Address[31:2] | Start Address | Always 32-bit aligned |
1 | [31:30] | OP-Code | Operation Code | 0x0=Read, 0x1=Write,
|
2 | [31:0] | WriteData[31:0] or ReadData[31:0] | First Write or First Read | |
... | ... | ... | ... | |
N-1 | [31:0] | WriteData[31:0] or ReadData[31:0] | Last Write or Last Read | |
N | [0] | Fail Flag | Register transaction Error | (response data) |
N | [1] | Timeout Flag | Timeout Error | (response data) |
N | [31:2] | Reserved | Reserved (0x0) | Reserved for Future Use |
Note: "set" and "clear" were defined but never implemented in the software and firmware.
uint32_t txData[4];
uint32_t rxData[4];
txData[0] = 0xa5a5a5a5; // Context data which is echoed back
txData[1] = 0x00000001; // Read from register 0x4
txData[1] |= 0x00000000; // Opcode is zero for read
txData[2] = 0x00000000; // Read count = 0 for a single location read
txData[3] = 0x00000000; // Final word is ignored
//Send the data, PGP example show (lane=0, vc=0)
pgpcard_send(fd, txData, 4, 0, 0);
// Wait for response (probably should use select call),
while (pgpcard_recv(fd,rxData,4,&lane,&vc,&eofe,&fifoErr,&lengthErr) == 0) usleep(10);
// Check for timeout or fail
uint32_t regError = rxData[3];
// Extract read data:
uint32_t readData = rxData[2];
uint32_t txData[4];
uint32_t rxData[4];
txData[0] = 0xa5a5a5a5; // Context data which is echoed back
txData[1] = 0x00000001; // Write to register 0x4
txData[1] |= 0x40000000; // Opcode is 1 for write
txData[2] = 0xdeadbeef; // Write data
txData[3] = 0x00000000; // Final word is ignored
//Send the data, PGP example show (lane=0, vc=0)
pgpcard_send(fd, txData, 4, 0, 0);
// Wait for response (probably should use select call),
while (pgpcard_recv(fd,rxData,4,&lane,&vc,&eofe,&fifoErr,&lengthErr) == 0) usleep(10);
// Check for timeout or fail
uint32_t regError = rxData[3];
Ben Reese
bareese@slac.stanford.edu