blob: 8e9aaf8ebc78d2e26c13bda9571df8f80d6752d5 [file] [log] [blame]
manarabdelaty1f670402021-02-01 05:45:23 -05001// SPDX-FileCopyrightText: 2020 Efabless Corporation
2//
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.
14// SPDX-License-Identifier: Apache-2.0
15
16`default_nettype none
17/*
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
manarabdelatyc7701682021-02-01 13:13:57 -050032`define MPRJ_IO_PADS 38
33
34module user_project_wrapper (
manarabdelaty1f670402021-02-01 05:45:23 -050035`ifdef USE_POWER_PINS
36 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
44`endif
45
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,
manarabdelaty31a95572021-02-03 10:55:39 -050055 output wbs_ack_o,
manarabdelaty1f670402021-02-01 05:45:23 -050056 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
64 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,
67
68 // 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
74 // Independent clock (on independent integer divider)
75 input user_clock2
76);
77
78 /*--------------------------------------*/
79 /* User project is instantiated here */
80 /*--------------------------------------*/
81
manarabdelatyc7701682021-02-01 13:13:57 -050082 user_proj_top user_proj_top (
manarabdelaty1f670402021-02-01 05:45:23 -050083 `ifdef USE_POWER_PINS
manarabdelaty31a95572021-02-03 10:55:39 -050084 .VPWR(vccd1), // User area 1 1.8V power
85 .VGND(vssd1), // User area 1 digital ground
manarabdelaty1f670402021-02-01 05:45:23 -050086 `endif
87
88 // MGMT core clock and reset
89
manarabdelatyc7701682021-02-01 13:13:57 -050090 .clk(wb_clk_i),
91 .rst(wb_rst_i),
manarabdelaty1f670402021-02-01 05:45:23 -050092
93 // Logic Analyzer
94
manarabdelatyc7701682021-02-01 13:13:57 -050095 .mc (la_data_in[31:0]),
96 .mp (la_data_in[63:32]),
97 .start (la_data_in[64]),
manarabdelaty31a95572021-02-03 10:55:39 -050098 .prod_sel(la_data_in[65]),
99 .done (la_data_out[66]),
100 .prod (la_data_out[127:96]),
manarabdelatyc7701682021-02-01 13:13:57 -0500101 .tie ({io_oeb[`MPRJ_IO_PADS-1:5], io_oeb[3:0], io_out[`MPRJ_IO_PADS-1:5], io_out[3:0], la_data_out[63:1], wbs_ack_o, wbs_dat_o[31:0]}),
manarabdelaty1f670402021-02-01 05:45:23 -0500102
manarabdelatyc7701682021-02-01 13:13:57 -0500103 // IO Pads
104 .tck(io_in[0]), // test clock on one of the IOs ?
105 .tms(io_in[1]),
106 .tdi(io_in[2]),
manarabdelaty31a95572021-02-03 10:55:39 -0500107 .trst(io_in[5]),
manarabdelatyc7701682021-02-01 13:13:57 -0500108 .tdo(io_out[4]),
109 .tdo_paden_o(io_oeb[4])
manarabdelaty1f670402021-02-01 05:45:23 -0500110 );
111
112endmodule // user_project_wrapper
manarabdelatyc7701682021-02-01 13:13:57 -0500113`default_nettype wire