1 |
6 |
dsheffie |
//----------------------------------------------------------------------------
|
2 |
|
|
// user_logic.v - module
|
3 |
|
|
//----------------------------------------------------------------------------
|
4 |
|
|
//
|
5 |
|
|
// ***************************************************************************
|
6 |
|
|
// ** Copyright (c) 1995-2012 Xilinx, Inc. All rights reserved. **
|
7 |
|
|
// ** **
|
8 |
|
|
// ** Xilinx, Inc. **
|
9 |
|
|
// ** XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" **
|
10 |
|
|
// ** AS A COURTESY TO YOU, SOLELY FOR USE IN DEVELOPING PROGRAMS AND **
|
11 |
|
|
// ** SOLUTIONS FOR XILINX DEVICES. BY PROVIDING THIS DESIGN, CODE, **
|
12 |
|
|
// ** OR INFORMATION AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, **
|
13 |
|
|
// ** APPLICATION OR STANDARD, XILINX IS MAKING NO REPRESENTATION **
|
14 |
|
|
// ** THAT THIS IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT, **
|
15 |
|
|
// ** AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE **
|
16 |
|
|
// ** FOR YOUR IMPLEMENTATION. XILINX EXPRESSLY DISCLAIMS ANY **
|
17 |
|
|
// ** WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE **
|
18 |
|
|
// ** IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR **
|
19 |
|
|
// ** REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF **
|
20 |
|
|
// ** INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS **
|
21 |
|
|
// ** FOR A PARTICULAR PURPOSE. **
|
22 |
|
|
// ** **
|
23 |
|
|
// ***************************************************************************
|
24 |
|
|
//
|
25 |
|
|
//----------------------------------------------------------------------------
|
26 |
|
|
// Filename: user_logic.v
|
27 |
|
|
// Version: 1.00.a
|
28 |
|
|
// Description: User logic module.
|
29 |
|
|
// Date: Wed Dec 12 22:58:12 2012 (by Create and Import Peripheral Wizard)
|
30 |
|
|
// Verilog Standard: Verilog-2001
|
31 |
|
|
//----------------------------------------------------------------------------
|
32 |
|
|
// Naming Conventions:
|
33 |
|
|
// active low signals: "*_n"
|
34 |
|
|
// clock signals: "clk", "clk_div#", "clk_#x"
|
35 |
|
|
// reset signals: "rst", "rst_n"
|
36 |
|
|
// generics: "C_*"
|
37 |
|
|
// user defined types: "*_TYPE"
|
38 |
|
|
// state machine next state: "*_ns"
|
39 |
|
|
// state machine current state: "*_cs"
|
40 |
|
|
// combinatorial signals: "*_com"
|
41 |
|
|
// pipelined or register delay signals: "*_d#"
|
42 |
|
|
// counter signals: "*cnt*"
|
43 |
|
|
// clock enable signals: "*_ce"
|
44 |
|
|
// internal version of output port: "*_i"
|
45 |
|
|
// device pins: "*_pin"
|
46 |
|
|
// ports: "- Names begin with Uppercase"
|
47 |
|
|
// processes: "*_PROCESS"
|
48 |
|
|
// component instantiations: "<ENTITY_>I_<#|FUNC>"
|
49 |
|
|
//----------------------------------------------------------------------------
|
50 |
|
|
|
51 |
|
|
`uselib lib=unisims_ver
|
52 |
|
|
`uselib lib=proc_common_v3_00_a
|
53 |
|
|
|
54 |
|
|
module user_logic
|
55 |
|
|
(
|
56 |
|
|
// -- ADD USER PORTS BELOW THIS LINE ---------------
|
57 |
|
|
// --USER ports added here
|
58 |
|
|
// -- ADD USER PORTS ABOVE THIS LINE ---------------
|
59 |
|
|
|
60 |
|
|
// -- DO NOT EDIT BELOW THIS LINE ------------------
|
61 |
|
|
// -- Bus protocol ports, do not add to or delete
|
62 |
|
|
Bus2IP_Clk, // Bus to IP clock
|
63 |
|
|
Bus2IP_Resetn, // Bus to IP reset
|
64 |
|
|
Bus2IP_Data, // Bus to IP data bus
|
65 |
|
|
Bus2IP_BE, // Bus to IP byte enables
|
66 |
|
|
Bus2IP_RdCE, // Bus to IP read chip enable
|
67 |
|
|
Bus2IP_WrCE, // Bus to IP write chip enable
|
68 |
|
|
IP2Bus_Data, // IP to Bus data bus
|
69 |
|
|
IP2Bus_RdAck, // IP to Bus read transfer acknowledgement
|
70 |
|
|
IP2Bus_WrAck, // IP to Bus write transfer acknowledgement
|
71 |
|
|
IP2Bus_Error // IP to Bus error response
|
72 |
|
|
// -- DO NOT EDIT ABOVE THIS LINE ------------------
|
73 |
|
|
); // user_logic
|
74 |
|
|
|
75 |
|
|
// -- ADD USER PARAMETERS BELOW THIS LINE ------------
|
76 |
|
|
// --USER parameters added here
|
77 |
|
|
// -- ADD USER PARAMETERS ABOVE THIS LINE ------------
|
78 |
|
|
|
79 |
|
|
// -- DO NOT EDIT BELOW THIS LINE --------------------
|
80 |
|
|
// -- Bus protocol parameters, do not add to or delete
|
81 |
|
|
parameter C_NUM_REG = 8;
|
82 |
|
|
parameter C_SLV_DWIDTH = 32;
|
83 |
|
|
// -- DO NOT EDIT ABOVE THIS LINE --------------------
|
84 |
|
|
|
85 |
|
|
// -- ADD USER PORTS BELOW THIS LINE -----------------
|
86 |
|
|
// --USER ports added here
|
87 |
|
|
// -- ADD USER PORTS ABOVE THIS LINE -----------------
|
88 |
|
|
|
89 |
|
|
// -- DO NOT EDIT BELOW THIS LINE --------------------
|
90 |
|
|
// -- Bus protocol ports, do not add to or delete
|
91 |
|
|
input Bus2IP_Clk;
|
92 |
|
|
input Bus2IP_Resetn;
|
93 |
|
|
input [C_SLV_DWIDTH-1 : 0] Bus2IP_Data;
|
94 |
|
|
input [C_SLV_DWIDTH/8-1 : 0] Bus2IP_BE;
|
95 |
|
|
input [C_NUM_REG-1 : 0] Bus2IP_RdCE;
|
96 |
|
|
input [C_NUM_REG-1 : 0] Bus2IP_WrCE;
|
97 |
|
|
output [C_SLV_DWIDTH-1 : 0] IP2Bus_Data;
|
98 |
|
|
output IP2Bus_RdAck;
|
99 |
|
|
output IP2Bus_WrAck;
|
100 |
|
|
output IP2Bus_Error;
|
101 |
|
|
// -- DO NOT EDIT ABOVE THIS LINE --------------------
|
102 |
|
|
|
103 |
|
|
|
104 |
|
|
wire write_ready;
|
105 |
|
|
wire read_ready;
|
106 |
|
|
|
107 |
|
|
assign IP2Bus_WrAck = write_ready && Bus2IP_WrCE != 0;
|
108 |
|
|
assign IP2Bus_RdAck = read_ready && Bus2IP_RdCE != 0;
|
109 |
|
|
assign IP2Bus_Error = 0;
|
110 |
|
|
|
111 |
|
|
Slave s
|
112 |
|
|
(
|
113 |
|
|
.clk(Bus2IP_Clk),
|
114 |
|
|
.reset(!Bus2IP_Resetn),
|
115 |
|
|
|
116 |
|
|
.io_write_valid(Bus2IP_WrCE),
|
117 |
|
|
.io_write_ready(write_ready),
|
118 |
|
|
.io_write_data(Bus2IP_Data),
|
119 |
|
|
.io_write_byteEnable(Bus2IP_BE),
|
120 |
|
|
|
121 |
|
|
.io_read_valid(Bus2IP_RdCE),
|
122 |
|
|
.io_read_ready(read_ready),
|
123 |
|
|
.io_read_data(IP2Bus_Data)
|
124 |
|
|
);
|
125 |
|
|
|
126 |
|
|
endmodule
|
127 |
|
|
|
128 |
|
|
`include "Slave.v"
|