5G LDPC Intel® FPGA IP User Guide

ID 683107
Date 4/01/2024
Public
Document Table of Contents

5.1.1. Running the 5G LDPC IP C++ Models

The encoder file is: LdpcEncoder_cTB.c. The decoder file is LdpcDecoder_fxp_cppTB.cpp.
  1. For the decoder, run:
    prompt> g++ LdpcDecoder_fxp_cppTB.cpp
    prompt> ./a.out
    snr = 1.60
    DecodedIters = 7
    BitErrors[7] = 0
    et_pass = 1
    
  2. For the encoder, run:
    prompt> g++ LdpcEncoder_cTB.c
    prompt> ./a.out <testcase>
    <testcase> =  0:
      z = 8;
      base_graph = 1; // BG#2
      code_rate = 0; // 1/5
      kb = 6;
      break; 
    <testcase> =  1:
      z = 36;
      base_graph = 1; // BG#2
      code_rate = 2; // 2/5
      kb = 8;
      break;
    <testcase> =  2:
      z = 104;
      base_graph = 0; // BG#1
      code_rate = 7; // 8/9
      kb = 22;
      break;
    <testcase> =  3:
      z = 384;
      base_graph = 0; // BG#1
      code_rate = 1; // 1/3
      kb = 22;
    
    For example, type ./a.out 0, then you see:
    prompt> tc=0
     prompt> output file: cw.z=8.bg=1.cr=0.kb=6.txt
     
  3. To check the result, type:
    prompt> diff ./cw.z=8.bg=1.cr=0.kb=6.txt ./txt