tests/conv: add LTE PBCH test vector

Change-Id: I1a3a48bba9ee32a0bacc0b05d25358496dbcbc1b
This commit is contained in:
Vadim Yanitskiy 2017-01-15 12:55:57 +07:00
parent 8928747a3e
commit 1214295062
2 changed files with 68 additions and 0 deletions

View File

@ -120,6 +120,57 @@ static const struct osmo_conv_code conv_wimax_fch = {
.next_state = conv_wimax_fch_next_state,
};
/**
* LTE PBCH
* Non recursive code, tail-biting, non-punctured
*/
static const uint8_t conv_lte_pbch_next_output[][2] = {
{ 0, 7 }, { 3, 4 }, { 7, 0 }, { 4 , 3 },
{ 6, 1 }, { 5, 2 }, { 1, 6 }, { 2 , 5 },
{ 1, 6 }, { 2, 5 }, { 6, 1 }, { 5 , 2 },
{ 7, 0 }, { 4, 3 }, { 0, 7 }, { 3 , 4 },
{ 4, 3 }, { 7, 0 }, { 3, 4 }, { 0 , 7 },
{ 2, 5 }, { 1, 6 }, { 5, 2 }, { 6 , 1 },
{ 5, 2 }, { 6, 1 }, { 2, 5 }, { 1 , 6 },
{ 3, 4 }, { 0, 7 }, { 4, 3 }, { 7 , 0 },
{ 7, 0 }, { 4, 3 }, { 0, 7 }, { 3 , 4 },
{ 1, 6 }, { 2, 5 }, { 6, 1 }, { 5 , 2 },
{ 6, 1 }, { 5, 2 }, { 1, 6 }, { 2 , 5 },
{ 0, 7 }, { 3, 4 }, { 7, 0 }, { 4 , 3 },
{ 3, 4 }, { 0, 7 }, { 4, 3 }, { 7 , 0 },
{ 5, 2 }, { 6, 1 }, { 2, 5 }, { 1 , 6 },
{ 2, 5 }, { 1, 6 }, { 5, 2 }, { 6 , 1 },
{ 4, 3 }, { 7, 0 }, { 3, 4 }, { 0 , 7 },
};
static const uint8_t conv_lte_pbch_next_state[][2] = {
{ 0, 1 }, { 2, 3 }, { 4, 5 }, { 6, 7 },
{ 8, 9 }, { 10, 11 }, { 12, 13 }, { 14, 15 },
{ 16, 17 }, { 18, 19 }, { 20, 21 }, { 22, 23 },
{ 24, 25 }, { 26, 27 }, { 28, 29 }, { 30, 31 },
{ 32, 33 }, { 34, 35 }, { 36, 37 }, { 38, 39 },
{ 40, 41 }, { 42, 43 }, { 44, 45 }, { 46, 47 },
{ 48, 49 }, { 50, 51 }, { 52, 53 }, { 54, 55 },
{ 56, 57 }, { 58, 59 }, { 60, 61 }, { 62, 63 },
{ 0, 1 }, { 2, 3 }, { 4, 5 }, { 6, 7 },
{ 8, 9 }, { 10, 11 }, { 12, 13 }, { 14, 15 },
{ 16, 17 }, { 18, 19 }, { 20, 21 }, { 22, 23 },
{ 24, 25 }, { 26, 27 }, { 28, 29 }, { 30, 31 },
{ 32, 33 }, { 34, 35 }, { 36, 37 }, { 38, 39 },
{ 40, 41 }, { 42, 43 }, { 44, 45 }, { 46, 47 },
{ 48, 49 }, { 50, 51 }, { 52, 53 }, { 54, 55 },
{ 56, 57 }, { 58, 59 }, { 60, 61 }, { 62, 63 },
};
const struct osmo_conv_code conv_lte_pbch = {
.N = 3,
.K = 7,
.len = 40,
.term = CONV_TERM_TAIL_BITING,
.next_output = conv_lte_pbch_next_output,
.next_state = conv_lte_pbch_next_state,
};
/* ------------------------------------------------------------------------ */
/* Test vectors */
/* ------------------------------------------------------------------------ */
@ -218,6 +269,15 @@ int main(int argc, char *argv[])
.vec_out = { 0x19, 0x42, 0x8a, 0xed, 0x21, 0xed, 0x19, 0x42,
0x8a, 0xed, 0x21, 0xed },
},
{
.name = "LTE PBCH (non-recursive, tail-biting, non-punctured)",
.code = &conv_lte_pbch,
.in_len = 40,
.out_len = 120,
.has_vec = 0,
.vec_in = { },
.vec_out = { },
},
{
.name = "??? (non-recursive, direct truncation, not punctured)",
.code = &conv_trunc,

View File

@ -42,6 +42,14 @@
[..] Encoding / Decoding cycle : OK
[..] Encoding / Decoding cycle : OK
[+] Testing: LTE PBCH (non-recursive, tail-biting, non-punctured)
[.] Input length : ret = 40 exp = 40 -> OK
[.] Output length : ret = 120 exp = 120 -> OK
[.] Random vector checks:
[..] Encoding / Decoding cycle : OK
[..] Encoding / Decoding cycle : OK
[..] Encoding / Decoding cycle : OK
[+] Testing: ??? (non-recursive, direct truncation, not punctured)
[.] Input length : ret = 224 exp = 224 -> OK
[.] Output length : ret = 448 exp = 448 -> OK