Line coding

Line-coding helpers and definitions.

bakeneko.physical.coding.K(x: int, y: int) int

Returns the 8b/10b encoded value for the given K symbol.

Return type:

int

bakeneko.physical.coding.D(x: int, y: int) int

Returns the 8b/10b encoded value for the given D symbol

Return type:

int

class bakeneko.physical.coding.Symbol(value: int, *, sym_type: Type | None = None, name: str = '', description: str = '') None

A simple encapsulation for PCIe 8b/10b named symbols

Parameters:
  • name (str) – The symbol name. (default: '')

  • value (int) – The numerical value of the symbol. Normally the result of a call to D or K.

  • sym_type (Symbol.Type) – The type of symbol this is, either Control or Data. (default: None)

  • description (str) – A brief description of this symbol. (default: '')

class Type(value)

Named symbol type

static control(name: str, value: int, description: str = '') Symbol

Construct a named control symbol

Return type:

Symbol

static data(name: str, value: int, description: str = '') Symbol

Construct a named data symbol

Return type:

Symbol

static from_bits(bits: int, *, name: str = '', description: str = '') Symbol | None

Convert a 10-bit code into a Symbol object if possible

Return type:

Symbol | None

x() int

Return the x component of the symbol

Return type:

int

y() int

Return the y component of the symbol

Return type:

int

decompose() tuple[int, int]

Decompose a symbol value into an (x, y) pair

Return type:

tuple[int, int]

as_value(*, repeat: int = 1) Const

Returns the data value of this symbol as a Torii Const

Return type:

Const

as_ctrl(*, repeat: int = 1) Const

Returns the ctrl value of this symbol as a Torii Const

Return type:

Const

class bakeneko.physical.coding.Symbols(value)

List of known PCIe named symbols