Matt Venn | 08cd6eb | 2020-11-16 12:01:14 +0100 | [diff] [blame] | 1 | `default_nettype none |
Tim Edwards | b86fc84 | 2020-10-13 17:11:54 -0400 | [diff] [blame] | 2 | /* |
| 3 | *------------------------------------------------------------- |
| 4 | * |
| 5 | * user_project_wrapper |
| 6 | * |
| 7 | * This wrapper enumerates all of the pins available to the |
| 8 | * user for the user project. |
| 9 | * |
| 10 | * An example user project is provided in this wrapper. The |
| 11 | * example should be removed and replaced with the actual |
| 12 | * user project. |
| 13 | * |
| 14 | *------------------------------------------------------------- |
| 15 | */ |
| 16 | |
| 17 | module user_project_wrapper #( |
Tim Edwards | b86fc84 | 2020-10-13 17:11:54 -0400 | [diff] [blame] | 18 | parameter BITS = 32 |
| 19 | )( |
Ahmed Ghazy | df4dd88 | 2020-11-25 18:38:42 +0200 | [diff] [blame] | 20 | `ifdef USE_POWER_PINS |
Tim Edwards | b86fc84 | 2020-10-13 17:11:54 -0400 | [diff] [blame] | 21 | inout vdda1, // User area 1 3.3V supply |
| 22 | inout vdda2, // User area 2 3.3V supply |
| 23 | inout vssa1, // User area 1 analog ground |
| 24 | inout vssa2, // User area 2 analog ground |
| 25 | inout vccd1, // User area 1 1.8V supply |
| 26 | inout vccd2, // User area 2 1.8v supply |
| 27 | inout vssd1, // User area 1 digital ground |
| 28 | inout vssd2, // User area 2 digital ground |
Ahmed Ghazy | df4dd88 | 2020-11-25 18:38:42 +0200 | [diff] [blame] | 29 | `endif |
Tim Edwards | b86fc84 | 2020-10-13 17:11:54 -0400 | [diff] [blame] | 30 | |
| 31 | // Wishbone Slave ports (WB MI A) |
| 32 | input wb_clk_i, |
| 33 | input wb_rst_i, |
| 34 | input wbs_stb_i, |
| 35 | input wbs_cyc_i, |
| 36 | input wbs_we_i, |
| 37 | input [3:0] wbs_sel_i, |
| 38 | input [31:0] wbs_dat_i, |
| 39 | input [31:0] wbs_adr_i, |
| 40 | output wbs_ack_o, |
| 41 | output [31:0] wbs_dat_o, |
| 42 | |
| 43 | // Logic Analyzer Signals |
| 44 | input [127:0] la_data_in, |
| 45 | output [127:0] la_data_out, |
| 46 | input [127:0] la_oen, |
| 47 | |
| 48 | // IOs |
Ahmed Ghazy | 22d29d6 | 2020-10-28 03:42:02 +0200 | [diff] [blame] | 49 | input [`MPRJ_IO_PADS-1:0] io_in, |
| 50 | output [`MPRJ_IO_PADS-1:0] io_out, |
| 51 | output [`MPRJ_IO_PADS-1:0] io_oeb, |
Tim Edwards | b86fc84 | 2020-10-13 17:11:54 -0400 | [diff] [blame] | 52 | |
Tim Edwards | 581068f | 2020-11-19 12:45:25 -0500 | [diff] [blame] | 53 | // Analog (direct connection to GPIO pad---use with caution) |
| 54 | // Note that analog I/O is not available on the 7 lowest-numbered |
| 55 | // GPIO pads, and so the analog_io indexing is offset from the |
| 56 | // GPIO indexing by 7. |
| 57 | inout [`MPRJ_IO_PADS-8:0] analog_io, |
| 58 | |
Tim Edwards | b86fc84 | 2020-10-13 17:11:54 -0400 | [diff] [blame] | 59 | // Independent clock (on independent integer divider) |
| 60 | input user_clock2 |
| 61 | ); |
| 62 | |
| 63 | /*--------------------------------------*/ |
| 64 | /* User project is instantiated here */ |
| 65 | /*--------------------------------------*/ |
| 66 | |
Ahmed Ghazy | 22d29d6 | 2020-10-28 03:42:02 +0200 | [diff] [blame] | 67 | user_proj_example mprj ( |
Ahmed Ghazy | df4dd88 | 2020-11-25 18:38:42 +0200 | [diff] [blame] | 68 | `ifdef USE_POWER_PINS |
Tim Edwards | b86fc84 | 2020-10-13 17:11:54 -0400 | [diff] [blame] | 69 | .vdda1(vdda1), // User area 1 3.3V power |
| 70 | .vdda2(vdda2), // User area 2 3.3V power |
| 71 | .vssa1(vssa1), // User area 1 analog ground |
| 72 | .vssa2(vssa2), // User area 2 analog ground |
| 73 | .vccd1(vccd1), // User area 1 1.8V power |
| 74 | .vccd2(vccd2), // User area 2 1.8V power |
| 75 | .vssd1(vssd1), // User area 1 digital ground |
| 76 | .vssd2(vssd2), // User area 2 digital ground |
Ahmed Ghazy | df4dd88 | 2020-11-25 18:38:42 +0200 | [diff] [blame] | 77 | `endif |
Tim Edwards | b86fc84 | 2020-10-13 17:11:54 -0400 | [diff] [blame] | 78 | |
| 79 | // MGMT core clock and reset |
| 80 | |
| 81 | .wb_clk_i(wb_clk_i), |
| 82 | .wb_rst_i(wb_rst_i), |
| 83 | |
Ahmed Ghazy | 22d29d6 | 2020-10-28 03:42:02 +0200 | [diff] [blame] | 84 | // MGMT SoC Wishbone Slave |
Tim Edwards | b86fc84 | 2020-10-13 17:11:54 -0400 | [diff] [blame] | 85 | |
| 86 | .wbs_cyc_i(wbs_cyc_i), |
| 87 | .wbs_stb_i(wbs_stb_i), |
| 88 | .wbs_we_i(wbs_we_i), |
| 89 | .wbs_sel_i(wbs_sel_i), |
| 90 | .wbs_adr_i(wbs_adr_i), |
| 91 | .wbs_dat_i(wbs_dat_i), |
| 92 | .wbs_ack_o(wbs_ack_o), |
| 93 | .wbs_dat_o(wbs_dat_o), |
| 94 | |
| 95 | // Logic Analyzer |
| 96 | |
| 97 | .la_data_in(la_data_in), |
| 98 | .la_data_out(la_data_out), |
| 99 | .la_oen (la_oen), |
| 100 | |
| 101 | // IO Pads |
| 102 | |
| 103 | .io_in (io_in), |
| 104 | .io_out(io_out), |
| 105 | .io_oeb(io_oeb) |
| 106 | ); |
| 107 | |
| 108 | endmodule // user_project_wrapper |
Tim Edwards | 581068f | 2020-11-19 12:45:25 -0500 | [diff] [blame] | 109 | `default_nettype wire |