blob: 11a7dc331df92d6d8b7e8eb236de261b23c14ef6 [file] [log] [blame]
Matt Venn08cd6eb2020-11-16 12:01:14 +01001`default_nettype none
Tim Edwards9eda80d2020-10-08 21:36:44 -04002module mprj_io #(
3 parameter AREA1PADS = 18 // Highest numbered pad in area 1
4) (
5 inout vddio,
6 inout vssio,
7 inout vdda,
8 inout vssa,
9 inout vccd,
10 inout vssd,
11
12 inout vdda1,
13 inout vdda2,
14 inout vssa1,
15 inout vssa2,
16 inout vccd1,
17 inout vccd2,
18 inout vssd1,
19 inout vssd2,
20
Tim Edwards04ba17f2020-10-02 22:27:50 -040021 input vddio_q,
22 input vssio_q,
23 input analog_a,
24 input analog_b,
Tim Edwards44bab472020-10-04 22:09:54 -040025 input porb_h,
26 input por,
27 inout [`MPRJ_IO_PADS-1:0] io,
Tim Edwards04ba17f2020-10-02 22:27:50 -040028 input [`MPRJ_IO_PADS-1:0] io_out,
Tim Edwards44bab472020-10-04 22:09:54 -040029 input [`MPRJ_IO_PADS-1:0] oeb,
shalan0d14e6e2020-08-31 16:50:48 +020030 input [`MPRJ_IO_PADS-1:0] hldh_n,
Tim Edwards04ba17f2020-10-02 22:27:50 -040031 input [`MPRJ_IO_PADS-1:0] enh,
shalan0d14e6e2020-08-31 16:50:48 +020032 input [`MPRJ_IO_PADS-1:0] inp_dis,
33 input [`MPRJ_IO_PADS-1:0] ib_mode_sel,
Tim Edwards04ba17f2020-10-02 22:27:50 -040034 input [`MPRJ_IO_PADS-1:0] vtrip_sel,
35 input [`MPRJ_IO_PADS-1:0] slow_sel,
36 input [`MPRJ_IO_PADS-1:0] holdover,
shalan0d14e6e2020-08-31 16:50:48 +020037 input [`MPRJ_IO_PADS-1:0] analog_en,
38 input [`MPRJ_IO_PADS-1:0] analog_sel,
39 input [`MPRJ_IO_PADS-1:0] analog_pol,
40 input [`MPRJ_IO_PADS*3-1:0] dm,
Tim Edwards04ba17f2020-10-02 22:27:50 -040041 output [`MPRJ_IO_PADS-1:0] io_in
shalan0d14e6e2020-08-31 16:50:48 +020042);
Tim Edwards9eda80d2020-10-08 21:36:44 -040043
44 wire [`MPRJ_IO_PADS-1:0] loop1_io;
45
Tim Edwards4c733352020-10-12 16:32:36 -040046 sky130_ef_io__gpiov2_pad area1_io_pad [AREA1PADS - 1:0] (
Tim Edwards9eda80d2020-10-08 21:36:44 -040047 `USER1_ABUTMENT_PINS
48 `ifndef TOP_ROUTING
Tim Edwards4c733352020-10-12 16:32:36 -040049 .PAD(io[AREA1PADS - 1:0]),
Tim Edwards9eda80d2020-10-08 21:36:44 -040050 `endif
Tim Edwards4c733352020-10-12 16:32:36 -040051 .OUT(io_out[AREA1PADS - 1:0]),
52 .OE_N(oeb[AREA1PADS - 1:0]),
53 .HLD_H_N(hldh_n[AREA1PADS - 1:0]),
54 .ENABLE_H(enh[AREA1PADS - 1:0]),
55 .ENABLE_INP_H(loop1_io[AREA1PADS - 1:0]),
56 .ENABLE_VDDA_H(porb_h),
57 .ENABLE_VSWITCH_H(vssio),
58 .ENABLE_VDDIO(vccd),
59 .INP_DIS(inp_dis[AREA1PADS - 1:0]),
60 .IB_MODE_SEL(ib_mode_sel[AREA1PADS - 1:0]),
61 .VTRIP_SEL(vtrip_sel[AREA1PADS - 1:0]),
62 .SLOW(slow_sel[AREA1PADS - 1:0]),
63 .HLD_OVR(holdover[AREA1PADS - 1:0]),
64 .ANALOG_EN(analog_en[AREA1PADS - 1:0]),
65 .ANALOG_SEL(analog_sel[AREA1PADS - 1:0]),
66 .ANALOG_POL(analog_pol[AREA1PADS - 1:0]),
67 .DM(dm[AREA1PADS*3 - 1:0]),
68 .PAD_A_NOESD_H(),
69 .PAD_A_ESD_0_H(),
70 .PAD_A_ESD_1_H(),
71 .IN(io_in[AREA1PADS - 1:0]),
72 .IN_H(),
73 .TIE_HI_ESD(),
74 .TIE_LO_ESD(loop1_io[AREA1PADS - 1:0])
Tim Edwards9eda80d2020-10-08 21:36:44 -040075 );
76
Tim Edwards4c733352020-10-12 16:32:36 -040077 sky130_ef_io__gpiov2_pad area2_io_pad [`MPRJ_IO_PADS - AREA1PADS - 1:0] (
Tim Edwards9eda80d2020-10-08 21:36:44 -040078 `USER2_ABUTMENT_PINS
79 `ifndef TOP_ROUTING
Tim Edwards4c733352020-10-12 16:32:36 -040080 .PAD(io[`MPRJ_IO_PADS - 1:AREA1PADS]),
Tim Edwards9eda80d2020-10-08 21:36:44 -040081 `endif
Tim Edwards4c733352020-10-12 16:32:36 -040082 .OUT(io_out[`MPRJ_IO_PADS - 1:AREA1PADS]),
83 .OE_N(oeb[`MPRJ_IO_PADS - 1:AREA1PADS]),
84 .HLD_H_N(hldh_n[`MPRJ_IO_PADS - 1:AREA1PADS]),
85 .ENABLE_H(enh[`MPRJ_IO_PADS - 1:AREA1PADS]),
86 .ENABLE_INP_H(loop1_io[`MPRJ_IO_PADS - 1:AREA1PADS]),
87 .ENABLE_VDDA_H(porb_h),
88 .ENABLE_VSWITCH_H(vssio),
89 .ENABLE_VDDIO(vccd),
90 .INP_DIS(inp_dis[`MPRJ_IO_PADS - 1:AREA1PADS]),
91 .IB_MODE_SEL(ib_mode_sel[`MPRJ_IO_PADS - 1:AREA1PADS]),
92 .VTRIP_SEL(vtrip_sel[`MPRJ_IO_PADS - 1:AREA1PADS]),
93 .SLOW(slow_sel[`MPRJ_IO_PADS - 1:AREA1PADS]),
94 .HLD_OVR(holdover[`MPRJ_IO_PADS - 1:AREA1PADS]),
95 .ANALOG_EN(analog_en[`MPRJ_IO_PADS - 1:AREA1PADS]),
96 .ANALOG_SEL(analog_sel[`MPRJ_IO_PADS - 1:AREA1PADS]),
97 .ANALOG_POL(analog_pol[`MPRJ_IO_PADS - 1:AREA1PADS]),
98 .DM(dm[`MPRJ_IO_PADS*3 - 1:AREA1PADS*3]),
99 .PAD_A_NOESD_H(),
100 .PAD_A_ESD_0_H(),
101 .PAD_A_ESD_1_H(),
102 .IN(io_in[`MPRJ_IO_PADS - 1:AREA1PADS]),
103 .IN_H(),
104 .TIE_HI_ESD(),
105 .TIE_LO_ESD(loop1_io[`MPRJ_IO_PADS - 1:AREA1PADS])
Tim Edwards9eda80d2020-10-08 21:36:44 -0400106 );
shalan0d14e6e2020-08-31 16:50:48 +0200107
Tim Edwards04ba17f2020-10-02 22:27:50 -0400108endmodule