blob: 47d92f4d6bb0cdbdca2175f28fa88f12fd574096 [file] [log] [blame]
agorararmard6c766a82020-12-10 18:13:12 +02001// SPDX-FileCopyrightText: 2020 Efabless Corporation
agorararmarde5780bf2020-12-09 21:27:56 +00002//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
agorararmardafa96ea2020-12-09 23:37:31 +020014// SPDX-License-Identifier: Apache-2.0
agorararmarde5780bf2020-12-09 21:27:56 +000015
Matt Venn08cd6eb2020-11-16 12:01:14 +010016`default_nettype none
Tim Edwardsb86fc842020-10-13 17:11:54 -040017/*
18 *-------------------------------------------------------------
19 *
20 * user_project_wrapper
21 *
22 * This wrapper enumerates all of the pins available to the
23 * user for the user project.
24 *
25 * An example user project is provided in this wrapper. The
26 * example should be removed and replaced with the actual
27 * user project.
28 *
29 *-------------------------------------------------------------
30 */
31
32module user_project_wrapper #(
Tim Edwardsb86fc842020-10-13 17:11:54 -040033 parameter BITS = 32
34)(
Ahmed Ghazydf4dd882020-11-25 18:38:42 +020035`ifdef USE_POWER_PINS
Tim Edwardsb86fc842020-10-13 17:11:54 -040036 inout vdda1, // User area 1 3.3V supply
37 inout vdda2, // User area 2 3.3V supply
38 inout vssa1, // User area 1 analog ground
39 inout vssa2, // User area 2 analog ground
40 inout vccd1, // User area 1 1.8V supply
41 inout vccd2, // User area 2 1.8v supply
42 inout vssd1, // User area 1 digital ground
43 inout vssd2, // User area 2 digital ground
Ahmed Ghazydf4dd882020-11-25 18:38:42 +020044`endif
Tim Edwardsb86fc842020-10-13 17:11:54 -040045
46 // Wishbone Slave ports (WB MI A)
47 input wb_clk_i,
48 input wb_rst_i,
49 input wbs_stb_i,
50 input wbs_cyc_i,
51 input wbs_we_i,
52 input [3:0] wbs_sel_i,
53 input [31:0] wbs_dat_i,
54 input [31:0] wbs_adr_i,
55 output wbs_ack_o,
56 output [31:0] wbs_dat_o,
57
58 // Logic Analyzer Signals
59 input [127:0] la_data_in,
60 output [127:0] la_data_out,
61 input [127:0] la_oen,
62
63 // IOs
Ahmed Ghazy22d29d62020-10-28 03:42:02 +020064 input [`MPRJ_IO_PADS-1:0] io_in,
65 output [`MPRJ_IO_PADS-1:0] io_out,
66 output [`MPRJ_IO_PADS-1:0] io_oeb,
Tim Edwardsb86fc842020-10-13 17:11:54 -040067
Tim Edwards581068f2020-11-19 12:45:25 -050068 // Analog (direct connection to GPIO pad---use with caution)
69 // Note that analog I/O is not available on the 7 lowest-numbered
70 // GPIO pads, and so the analog_io indexing is offset from the
71 // GPIO indexing by 7.
72 inout [`MPRJ_IO_PADS-8:0] analog_io,
73
Tim Edwardsb86fc842020-10-13 17:11:54 -040074 // Independent clock (on independent integer divider)
75 input user_clock2
76);
77
78 /*--------------------------------------*/
79 /* User project is instantiated here */
80 /*--------------------------------------*/
81
Ahmed Ghazy22d29d62020-10-28 03:42:02 +020082 user_proj_example mprj (
Ahmed Ghazydf4dd882020-11-25 18:38:42 +020083 `ifdef USE_POWER_PINS
Tim Edwardsb86fc842020-10-13 17:11:54 -040084 .vdda1(vdda1), // User area 1 3.3V power
85 .vdda2(vdda2), // User area 2 3.3V power
86 .vssa1(vssa1), // User area 1 analog ground
87 .vssa2(vssa2), // User area 2 analog ground
88 .vccd1(vccd1), // User area 1 1.8V power
89 .vccd2(vccd2), // User area 2 1.8V power
90 .vssd1(vssd1), // User area 1 digital ground
91 .vssd2(vssd2), // User area 2 digital ground
Ahmed Ghazydf4dd882020-11-25 18:38:42 +020092 `endif
Tim Edwardsb86fc842020-10-13 17:11:54 -040093
94 // MGMT core clock and reset
95
96 .wb_clk_i(wb_clk_i),
97 .wb_rst_i(wb_rst_i),
98
Ahmed Ghazy22d29d62020-10-28 03:42:02 +020099 // MGMT SoC Wishbone Slave
Tim Edwardsb86fc842020-10-13 17:11:54 -0400100
101 .wbs_cyc_i(wbs_cyc_i),
102 .wbs_stb_i(wbs_stb_i),
103 .wbs_we_i(wbs_we_i),
104 .wbs_sel_i(wbs_sel_i),
105 .wbs_adr_i(wbs_adr_i),
106 .wbs_dat_i(wbs_dat_i),
107 .wbs_ack_o(wbs_ack_o),
108 .wbs_dat_o(wbs_dat_o),
109
110 // Logic Analyzer
111
112 .la_data_in(la_data_in),
113 .la_data_out(la_data_out),
114 .la_oen (la_oen),
115
116 // IO Pads
117
118 .io_in (io_in),
119 .io_out(io_out),
120 .io_oeb(io_oeb)
121 );
122
123endmodule // user_project_wrapper
Tim Edwards581068f2020-11-19 12:45:25 -0500124`default_nettype wire