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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Sun Jan 8 15:48:07 UTC 2017


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

tests/conv: add LTE PBCH test vector

Change-Id: Ifea601d49c82c36d7c8d4a527b7422d701833806
---
M tests/conv/conv_codes.c
M tests/conv/conv_test.h
M tests/conv/conv_test.ok
M tests/conv/conv_test_vectors.c
4 files changed, 70 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/43/1543/1

diff --git a/tests/conv/conv_codes.c b/tests/conv/conv_codes.c
index 8bcf05f..c3be8ef 100644
--- a/tests/conv/conv_codes.c
+++ b/tests/conv/conv_codes.c
@@ -139,3 +139,54 @@
 	.next_output = conv_wimax_fch_next_output,
 	.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,
+};
diff --git a/tests/conv/conv_test.h b/tests/conv/conv_test.h
index 41e8686..c6c8926 100644
--- a/tests/conv/conv_test.h
+++ b/tests/conv/conv_test.h
@@ -2,7 +2,7 @@
 
 #include <osmocom/core/conv.h>
 
-#define TEST_VEC_COUNT	5
+#define TEST_VEC_COUNT	6
 #define MAX_LEN_BITS	512
 #define MAX_LEN_BYTES	(512 / 8)
 
@@ -21,4 +21,5 @@
 /* Non GSM specific codes */
 const struct osmo_conv_code conv_gmr1_tch3_speech;
 const struct osmo_conv_code conv_wimax_fch;
+const struct osmo_conv_code conv_lte_pbch;
 const struct osmo_conv_code conv_trunc;
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
diff --git a/tests/conv/conv_test_vectors.c b/tests/conv/conv_test_vectors.c
index 8b245d3..c1da68a 100644
--- a/tests/conv/conv_test_vectors.c
+++ b/tests/conv/conv_test_vectors.c
@@ -67,6 +67,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,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifea601d49c82c36d7c8d4a527b7422d701833806
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