Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use CRC inside py_aff3ct #6

Open
yunl140 opened this issue Oct 14, 2021 · 4 comments
Open

use CRC inside py_aff3ct #6

yunl140 opened this issue Oct 14, 2021 · 4 comments

Comments

@yunl140
Copy link

yunl140 commented Oct 14, 2021

Thank you so much for this super helpful project.

I am trying to modify from https://github.com/aff3ct/py_aff3ct/blob/master/examples/full_python/bfer_polar.py to use the CA-SCL decoding with some crc polynomial. I rarely worked with c++ and I'm not familiar at all with the binding stuff... I could not find any wrapped module for CRCs, and I'm not sure how to construct a proper aff3ct::module::CRC type argument for the decoder Decoder_polar_SCL_naive_CA. Any hints on this?

@rtajan
Copy link
Member

rtajan commented Oct 16, 2021

Hi,

Thank you for your interest for AFF3CT and py_aff3ct.

I have added CRC to modules wrapped by default.
Within the bfer_polar example, something like this should work now:

K_crc = 512
K = K_crc - 24
...
crc = aff3ct.module.crc.CRC_polynomial_fast(K,'24-5GA') # Instanciate CRC
dec = aff3ct.module.decoder.Decoder_polar_SCL_fast_CA_sys(K_crc,N,L,frozen_bits,crc) # Use CRC for the SCL CA

crc["build        ::U_K1"].bind(src["generate   ::U_K "])
enc["encode       ::U_K "].bind(crc["build      ::U_K2"])
...
crc["extract      ::V_K1"].bind(dec["decode_siho::V_K "])
mnt["check_errors ::U   "].bind(src["generate   ::U_K "])
mnt["check_errors ::V   "].bind(crc["extract    ::V_K2"])

@yunl140
Copy link
Author

yunl140 commented Oct 19, 2021

Yes the CRC module works. Just one more remark: in calculating error rate, I think

crc["extract      ::V_K1"].bind(dec["decode_siho::V_K "])
mnt["check_errors ::V   "].bind(crc["extract      ::V_K2"])

is the correct way we're looking for.

@rtajan
Copy link
Member

rtajan commented Oct 19, 2021

I have edited my answer so that the solution seems complete now.

@yunl140
Copy link
Author

yunl140 commented Oct 19, 2021

The following version works now (changed fbgen and enc as well). Thank you!

K_crc = 512
K = K_crc - 24
...
fbgen = aff3ct.tools.frozenbits_generator.Frozenbits_generator_GA_Arikan(K_crc, N)
...
crc = aff3ct.module.crc.CRC_polynomial_fast(K,'24-5GA')
enc = aff3ct.module.encoder.Encoder_polar_sys(K_crc,N,frozen_bits)
dec = aff3ct.module.decoder.Decoder_polar_SCL_fast_CA_sys(K_crc,N,L,frozen_bits,crc) # Use CRC for the SCL CA
...
crc["build        ::U_K1"].bind(src["generate   ::U_K "])
enc["encode       ::U_K "].bind(crc["build      ::U_K2"])
...
crc["extract      ::V_K1"].bind(dec["decode_siho::V_K "])
mnt["check_errors ::U   "].bind(src["generate   ::U_K "])
mnt["check_errors ::V   "].bind(crc["extract    ::V_K2"])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants