lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

May 2022

  • 2 participants
  • 1343 discussions
Change in osmo-e1-hardware[master]: gateware/icE1usb: Don't let nextpnr promote globals
by tnt 03 May '22

03 May '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/28009 ) Change subject: gateware/icE1usb: Don't let nextpnr promote globals ...................................................................... gateware/icE1usb: Don't let nextpnr promote globals We manually use global buffers for the signals that need to be global, don't let nextpnr heuristic mess with things. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I5dc5f2f39dca933b2570cbe4e26d9d7fd2a44688 --- M gateware/icE1usb/Makefile 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/09/28009/1 diff --git a/gateware/icE1usb/Makefile b/gateware/icE1usb/Makefile index 2bfd1b5..790a1cb 100644 --- a/gateware/icE1usb/Makefile +++ b/gateware/icE1usb/Makefile @@ -38,7 +38,7 @@ SEED ?= 15 YOSYS_SYNTH_ARGS := -NEXTPNR_ARGS := --pre-pack data/clocks.py --pre-pack data/opt.py --seed $(SEED) +NEXTPNR_ARGS := --pre-pack data/clocks.py --pre-pack data/opt.py --seed $(SEED) --no-promote-globals ifeq ($(IGNORE_TIMING),1) NEXTPNR_ARGS += --timing-allow-fail -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/28009 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: I5dc5f2f39dca933b2570cbe4e26d9d7fd2a44688 Gerrit-Change-Number: 28009 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-e1-hardware[master]: gateware/icE1usb: Replace local I2C core with no2misc one
by tnt 03 May '22

03 May '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/28011 ) Change subject: gateware/icE1usb: Replace local I2C core with no2misc one ...................................................................... gateware/icE1usb: Replace local I2C core with no2misc one This core has been merged (and improved) upstream, so update the submodule, remove local copy and make the required tweaks. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I79fca561fee32bbaec94882b4f65c7ecaa44be11 --- M gateware/cores/no2misc M gateware/icE1usb/Makefile D gateware/icE1usb/rtl/i2c_master.v D gateware/icE1usb/rtl/i2c_master_wb.v M gateware/icE1usb/rtl/top.v 5 files changed, 7 insertions(+), 313 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/11/28011/1 diff --git a/gateware/cores/no2misc b/gateware/cores/no2misc index 16103ac..f9d1d47 160000 --- a/gateware/cores/no2misc +++ b/gateware/cores/no2misc @@ -1 +1 @@ -Subproject commit 16103ac61c8f11e63e043229a0a7a085bc38bde0 +Subproject commit f9d1d47620ce81e9545287c585a5e8f0873b1661 diff --git a/gateware/icE1usb/Makefile b/gateware/icE1usb/Makefile index 790a1cb..8c3f49a 100644 --- a/gateware/icE1usb/Makefile +++ b/gateware/icE1usb/Makefile @@ -3,8 +3,6 @@ PROJ_DEPS := no2e1 no2ice40 no2misc no2usb PROJ_RTL_SRCS := $(addprefix rtl/, \ - i2c_master.v \ - i2c_master_wb.v \ led_blinker.v \ misc.v \ sr_btn_if.v \ diff --git a/gateware/icE1usb/rtl/i2c_master.v b/gateware/icE1usb/rtl/i2c_master.v deleted file mode 100644 index 16e7555..0000000 --- a/gateware/icE1usb/rtl/i2c_master.v +++ /dev/null @@ -1,192 +0,0 @@ -/* - * i2c_master.v - * - * vim: ts=4 sw=4 - * - * Copyright (C) 2019-2020 Sylvain Munaut <tnt(a)246tNt.com> - * SPDX-License-Identifier: CERN-OHL-P-2.0 - */ - -`default_nettype none - -module i2c_master #( - parameter integer DW = 3 -)( - // IOs - output reg scl_oe, - output reg sda_oe, - input wire sda_i, - - // Control - input wire [7:0] data_in, - input wire ack_in, - input wire [1:0] cmd, - input wire stb, - - output wire [7:0] data_out, - output wire ack_out, - - output wire ready, - - // Clock / Reset - input wire clk, - input wire rst -); - - // Commands - localparam [2:0] CMD_START = 3'b00; - localparam [2:0] CMD_STOP = 3'b01; - localparam [2:0] CMD_WRITE = 3'b10; - localparam [2:0] CMD_READ = 3'b11; - - // FSM states - localparam - ST_IDLE = 0, - ST_LOWER_SCL = 1, - ST_LOW_CYCLE = 2, - ST_RISE_SCL = 3, - ST_HIGH_CYCLE = 4; - - - // Signals - // ------- - - reg [2:0] state; - reg [2:0] state_nxt; - - reg [1:0] cmd_cur; - - reg [DW:0] cyc_cnt; - wire cyc_now; - - reg [3:0] bit_cnt; - wire bit_last; - - reg [8:0] data_reg; - - - // State Machine - // ------------- - - always @(posedge clk) - if (rst) - state <= ST_IDLE; - else - state <= state_nxt; - - always @(*) - begin - // Default is to stay put - state_nxt = state; - - // Act depending on current state - case (state) - ST_IDLE: - if (stb) - state_nxt = ST_LOW_CYCLE; - - ST_LOW_CYCLE: - if (cyc_now) - state_nxt = ST_RISE_SCL; - - ST_RISE_SCL: - if (cyc_now) - state_nxt = ST_HIGH_CYCLE; - - ST_HIGH_CYCLE: - if (cyc_now) - state_nxt = (cmd_cur == 2'b01) ? ST_IDLE : ST_LOWER_SCL; - - ST_LOWER_SCL: - if (cyc_now) - state_nxt = bit_last ? ST_IDLE : ST_LOW_CYCLE; - endcase - end - - // Misc control - // ------------ - - always @(posedge clk) - if (stb) - cmd_cur <= cmd; - - - // Baud Rate generator - // ------------------- - - always @(posedge clk) - if (state == ST_IDLE) - cyc_cnt <= 0; - else - cyc_cnt <= cyc_cnt[DW] ? 0 : (cyc_cnt + 1); - - assign cyc_now = cyc_cnt[DW]; - - - // Bit count - // --------- - - always @(posedge clk) - if ((state == ST_LOWER_SCL) && cyc_now) - bit_cnt <= bit_cnt + 1; - else if (stb) - case (cmd) - 2'b00: bit_cnt <= 4'h8; // START - 2'b01: bit_cnt <= 4'h8; // STOP - 2'b10: bit_cnt <= 4'h0; // Write - 2'b11: bit_cnt <= 4'h0; // Read - default: bit_cnt <= 4'hx; - endcase - - assign bit_last = bit_cnt[3]; - - - // Data register - // ------------- - - always @(posedge clk) - if ((state == ST_HIGH_CYCLE) && cyc_now) - data_reg <= { data_reg[7:0], sda_i }; - else if (stb) - // Only handle Write / Read. START & STOP is handled in IO mux - data_reg <= cmd[0] ? { 8'b11111111, ack_in } : { data_in, 1'b1 }; - - - // IO - // -- - - always @(posedge clk) - if (rst) - scl_oe <= 1'b0; - else if (cyc_now) begin - if (state == ST_LOWER_SCL) - scl_oe <= 1'b1; - else if (state == ST_RISE_SCL) - scl_oe <= 1'b0; - end - - always @(posedge clk) - if (rst) - sda_oe <= 1'b0; - else if (cyc_now) begin - if (~cmd_cur[1]) begin - if (state == ST_LOW_CYCLE) - sda_oe <= cmd_cur[0]; - else if (state == ST_HIGH_CYCLE) - sda_oe <= ~cmd_cur[0]; - end else begin - if (state == ST_LOW_CYCLE) - sda_oe <= ~data_reg[8]; - end - end - - - // User IF - // ------- - - assign data_out = data_reg[8:1]; - assign ack_out = data_reg[0]; - - assign ready = (state == ST_IDLE); - -endmodule diff --git a/gateware/icE1usb/rtl/i2c_master_wb.v b/gateware/icE1usb/rtl/i2c_master_wb.v deleted file mode 100644 index 0a54971..0000000 --- a/gateware/icE1usb/rtl/i2c_master_wb.v +++ /dev/null @@ -1,102 +0,0 @@ -/* - * i2c_master_wb.v - * - * vim: ts=4 sw=4 - * - * Wishbone wrapper with optional buffering for i2c_master core - * - * Copyright (C) 2019-2020 Sylvain Munaut <tnt(a)246tNt.com> - * SPDX-License-Identifier: CERN-OHL-P-2.0 - */ - -`default_nettype none - -module i2c_master_wb #( - parameter integer DW = 3, - parameter integer FIFO_DEPTH = 0 -)( - // IOs - output wire scl_oe, - output wire sda_oe, - input wire sda_i, - - // Wishbone - output wire [31:0] wb_rdata, - input wire [31:0] wb_wdata, - input wire wb_we, - input wire wb_cyc, - output wire wb_ack, - - output wire ready, - - // Clock / Reset - input wire clk, - input wire rst -); - - // Signals - // ------- - - wire [7:0] data_in; - wire ack_in; - wire [1:0] cmd; - wire stb; - wire [7:0] data_out; - wire ack_out; - - - // Core - // ---- - - i2c_master #( - .DW(DW) - ) core_I ( - .scl_oe (scl_oe), - .sda_oe (sda_oe), - .sda_i (sda_i), - .data_in (data_in), - .ack_in (ack_in), - .cmd (cmd), - .stb (stb), - .data_out(data_out), - .ack_out (ack_out), - .ready (ready), - .clk (clk), - .rst (rst) - ); - - - // Bus interface (no buffer) - // ------------- - - if (FIFO_DEPTH == 0) begin - // No buffer - assign wb_rdata = wb_cyc ? { ready, 22'd0, ack_out, data_out } : 32'h00000000; - - assign cmd = wb_wdata[13:12]; - assign ack_in = wb_wdata[8]; - assign data_in = wb_wdata[7:0]; - - assign stb = wb_cyc & wb_we; - - assign wb_ack = wb_cyc; - end - - - // Bus interface (FIFO) - // ------------- - - if (FIFO_DEPTH > 0) begin - - // Signals - // ------- - - - // FIFOs - // ----- - - - - end - -endmodule diff --git a/gateware/icE1usb/rtl/top.v b/gateware/icE1usb/rtl/top.v index b38f97a..fdf75a1 100644 --- a/gateware/icE1usb/rtl/top.v +++ b/gateware/icE1usb/rtl/top.v @@ -105,6 +105,7 @@ // I2C wire i2c_scl_oe; + wire i2c_scl_i; wire i2c_sda_oe; wire i2c_sda_i; @@ -319,6 +320,7 @@ .FIFO_DEPTH(0) ) i2c_I ( .scl_oe (i2c_scl_oe), + .scl_i (i2c_scl_i), .sda_oe (i2c_sda_oe), .sda_i (i2c_sda_i), .wb_rdata(wb_rdata[2]), @@ -326,34 +328,22 @@ .wb_we (wb_we), .wb_cyc (wb_cyc[2]), .wb_ack (wb_ack[2]), - .ready (), .clk (clk_sys), .rst (rst_sys) ); // IOBs SB_IO #( - .PIN_TYPE(6'b110101), - .PULLUP(1'b1), - .IO_STANDARD("SB_LVCMOS") - ) i2c_scl_iob_I ( - .PACKAGE_PIN (i2c_scl), - .OUTPUT_CLK (clk_sys), - .OUTPUT_ENABLE(i2c_scl_oe), - .D_OUT_0 (1'b0) - ); - - SB_IO #( .PIN_TYPE(6'b110100), .PULLUP(1'b1), .IO_STANDARD("SB_LVCMOS") - ) i2c_sda_iob_I ( - .PACKAGE_PIN (i2c_sda), + ) i2c_iob_I[1:0] ( + .PACKAGE_PIN ({i2c_scl, i2c_sda}), .INPUT_CLK (clk_sys), .OUTPUT_CLK (clk_sys), - .OUTPUT_ENABLE(i2c_sda_oe), + .OUTPUT_ENABLE({i2c_scl_oe, i2c_sda_oe}), .D_OUT_0 (1'b0), - .D_IN_0 (i2c_sda_i) + .D_IN_0 ({i2c_scl_i, i2c_sda_i}) ); `else -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/28011 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: I79fca561fee32bbaec94882b4f65c7ecaa44be11 Gerrit-Change-Number: 28011 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-e1-hardware[master]: gateware/common: Unify a bit with other repo
by tnt 03 May '22

03 May '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/28008 ) Change subject: gateware/common: Unify a bit with other repo ...................................................................... gateware/common: Unify a bit with other repo This just pulls in some small update in various files shared by several repository. It's mostly comment and formatting, nothing functionnal really. Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: Icb7bea1cf7243e9ace819cd567eb006fcc71c808 --- M gateware/common/fw/Makefile D gateware/common/fw/bin2hex.py M gateware/common/fw/boot.S M gateware/common/rtl/soc_picorv32_bridge.v 4 files changed, 72 insertions(+), 41 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1-hardware refs/changes/08/28008/1 diff --git a/gateware/common/fw/Makefile b/gateware/common/fw/Makefile index 3fef9a5..52889ee 100644 --- a/gateware/common/fw/Makefile +++ b/gateware/common/fw/Makefile @@ -1,12 +1,14 @@ -CROSS = riscv-none-embed- +CROSS ?= riscv-none-embed- CC := $(CROSS)gcc OBJCOPY := $(CROSS)objcopy -CFLAGS=-Wall -Os -march=rv32i -mabi=ilp32 -ffreestanding -flto -nostartfiles -fomit-frame-pointer -Wl,--gc-section +CFLAGS=-Wall -Os -march=rv32i -mabi=ilp32 -ffreestanding -flto -nostartfiles -fomit-frame-pointer -Wl,--gc-section --specs=nano.specs + all: boot.hex + boot.elf: lnk-boot.lds boot.S $(CC) $(CFLAGS) -Wl,-Bstatic,-T,lnk-boot.lds,--strip-debug -DAPP_FLASH_ADDR=0x000a0000 -o $@ boot.S @@ -14,7 +16,7 @@ $(OBJCOPY) -O binary $< $@ %.hex: %.bin - ./bin2hex.py $< $@ + hexdump boot.bin -ve '1/4 "%08x\n"' $< > $@ clean: rm -f *.bin *.hex *.elf *.o diff --git a/gateware/common/fw/bin2hex.py b/gateware/common/fw/bin2hex.py deleted file mode 100755 index 43ba263..0000000 --- a/gateware/common/fw/bin2hex.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python3 -# -# Converts binary into something that can be used by `readmemh` -# -# Copyright (C) 2020 Sylvain Munaut <tnt(a)246tNt.com> -# SPDX-License-Identifier: MIT -# - -import struct -import sys - - -def main(argv0, in_name, out_name): - with open(in_name, 'rb') as in_fh, open(out_name, 'w') as out_fh: - while True: - b = in_fh.read(4) - if len(b) < 4: - break - out_fh.write('%08x\n' % struct.unpack('<I', b)) - -if __name__ == '__main__': - main(*sys.argv) diff --git a/gateware/common/fw/boot.S b/gateware/common/fw/boot.S index df4f41b..b01fc80 100644 --- a/gateware/common/fw/boot.S +++ b/gateware/common/fw/boot.S @@ -3,10 +3,13 @@ * * SPI boot code * - * Copyright (C) 2020 Sylvain Munaut <tnt(a)246tNt.com> + * Copyright (C) 2020-2022 Sylvain Munaut <tnt(a)246tNt.com> * SPDX-License-Identifier: MIT */ +// #define BOOT_DEBUG +// (also set UART_DIV for the board below !) + #ifndef APP_FLASH_ADDR #define APP_FLASH_ADDR 0x00100000 #endif @@ -19,18 +22,50 @@ #define APP_SIZE 0x00010000 #endif + .equ UART_BASE, 0x81000000 + .equ UART_DIV, 29 // 30.72 MHz / (29+2) ~= 1 Mbaud (icE1usb) + //.equ UART_DIV, 22 // 24 MHz / (22+2) ~= 1 Mbaud (e1-tracer) + .section .text.start .global _start _start: + // Debug +#ifdef BOOT_DEBUG + // Set UART divisor + li a0, UART_BASE + li a1, UART_DIV + sw a1, 4(a0) + + // Output 'a' + li a1, 97 + sw a1, 0(a0) +#endif + // SPI init jal spi_init + // Debug +#ifdef BOOT_DEBUG + // Output 'b' + li a0, UART_BASE + li a1, 98 + sw a1, 0(a0) +#endif + // Read from flash to SRAM li a0, APP_SRAM_ADDR li a1, APP_SIZE li a2, APP_FLASH_ADDR jal spi_flash_read + // Debug +#ifdef BOOT_DEBUG + // Output 'c' + li a0, UART_BASE + li a1, 99 + sw a1, 0(a0) +#endif + // Setup reboot code li t0, 0x0002006f sw t0, 0(zero) @@ -39,16 +74,27 @@ j APP_SRAM_ADDR - .equ SPI_BASE, 0x80000000 - .equ SPICR0, 4 * 0x08 - .equ SPICR1, 4 * 0x09 - .equ SPICR2, 4 * 0x0a - .equ SPIBR, 4 * 0x0b - .equ SPISR, 4 * 0x0c - .equ SPITXDR, 4 * 0x0d - .equ SPIRXDR, 4 * 0x0e - .equ SPICSR, 4 * 0x0f +// --------------------------------------------------------------------------- +// SB_SPI driver code +// --------------------------------------------------------------------------- +// Register definitions + + .equ SPI_BASE, 0x80000000 + + .equ SPICR0, 4 * 0x08 + .equ SPICR1, 4 * 0x09 + .equ SPICR2, 4 * 0x0a + .equ SPIBR, 4 * 0x0b + .equ SPISR, 4 * 0x0c + .equ SPITXDR, 4 * 0x0d + .equ SPIRXDR, 4 * 0x0e + .equ SPICSR, 4 * 0x0f + + +// Initializes te SPI hardware +// +// Clobbers a0, a1 spi_init: li a0, SPI_BASE @@ -71,11 +117,13 @@ ret +// Reads a block of memory from SPI flash +// // Params: // a0 - destination pointer // a1 - length (bytes) // a2 - flash offset -// +// Clobbers t0, t1, s0, s1, s2 spi_flash_read: // Save params @@ -121,9 +169,12 @@ jr s2 +// Performs a single 8 bit SPI xfer +// // Params: a0 - Data to TX // Returns: a0 - RX data // Clobbers t0, t1 + _spi_do_one: li t0, SPI_BASE li t1, 0x08 diff --git a/gateware/common/rtl/soc_picorv32_bridge.v b/gateware/common/rtl/soc_picorv32_bridge.v index c0860fe..282a950 100644 --- a/gateware/common/rtl/soc_picorv32_bridge.v +++ b/gateware/common/rtl/soc_picorv32_bridge.v @@ -10,11 +10,11 @@ `default_nettype none module soc_picorv32_bridge #( - parameter integer WB_N = 8, - parameter integer WB_DW = 32, - parameter integer WB_AW = 16, - parameter integer WB_AI = 2, - parameter integer WB_REG = 0 // [0] = cyc / [1] = addr/wdata/wstrb / [2] = ack/rdata + parameter integer WB_N = 8, + parameter integer WB_DW = 32, + parameter integer WB_AW = 16, + parameter integer WB_AI = 2, + parameter integer WB_REG = 0 // [0] = cyc / [1] = addr/wdata/wstrb / [2] = ack/rdata )( /* PicoRV32 bus */ input wire [31:0] pb_addr, -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/28008 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: Icb7bea1cf7243e9ace819cd567eb006fcc71c808 Gerrit-Change-Number: 28008 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ttcn3-hacks[master]: bsc: Fix dangling subscriber talloc ctx in f_TC_paging_Nreq
by fixeria 03 May '22

03 May '22
Attention is currently required from: osmith, neels, pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28007 ) Change subject: bsc: Fix dangling subscriber talloc ctx in f_TC_paging_Nreq ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28007 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ibbd9168f3ac2c1cd4f4577644d75499d49c2823f Gerrit-Change-Number: 28007 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 03 May 2022 11:12:00 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-bsc[master]: stats: new trackers for lchan life duration
by pespin 03 May '22

03 May '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27081 ) Change subject: stats: new trackers for lchan life duration ...................................................................... stats: new trackers for lchan life duration This patch adds two stats which track cummulative lchan lifetime by type TCH and SDCCH. These new counters will accomplish two things: 1) Provide a glanceable way to see if lchan durations look healthy. When examining a site, short-lived (<5s) and long-lived (>30s) TCH lchans are difficult to tell apart. If we only see short-lived TCH lchans, there is most likely an RF or signaling problem to investigate. This new counter will expose channel ages in the VTY output 2) Provide a more accurate count for Erlangs per site. Currently, we are basing Erlangs on active TCH channel counts per stats period. This method skews high very quickly. Each active TCH in that period translates into the full 10s of activity. This counter should improve accuracy by two orders of magnitude. Change-Id: I1b0670c47cb5e0b7776eda89d1e71545ba0e3347 --- M include/osmocom/bsc/bts.h M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/bts.c M src/osmo-bsc/bts_trx_vty.c M src/osmo-bsc/bts_vty.c M src/osmo-bsc/gsm_data.c M src/osmo-bsc/lchan_fsm.c 7 files changed, 91 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve neels: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h index 008eee5..9e50e2d 100644 --- a/include/osmocom/bsc/bts.h +++ b/include/osmocom/bsc/bts.h @@ -59,6 +59,8 @@ BTS_CTR_CHAN_ACT_SDCCH, BTS_CTR_CHAN_ACT_TCH, BTS_CTR_CHAN_ACT_NACK, + BTS_CTR_CHAN_TCH_ACTIVE_DECISECONDS_TOTAL, + BTS_CTR_CHAN_SDCCH_ACTIVE_DECISECONDS_TOTAL, BTS_CTR_RSL_UNKNOWN, BTS_CTR_RSL_IPA_NACK, BTS_CTR_RSL_DELETE_IND, diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index cb20b9e..4babe5e 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -888,6 +888,8 @@ uint8_t interf_band; /* MS power control state */ struct lchan_power_ctrl_state ms_power_ctrl; + /* Interval timing to capture duration per activation and cumulative active time */ + struct osmo_time_cc active_cc; }; /* One Timeslot in a TRX */ @@ -1146,6 +1148,7 @@ char *gsm_ts_name(const struct gsm_bts_trx_ts *ts); char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts); void lchan_update_name(struct gsm_lchan *lchan); +uint64_t gsm_lchan_active_duration_ms(const struct gsm_lchan *lchan); static inline char *gsm_lchan_name(const struct gsm_lchan *lchan) { diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c index 2dfd4fa..5786833 100644 --- a/src/osmo-bsc/bts.c +++ b/src/osmo-bsc/bts.c @@ -1095,6 +1095,12 @@ [BTS_CTR_CHAN_ACT_NACK] = \ { "chan_act:nack", "Number of Channel Activations that the BTS NACKed" }, + [BTS_CTR_CHAN_TCH_ACTIVE_DECISECONDS_TOTAL] = \ + { "chan_tch:active_deciseconds:total", + "Cumulative number of deciseconds of TCH channel activity" }, + [BTS_CTR_CHAN_SDCCH_ACTIVE_DECISECONDS_TOTAL] = \ + { "chan_sdcch:active_deciseconds:total", + "Cumulative number of deciseconds of SDCCH channel activity" }, [BTS_CTR_RSL_UNKNOWN] = \ { "rsl:unknown", "Number of unknown/unsupported RSL messages received from BTS" }, diff --git a/src/osmo-bsc/bts_trx_vty.c b/src/osmo-bsc/bts_trx_vty.c index a3d6033..d232d46 100644 --- a/src/osmo-bsc/bts_trx_vty.c +++ b/src/osmo-bsc/bts_trx_vty.c @@ -569,6 +569,13 @@ vty_out(vty, "BTS %u, TRX %u, Timeslot %u, Lchan %u: Type %s%s", lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, lchan->nr, gsm_lchant_name(lchan->type), VTY_NEWLINE); + + if (lchan->activate.concluded) { + vty_out(vty, " Activated %s seconds ago%s", + osmo_int_to_float_str_c(OTC_SELECT, gsm_lchan_active_duration_ms(lchan), 3), + VTY_NEWLINE); + } + vty_out_dyn_ts_details(vty, lchan->ts); vty_out(vty, " Connection: %u, State: %s%s%s%s", lchan->conn ? 1: 0, lchan_state_name(lchan), diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index 4e60cd8..8af96ed 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -3677,6 +3677,8 @@ struct gsm_bts_trx *trx; int ts_hopping_total; int ts_non_hopping_total; + const struct rate_ctr *activations_tch; + const struct rate_ctr *activations_sdcch; vty_out(vty, "BTS %u is of %s type in band %s, has CI %u LAC %u, " "BSIC %u (NCC=%u, BCC=%u) and %u TRX%s", @@ -3851,6 +3853,29 @@ rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_CHREQ_TOTAL)->current, rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_CHREQ_NO_CHANNEL)->current, VTY_NEWLINE); + + vty_out(vty, " Channel Activations :%s", VTY_NEWLINE); + activations_tch = rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_CHAN_ACT_TCH); + vty_out(vty, " TCH %"PRIu64"", activations_tch->current); + if (activations_tch->intv[RATE_CTR_INTV_HOUR].rate > 0) { + const struct rate_ctr *active_time_tch_ds = rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_CHAN_TCH_ACTIVE_DECISECONDS_TOTAL); + vty_out(vty, " (avg lifespan %s seconds in last hour)", + osmo_int_to_float_str_c(OTC_SELECT, + 100 * active_time_tch_ds->intv[RATE_CTR_INTV_HOUR].rate + / activations_tch->intv[RATE_CTR_INTV_HOUR].rate, 3)); + } + vty_out(vty, "%s", VTY_NEWLINE); + activations_sdcch = rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_CHAN_ACT_SDCCH); + vty_out(vty, " SDCCH %"PRIu64"", activations_sdcch->current); + if (activations_sdcch->intv[RATE_CTR_INTV_HOUR].rate > 0) { + const struct rate_ctr *active_time_sdcch_ds = rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_CHAN_SDCCH_ACTIVE_DECISECONDS_TOTAL); + vty_out(vty, " (avg lifespan %s seconds in last hour)", + osmo_int_to_float_str_c(OTC_SELECT, + 100 * active_time_sdcch_ds->intv[RATE_CTR_INTV_HOUR].rate + / activations_sdcch->intv[RATE_CTR_INTV_HOUR].rate, 3)); + } + vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, " Channel Failures : %"PRIu64" rf_failures, %"PRIu64" rll failures%s", rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_CHAN_RF_FAIL)->current, rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_CHAN_RLL_ERR)->current, diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c index 639a724..de298a8 100644 --- a/src/osmo-bsc/gsm_data.c +++ b/src/osmo-bsc/gsm_data.c @@ -342,6 +342,15 @@ lchan->nr - (lchan->vamos.is_secondary ? ts->max_primary_lchans : 0)); } +/* If the lchan is currently active, return the duration since activation in milliseconds. + * Otherwise return 0. */ +uint64_t gsm_lchan_active_duration_ms(const struct gsm_lchan *lchan) +{ + if (!lchan->activate.concluded) + return 0; + return lchan->active_cc.total_sum / 1000; +} + /* obtain the MO structure for a given object instance */ static inline struct gsm_abis_mo * gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index 5df6c57..d693189 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -200,10 +200,33 @@ static void lchan_on_fully_established(struct gsm_lchan *lchan) { + struct rate_ctr *rate_ctr; + if (lchan->activate.concluded) return; lchan->activate.concluded = true; + /* Assign timekeeper to appropriate rate counter */ + switch (lchan->type) { + case GSM_LCHAN_TCH_H: + case GSM_LCHAN_TCH_F: + rate_ctr = rate_ctr_group_get_ctr(lchan->ts->trx->bts->bts_ctrs, BTS_CTR_CHAN_TCH_ACTIVE_DECISECONDS_TOTAL); + break; + case GSM_LCHAN_SDCCH: + rate_ctr = rate_ctr_group_get_ctr(lchan->ts->trx->bts->bts_ctrs, BTS_CTR_CHAN_SDCCH_ACTIVE_DECISECONDS_TOTAL); + break; + default: + rate_ctr = NULL; + break; + } + lchan->active_cc.cfg.rate_ctr = rate_ctr; + + /* This reset allows showing on vty how long ago a single active lchan was activated. + * This reset does not affect rate_ctr statistics. */ + osmo_time_cc_cleanup(&lchan->active_cc); + /* Start the timekeeper */ + osmo_time_cc_set_flag(&lchan->active_cc, true); + switch (lchan->activate.info.activ_for) { case ACTIVATE_FOR_MS_CHANNEL_REQUEST: /* No signalling to do here, MS is free to use the channel, and should go on to connect @@ -463,6 +486,16 @@ OSMO_ASSERT(lchan->fi); lchan->fi->priv = lchan; lchan_fsm_update_id(lchan); + + /* Configure timekeeper to track this lchan's cumulative active milliseconds */ + lchan->active_cc = (struct osmo_time_cc){ + .cfg = { + .gran_usec = 1*100000, + .forget_sum_usec = 1, + .rate_ctr = NULL, + }, + }; + LOGPFSML(lchan->fi, LOGL_DEBUG, "new lchan\n"); lchan_reset(lchan); } @@ -511,6 +544,8 @@ .tsc_set = 1, .interf_dbm = INTERF_DBM_UNKNOWN, .interf_band = INTERF_BAND_UNKNOWN, + + .active_cc = lchan->active_cc, }; } @@ -518,6 +553,10 @@ { struct gsm_lchan *lchan = lchan_fi_lchan(fi); struct gsm_bts *bts = lchan->ts->trx->bts; + + /* Stop the timekeeper */ + osmo_time_cc_set_flag(&lchan->active_cc, false); + lchan_reset(lchan); osmo_fsm_inst_dispatch(lchan->ts->fi, TS_EV_LCHAN_UNUSED, lchan); -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27081 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I1b0670c47cb5e0b7776eda89d1e71545ba0e3347 Gerrit-Change-Number: 27081 Gerrit-PatchSet: 22 Gerrit-Owner: iedemam <michael(a)kapsulate.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-bsc[master]: stats: new trackers for lchan life duration
by iedemam 03 May '22

03 May '22
Attention is currently required from: neels. iedemam has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27081 ) Change subject: stats: new trackers for lchan life duration ...................................................................... Patch Set 21: (1 comment) Patchset: PS21: > i'll leave it to you to hit 'submit' Thanks for the +2. I'd go ahead myself but I don't have permission to submit/merge on Gerrit. -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27081 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I1b0670c47cb5e0b7776eda89d1e71545ba0e3347 Gerrit-Change-Number: 27081 Gerrit-PatchSet: 21 Gerrit-Owner: iedemam <michael(a)kapsulate.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Tue, 03 May 2022 10:58:58 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in osmo-bsc[master]: stats: new trackers for lchan life duration
by neels 03 May '22

03 May '22
Attention is currently required from: iedemam. neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27081 ) Change subject: stats: new trackers for lchan life duration ...................................................................... Patch Set 21: (1 comment) Patchset: PS21: i'll leave it to you to hit 'submit' -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27081 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I1b0670c47cb5e0b7776eda89d1e71545ba0e3347 Gerrit-Change-Number: 27081 Gerrit-PatchSet: 21 Gerrit-Owner: iedemam <michael(a)kapsulate.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: iedemam <michael(a)kapsulate.com> Gerrit-Comment-Date: Tue, 03 May 2022 10:57:24 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in osmo-bsc[master]: stats: new trackers for lchan life duration
by neels 03 May '22

03 May '22
Attention is currently required from: iedemam. neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27081 ) Change subject: stats: new trackers for lchan life duration ...................................................................... Patch Set 21: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27081 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I1b0670c47cb5e0b7776eda89d1e71545ba0e3347 Gerrit-Change-Number: 27081 Gerrit-PatchSet: 21 Gerrit-Owner: iedemam <michael(a)kapsulate.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: iedemam <michael(a)kapsulate.com> Gerrit-Comment-Date: Tue, 03 May 2022 10:56:21 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-bsc[master]: stats: new trackers for lchan life duration
by iedemam 03 May '22

03 May '22
Attention is currently required from: neels. iedemam has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27081 ) Change subject: stats: new trackers for lchan life duration ...................................................................... Patch Set 21: (1 comment) Patchset: PS21: Hi Neels, I have now completed the additional testing I mentioned earlier. This can now be merged whenever you're ready. Thanks, -Michael -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27081 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I1b0670c47cb5e0b7776eda89d1e71545ba0e3347 Gerrit-Change-Number: 27081 Gerrit-PatchSet: 21 Gerrit-Owner: iedemam <michael(a)kapsulate.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Comment-Date: Tue, 03 May 2022 10:49:58 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in osmo-ttcn3-hacks[master]: bsc: Fix dangling subscriber talloc ctx in f_TC_paging_Nreq
by pespin 03 May '22

03 May '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28007 ) Change subject: bsc: Fix dangling subscriber talloc ctx in f_TC_paging_Nreq ...................................................................... bsc: Fix dangling subscriber talloc ctx in f_TC_paging_Nreq First, page only on BTS0, not all the BTS. This simplifies the test and also makes the subscriber be refcounted only on BTS0. Then, drop the OML connection after receiving all the expected paging requests; it will make the BSC flush the paging queue and hence avoid TTCN3 checks erroring due to dangling subscriber talloc contexts. Change-Id: Ibbd9168f3ac2c1cd4f4577644d75499d49c2823f --- M bsc/BSC_Tests.ttcn 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/07/28007/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index f514c43..b35d316 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -3607,8 +3607,10 @@ } for (i := 0; i < num_subscribers; i := i + 1) { + /* Page on LAC-CI of BTS0: */ BSSAP.send(ts_BSSAP_UNITDATA_req(g_bssap[0].sccp_addr_peer, g_bssap[0].sccp_addr_own, - ts_BSSMAP_Paging(imsis[i], valueof(ts_BSSMAP_CIL_noCell), omit, omit))); + ts_BSSMAP_Paging(imsis[i], valueof(ts_BSSMAP_CIL_LAC_CI({ts_BSSMAP_CI_LAC_CI(1, 0)})), + omit, omit))); } T_rx.start; @@ -3645,6 +3647,9 @@ } } + /* Drop OML connection to have all paging requests flushed: */ + f_vty_transceive(BSCVTY, "drop bts connection 0 oml"); + f_shutdown_helper(); } /* Verify BSC can schedule 500 paging requests under one minute if BTS buffer is good enough */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/28007 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ibbd9168f3ac2c1cd4f4577644d75499d49c2823f Gerrit-Change-Number: 28007 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • ...
  • 135
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.