ldpc_decoder Module

This module provides the TDecoder class, capable of performing Gallager's SPA decoding.


Uses

  • module~~ldpc_decoder~~UsesGraph module~ldpc_decoder ldpc_decoder iso_c_binding iso_c_binding module~ldpc_decoder->iso_c_binding module~ldpc_edge_list ldpc_edge_list module~ldpc_decoder->module~ldpc_edge_list

Interfaces

public interface TDecoder

  • public function TDecoderConstructor(N, e_to_v, e_to_c) result(decoder)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: N

    Number of edges

    integer, intent(in) :: e_to_v(N)

    each location contains the index of the variable node connected to the edge corresponding to that location

    integer, intent(in) :: e_to_c(N)

    each location contains the index of the check node connected to the edge corresponding to that location

    Return Value type(TDecoder)

    The resulting Decoder object


Derived Types

type, public ::  TDecoder

LDPC Decoder object

Components

Type Visibility Attributes Name Initial
integer, public :: cnum

Number of Check Nodes

integer, public :: vnum

Number of variable nodes

integer, public :: Ne

Number of edges

type(TEdgeList), public, allocatable :: c_to_e(:)

For each check node, the list of its connected edges

type(TEdgeList), public, allocatable :: v_to_e(:)

For each variable node, the list of its connected edges

type(TEdgeList), public, allocatable :: c_to_v(:)

For each check node, the list of its connected variable nodes

type(TEdgeList), public, allocatable :: v_to_c(:)

For each variable node, the list of its connected check nodes

real(kind=wp), public, allocatable :: B_buffer(:)

Support buffer for node processing (backwards partial results)

real(kind=wp), public, allocatable :: F_buffer(:)

Support buffer for node processing (forward partial results)

Constructor

public function TDecoderConstructor (N, e_to_v, e_to_c)

Finalizations Procedures

final :: destructor

Type-Bound Procedures

procedure, public, pass(this) :: print => print_decoder
procedure, public, pass(this) :: check_llr
procedure, public, pass(this) :: word_to_synd
procedure, public, pass(this) :: decode

Functions

public function TDecoderConstructor(N, e_to_v, e_to_c) result(decoder)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: N

Number of edges

integer, intent(in) :: e_to_v(N)

each location contains the index of the variable node connected to the edge corresponding to that location

integer, intent(in) :: e_to_c(N)

each location contains the index of the check node connected to the edge corresponding to that location

Return Value type(TDecoder)

The resulting Decoder object

public pure function f_plus_add(x, y) result(z)

Real sum

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x
real(kind=wp), intent(in) :: y

Return Value real(kind=wp)

public pure function f_plus_box(x, y) result(z)

Box-plus sum

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x
real(kind=wp), intent(in) :: y

Return Value real(kind=wp)

public function check_llr(this, llr, synd)

Check the array of LLRs (or LAPPRs) against the syndrome

Arguments

Type IntentOptional Attributes Name
class(TDecoder) :: this

Decoder

real(kind=wp), intent(in) :: llr(this%vnum)

Array of LLR (or LAPPR)

logical, intent(in) :: synd(this%cnum)

Syndrome

Return Value logical

public function word_to_synd(this, word) result(synd)

Evaluate the syndrome from a word

Arguments

Type IntentOptional Attributes Name
class(TDecoder) :: this

Decoder

logical, intent(in) :: word(this%vnum)

Word

Return Value logical, (this%cnum)

Syndrome

public function llr_to_word(N, llr) result(word)

Binarize the LLRs (or LAPPRs)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: N

Word size

real(kind=wp), intent(in) :: llr(N)

LLR (or LAPPR)

Return Value logical, (N)

Word


Subroutines

public subroutine invert_table(N, e_to_x, xnum, x_to_e)

Create an array which contains, in each location, the list of edges connected to the node corresponding to that location

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: N

Number of edges

integer, intent(in) :: e_to_x(N)

Array of nodes to which each edge is connected

integer, intent(in) :: xnum

Total number of nodes

type(TEdgeList), intent(inout) :: x_to_e(xnum)

Array of list of edges, one list for each node

public subroutine edge_to_node_convert_table(N, x_to_e, Ne, e_to_y, x_to_y)

Build node-to-node connection list from node-to-edge and edge-to-other-node

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: N

Number of nodes

type(TEdgeList), intent(in) :: x_to_e(N)

Array with the list of connected edges for each node

integer, intent(in) :: Ne

Total number of edges

integer, intent(in) :: e_to_y(Ne)

Array with nodes (of the other kind) connected to each edge

type(TEdgeList), intent(inout) :: x_to_y(N)

Array with the list of connected nodes from the original nodes i.e. from variable- to check-nodes or vice versa

public subroutine destructor(decoder)

Destructor method for the TDecoder object It will just deallocate whatever was allocated.

Read more…

Arguments

Type IntentOptional Attributes Name
type(TDecoder) :: decoder

public subroutine print_decoder(this)

Arguments

Type IntentOptional Attributes Name
class(TDecoder) :: this

public subroutine process_xnode(buffer_x_to_y, Ne, m_inout, f_plus_kind, total, B_buffer, F_buffer)

Generic processing function, it works both for variable- and for check- nodes - for variable nodes, f_plus_kind is a simple addition routine - for check nodes, f_plus_kind can be: + the "box plus" for exact message passing + the min abs with sign product for the min-sum algorithm + whatever you want for your approximation

Arguments

Type IntentOptional Attributes Name
type(TEdgeList), intent(in) :: buffer_x_to_y

List of edges "y" connected to node "x"

integer, intent(in) :: Ne

Number of edges

real(kind=wp), intent(inout) :: m_inout(Ne)

Input messages, updated with the output messages

procedure(f_real_real) :: f_plus_kind

Function with 2 real inputs and one real output used to perform the combination of input messages to output messages

real(kind=wp), intent(out), optional :: total

f_plus_kind applied to all input messages

real(kind=wp), intent(inout), optional, target :: B_buffer(2:buffer_x_to_y%N)

pre-allocated backwords buffer for partial message processing results

real(kind=wp), intent(inout), optional, target :: F_buffer(buffer_x_to_y%N-1)

pre-allocated forward buffer for partial message processing results

public subroutine process_vnode(buffer_v_to_e, llr_channel, llr_updated, Ne, m_inout, B_buffer, F_buffer)

Variable node A Posteriori Probability (APP) processing function

Arguments

Type IntentOptional Attributes Name
type(TEdgeList), intent(in) :: buffer_v_to_e

List of edges connected to the variable node being currently processed

real(kind=wp), intent(in) :: llr_channel

Log-Likelihood ratio (or Log-A Posteriori Probability Ratio) of the variable node being currently processed

real(kind=wp), intent(out) :: llr_updated

Log-Likelihood ratio (or Log-A Posteriori Probability Ratio) of the variable node after processing

integer, intent(in) :: Ne

Total number of edges in the LDPC code

real(kind=wp), intent(inout) :: m_inout(Ne)

Array of input messages, to be updated with output messages, one per edge

real(kind=wp), intent(inout), optional, target :: B_buffer(2:buffer_v_to_e%N)

pre-allocated backwords buffer for partial message processing results

real(kind=wp), intent(inout), optional, target :: F_buffer(buffer_v_to_e%N-1)

pre-allocated forward buffer for partial message processing results

public subroutine process_cnode(buffer_c_to_e, s, Ne, m_inout, B_buffer, F_buffer)

Variable node A Posteriori Probability (APP) processing function

Arguments

Type IntentOptional Attributes Name
type(TEdgeList), intent(in) :: buffer_c_to_e

List of edges connected to the variable node being currently processed

logical, intent(in) :: s

Syndrome bit value associated to the checknode being currently processed

integer, intent(in) :: Ne

Total number of edges in the LDPC code

real(kind=wp), intent(inout) :: m_inout(Ne)

Message buffer

real(kind=wp), intent(inout), optional, target :: B_buffer(2:buffer_c_to_e%N)

pre-allocated backwords buffer for partial message processing results

real(kind=wp), intent(inout), optional, target :: F_buffer(buffer_c_to_e%N-1)

pre-allocated forward buffer for partial message processing results

public subroutine decode(this, llr_channel, llr_updated, synd, N_iterations)

Iteratively decode array of LLR (or LAPPRs) based on syndrome

Arguments

Type IntentOptional Attributes Name
class(TDecoder) :: this

Decoder

real(kind=wp), intent(in) :: llr_channel(this%vnum)

Array of LLRs (or LAPPRs) obtained from the channel

real(kind=wp), intent(out) :: llr_updated(this%vnum)

Array of processed LLRs (or LAPPRs)

logical, intent(in) :: synd(this%cnum)

Syndrome

integer, intent(inout) :: N_iterations

Maximum number of iterations (in), actual number of iterations (out)