From: Jan Michel Date: Fri, 20 Feb 2026 16:04:32 +0000 (+0100) Subject: fix I2C ouputs, add operation with 1,2,4 links X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=9e0138c0dff401e94ae60f390a3c7b61a37b8dc7;p=trb5sc.git fix I2C ouputs, add operation with 1,2,4 links --- diff --git a/mimosis/code/WordAlign.vhd b/mimosis/code/WordAlign.vhd index 2502428..e9a2fe0 100644 --- a/mimosis/code/WordAlign.vhd +++ b/mimosis/code/WordAlign.vhd @@ -41,14 +41,17 @@ architecture arch of WordAlign is alias CONF_fixalign : std_logic is control_reg(8); alias CONF_writeall : std_logic is control_reg(9); alias CONF_ignoreactive : std_logic is control_reg(10); + alias CONF_inactivelinks : std_logic_vector is control_reg(17 downto 16); signal bittime : integer range 0 to 31 := 0; signal word_update : std_logic_vector(7 downto 0); signal found_idle : std_logic_vector(7 downto 0) := (others => '0'); signal last_word_update, next_last_word_update : std_logic; - signal copycnt : integer range 0 to 4; - + signal copycnt : integer range 0 to 6; + signal fullsetcnt : integer range 0 to 7; + signal is_full_hdr : std_logic; + begin bittime <= bittime + 1 when rising_edge(CLK); @@ -91,27 +94,70 @@ end generate; next_last_word_update <= word_update(0) when rising_edge(CLK); last_word_update <= next_last_word_update when rising_edge(CLK); +is_full_hdr <= '1' when data_reg(0)(15 downto 8) = x"FE" and + data_reg(1)(15 downto 8) = x"FE" and + data_reg(2)(15 downto 8) = x"FE" and + data_reg(3)(15 downto 8) = x"FE" and + data_reg(4)(15 downto 8) = x"FE" and + data_reg(5)(15 downto 8) = x"FE" and + data_reg(6)(15 downto 8) = x"FE" and + data_reg(7)(15 downto 8) = x"FE" + else '0'; + + + PROC_COPY_MUX : process begin wait until rising_edge(CLK); doubleword_valid <= '0'; copycnt <= copycnt + 1; if last_word_update = '1' then - data_reg <= words; - copycnt <= 0; - elsif copycnt = 0 then + if CONF_inactivelinks = "00" then + data_reg <= words; + copycnt <= 3; + elsif CONF_inactivelinks = "01" then + data_reg(0 to 6) <= data_reg(1 to 7); + data_reg(1) <= words(0); + data_reg(3) <= words(2); + data_reg(5) <= words(4); + data_reg(7) <= words(6); + copycnt <= 1; + elsif CONF_inactivelinks = "10" then + data_reg(0 to 6) <= data_reg(1 to 7); + data_reg(3) <= words(0); + data_reg(7) <= words(4); + copycnt <= 1; + else + data_reg(0 to 6) <= data_reg(1 to 7); + data_reg(7) <= words(0); + copycnt <= 1; + end if; + elsif copycnt = 1 then + null; + elsif copycnt = 2 then + if is_full_hdr = '1' or fullsetcnt = 0 then + fullsetcnt <= 1 when CONF_inactivelinks = "01" + else 3 when CONF_inactivelinks = "10" + else 7; + else + fullsetcnt <= fullsetcnt - 1; + copycnt <= 0; + end if; + + elsif copycnt = 3 then doubleword <= data_reg(0)(15 downto 0) & data_reg(1)(15 downto 0); doubleword_valid <= '1'; - elsif copycnt = 1 then + elsif copycnt = 4 then doubleword <= data_reg(2)(15 downto 0) & data_reg(3)(15 downto 0); doubleword_valid <= '1'; - elsif copycnt = 2 then + elsif copycnt = 5 then doubleword <= data_reg(4)(15 downto 0) & data_reg(5)(15 downto 0); doubleword_valid <= '1'; - elsif copycnt = 3 then + elsif copycnt = 6 then doubleword <= data_reg(6)(15 downto 0) & data_reg(7)(15 downto 0); doubleword_valid <= '1'; - elsif copycnt = 4 then - copycnt <= copycnt; + else + copycnt <= 0; + end if; end process; diff --git a/mimosis_standalone/config_compile_frankfurt.pl b/mimosis_standalone/config_compile_frankfurt.pl index d941a92..ad1bdd0 100644 --- a/mimosis_standalone/config_compile_frankfurt.pl +++ b/mimosis_standalone/config_compile_frankfurt.pl @@ -7,10 +7,10 @@ Speedgrade => '8', TOPNAME => "trb5sc_mimosis", lm_license_file_for_synplify => "27020\@jspc29", #"27000\@lxcad01.gsi.de"; lm_license_file_for_par => "1710\@jspc29", -lattice_path => '/d/jspc29/lattice/diamond/3.12', -synplify_path => '/d/jspc29/lattice/synplify/V-2023.09-SP1/',#T-2022.09-SP2/', +lattice_path => '/d/jspc29/lattice/diamond/3.14', +synplify_path => '/d/jspc29/lattice/synplify/W-2024.09/',#T-2022.09-SP2/', -nodelist_file => '../nodelist_frankfurt.txt', +nodelist_file => 'nodelist_frankfurt.txt', pinout_file => 'trb5sc_hdmi', par_options => '../par.p2t', diff --git a/mimosis_standalone/nodelist_frankfurt.txt b/mimosis_standalone/nodelist_frankfurt.txt new file mode 100644 index 0000000..83f9f51 --- /dev/null +++ b/mimosis_standalone/nodelist_frankfurt.txt @@ -0,0 +1,7 @@ +// nodes file for parallel place&route + +[jspc85] +SYSTEM = linux +CORENUM = 8 +ENV = /d/jspc29/lattice/314_settings.sh +WORKDIR = /d/jspc22/trb/git/trb5sc/mimosis_standalone/workdir diff --git a/mimosis_standalone/trb5sc_mimosis.vhd b/mimosis_standalone/trb5sc_mimosis.vhd index ac0c67b..84c7ef7 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 : inout std_logic_vector(8 downto 1); + PIN : out std_logic_vector(8 downto 1); MIMOSIS_SCL, MIMOSIS_SDA : inout std_logic; @@ -741,13 +741,13 @@ 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' 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) <= 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'; +-- 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