]> jspc29.x-matter.uni-frankfurt.de Git - padiwa.git/commitdiff
Added internal delay via stretcher, new discharge generation
authorlocal account <arost@lxhadeb07.gsi.de>
Mon, 18 Jan 2016 17:22:09 +0000 (18:22 +0100)
committerlocal account <arost@lxhadeb07.gsi.de>
Mon, 18 Jan 2016 17:22:09 +0000 (18:22 +0100)
amps/compile_padiwa_amps_gsi.pl
amps/padiwa_amps.ldf
amps/padiwa_amps.prj
amps/padiwa_amps.vhd
pinout/padiwa_amps.lpf

index 69d233ba79fba7f36e0af229db8ace5044f2887d..67387f38bbf34c5c9debf7664e1e32399de2dba2 100755 (executable)
@@ -10,9 +10,9 @@ use FileHandle;
 ###################################################################################
 #Settings for this project
 my $TOPNAME                      = "padiwa_amps";  #Name of top-level entity
-my $lattice_path                 = '/opt/lattice/diamond/2.2_x64';
+my $lattice_path                 = '/opt/lattice/diamond/3.6_x64';
 my $lattice_bin_path             = "$lattice_path/bin/lin64"; # note the lin/lin64 at the end, no isfgpa needed
-my $synplify_path                = '/opt/synplicity/F-2012.03-SP1';
+my $synplify_path                = '/opt/synplicity/K-2015.09';
 my $lm_license_file_for_synplify = '27000@lxcad01.gsi.de';
 my $lm_license_file_for_par      = '1702@hadeb05.gsi.de';
 ###################################################################################
index 754a5fde8a73f4d2859cdb49f479968c4b3c6253..f180a139cd241dd04c5d9960d3280b85fcb0438f 100644 (file)
@@ -1,21 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<BaliProject version="1.3" title="padiwa_amps" device="LCMXO2-4000HC-6FTG256C" default_implementation="padiwa_amps">
+<BaliProject version="3.2" title="padiwa_amps" device="LCMXO2-4000HC-6FTG256C" default_implementation="padiwa_amps">
     <Options/>
     <Implementation title="padiwa_amps" dir="padiwa_amps" description="padiwa_amps" default_strategy="Strategy1">
-        <Options top="padiwa_amps"/>
+        <Options deftop="padiwa_amps" top="padiwa_amps"/>
         <Source name="padiwa_amps.vhd" type="VHDL" type_short="VHDL">
             <Options top_module="padiwa_amps"/>
         </Source>
-        <Source name="../base/trb3_components.vhd" type="VHDL" type_short="VHDL">
-            <Options/>
-        </Source>
         <Source name="../../trbnet/trb_net_std.vhd" type="VHDL" type_short="VHDL">
             <Options/>
         </Source>
         <Source name="../../trbnet/trb_net_components.vhd" type="VHDL" type_short="VHDL">
             <Options/>
         </Source>
-        <Source name="../wasa/source/spi_slave.vhd" type="VHDL" type_short="VHDL">
+        <Source name="../source/spi_slave.vhd" type="VHDL" type_short="VHDL">
             <Options/>
         </Source>
         <Source name="../../trbnet/trb_net_onewire.vhd" type="VHDL" type_short="VHDL">
         <Source name="version.vhd" type="VHDL" type_short="VHDL">
             <Options/>
         </Source>
-        <Source name="../wasa/cores/oddr16.vhd" type="VHDL" type_short="VHDL">
+        <Source name="../source/pwm.vhd" type="VHDL" type_short="VHDL">
+            <Options/>
+        </Source>
+        <Source name="../cores/efb_define_def.v" type="Verilog" type_short="Verilog">
+            <Options/>
+        </Source>
+        <Source name="../cores/UFM_WB.v" type="Verilog" type_short="Verilog">
             <Options/>
         </Source>
-        <Source name="../wasa/source/pwm.vhd" type="VHDL" type_short="VHDL">
+        <Source name="../cores/pll.vhd" type="VHDL" type_short="VHDL">
             <Options/>
         </Source>
-        <Source name="../wasa/cores/efb_define_def.v" type="Verilog" type_short="Verilog">
+        <Source name="../cores/flashram.vhd" type="VHDL" type_short="VHDL">
             <Options/>
         </Source>
-        <Source name="../wasa/cores/UFM_WB_top.v" type="Verilog" type_short="Verilog">
+        <Source name="../cores/flash.vhd" type="VHDL" type_short="VHDL">
             <Options/>
         </Source>
-        <Source name="../wasa/cores/pll.vhd" type="VHDL" type_short="VHDL">
+        <Source name="../pinout/padiwa_amps.lpf" type="Logic Preference" type_short="LPF">
             <Options/>
         </Source>
-        <Source name="../wasa/cores/flashram.vhd" type="VHDL" type_short="VHDL">
+        <Source name="../source/Stretcher.vhd" type="VHDL" type_short="VHDL">
             <Options/>
         </Source>
-        <Source name="../wasa/cores/flash.vhd" type="VHDL" type_short="VHDL">
+       <Source name="../source/Stretcher_A.vhd" type="VHDL" type_short="VHDL">
             <Options/>
         </Source>
-        <Source name="../base/padiwa_amps.lpf" type="Logic Preference" type_short="LPF">
+       <Source name="../source/Stretcher_B.vhd" type="VHDL" type_short="VHDL">
             <Options/>
         </Source>
-    </Implementation>
+       </Implementation>
     <Strategy name="Strategy1" file="Strategy1.sty"/>
 </BaliProject>
index 39d2d5182d1582b5bc60f32632906cdde36cc64e..12aa866e60e46b98aa7d487eaa8e27996e9b224b 100644 (file)
@@ -11,8 +11,8 @@ add_file -vhdl -lib work "../../trbnet/trb_net_std.vhd"
 add_file -vhdl -lib work "../../trbnet/trb_net_components.vhd"
 add_file -vhdl -lib work "../source/spi_slave.vhd"
 add_file -vhdl -lib work "../../trbnet/trb_net_onewire.vhd"
-add_file -vhdl -lib work "../../trbnet/special/uart_sctrl.vhd"
-add_file -vhdl -lib work "../../trbnet/special/uart_recv.vhd"
+###add_file -vhdl -lib work "../../trbnet/special/uart_sctrl.vhd"
+###add_file -vhdl -lib work "../../trbnet/special/uart_recv.vhd"
 add_file -vhdl -lib work "version.vhd"
 add_file -vhdl -lib work "../source/pwm.vhd"
 add_file -vhdl -lib work "../cores/pll_shifted_clocks.vhd"
@@ -27,6 +27,9 @@ add_file -vhdl -lib work "../cores/pll.vhd"
 add_file -verilog -lib work "../cores/efb_define_def.v"
 add_file -verilog -lib work "../cores/UFM_WB.v"
 
+add_file -vhdl -lib work "../source/Stretcher.vhd"
+add_file -vhdl -lib work "../source/Stretcher_A.vhd"
+add_file -vhdl -lib work "../source/Stretcher_B.vhd"
 
 add_file -vhdl -lib work "padiwa_amps.vhd"
 
index 0f83dca9c1e61a6ddf420f9a592c913f45989040..78613b7e6c7f227b6a07f54c5372245317e07a36 100644 (file)
@@ -155,7 +155,7 @@ end component;
 component PUR   port(PUR : in std_logic); end component;
 component GSR   port(GSR : in std_logic); end component;
   
-
+constant DELAYDEPTH : integer := 16;
 
 attribute NOM_FREQ : string;
 attribute NOM_FREQ of clk_source : label is "133.00";
@@ -211,7 +211,7 @@ signal flash_busy    : std_logic;
 signal flash_err     : std_logic;
 
 signal inp_select    : integer range 0 to 31 := 0;
-signal inp_invert   : std_logic_vector(15 downto 0);
+signal inp_invert   : std_logic_vector(15 downto 0) := (others => '1');
 signal input_enable : std_logic_vector(15 downto 0);
 signal inp_status   : std_logic_vector(15 downto 0);
 signal led_status   : std_logic_vector(8  downto 0) := "100000000";
@@ -266,7 +266,9 @@ signal comp_setting_s   : std_logic_vector(15 downto 0);
 signal ffarr_data       : std_logic_vector(15 downto 0);
 signal ffarr_read       : std_logic;
 
-
+signal delayed_inputs   : std_logic_vector(127 downto 0);
+signal selected_delay   : std_logic_vector(8 downto 1);
+signal delayselect      : integer range 0 to 15;
 begin
 
 
@@ -541,6 +543,7 @@ THE_IO_REG_READ : process begin
       when x"8" => spi_reg20_i <= x"00" & discharge_override;
       when x"9" => spi_reg20_i <= x"00" & discharge_highz;
       when x"a" => spi_reg20_i <= x"00" & delay_invert;
+      when x"b" => spi_reg20_i <= x"00" & std_logic_vector(to_unsigned(delayselect,8));
       when x"f" => spi_reg20_i <= ffarr_data; 
       when others => null;
     end case;
@@ -569,6 +572,7 @@ THE_IO_REG_WRITE : process begin
       when x"8" => discharge_override <= spi_data_i(7 downto 0);
       when x"9" => discharge_highz    <= spi_data_i(7 downto 0);
       when x"a" => delay_invert       <= spi_data_i(7 downto 0);
+      when x"b" => delayselect        <= to_integer(unsigned(spi_data_i(7 downto 0)));
       when others => null;
     end case;
   end if;
@@ -590,18 +594,50 @@ end generate;
 
 
 ---------------------------------------------------------------------------
--- Delay generation
+-- Stretcher
 ---------------------------------------------------------------------------
+THE_STRETCHER : entity work.Stretcher
+  generic map(
+    CHANNEL => 8,
+    DEPTH   => DELAYDEPTH
+    )
+  port map(
+    PULSE_IN  => fast_input,
+    PULSE_OUT => delayed_inputs
+    );
 
+---------------------------------------------------------------------------
+-- Delay generation
+---------------------------------------------------------------------------
 
+--git delay
+------------
+--gen_discharge : for i in 1 to 8 generate
+--DISCHARGE(i) <= 'Z'                               when  discharge_highz(i) = '1' else
+--               (DELAY_C_IN(i) and slow_input(i)) when  discharge_disable(i) = '0' else
+--                discharge_override(i)             when  discharge_disable(i) = '1';
+--                
+--DELAY_C_OUT(i) <= (fast_input(i) or slow_input(i)) xor delay_invert(i);
+--end generate;
+
+--delay intern: standard latch
+-------------------------
 gen_discharge : for i in 1 to 8 generate
-DISCHARGE(i) <= 'Z'                               when  discharge_highz(i) = '1' else
-                (DELAY_C_IN(i) and slow_input(i)) when  discharge_disable(i) = '0' else
-                discharge_override(i)             when  discharge_disable(i) = '1';
-                
-DELAY_C_OUT(i) <= (fast_input(i) or slow_input(i)) xor delay_invert(i);
+process (slow_input, selected_delay)
+begin
+   if (slow_input(i)='0') then
+      DISCHARGE(i)<='0';             
+   elsif (selected_delay(i)='1') then
+      DISCHARGE(i)<='1';
+   end if;
+end process;
+
+-- delayed_inputs(i) <= selected_delay(i);
+selected_delay(i) <= delayed_inputs(i*DELAYDEPTH-1-delayselect);
 end generate;
-                
+
+
+
 fast_input <= inp_gated(14) & inp_gated(12) & inp_gated(10) & inp_gated(8) & inp_gated(6) & inp_gated(4) & inp_gated(2) & inp_gated(0);
 slow_input <= inp_gated(15) & inp_gated(13) & inp_gated(11) & inp_gated(9) & inp_gated(7) & inp_gated(5) & inp_gated(3) & inp_gated(1);
 
@@ -654,8 +690,11 @@ inp_long_reg      <= inp_long_or when rising_edge(clk_i);
 last_inp_long_reg <= inp_long_reg when rising_edge(clk_i);
 
 
-TEST_LINE               <= (others => '0');
-
+-- TEST_LINE               <= (others => '0');
+--TEST_LINE(7 downto 0) <= delayed_inputs(7 downto 0);
+--TEST_LINE(8) <= fast_input(1);
+--TEST_LINE(13 downto 9) <= (others => '0');
+TEST_LINE(7 downto 0) <= selected_delay;
 
 gen_leds : for i in 1 to 8 generate
   LED(i) <= not leds((i-1)*2) when led_status(8) = '1' else not led_status(i-1);
index 3de9338dcee6c2a62acef49d34e42c14cd8446e1..7dbbdd757c94c119a5d36018929347d84af38992 100644 (file)
@@ -204,3 +204,16 @@ IOBUF GROUP  "DELAY_C_OUT_group" IO_TYPE=LVCMOS33 DRIVE=4 PULLMODE=DOWN;
 \r
 DEFINE PORT GROUP "DELAY_C_IN_group" "DELAY_*_IN*" ;\r
 IOBUF GROUP  "DELAY_C_IN_group" IO_TYPE=LVCMOS33  ;\r
+\r
+UGROUP "StretchA" BBOX 8 2\r
+  BLKNAME THE_STRETCHER/Stretcher_A_1\r
+  ;\r
+LOCATE UGROUP "StretchA" SITE "R2C2D";  \r
+  \r
+UGROUP "StretchB" BBOX 8 2\r
+  BLKNAME THE_STRETCHER/Stretcher_B_1\r
+  ;\r
+LOCATE UGROUP "StretchB" SITE "R2C30D";  \r
+  \r
+\r
+  
\ No newline at end of file