]> jspc29.x-matter.uni-frankfurt.de Git - trb3.git/commitdiff
introduce records to short entity declarations a bit.
authorTobias Weber <toweber86@gmail.com>
Mon, 7 Aug 2017 11:34:06 +0000 (13:34 +0200)
committerTobias Weber <toweber86@gmail.com>
Mon, 7 Aug 2017 11:34:06 +0000 (13:34 +0200)
mupix/sources/MuPix3_PixCtr.vhd
mupix/sources/MuPix3_board.vhd
mupix/sources/StdTypes.vhd [new file with mode: 0644]
mupix/sources/mupix_components.vhd

index 7acf0fc45a278976b8faaa95b4e8040d4ddcad65..d1b6b8080df22b7495cd20262ba1efb684080126 100644 (file)
@@ -6,16 +6,15 @@ library IEEE;
 use IEEE.STD_LOGIC_1164.all;
 use IEEE.numeric_std.all;
 
+use work.StdTypes.all;
+
 entity PixCtr is
   
   port (
     clk                  : in  std_logic;
     sout_c_from_mupix    : in  std_logic;
     sout_d_from_mupix    : in  std_logic;
-    ck_d_to_mupix        : out std_logic;
-    ck_c_to_mupix        : out std_logic;
-    ld_c_to_mupix        : out std_logic;
-    sin_to_mupix         : out std_logic;
+    mupix_ctrl           : out MupixSlowControl;
     SLV_READ_IN          : in  std_logic;
     SLV_WRITE_IN         : in  std_logic;
     SLV_DATA_OUT         : out std_logic_vector(31 downto 0);
@@ -61,10 +60,10 @@ begin  -- Behavioral
     end if;
   end process Delay;
 
-  sin_to_mupix  <= slowcontrol_reg_old(0);
-  ck_c_to_mupix <= slowcontrol_reg_old(1);
-  ck_d_to_mupix <= slowcontrol_reg_old(2);
-  ld_c_to_mupix <= slowcontrol_reg_old(3);
+  mupix_ctrl.sin  <= slowcontrol_reg_old(0);
+  mupix_ctrl.ck_c <= slowcontrol_reg_old(1);
+  mupix_ctrl.ck_d <= slowcontrol_reg_old(2);
+  mupix_ctrl.ld_c <= slowcontrol_reg_old(3);
 
   -----------------------------------------------------------------------------
   --x0080: Register for SlowControl
index 8818be05c8796c3fc2c0eb627f6e5b95413cfe71..48bca5259ea9424d646a55bdc734a46bcd4acc5f 100644 (file)
@@ -11,6 +11,7 @@ use work.trb_net_std.all;
 use work.trb_net_components.all;
 use work.trb3_components.all;
 
+use work.StdTypes.all;
 
 entity MuPix3_Board is
   port(
@@ -124,7 +125,7 @@ architecture Behavioral of MuPix3_Board is
   signal fpga_aux_from_board_sync  : std_logic_vector(5 downto 0);
   signal szintilator_sync          : std_logic;
 
-  
+  signal mupix_ctrl_i : MupixSlowControl;
 
 begin  -- Behavioral
 
@@ -287,16 +288,17 @@ begin  -- Behavioral
       testpulse2           => testpulse2_to_board
       );
 
+  ck_d_to_mupix <= mupix_ctrl_i.ck_d;
+  ck_c_to_mupix <= mupix_ctrl_i.ck_c;
+  ld_c_to_mupix <= mupix_ctrl_i.ld_c;
+  sin_to_mupix  <= mupix_ctrl_i.sin;
 
   PixCtr_1: PixCtr
     port map (
       clk                  => clk,
       sout_c_from_mupix    => sout_c_from_mupix_sync,
       sout_d_from_mupix    => sout_d_from_mupix_sync,
-      ck_d_to_mupix        => ck_d_to_mupix,
-      ck_c_to_mupix        => ck_c_to_mupix,
-      ld_c_to_mupix        => ld_c_to_mupix,
-      sin_to_mupix         => sin_to_mupix,
+      mupix_ctrl           => mupix_ctrl_i,
       SLV_READ_IN          => slv_read(3),
       SLV_WRITE_IN         => slv_write(3),
       SLV_DATA_OUT         => slv_data_rd(3*32+31 downto 3*32),
diff --git a/mupix/sources/StdTypes.vhd b/mupix/sources/StdTypes.vhd
new file mode 100644 (file)
index 0000000..1fddd75
--- /dev/null
@@ -0,0 +1,35 @@
+------------------------------------------------------------
+--! @file
+--! @brief definition of types used in Readout for Mupix 6
+--! @author Tobias Weber
+--! @date August 2017
+------------------------------------------------------------
+library IEEE;
+use IEEE.std_logic_1164.all;
+
+package StdTypes is
+
+  type MupixReadoutCtrl is record  --control signals for mupix readout state machine
+    ldpix      : std_logic;             --load pixel
+    ldcol      : std_logic;             --load column
+    rdcol      : std_logic;             --read column
+    pulldown   : std_logic;             --pull down
+    timestamps : std_logic_vector(7 downto 0);  --timestamps to chip
+  end record MupixReadoutCtrl;
+
+  type MupixReadoutData is record       --readout data from the mupix chip
+    priout   : std_logic;               --priority out
+    hit_col  : std_logic_vector(5 downto 0);  --hit column
+    hit_row  : std_logic_vector(5 downto 0);  --hit row
+    hit_time : std_logic_vector(7 downto 0);  --hit time
+  end record MupixReadoutData;
+
+  type MupixSlowControl is record       --slow control signals for mupix chip
+    ck_d : std_logic;                   --clock d
+    ck_c : std_logic;                   --clock c
+    ld_c : std_logic;                   --load c
+    sin  : std_logic;                   --serial data in
+  end record MupixSlowControl;
+
+  
+end package StdTypes;
index 4dabb4472e6748a2c4b78b995eb3643035186d7a..ec6407100003e140ca438e6e520f05d308fd6a55 100644 (file)
@@ -3,6 +3,8 @@ library ieee;
 use ieee.std_logic_1164.all;
 use ieee.numeric_std.all;
 
+use work.StdTypes.all;
+
 package mupix_components is
 
   --MuPix Board entity with regio to trbv3
@@ -205,10 +207,7 @@ package mupix_components is
       clk                  : in  std_logic;
       sout_c_from_mupix    : in  std_logic;
       sout_d_from_mupix    : in  std_logic;
-      ck_d_to_mupix        : out std_logic;
-      ck_c_to_mupix        : out std_logic;
-      ld_c_to_mupix        : out std_logic;
-      sin_to_mupix         : out std_logic;
+      mupix_ctrl           : out MupixSlowControl;
       SLV_READ_IN          : in  std_logic;
       SLV_WRITE_IN         : in  std_logic;
       SLV_DATA_OUT         : out std_logic_vector(31 downto 0);