Changeset 207
- Timestamp:
- 05/17/10 08:32:09 (15 years ago)
- Location:
- FPGA/FTU
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
FPGA/FTU/FTU_top.vhd
r157 r207 29 29 30 30 31 32 31 entity FTU_top is 33 32 port( 34 33 -- global control 35 34 ext_clk : IN STD_LOGIC; -- external clock from FTU board 36 reset : in STD_LOGIC; -- reset 37 brd_add : IN STD_LOGIC_VECTOR(7 downto 0); -- global board address 35 brd_add : IN STD_LOGIC_VECTOR(5 downto 0); -- global board address 38 36 39 37 -- rate counters LVDS inputs … … 51 49 52 50 -- DAC interface 53 -- miso : IN STD_LOGIC; -- master-in-slave-out54 51 sck : OUT STD_LOGIC; -- serial clock to DAC 55 52 mosi : OUT STD_LOGIC; -- serial data to DAC, master-out-slave-in … … 70 67 71 68 -- testpoints 72 TP_A : out STD_LOGIC_VECTOR(7downto 0) -- testpoints69 TP_A : out STD_LOGIC_VECTOR(11 downto 0) -- testpoints 73 70 ); 74 71 end FTU_top; … … 99 96 end component; 100 97 101 signal clk_sig : STD_LOGIC; 102 signal reset_sig : STD_LOGIC; 103 signal miso_sig : STD_LOGIC; 104 signal clr_sig : STD_LOGIC; 105 signal mosi_sig : STD_LOGIC; 106 signal sck_sig : STD_LOGIC; 107 signal cs_ld_sig : STD_LOGIC; 98 signal reset_sig : STD_LOGIC := '0'; -- initialize reset to 0 at power up 99 signal clk_5M_sig : STD_LOGIC; 108 100 109 signal clk_5M_sig : STD_LOGIC; 101 type FTU_top_StateType is (Init, Running, Reset); 102 signal FTU_top_State, FTU_top_NextState: FTU_top_StateType; 110 103 111 104 begin 112 105 113 clk_sig <= ext_clk;114 reset_sig <= '0';--where to get this from?115 -- miso_sig <= miso;116 117 clr <= clr_sig;118 mosi <= mosi_sig;119 sck <= sck_sig;120 cs_ld <= cs_ld_sig;121 122 106 Inst_FTU_dac_dcm : FTU_dac_dcm 123 107 port map( 124 CLKIN_IN => clk_sig,108 CLKIN_IN => ext_clk, 125 109 RST_IN => reset_sig, 126 110 CLKFX_OUT => clk_5M_sig, … … 133 117 clk => clk_5M_sig, 134 118 reset => reset_sig, 135 miso => miso_sig,136 clr => clr _sig,137 mosi => mosi _sig,138 sck => sck _sig,139 cs_ld => cs_ld _sig119 miso => '0', 120 clr => clr, 121 mosi => mosi, 122 sck => sck, 123 cs_ld => cs_ld 140 124 ); 141 125 126 --FTU main state machine (two-process implementation) 127 128 FTU_top_Registers: process (ext_clk) 129 begin 130 if Rising_edge(ext_clk) then 131 FTU_top_State <= FTU_top_NextState; 132 end if; 133 end process FTU_top_Registers; 134 135 FTU_top_C_logic: process (FTU_top_State) 136 begin 137 FTU_top_NextState <= FTU_top_State; 138 case FTU_top_State is 139 when Init => 140 reset_sig <= '0'; 141 FTU_top_NextState <= Running; 142 when Running => 143 when Reset => 144 reset_sig <= '1'; 145 FTU_top_NextState <= Init; 146 end case; 147 end process FTU_top_C_logic; 148 142 149 end Behavioral; 143 150 -
FPGA/FTU/FTU_top_tb.vhd
r158 r207 42 42 -- global control 43 43 ext_clk : IN STD_LOGIC; -- external clock from FTU board 44 reset : in STD_LOGIC; -- reset 45 brd_add : IN STD_LOGIC_VECTOR(7 downto 0); -- global board address 44 brd_add : IN STD_LOGIC_VECTOR(5 downto 0); -- global board address 46 45 47 46 -- rate counters LVDS inputs … … 59 58 60 59 -- DAC interface 61 -- miso : IN STD_LOGIC; -- master-in-slave-out62 60 sck : OUT STD_LOGIC; -- serial clock to DAC 63 61 mosi : OUT STD_LOGIC; -- serial data to DAC, master-out-slave-in … … 78 76 79 77 -- testpoints 80 TP_A : out STD_LOGIC_VECTOR( 7downto 0) -- testpoints78 TP_A : out STD_LOGIC_VECTOR(11 downto 0) -- testpoints 81 79 ); 82 80 end component; … … 84 82 --Inputs 85 83 signal ext_clk : STD_LOGIC := '0'; 86 signal reset : STD_LOGIC := '0'; 87 signal brd_add : STD_LOGIC_VECTOR(7 downto 0) := (others => '0'); 84 signal brd_add : STD_LOGIC_VECTOR(5 downto 0) := (others => '0'); 88 85 signal patch_A_p : STD_LOGIC := '0'; 89 86 signal patch_A_n : STD_LOGIC := '0'; … … 96 93 signal trig_prim_p : STD_LOGIC := '0'; 97 94 signal trig_prim_n : STD_LOGIC := '0'; 98 -- signal miso : STD_LOGIC := '0';99 95 signal rx : STD_LOGIC := '0'; 100 96 … … 111 107 signal rx_en : STD_LOGIC; 112 108 signal tx_en : STD_LOGIC; 113 signal TP_A : STD_LOGIC_VECTOR( 7downto 0);109 signal TP_A : STD_LOGIC_VECTOR(11 downto 0); 114 110 115 111 -- Clock period definitions … … 122 118 port map( 123 119 ext_clk => ext_clk, 124 reset => reset,125 120 brd_add => brd_add, 126 121 patch_A_p => patch_A_p, … … 134 129 trig_prim_p => trig_prim_p, 135 130 trig_prim_n => trig_prim_n, 136 -- miso => miso,137 131 rx => rx, 138 132 rx_en => rx_en,
Note:
See TracChangeset
for help on using the changeset viewer.