玩转赛灵思Zedboard开发板(5):基于AXI Lite总线的从设备IP设计
--------------------
202 -- Index for CS/CE
203 ------------------------------------------
204 constant USER_SLV_CS_INDEX : integer := 0;
205 constant USER_SLV_CE_INDEX : integer := calc_start_ce_index(IPIF_ARD_NUM_CE_ARRAY, USER_SLV_CS_INDEX);
206
207 constant USER_CE_INDEX : integer := USER_SLV_CE_INDEX;
208
209 ------------------------------------------
210 -- IP Interconnect (IPIC) signal declarations
211 ------------------------------------------
212 signal ipif_Bus2IP_Clk : std_logic;
213 signal ipif_Bus2IP_Resetn : std_logic;
214 signal ipif_Bus2IP_Addr : std_logic_vector(C_S_AXI_ADDR_WIDTH-1 downto 0);
215 signal ipif_Bus2IP_RNW : std_logic;
216 signal ipif_Bus2IP_BE : std_logic_vector(IPIF_SLV_DWIDTH/8-1 downto 0);
217 signal ipif_Bus2IP_CS : std_logic_vector((IPIF_ARD_ADDR_RANGE_ARRAY'LENGTH)/2-1 downto 0);
218 signal ipif_Bus2IP_RdCE : std_logic_vector(calc_num_ce(IPIF_ARD_NUM_CE_ARRAY)-1 downto 0);
219 signal ipif_Bus2IP_WrCE : std_logic_vector(calc_num_ce(IPIF_ARD_NUM_CE_ARRAY)-1 downto 0);
220 signal ipif_Bus2IP_Data : std_logic_vector(IPIF_SLV_DWIDTH-1 downto 0);
221 signal ipif_IP2Bus_WrAck : std_logic;
222 signal ipif_IP2Bus_RdAck : std_logic;
223 signal ipif_IP2Bus_Error : std_logic;
224 signal ipif_IP2Bus_Data : std_logic_vector(IPIF_SLV_DWIDTH-1 downto 0);
225 signal user_Bus2IP_RdCE : std_logic_vector(USER_NUM_REG-1 downto 0);
226 signal user_Bus2IP_WrCE : std_logic_vector(USER_NUM_REG-1 downto 0);
227 signal user_IP2Bus_Data : std_logic_vector(USER_SLV_DWIDTH-1 downto 0);
228 signal user_IP2Bus_RdAck : std_logic;
229 signal user_IP2Bus_WrAck : std_logic;
230 signal user_IP2Bus_Error : std_logic;
231
232 ------------------------------------------
233 -- Component declaration for verilog user logic
234 ------------------------------------------
235 component user_logic is
236 generic
237 (
238 -- ADD USER GENERICS BELOW THIS LINE ---------------
239 --USER generics added here
240 -- ADD USER GENERICS ABOVE THIS LINE ---------------
241
242 -- DO NOT EDIT BELOW THIS LINE ---------------------
243 -- Bus protocol parameters, do not add to or delete
244 C_NUM_REG : integer := 1;
245 C_SLV_DWIDTH : integer := 32
246 -- DO NOT EDIT ABOVE THIS LINE ---------------------
247 );
248 port
249 (
250 -- ADD USER PORTS BELOW THIS LINE ------------------
251 LED : out std_logic_vector(7 downto 0);
252 -- ADD USER PORTS ABOVE THIS LINE ------------------
253
254 -- DO NOT EDIT BELOW THIS LINE ---------------------
255 -- Bus protocol ports, do not add to or delete
256 Bus2IP_Clk : in std_logic;
257 Bus2IP_Resetn : in std_logic;
258 Bus2IP_Data : in std_logic_vector(C_SLV_DWIDTH-1 downto 0);
259 Bus2IP_BE : in std_logic_vector(C_SLV_DWIDTH/8-1 downto 0);
260 Bus2IP_RdCE : in std_logic_vector(C_NUM_REG-1 downto 0);
261 Bus2IP_WrCE : in std_logic_vector(C_NUM_REG-1 downto 0);
262 IP2Bus_Data : out std_logic_vector(C_SLV_DWIDTH-1 downto 0);
263 IP2Bus_RdAck : out std_logic;
264 IP2Bus_WrAck : out std_logic;
265 IP2Bus_Error : out std_logic
266 -- DO NOT EDIT ABOVE THIS LINE ---------------------
267 );
268 end component user_logic;
269
270 begin
271
272 ------------------------------------------
273 -- instantiate axi_lite_ipif
274 ------------------------------------------
275 AXI_LITE_IPIF_I : entity axi_lite_ipif_v1_01_a.axi_lite_ipif
276 generic map
277 (
278 C_S_AXI_DATA_WIDTH => IPIF_SLV_DWIDTH,
279 C_S_AXI_ADDR_WIDTH => C_S_AXI_ADDR_WIDTH,
280 C_S_AXI