]> jspc29.x-matter.uni-frankfurt.de Git - trb5sc.git/commitdiff
fix I2C ouputs, add operation with 1,2,4 links
authorJan Michel <michel@physik.uni-frankfurt.de>
Fri, 20 Feb 2026 16:04:32 +0000 (17:04 +0100)
committerJan Michel <michel@physik.uni-frankfurt.de>
Fri, 20 Feb 2026 16:04:32 +0000 (17:04 +0100)
mimosis/code/WordAlign.vhd
mimosis_standalone/config_compile_frankfurt.pl
mimosis_standalone/nodelist_frankfurt.txt [new file with mode: 0644]
mimosis_standalone/trb5sc_mimosis.vhd

index 2502428d340423b46256399d731302b4972229da..e9a2fe08921ae772f24fae3a971cd35f2524ee46 100644 (file)
@@ -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;
 
index d941a92852f179e3f54c2dd765c28a3691277e0c..ad1bdd08ac40c3ac480862f6649eafdbe940fd5d 100644 (file)
@@ -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 (file)
index 0000000..83f9f51
--- /dev/null
@@ -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
index ac0c67bdaf514c2574bb4abb24cd5a015a09c82b..84c7ef7967065ebffefefc0d3ee84920e14240c3 100644 (file)
@@ -43,7 +43,7 @@ entity trb5sc_mimosis is
     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
@@ -741,13 +741,13 @@ begin
 -- 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