From: Jan Michel Date: Fri, 10 Jan 2025 11:35:23 +0000 (+0100) Subject: update mimosis standalone design: add missing I2C port, reduce buffer size X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;p=trb5sc.git update mimosis standalone design: add missing I2C port, reduce buffer size --- diff --git a/mimosis/code/MimosisInput.vhd b/mimosis/code/MimosisInput.vhd index 5935f82..33c8f05 100644 --- a/mimosis/code/MimosisInput.vhd +++ b/mimosis/code/MimosisInput.vhd @@ -25,7 +25,7 @@ end entity; architecture arch of MimosisInput is constant HDR_WORD : std_logic_vector(15 downto 0) := x"FE00"; - constant WORD_LIMIT : integer := 8500; + constant WORD_LIMIT : integer := 4000; signal input_active_i : std_logic; signal data_i : std_logic_vector(15 downto 0); signal inp_i : std_logic_vector(7 downto 0); @@ -205,7 +205,7 @@ THE_FIFO : entity work.fifo_36x8k_oreg WrEn => buffer_write, RdEn => buffer_read, Reset => RESET, - AmFullThresh => "1000000000000", + AmFullThresh => "0010000000000", Q(31 downto 0) => buffer_dout, WCNT => buffer_fill, Empty => buffer_empty, diff --git a/mimosis/trb5sc_mimosis.vhd b/mimosis/trb5sc_mimosis.vhd index a8c2792..e842da2 100644 --- a/mimosis/trb5sc_mimosis.vhd +++ b/mimosis/trb5sc_mimosis.vhd @@ -455,8 +455,8 @@ begin PIN(4) <= MIMOSIS_SDA; PIN(3) <= MIMOSIS_SCL; - MIMOSIS_SDA <= '0' when (mimosis_sda_drv = '0') else 'Z'; - MIMOSIS_SCL <= '0' when (mimosis_scl_drv = '0') else 'Z'; + MIMOSIS_SDA <= '0' when (mimosis_sda_drv = '0' or i2c_reg_1(31) = '1') else 'Z'; + MIMOSIS_SCL <= '0' when (mimosis_scl_drv = '0' or i2c_reg_1(30) = '1') else 'Z'; H3(1) <= i2c_reg_5_40(0); --MIMOSIS_SYNC PIN(1) <= i2c_reg_5_40(4); --MIMOSIS_START diff --git a/mimosis_standalone/config.vhd b/mimosis_standalone/config.vhd index ea83682..c8cf18c 100644 --- a/mimosis_standalone/config.vhd +++ b/mimosis_standalone/config.vhd @@ -36,8 +36,8 @@ package config is -- -- 14: Debug - single fine time and the ROM addresses for the two transitions -- -- 15: Debug - complete carry chain dump - constant EVENT_BUFFER_SIZE : integer range 9 to 15 := 10; -- size of the event buffer, 2**N - constant EVENT_MAX_SIZE : integer := 500; --maximum event size. Must not exceed EVENT_BUFFER_SIZE/2 + constant EVENT_BUFFER_SIZE : integer range 9 to 15 := 13; -- size of the event buffer, 2**N + constant EVENT_MAX_SIZE : integer := 4095; --maximum event size. Must not exceed EVENT_BUFFER_SIZE/2 constant USE_GBE : integer := c_YES; --Runs with 120 MHz instead of 100 MHz @@ -47,13 +47,13 @@ package config is constant USE_RXCLOCK : integer := c_NO; --Address settings - constant INIT_ADDRESS : std_logic_vector := x"F586"; - constant BROADCAST_SPECIAL_ADDR : std_logic_vector := x"86"; + constant INIT_ADDRESS : std_logic_vector := x"F575"; + constant BROADCAST_SPECIAL_ADDR : std_logic_vector := x"82"; constant INCLUDE_UART : integer := c_NO; constant INCLUDE_SPI : integer := c_YES; constant INCLUDE_ADC : integer := c_YES; - constant INCLUDE_I2C : integer := c_NO; + constant INCLUDE_I2C : integer := c_YES; constant INCLUDE_DEBUG_INTERFACE: integer := c_NO; --input monitor and trigger generation logic @@ -74,6 +74,7 @@ package config is constant PERIPH_TRIGGER_COUNT : integer := 0; constant ADDON_LINE_COUNT : integer := 1; --36 with Padiwa, 22 with RJ-adapter constant CTS_OUTPUT_MULTIPLEXERS : integer := 0; + constant CTS_NOREADOUT : integer := 1; --no data in readout from CTS --TODO: -- constant INCLUDE_MBS_MASTER : integer range c_NO to c_YES := c_NO; --Which external trigger module (ETM) to use? diff --git a/mimosis_standalone/trb5sc_mimosis.vhd b/mimosis_standalone/trb5sc_mimosis.vhd index a7d2d58..ac0c67b 100644 --- a/mimosis_standalone/trb5sc_mimosis.vhd +++ b/mimosis_standalone/trb5sc_mimosis.vhd @@ -43,7 +43,7 @@ entity trb5sc_mimosis is H6 : inout std_logic_vector(4 downto 0); H7 : inout std_logic_vector(4 downto 0); - PIN : out std_logic_vector(8 downto 1); + PIN : inout std_logic_vector(8 downto 1); MIMOSIS_SCL, MIMOSIS_SDA : inout std_logic; @@ -294,6 +294,7 @@ begin UP_DOWN_MODE => 0, UP_DOWN_LIMIT => 100, FIXED_DELAY => 100, + SLOWCTRL_BUFFER_SIZE => 1, NUMBER_OF_GBE_LINKS => 1, LINKS_ACTIVE => "0001", @@ -382,7 +383,8 @@ begin RDO_DATA_BUFFER_DEPTH => EVENT_BUFFER_SIZE, RDO_DATA_BUFFER_FULL_THRESH => 2**EVENT_BUFFER_SIZE-EVENT_MAX_SIZE, RDO_HEADER_BUFFER_DEPTH => 9, - RDO_HEADER_BUFFER_FULL_THRESH => 2**9-16 + RDO_HEADER_BUFFER_FULL_THRESH => 2**9-16, + RDO_SKIP_FIRST_BUFFER => CTS_NOREADOUT ) port map ( CLK => clk_sys, @@ -670,8 +672,8 @@ begin SPI_CLK_OUT => spi_clk, --Header --HEADER_IO => open, - -- HEADER_IO(7) => HDR_IO(6), - -- HEADER_IO(8) => HDR_IO(7), + HEADER_IO(7) => HDR_IO(6), + HEADER_IO(8) => HDR_IO(7), ADDITIONAL_REG => add_reg, --ADC ADC_CS => ADC_NCS, @@ -739,11 +741,15 @@ begin -- PIN(4) <= '0' when (mimosis_sda_drv = '0') else 'Z'; -- PIN(3) <= '0' when (mimosis_scl_drv = '0') else 'Z'; - PIN(4) <= MIMOSIS_SDA; - PIN(3) <= MIMOSIS_SCL; - MIMOSIS_SDA <= '0' when (mimosis_sda_drv = '0') else 'Z'; - MIMOSIS_SCL <= '0' when (mimosis_scl_drv = '0') else 'Z'; + -- PIN(4) <= MIMOSIS_SDA; + -- PIN(3) <= MIMOSIS_SCL; + -- MIMOSIS_SDA <= '0' when (mimosis_sda_drv = '0' or i2c_reg_1(31) = '1') else 'Z'; + -- MIMOSIS_SCL <= '0' when (mimosis_scl_drv = '0' or i2c_reg_1(30) = '1') else 'Z'; +PIN(4) <= '0' when (mimosis_sda_drv = '0' or i2c_reg_1(31) = '1') else 'Z'; +PIN(3) <= '0' when (mimosis_scl_drv = '0' or i2c_reg_1(30) = '1') else 'Z'; + + H3(1) <= i2c_reg_5_40(0); --MIMOSIS_SYNC PIN(1) <= i2c_reg_5_40(4); --MIMOSIS_START PIN(2) <= i2c_reg_5_40(8); --MIMOSIS_RESET