[PATCH] libosmocore[master]: tests/conv: add LTE PBCH test vector

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Sun Jan 15 05:56:19 UTC 2017


Review at  https://gerrit.osmocom.org/1601

tests/conv: add LTE PBCH test vector

Change-Id: I1a3a48bba9ee32a0bacc0b05d25358496dbcbc1b
---
M tests/conv/conv_test.c
M tests/conv/conv_test.ok
2 files changed, 68 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/01/1601/1

diff --git a/tests/conv/conv_test.c b/tests/conv/conv_test.c
index 608f829..ed1257e 100644
--- a/tests/conv/conv_test.c
+++ b/tests/conv/conv_test.c
@@ -120,6 +120,57 @@
 	.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                                                             */
 /* ------------------------------------------------------------------------ */
@@ -219,6 +270,15 @@
 						 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,
 			.in_len  = 224,
diff --git a/tests/conv/conv_test.ok b/tests/conv/conv_test.ok
index 2122961..eceadb0 100644
--- a/tests/conv/conv_test.ok
+++ b/tests/conv/conv_test.ok
@@ -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

-- 
To view, visit https://gerrit.osmocom.org/1601
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a3a48bba9ee32a0bacc0b05d25358496dbcbc1b
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>


More information about the gerrit-log mailing list