8.2. PRBS Usage Model
Different PRBS patterns can be configured using the 0x84, 0x85, 0x86, and 0x87 Avalon® memory-mapped interface addresses. The 0x84 and 0x85 Avalon® memory-mapped interface addresses point to the PRBS pattern code. The 0x86 and 0x87 Avalon® memory-mapped interface addresses point to the PMA code address 0x02.
| Address | Direction | Definition | 
|---|---|---|
| 0x84[2:0] | input |   3'b000: prbs7 3'b001: prbs9 3'b010: prbs11 3'b011: prbs15 3'b100: prbs23 3'b101: prbs31 3'b110: prbs13 3'b111: user  |  
     
| 0x84[4] | input | Reseed on error | 
| 0x84[5] | input | Autoseed correct (generator goes from all ‘0’ to all ‘1’ if it occurs) | 
| 0x84[7] | input | Stop on error (RX) | 
| 0x85[0] | input | Load TX PRBSGEN | 
| 0x85[1] | input | Load RX PRBSGEN | 
| Address | Direction | Definition | 
|---|---|---|
| 0x85[7:0] 0x84[7:0] | input |   Disable codes 0x3ff: disable both generators 0x1ff: disable TX PRBSGEN 0x2ff: disable RX PRBSGEN  |  
     
| 0x89[7:0] 0x88[7:0] | return value |   0x00: Failed due to background processes needing time to complete operations that may change the requested configuration. Wait some time and re-issue the request. 0x02: Success  |  
     
For example, to use the PRBS31 generator and checker, do the following steps:
- Set TX PRBS31. 
    
- Write 0x84[7:0] = 0x25.
 - Write 0x85[7:0] = 0x01.
 - Write 0x86[7:0] = 0x02.
 - Write 0x87[7:0] = 0x00.
 - Write 0x90[0] = 1'b1.
 - Read 0x8A[7]. It should be 1.
 - Read 0x8B[0] until it changes to 0.
 - Write 0x8A[7] to 1'b1 to clear the 0x8A[7] value.
 
 - Set RX PRBS31. 
    
- Write 0x84[7:0] = 0x35.
 - Write 0x85[7:0] = 0x02.
 - Write 0x86[7:0] = 0x02.
 - Write 0x87[7:0] = 0x00.
 - Write 0x90[0] = 1'b1.
 - Read 0x8A[7]. It should be 1.
 - Read 0x8B[0] until it changes to 0.
 - Write 0x8A[7] to 1'b1 to clear the 0x8A[7] value.
 
 - Enable the transceiver channel if it is not running already. 
    
- Write 0x84[7:0] = 0x07.
 - Write 0x85[7:0] = 0x00.
 - Write 0x86[7:0] = 0x01.
 - Write 0x87[7:0] = 0x00.
 - Write 0x90[0] = 1'b1.
 - Read 0x8A[7]. It should be 1.
 - Read 0x8B[0] until it changes to 0.
 - Write 0x8A[7] to 1'b1 to clear the 0x8A[7] value.
 
 - Wait for tx_ready and rx_ready to both be 1.
 - Set the data comparator. 
    
- Write 0x84[7:0] = 0x03.
 - Write 0x85[7:0] = 0x02.
 - Write 0x86[7:0] = 0x03.
 - Write 0x87[7:0] = 0x00.
 - Write 0x90[0] = 1'b1.
 - Read 0x8A[7]. It should be 1.
 - Read 0x8B[0] until it changes to 0.
 - Write 0x8A[7] to 1'b1 to clear the 0x8A[7] value.
 
 - Reset error counters. 
    
- Write 0x84[7:0] = 0x00.
 - Write 0x85[7:0] = 0x00.
 - Write 0x86[7:0] = 0x17.
 - Write 0x87[7:0] = 0x00.
 - Write 0x90[0] = 1'b1.
 - Read 0x8A[7]. It should be 1.
 - Read 0x8B[0] until it changes to 0.
 - Write 0x8A[7] to 1'b1 to clear the 0x8A[7] value.
 
 - Wait for the 32 bits wide error counter to be accumulated.
 - Set the error count to be read out. 
    
- Write 0x84[7:0] = 0x03.
 - Write 0x85[7:0] = 0x00.
 - Write 0x86[7:0] = 0x18.
 - Write 0x87[7:0] = 0x00.
 - Write 0x90[0] = 1'b1.
 - Read 0x8A[7]. It should be 1.
 - Read 0x8B[0] until it changes to 0.
 - Write 0x8A[7] to 1'b1 to clear the 0x8A[7] value.
 
 - Read the lower 16 bits of the error counter. 
    
- Write 0x84[7:0] = 0x00.
 - Write 0x85[7:0] = 0x00.
 - Write 0x86[7:0] = 0x1A.
 - Write 0x87[7:0] = 0x00.
 - Write 0x90[0] = 1'b1.
 - Read 0x8A[7]. It should be 1.
 - Read 0x8B[0] until it changes to 0.
 - Write 0x8A[7] to 1'b1 to clear the 0x8A[7] value.
 - Read 0x88[7:0]. This represents bits [7:0] of the error counter.
 - Read 0x89[7:0]. This represents bits [15:8] of the error counter.
 
 - Read the upper 16 bits of the error counter. 
    
- Write 0x84[7:0] = 0x00.
 - Write 0x85[7:0] = 0x00.
 - Write 0x86[7:0] = 0x1a.
 - Write 0x87[7:0] = 0x00.
 - Write 0x90[0] = 1'b1.
 - Read 0x8A[7]. It should be 1.
 - Read 0x8B[0] until it changes to 0.
 - Write 0x8A[7] to 1'b1 to clear the 0x8A[7] value.
 - Read 0x88[7:0]. This represents bits [23:16] of the error counter.
 - Read 0x89[7:0]. This represents bits [31:24] of the error counter.