]> jspc29.x-matter.uni-frankfurt.de Git - trb3.git/commitdiff
*** empty log message ***
authorhadeshyp <hadeshyp>
Thu, 30 Aug 2012 08:30:06 +0000 (08:30 +0000)
committerhadeshyp <hadeshyp>
Thu, 30 Aug 2012 08:30:06 +0000 (08:30 +0000)
base/code/mbs_vulom_recv.vhd
base/trb3_components.vhd
base/trb3_periph_mainz.lpf

index 8698fd1cbf971cccde6480fc6276e9d88f3ee40d..f464f2374b01c462763944c6bf4c96f5a4751cdc 100644 (file)
@@ -49,7 +49,7 @@ end entity;
 -- Bit 30 - 29 : Status
 -- Bit 31      : Error flag
 
-
+--statusbit 23 will be set in case of a data error from MBS
 
 architecture mbs_vulom_recv_arch of mbs_vulom_recv is
 
@@ -62,7 +62,7 @@ signal first_bits_slow : std_logic;
 signal reg_MBS_IN      : std_logic;
 signal done            : std_logic;
 
-signal numer_reg       : std_logic_vector(23 downto 0);
+signal number_reg      : std_logic_vector(23 downto 0);
 signal status_reg      : std_logic_vector(1 downto 0);
 signal error_reg       : std_logic;
 
@@ -132,7 +132,7 @@ end process;
 PROC_REG_INFO : process begin
   wait until rising_edge(CLK);
   if done = '1' then
-    numer_reg <= shift_reg(31 downto 8);
+    number_reg <= shift_reg(31 downto 8);
     status_reg <= shift_reg(7 downto 6);
     if shift_reg(36 downto 32) = "01010" and shift_reg(4 downto 0) = "10101" and xor_all(31 downto 5) = '0' then
       error_reg <= '0';
@@ -145,10 +145,19 @@ end process;
 
 PROC_RDO : process begin
   wait until rising_edge(CLK);
+  WRITE_OUT     <= '0';
+  FINISHED_OUT  <= '0';
+  STATUSBIT_OUT <= (23 => error_reg, others => '0');
   case rdostate is
     when RDO_IDLE =>
-    when RDO_WRITE =>
+      if TRIGGER_IN = '1' then
+        rdostate <= RDO_FINISH;
+        DATA_OUT <= error_reg & status_reg & "00000" & number_reg;
+        WRITE_OUT <= '1';
+      end if;
     when RDO_FINISH =>
+      FINISHED_OUT <= '1';
+      rdostate     <= RDO_IDLE;
   end case;
 end process;
 
index f0c88a316aa83a4343dc05b3d35968ea9b692ea1..8695c12cc1b8860743d7d30dc9cb12b14ad44aeb 100644 (file)
@@ -28,7 +28,7 @@ component pll_in125_out125
 
 component TDC
   generic (
-    CHANNEL_NUMBER : integer range 0 to 64;
+    CHANNEL_NUMBER : integer range 2 to 65;
     STATUS_REG_NR  : integer range 0 to 6;
     CONTROL_REG_NR : integer range 0 to 6);
   port (
@@ -83,14 +83,16 @@ component Reference_Channel
     REF_DEBUG_OUT        : out std_logic_vector(31 downto 0));
 end component;
 
-component Channel
+component Channel is
+
   generic (
-    CHANNEL_ID : integer range 1 to 65);
+    CHANNEL_ID : integer range 1 to 64);
   port (
-    RESET_WR             : in  std_logic;
-    RESET_RD             : in  std_logic;
-    CLK_WR               : in  std_logic;
-    CLK_RD               : in  std_logic;
+    RESET_200            : in  std_logic;
+    RESET_100            : in  std_logic;
+    CLK_200              : in  std_logic;
+    CLK_100              : in  std_logic;
+--
     HIT_IN               : in  std_logic;
     READ_EN_IN           : in  std_logic;
     FIFO_DATA_OUT        : out std_logic_vector(31 downto 0);
@@ -98,11 +100,38 @@ component Channel
     FIFO_FULL_OUT        : out std_logic;
     FIFO_ALMOST_FULL_OUT : out std_logic;
     COARSE_COUNTER_IN    : in  std_logic_vector(10 downto 0);
+--
     LOST_HIT_NUMBER      : out std_logic_vector(23 downto 0);
     HIT_DETECT_NUMBER    : out std_logic_vector(23 downto 0);
     ENCODER_START_NUMBER : out std_logic_vector(23 downto 0);
     FIFO_WR_NUMBER       : out std_logic_vector(23 downto 0);
-    Channel_DEBUG_01     : out std_logic_vector(31 downto 0));
+--
+    Channel_DEBUG        : out std_logic_vector(31 downto 0)
+    );
+
+end component;
+
+
+component Channel_200 is
+
+  generic (
+    CHANNEL_ID : integer range 0 to 64);  
+  port (
+    CLK_200              : in  std_logic;   -- 200 MHz clk
+    RESET_200            : in  std_logic;   -- reset sync with 200Mhz clk
+    CLK_100              : in  std_logic;   -- 100 MHz clk
+    RESET_100            : in  std_logic;   -- reset sync with 100Mhz clk
+--
+    HIT_IN               : in  std_logic;   -- hit in
+    COARSE_CNTR_IN       : in  std_logic_vector(10 downto 0);  -- coarse counter in
+    READ_EN_IN           : in  std_logic;   -- read en signal
+    FIFO_DATA_OUT        : out std_logic_vector(31 downto 0);  -- fifo data out
+    FIFO_EMPTY_OUT       : out std_logic;   -- fifo empty signal
+    FIFO_FULL_OUT        : out std_logic;   -- fifo full signal
+    FIFO_ALMOST_FULL_OUT : out std_logic;   -- fifo almost full signal
+    FIFO_WR_OUT          : out std_logic;   -- fifo wr en signal
+    ENCODER_START_OUT    : out std_logic);  -- encoder start signal
+
 end component;
 
 component ROM_FIFO
index d45a38744a23848589fec2ffe9ae29a12fe44031..e82b00b6fe4c839062b666982f5b41ad6fade5a1 100644 (file)
@@ -6,7 +6,7 @@ BLOCK RD_DURING_WR_PATHS ;
 #################################################################
 # Basic Settings
 #################################################################
-
+SYSCONFIG MCCLK_FREQ = 20;
 FREQUENCY PORT CLK_PCLK_RIGHT 200 MHz;
 FREQUENCY PORT CLK_GPLL_LEFT  125 MHz;
 FREQUENCY PORT CLK_PCLK_LEFT  200 MHz;