neels has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/29474 )
Change subject: improve test output for gsm0808_sc_cfg_from_gsm48_mr_cfg() ...................................................................... improve test output for gsm0808_sc_cfg_from_gsm48_mr_cfg() Improve the test output to make it easier to confirm that the fix in an upcoming patch (I900fda192742fa8f6dd54e9131ef1704b14cc41a) is indeed correct. Spell out each S0-S15 mode along with the bitmask. Rejigger the format of printing the mr_cfg flags, so that the AMR modes line up vertically with the S0-S15 modes. This clearly shows that the mr_cfg <-> s15_s0 conversion is wrong. For example, in this test only 4k75 is enabled, yet we allow configs featuring 6 other rates: Input: cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 m4_75=1 ------- ------- ------- ------- ------- ------- ------- Result (fr): S15-S0 = 0x5701 = 0b0101011100000001 S0 4.75 S8 4.75 5.90 S9 4.75 5.90 6.70 S10 4.75 5.90 6.70 7.40 S12 4.75 5.90 6.70 10.2 S14 4.75 5.90 7.95 12.2 Result (hr): S15-S0 = 0x0701 = 0b0000011100000001 S0 4.75 S8 4.75 5.90 S9 4.75 5.90 6.70 S10 4.75 5.90 6.70 7.40 In this test, an s15_s0 featuring a configuration with 6k70 allowed does not result in m6_70 == 1: Input: S15-S0 = 0x0c12 = 0b0000110000010010 S1 4.75 5.90 7.40 12.2 S4 7.40 S10 4.75 5.90 6.70 7.40 S11 4.75 5.90 6.70 7.40 Output: cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 m4_75=1 ------- m5_90=1 ------- m7_40=1 ------- ------- m12_2=1 Almost every conversion contains errors like this. Related: I900fda192742fa8f6dd54e9131ef1704b14cc41a Change-Id: Iec7c491d9fadd37d9e43fbaac8e709c2029f8a8e --- M tests/gsm0808/gsm0808_test.c M tests/gsm0808/gsm0808_test.ok 2 files changed, 517 insertions(+), 418 deletions(-) Approvals: neels: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c index d7c278f..501b743 100644 --- a/tests/gsm0808/gsm0808_test.c +++ b/tests/gsm0808/gsm0808_test.c @@ -2026,29 +2026,81 @@ msgb_free(msg_cgi_ps); } +static void print_s15_s0(uint16_t s15_s0, bool full_rate) +{ + int i; + printf(" S15-S0 = 0x%04x = 0b" OSMO_BIN_SPEC OSMO_BIN_SPEC "\n", s15_s0, + OSMO_BIN_PRINT(s15_s0 >> 8), OSMO_BIN_PRINT(s15_s0)); + for (i = 0; i < 16; i++) { + uint8_t modes; + int m; + int space; + + if (!(s15_s0 & (1 << i))) + continue; + + space = 6; + if (i < 10) + space++; + + printf(" S%d", i); + + modes = gsm0808_amr_modes_from_cfg[full_rate ? 1 : 0][i]; + if (!modes) { + printf(" (empty)\n"); + continue; + } + + for (m = 0; m < 8; m++) { + if (!(modes & (1 << m))) { + /* avoid whitespace at line ends -- accumulate whitespace width until there is + * non-whitespace to actually be printed.*/ + space += 8; + continue; + } + printf("%*s", space, gsm0808_amr_mode_name(m)); + space = 8; + } + printf("\n"); + } +} + +static void print_mr_cfg(const struct gsm48_multi_rate_conf *cfg) +{ + printf(" cfg.smod=%u spare=%u icmi=%u nscb=%u ver=%u\n", + cfg->smod, cfg->spare, cfg->icmi, cfg->nscb, cfg->ver); + printf(" "); +#define PRINT_MODE_BIT(NAME) do { \ + if (cfg->NAME) \ + printf(" " #NAME "=1"); \ + else \ + printf(" -------"); \ + } while (0) + PRINT_MODE_BIT(m4_75); + PRINT_MODE_BIT(m5_15); + PRINT_MODE_BIT(m5_90); + PRINT_MODE_BIT(m6_70); + PRINT_MODE_BIT(m7_40); + PRINT_MODE_BIT(m7_95); + PRINT_MODE_BIT(m10_2); + PRINT_MODE_BIT(m12_2); + printf("\n"); +} + static void test_gsm0808_sc_cfg_from_gsm48_mr_cfg_single(struct gsm48_multi_rate_conf *cfg) { uint16_t s15_s0; printf("Input:\n"); - printf(" m4_75= %u smod= %u\n", cfg->m4_75, cfg->smod); - printf(" m5_15= %u spare= %u\n", cfg->m5_15, cfg->spare); - printf(" m5_90= %u icmi= %u\n", cfg->m5_90, cfg->icmi); - printf(" m6_70= %u nscb= %u\n", cfg->m6_70, cfg->nscb); - printf(" m7_40= %u ver= %u\n", cfg->m7_40, cfg->ver); - printf(" m7_95= %u\n", cfg->m7_95); - printf(" m10_2= %u\n", cfg->m10_2); - printf(" m12_2= %u\n", cfg->m12_2); + print_mr_cfg(cfg); s15_s0 = gsm0808_sc_cfg_from_gsm48_mr_cfg(cfg, true); printf("Result (fr):\n"); - printf(" S15-S0 = %04x = 0b" OSMO_BIN_SPEC OSMO_BIN_SPEC "\n", s15_s0, - OSMO_BIN_PRINT(s15_s0 >> 8), OSMO_BIN_PRINT(s15_s0)); + print_s15_s0(s15_s0, true); s15_s0 = gsm0808_sc_cfg_from_gsm48_mr_cfg(cfg, false); printf("Result (hr):\n"); - printf(" S15-S0 = %04x = 0b" OSMO_BIN_SPEC OSMO_BIN_SPEC "\n", s15_s0, - OSMO_BIN_PRINT(s15_s0 >> 8), OSMO_BIN_PRINT(s15_s0)); + print_s15_s0(s15_s0, false); printf("\n"); } @@ -2249,20 +2301,12 @@ int rc; printf("Input:\n"); - printf(" S15-S0 = %04x = 0b" OSMO_BIN_SPEC OSMO_BIN_SPEC "\n", s15_s0, - OSMO_BIN_PRINT(s15_s0 >> 8), OSMO_BIN_PRINT(s15_s0)); + print_s15_s0(s15_s0, true); rc = gsm48_mr_cfg_from_gsm0808_sc_cfg(&cfg, s15_s0); printf("Output:\n"); - printf(" m4_75= %u smod= %u\n", cfg.m4_75, cfg.smod); - printf(" m5_15= %u spare= %u\n", cfg.m5_15, cfg.spare); - printf(" m5_90= %u icmi= %u\n", cfg.m5_90, cfg.icmi); - printf(" m6_70= %u nscb= %u\n", cfg.m6_70, cfg.nscb); - printf(" m7_40= %u ver= %u\n", cfg.m7_40, cfg.ver); - printf(" m7_95= %u\n", cfg.m7_95); - printf(" m10_2= %u\n", cfg.m10_2); - printf(" m12_2= %u\n", cfg.m12_2); + print_mr_cfg(&cfg); if (rc != 0) printf(" Result invalid!\n"); diff --git a/tests/gsm0808/gsm0808_test.ok b/tests/gsm0808/gsm0808_test.ok index 8f91eb1..2329fcd 100644 --- a/tests/gsm0808/gsm0808_test.ok +++ b/tests/gsm0808/gsm0808_test.ok @@ -87,549 +87,549 @@ test_gsm0808_enc_dec_cell_id_global: encoded: 05 08 00 21 63 54 23 42 04 23 (rc = 10) Testing gsm0808_sc_cfg_from_gsm48_mr_cfg(): Input: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 0 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 0 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + ------- ------- ------- ------- ------- ------- ------- ------- Result (fr): - S15-S0 = 0000 = 0b0000000000000000 + S15-S0 = 0x0000 = 0b0000000000000000 Result (hr): - S15-S0 = 0000 = 0b0000000000000000 + S15-S0 = 0x0000 = 0b0000000000000000 Input: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 0 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 0 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + m4_75=1 ------- ------- ------- ------- ------- ------- ------- Result (fr): - S15-S0 = 5701 = 0b0101011100000001 + S15-S0 = 0x5701 = 0b0101011100000001 + S0 4.75 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S12 4.75 5.90 6.70 10.2 + S14 4.75 5.90 7.95 12.2 Result (hr): - S15-S0 = 0701 = 0b0000011100000001 + S15-S0 = 0x0701 = 0b0000011100000001 + S0 4.75 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 Input: - m4_75= 0 smod= 0 - m5_15= 1 spare= 0 - m5_90= 0 icmi= 0 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 0 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + ------- m5_15=1 ------- ------- ------- ------- ------- ------- Result (fr): - S15-S0 = 0000 = 0b0000000000000000 + S15-S0 = 0x0000 = 0b0000000000000000 Result (hr): - S15-S0 = 0000 = 0b0000000000000000 + S15-S0 = 0x0000 = 0b0000000000000000 Input: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 0 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 0 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + ------- ------- m5_90=1 ------- ------- ------- ------- ------- Result (fr): - S15-S0 = 5704 = 0b0101011100000100 + S15-S0 = 0x5704 = 0b0101011100000100 + S2 5.90 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S12 4.75 5.90 6.70 10.2 + S14 4.75 5.90 7.95 12.2 Result (hr): - S15-S0 = 0704 = 0b0000011100000100 + S15-S0 = 0x0704 = 0b0000011100000100 + S2 5.90 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 Input: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 0 - m6_70= 1 nscb= 0 - m7_40= 0 ver= 0 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + ------- ------- ------- m6_70=1 ------- ------- ------- ------- Result (fr): - S15-S0 = 1608 = 0b0001011000001000 + S15-S0 = 0x1608 = 0b0001011000001000 + S3 6.70 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S12 4.75 5.90 6.70 10.2 Result (hr): - S15-S0 = 0608 = 0b0000011000001000 + S15-S0 = 0x0608 = 0b0000011000001000 + S3 6.70 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 Input: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 0 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 0 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + ------- ------- ------- ------- m7_40=1 ------- ------- ------- Result (fr): - S15-S0 = 0410 = 0b0000010000010000 + S15-S0 = 0x0410 = 0b0000010000010000 + S4 7.40 + S10 4.75 5.90 6.70 7.40 Result (hr): - S15-S0 = 0410 = 0b0000010000010000 + S15-S0 = 0x0410 = 0b0000010000010000 + S4 7.40 + S10 4.75 5.90 6.70 7.40 Input: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 0 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 0 - m7_95= 1 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + ------- ------- ------- ------- ------- m7_95=1 ------- ------- Result (fr): - S15-S0 = 4020 = 0b0100000000100000 + S15-S0 = 0x4020 = 0b0100000000100000 + S5 7.95 + S14 4.75 5.90 7.95 12.2 Result (hr): - S15-S0 = 0020 = 0b0000000000100000 + S15-S0 = 0x0020 = 0b0000000000100000 + S5 7.95 Input: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 0 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 0 - m7_95= 0 - m10_2= 1 - m12_2= 0 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + ------- ------- ------- ------- ------- ------- m10_2=1 ------- Result (fr): - S15-S0 = 1040 = 0b0001000001000000 + S15-S0 = 0x1040 = 0b0001000001000000 + S6 10.2 + S12 4.75 5.90 6.70 10.2 Result (hr): - S15-S0 = 0000 = 0b0000000000000000 + S15-S0 = 0x0000 = 0b0000000000000000 Input: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 0 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 0 - m7_95= 0 - m10_2= 0 - m12_2= 1 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + ------- ------- ------- ------- ------- ------- ------- m12_2=1 Result (fr): - S15-S0 = 4080 = 0b0100000010000000 + S15-S0 = 0x4080 = 0b0100000010000000 + S7 12.2 + S14 4.75 5.90 7.95 12.2 Result (hr): - S15-S0 = 0000 = 0b0000000000000000 + S15-S0 = 0x0000 = 0b0000000000000000 Input: - m4_75= 1 smod= 0 - m5_15= 1 spare= 0 - m5_90= 1 icmi= 0 - m6_70= 1 nscb= 0 - m7_40= 0 ver= 0 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + m4_75=1 m5_15=1 m5_90=1 m6_70=1 ------- ------- ------- ------- Result (fr): - S15-S0 = 570d = 0b0101011100001101 + S15-S0 = 0x570d = 0b0101011100001101 + S0 4.75 + S2 5.90 + S3 6.70 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S12 4.75 5.90 6.70 10.2 + S14 4.75 5.90 7.95 12.2 Result (hr): - S15-S0 = 070d = 0b0000011100001101 + S15-S0 = 0x070d = 0b0000011100001101 + S0 4.75 + S2 5.90 + S3 6.70 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 Input: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 0 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 0 - m7_95= 1 - m10_2= 1 - m12_2= 1 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + ------- ------- ------- ------- m7_40=1 m7_95=1 m10_2=1 m12_2=1 Result (fr): - S15-S0 = 54f0 = 0b0101010011110000 + S15-S0 = 0x54f0 = 0b0101010011110000 + S4 7.40 + S5 7.95 + S6 10.2 + S7 12.2 + S10 4.75 5.90 6.70 7.40 + S12 4.75 5.90 6.70 10.2 + S14 4.75 5.90 7.95 12.2 Result (hr): - S15-S0 = 0430 = 0b0000010000110000 + S15-S0 = 0x0430 = 0b0000010000110000 + S4 7.40 + S5 7.95 + S10 4.75 5.90 6.70 7.40 Input: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 0 - m6_70= 1 nscb= 0 - m7_40= 0 ver= 0 - m7_95= 0 - m10_2= 1 - m12_2= 1 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + ------- ------- m5_90=1 m6_70=1 ------- ------- m10_2=1 m12_2=1 Result (fr): - S15-S0 = 57cc = 0b0101011111001100 + S15-S0 = 0x57cc = 0b0101011111001100 + S2 5.90 + S3 6.70 + S6 10.2 + S7 12.2 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S12 4.75 5.90 6.70 10.2 + S14 4.75 5.90 7.95 12.2 Result (hr): - S15-S0 = 070c = 0b0000011100001100 + S15-S0 = 0x070c = 0b0000011100001100 + S2 5.90 + S3 6.70 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 Input: - m4_75= 1 smod= 0 - m5_15= 1 spare= 0 - m5_90= 0 icmi= 0 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 0 - m7_95= 1 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + m4_75=1 m5_15=1 ------- ------- m7_40=1 m7_95=1 ------- ------- Result (fr): - S15-S0 = 5731 = 0b0101011100110001 + S15-S0 = 0x5731 = 0b0101011100110001 + S0 4.75 + S4 7.40 + S5 7.95 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S12 4.75 5.90 6.70 10.2 + S14 4.75 5.90 7.95 12.2 Result (hr): - S15-S0 = 0731 = 0b0000011100110001 + S15-S0 = 0x0731 = 0b0000011100110001 + S0 4.75 + S4 7.40 + S5 7.95 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 Input: - m4_75= 0 smod= 0 - m5_15= 1 spare= 0 - m5_90= 0 icmi= 0 - m6_70= 1 nscb= 0 - m7_40= 0 ver= 0 - m7_95= 1 - m10_2= 0 - m12_2= 1 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + ------- m5_15=1 ------- m6_70=1 ------- m7_95=1 ------- m12_2=1 Result (fr): - S15-S0 = 56a8 = 0b0101011010101000 + S15-S0 = 0x56a8 = 0b0101011010101000 + S3 6.70 + S5 7.95 + S7 12.2 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S12 4.75 5.90 6.70 10.2 + S14 4.75 5.90 7.95 12.2 Result (hr): - S15-S0 = 0628 = 0b0000011000101000 + S15-S0 = 0x0628 = 0b0000011000101000 + S3 6.70 + S5 7.95 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 Input: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 0 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 0 - m7_95= 0 - m10_2= 1 - m12_2= 0 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + m4_75=1 ------- m5_90=1 ------- m7_40=1 ------- m10_2=1 ------- Result (fr): - S15-S0 = 5755 = 0b0101011101010101 + S15-S0 = 0x5755 = 0b0101011101010101 + S0 4.75 + S2 5.90 + S4 7.40 + S6 10.2 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S12 4.75 5.90 6.70 10.2 + S14 4.75 5.90 7.95 12.2 Result (hr): - S15-S0 = 0717 = 0b0000011100010111 + S15-S0 = 0x0717 = 0b0000011100010111 + S0 4.75 + S1 4.75 5.90 7.40 + S2 5.90 + S4 7.40 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 Input: - m4_75= 1 smod= 0 - m5_15= 1 spare= 0 - m5_90= 1 icmi= 0 - m6_70= 1 nscb= 0 - m7_40= 1 ver= 0 - m7_95= 1 - m10_2= 1 - m12_2= 1 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + m4_75=1 m5_15=1 m5_90=1 m6_70=1 m7_40=1 m7_95=1 m10_2=1 m12_2=1 Result (fr): - S15-S0 = 57ff = 0b0101011111111111 + S15-S0 = 0x57ff = 0b0101011111111111 + S0 4.75 + S1 4.75 5.90 7.40 12.2 + S2 5.90 + S3 6.70 + S4 7.40 + S5 7.95 + S6 10.2 + S7 12.2 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S12 4.75 5.90 6.70 10.2 + S14 4.75 5.90 7.95 12.2 Result (hr): - S15-S0 = 073f = 0b0000011100111111 + S15-S0 = 0x073f = 0b0000011100111111 + S0 4.75 + S1 4.75 5.90 7.40 + S2 5.90 + S3 6.70 + S4 7.40 + S5 7.95 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 Input: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 0 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 0 - m7_95= 0 - m10_2= 0 - m12_2= 1 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + m4_75=1 ------- m5_90=1 ------- m7_40=1 ------- ------- m12_2=1 Result (fr): - S15-S0 = 5797 = 0b0101011110010111 + S15-S0 = 0x5797 = 0b0101011110010111 + S0 4.75 + S1 4.75 5.90 7.40 12.2 + S2 5.90 + S4 7.40 + S7 12.2 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S12 4.75 5.90 6.70 10.2 + S14 4.75 5.90 7.95 12.2 Result (hr): - S15-S0 = 0717 = 0b0000011100010111 + S15-S0 = 0x0717 = 0b0000011100010111 + S0 4.75 + S1 4.75 5.90 7.40 + S2 5.90 + S4 7.40 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 Input: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 0 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 0 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=0 nscb=0 ver=0 + m4_75=1 ------- m5_90=1 ------- m7_40=1 ------- ------- ------- Result (fr): - S15-S0 = 5715 = 0b0101011100010101 + S15-S0 = 0x5715 = 0b0101011100010101 + S0 4.75 + S2 5.90 + S4 7.40 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S12 4.75 5.90 6.70 10.2 + S14 4.75 5.90 7.95 12.2 Result (hr): - S15-S0 = 0717 = 0b0000011100010111 + S15-S0 = 0x0717 = 0b0000011100010111 + S0 4.75 + S1 4.75 5.90 7.40 + S2 5.90 + S4 7.40 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 Testing gsm48_mr_cfg_from_gsm0808_sc_cfg(): Input: - S15-S0 = ff03 = 0b1111111100000011 + S15-S0 = 0xff03 = 0b1111111100000011 + S0 4.75 + S1 4.75 5.90 7.40 12.2 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S11 (empty) + S12 4.75 5.90 6.70 10.2 + S13 (empty) + S14 4.75 5.90 7.95 12.2 + S15 (empty) Output: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 1 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + m4_75=1 ------- m5_90=1 ------- m7_40=1 ------- ------- m12_2=1 Input: - S15-S0 = 0000 = 0b0000000000000000 + S15-S0 = 0x0000 = 0b0000000000000000 Output: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + ------- ------- ------- ------- ------- ------- ------- ------- Result invalid! Input: - S15-S0 = ff06 = 0b1111111100000110 + S15-S0 = 0xff06 = 0b1111111100000110 + S1 4.75 5.90 7.40 12.2 + S2 5.90 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S11 (empty) + S12 4.75 5.90 6.70 10.2 + S13 (empty) + S14 4.75 5.90 7.95 12.2 + S15 (empty) Output: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 1 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + m4_75=1 ------- m5_90=1 ------- m7_40=1 ------- ------- m12_2=1 Input: - S15-S0 = 3e08 = 0b0011111000001000 + S15-S0 = 0x3e08 = 0b0011111000001000 + S3 6.70 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S11 (empty) + S12 4.75 5.90 6.70 10.2 + S13 (empty) Output: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 1 - m6_70= 1 nscb= 0 - m7_40= 0 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + ------- ------- ------- m6_70=1 ------- ------- ------- ------- Input: - S15-S0 = 0c12 = 0b0000110000010010 + S15-S0 = 0x0c12 = 0b0000110000010010 + S1 4.75 5.90 7.40 12.2 + S4 7.40 + S10 4.75 5.90 6.70 7.40 + S11 (empty) Output: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 1 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + m4_75=1 ------- m5_90=1 ------- m7_40=1 ------- ------- m12_2=1 Input: - S15-S0 = c020 = 0b1100000000100000 + S15-S0 = 0xc020 = 0b1100000000100000 + S5 7.95 + S14 4.75 5.90 7.95 12.2 + S15 (empty) Output: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 1 - m7_95= 1 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + ------- ------- ------- ------- ------- m7_95=1 ------- ------- Input: - S15-S0 = 3040 = 0b0011000001000000 + S15-S0 = 0x3040 = 0b0011000001000000 + S6 10.2 + S12 4.75 5.90 6.70 10.2 + S13 (empty) Output: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 1 - m7_95= 0 - m10_2= 1 - m12_2= 0 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + ------- ------- ------- ------- ------- ------- m10_2=1 ------- Input: - S15-S0 = c082 = 0b1100000010000010 + S15-S0 = 0xc082 = 0b1100000010000010 + S1 4.75 5.90 7.40 12.2 + S7 12.2 + S14 4.75 5.90 7.95 12.2 + S15 (empty) Output: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 1 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + m4_75=1 ------- m5_90=1 ------- m7_40=1 ------- ------- m12_2=1 Input: - S15-S0 = 0001 = 0b0000000000000001 + S15-S0 = 0x0001 = 0b0000000000000001 + S0 4.75 Output: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + m4_75=1 ------- ------- ------- ------- ------- ------- ------- Input: - S15-S0 = 0002 = 0b0000000000000010 + S15-S0 = 0x0002 = 0b0000000000000010 + S1 4.75 5.90 7.40 12.2 Output: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 1 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + m4_75=1 ------- m5_90=1 ------- m7_40=1 ------- ------- m12_2=1 Input: - S15-S0 = 0004 = 0b0000000000000100 + S15-S0 = 0x0004 = 0b0000000000000100 + S2 5.90 Output: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + ------- ------- m5_90=1 ------- ------- ------- ------- ------- Input: - S15-S0 = 0008 = 0b0000000000001000 + S15-S0 = 0x0008 = 0b0000000000001000 + S3 6.70 Output: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 1 - m6_70= 1 nscb= 0 - m7_40= 0 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + ------- ------- ------- m6_70=1 ------- ------- ------- ------- Input: - S15-S0 = 0010 = 0b0000000000010000 + S15-S0 = 0x0010 = 0b0000000000010000 + S4 7.40 Output: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + ------- ------- ------- ------- m7_40=1 ------- ------- ------- Input: - S15-S0 = 0020 = 0b0000000000100000 + S15-S0 = 0x0020 = 0b0000000000100000 + S5 7.95 Output: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 1 - m7_95= 1 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + ------- ------- ------- ------- ------- m7_95=1 ------- ------- Input: - S15-S0 = 0040 = 0b0000000001000000 + S15-S0 = 0x0040 = 0b0000000001000000 + S6 10.2 Output: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 1 - m7_95= 0 - m10_2= 1 - m12_2= 0 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + ------- ------- ------- ------- ------- ------- m10_2=1 ------- Input: - S15-S0 = 0080 = 0b0000000010000000 + S15-S0 = 0x0080 = 0b0000000010000000 + S7 12.2 Output: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 1 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + ------- ------- ------- ------- ------- ------- ------- m12_2=1 Input: - S15-S0 = 0058 = 0b0000000001011000 + S15-S0 = 0x0058 = 0b0000000001011000 + S3 6.70 + S4 7.40 + S6 10.2 Output: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 1 - m6_70= 1 nscb= 0 - m7_40= 1 ver= 1 - m7_95= 0 - m10_2= 1 - m12_2= 0 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + ------- ------- ------- m6_70=1 m7_40=1 ------- m10_2=1 ------- Input: - S15-S0 = 0021 = 0b0000000000100001 + S15-S0 = 0x0021 = 0b0000000000100001 + S0 4.75 + S5 7.95 Output: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 1 - m7_95= 1 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + m4_75=1 ------- ------- ------- ------- m7_95=1 ------- ------- Input: - S15-S0 = 0084 = 0b0000000010000100 + S15-S0 = 0x0084 = 0b0000000010000100 + S2 5.90 + S7 12.2 Output: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 1 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + ------- ------- m5_90=1 ------- ------- ------- ------- m12_2=1 Input: - S15-S0 = 0086 = 0b0000000010000110 + S15-S0 = 0x0086 = 0b0000000010000110 + S1 4.75 5.90 7.40 12.2 + S2 5.90 + S7 12.2 Output: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 1 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + m4_75=1 ------- m5_90=1 ------- m7_40=1 ------- ------- m12_2=1 Input: - S15-S0 = 000a = 0b0000000000001010 + S15-S0 = 0x000a = 0b0000000000001010 + S1 4.75 5.90 7.40 12.2 + S3 6.70 Output: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 1 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + m4_75=1 ------- m5_90=1 ------- m7_40=1 ------- ------- m12_2=1 Result invalid! Input: - S15-S0 = 0079 = 0b0000000001111001 + S15-S0 = 0x0079 = 0b0000000001111001 + S0 4.75 + S3 6.70 + S4 7.40 + S5 7.95 + S6 10.2 Output: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 1 - m6_70= 1 nscb= 0 - m7_40= 1 ver= 1 - m7_95= 1 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + m4_75=1 ------- ------- m6_70=1 m7_40=1 m7_95=1 ------- ------- Result invalid! Input: - S15-S0 = 0000 = 0b0000000000000000 + S15-S0 = 0x0000 = 0b0000000000000000 Output: - m4_75= 0 smod= 0 - m5_15= 0 spare= 0 - m5_90= 0 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 0 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 0 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + ------- ------- ------- ------- ------- ------- ------- ------- Result invalid! Input: - S15-S0 = ffff = 0b1111111111111111 + S15-S0 = 0xffff = 0b1111111111111111 + S0 4.75 + S1 4.75 5.90 7.40 12.2 + S2 5.90 + S3 6.70 + S4 7.40 + S5 7.95 + S6 10.2 + S7 12.2 + S8 4.75 5.90 + S9 4.75 5.90 6.70 + S10 4.75 5.90 6.70 7.40 + S11 (empty) + S12 4.75 5.90 6.70 10.2 + S13 (empty) + S14 4.75 5.90 7.95 12.2 + S15 (empty) Output: - m4_75= 1 smod= 0 - m5_15= 0 spare= 0 - m5_90= 1 icmi= 1 - m6_70= 0 nscb= 0 - m7_40= 1 ver= 1 - m7_95= 0 - m10_2= 0 - m12_2= 1 + cfg.smod=0 spare=0 icmi=1 nscb=0 ver=1 + m4_75=1 ------- m5_90=1 ------- m7_40=1 ------- ------- m12_2=1 Result invalid! -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/29474 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Iec7c491d9fadd37d9e43fbaac8e709c2029f8a8e Gerrit-Change-Number: 29474 Gerrit-PatchSet: 4 Gerrit-Owner: neels <nhofm...@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pma...@sysmocom.de> Gerrit-Reviewer: laforge <lafo...@osmocom.org> Gerrit-Reviewer: neels <nhofm...@sysmocom.de> Gerrit-Reviewer: pespin <pes...@sysmocom.de> Gerrit-MessageType: merged