Class: KATCP::TenGE
Overview
Class used to access 10 GbE cores
Instance Method Summary collapse
-
#[](idx) ⇒ Object
Returns current value of ARP table entry
idx
. -
#[]=(idx, mac) ⇒ Object
Sets value of ARP table entry
idx
tomac
. -
#gw ⇒ Object
Get gateway IP address as 32-bit integer.
-
#gw=(a) ⇒ Object
Set gateway IP address to 32-bit integer
a
. -
#ip ⇒ Object
Get source IP address as 32-bit integer.
-
#ip=(a) ⇒ Object
Set source IP address to 32-bit integer
a
. -
#mac ⇒ Object
Return MAC address of 10 GbE core as 48-bit value.
-
#mac=(m) ⇒ Object
Set MAC address of 10 GbE core to 48-bit value
m
. -
#port ⇒ Object
Get local rx port as 16-bit integer.
-
#port=(p) ⇒ Object
Set local rx port to 16-bit integer
p
. -
#read64(addr) ⇒ Object
Read a 64 bit value big endian value starting at 32-bit word offset
addr
. -
#rx_eq_mix ⇒ Object
Get current value of rx_eq_mix parameter.
-
#rx_eq_pol ⇒ Object
Get current value of rx_eq_pol parameter.
-
#tx_diff_ctrl ⇒ Object
Get current value of tx_diff_ctrl parameter.
-
#tx_preemph ⇒ Object
Get current value of tx_preemph parameter.
-
#write64(addr, val64) ⇒ Object
Write
val64
as a 64 bit value big endian value starting at 32-bit word offsetaddr
. -
#xaui_bonded? ⇒ Boolean
Returns true if all four XAUI lanes are bonded.
-
#xaui_status ⇒ Object
Returns xaui status word.
-
#xaui_status_ok? ⇒ Boolean
Returns true if all four lanes are sync’d and bonded.
-
#xaui_sync ⇒ Object
Four least significant bits represent sync status for each lane.
-
#xaui_sync_ok? ⇒ Boolean
Returns true if #xaui_sync returns 15.
Methods inherited from Bram
Constructor Details
This class inherits a constructor from KATCP::Bram
Instance Method Details
#[](idx) ⇒ Object
Returns current value of ARP table entry idx
.
94 95 96 |
# File 'lib/katcp/client/roach.rb', line 94 def [](idx) read64(0xc00+2*idx) end |
#[]=(idx, mac) ⇒ Object
Sets value of ARP table entry idx
to mac
.
99 100 101 |
# File 'lib/katcp/client/roach.rb', line 99 def []=(idx, mac) write64(0xc00+2*idx, mac) end |
#gw ⇒ Object
Get gateway IP address as 32-bit integer.
54 |
# File 'lib/katcp/client/roach.rb', line 54 def gw ; get(3) ; end |
#gw=(a) ⇒ Object
Set gateway IP address to 32-bit integer a
.
56 |
# File 'lib/katcp/client/roach.rb', line 56 def gw=(a); set(3, a); end |
#ip ⇒ Object
Get source IP address as 32-bit integer.
59 |
# File 'lib/katcp/client/roach.rb', line 59 def ip ; get(4) ; end |
#ip=(a) ⇒ Object
Set source IP address to 32-bit integer a
.
61 |
# File 'lib/katcp/client/roach.rb', line 61 def ip=(a); set(4, a); end |
#mac ⇒ Object
Return MAC address of 10 GbE core as 48-bit value.
44 45 46 |
# File 'lib/katcp/client/roach.rb', line 44 def mac read64(0) end |
#mac=(m) ⇒ Object
Set MAC address of 10 GbE core to 48-bit value m
.
49 50 51 |
# File 'lib/katcp/client/roach.rb', line 49 def mac=(m) write64(0, m) end |
#port ⇒ Object
Get local rx port as 16-bit integer.
64 |
# File 'lib/katcp/client/roach.rb', line 64 def port ; get(8) & 0xffff ; end |
#port=(p) ⇒ Object
Set local rx port to 16-bit integer p
.
66 |
# File 'lib/katcp/client/roach.rb', line 66 def port=(p); set(8, (get(8) & 0xffff0000) | (p & 0xffff)); end |
#read64(addr) ⇒ Object
Read a 64 bit value big endian value starting at 32-bit word offset addr
.
30 31 32 33 |
# File 'lib/katcp/client/roach.rb', line 30 def read64(addr) hi, lo = get(addr,2).to_a ((hi & 0xffff) << 32) | (lo & 0xffffffff) end |
#rx_eq_mix ⇒ Object
Get current value of rx_eq_mix parameter.
85 |
# File 'lib/katcp/client/roach.rb', line 85 def rx_eq_mix ; (get(10) >> 24) & 0xff; end |
#rx_eq_pol ⇒ Object
Get current value of rx_eq_pol parameter.
87 |
# File 'lib/katcp/client/roach.rb', line 87 def rx_eq_pol ; (get(10) >> 16) & 0xff; end |
#tx_diff_ctrl ⇒ Object
Get current value of tx_diff_ctrl parameter.
91 |
# File 'lib/katcp/client/roach.rb', line 91 def tx_diff_ctrl; (get(10) ) & 0xff; end |
#tx_preemph ⇒ Object
Get current value of tx_preemph parameter.
89 |
# File 'lib/katcp/client/roach.rb', line 89 def tx_preemph ; (get(10) >> 8) & 0xff; end |
#write64(addr, val64) ⇒ Object
Write val64
as a 64 bit value big endian value starting at 32-bit word offset addr
.
37 38 39 40 41 |
# File 'lib/katcp/client/roach.rb', line 37 def write64(addr, val64) hi = ((val64 >> 32) & 0xffff) lo = val64 & 0xffffffff set(addr, hi, lo) end |
#xaui_bonded? ⇒ Boolean
Returns true if all four XAUI lanes are bonded
82 |
# File 'lib/katcp/client/roach.rb', line 82 def xaui_bonded?; ((get(9) >> 6) & 1) == 1; end |
#xaui_status ⇒ Object
Returns xaui status word. Bits 2 through 5 are lane sync, bit 6 is channel bonding status.
70 |
# File 'lib/katcp/client/roach.rb', line 70 def xaui_status; get(9); end |
#xaui_status_ok? ⇒ Boolean
Returns true if all four lanes are sync’d and bonded.
72 |
# File 'lib/katcp/client/roach.rb', line 72 def xaui_status_ok?; (get(9) & 0b01111100) == 0b01111100; end |
#xaui_sync ⇒ Object
Four least significant bits represent sync status for each lane.
1 bit = lane sync OK
0 bit = lane sync BAD
Proper operation requires all four lanes to have good sync status, so 15 (0b1111) is the desired value.
78 |
# File 'lib/katcp/client/roach.rb', line 78 def xaui_sync; (get(9) >> 2) & 0b1111; end |
#xaui_sync_ok? ⇒ Boolean
Returns true if #xaui_sync returns 15
80 |
# File 'lib/katcp/client/roach.rb', line 80 def xaui_sync_ok?; xaui_sync == 0b1111; end |