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);
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;
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',
H6 : inout std_logic_vector(4 downto 0);\r
H7 : inout std_logic_vector(4 downto 0);\r
\r
- PIN : inout std_logic_vector(8 downto 1);\r
+ PIN : out std_logic_vector(8 downto 1);\r
\r
MIMOSIS_SCL, MIMOSIS_SDA : inout std_logic;\r
\r
-- PIN(4) <= '0' when (mimosis_sda_drv = '0') else 'Z';\r
-- PIN(3) <= '0' when (mimosis_scl_drv = '0') else 'Z';\r
\r
- -- PIN(4) <= MIMOSIS_SDA;\r
- -- PIN(3) <= MIMOSIS_SCL;\r
- -- MIMOSIS_SDA <= '0' when (mimosis_sda_drv = '0' or i2c_reg_1(31) = '1') else 'Z';\r
- -- MIMOSIS_SCL <= '0' when (mimosis_scl_drv = '0' or i2c_reg_1(30) = '1') else 'Z';\r
+ PIN(4) <= MIMOSIS_SDA;\r
+ PIN(3) <= MIMOSIS_SCL;\r
+ MIMOSIS_SDA <= '0' when (mimosis_sda_drv = '0' or i2c_reg_1(31) = '1') else 'Z';\r
+ MIMOSIS_SCL <= '0' when (mimosis_scl_drv = '0' or i2c_reg_1(30) = '1') else 'Z';\r
\r
-PIN(4) <= '0' when (mimosis_sda_drv = '0' or i2c_reg_1(31) = '1') else 'Z';\r
-PIN(3) <= '0' when (mimosis_scl_drv = '0' or i2c_reg_1(30) = '1') else 'Z';\r
+-- PIN(4) <= '0' when (mimosis_sda_drv = '0' or i2c_reg_1(31) = '1') else 'Z';\r
+-- PIN(3) <= '0' when (mimosis_scl_drv = '0' or i2c_reg_1(30) = '1') else 'Z';\r
\r
\r
H3(1) <= i2c_reg_5_40(0); --MIMOSIS_SYNC\r