../src/lowrisc_top_earlgrey_pinmux_reg_0.1/rtl/autogen/pinmux_reg_pkg.sv Cov: 100%
1: // Copyright lowRISC contributors.
2: // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3: // SPDX-License-Identifier: Apache-2.0
4: //
5: // Register Package auto-generated by `reggen` containing data structure
6:
7: package pinmux_reg_pkg;
8:
9: // Param list
10: parameter int NMioPeriphIn = 32;
11: parameter int NMioPeriphOut = 32;
12: parameter int NMioPads = 32;
13: parameter int NDioPads = 15;
14: parameter int NWkupDetect = 8;
15: parameter int WkupCntWidth = 8;
16:
17: ////////////////////////////
18: // Typedefs for registers //
19: ////////////////////////////
20: typedef struct packed {
21: logic [5:0] q;
22: } pinmux_reg2hw_periph_insel_mreg_t;
23:
24: typedef struct packed {
25: logic [5:0] q;
26: } pinmux_reg2hw_mio_outsel_mreg_t;
27:
28: typedef struct packed {
29: logic [1:0] q;
30: } pinmux_reg2hw_mio_out_sleep_val_mreg_t;
31:
32: typedef struct packed {
33: logic [1:0] q;
34: logic qe;
35: } pinmux_reg2hw_dio_out_sleep_val_mreg_t;
36:
37: typedef struct packed {
38: logic q;
39: } pinmux_reg2hw_wkup_detector_en_mreg_t;
40:
41: typedef struct packed {
42: struct packed {
43: logic [2:0] q;
44: } mode;
45: struct packed {
46: logic q;
47: } filter;
48: struct packed {
49: logic q;
50: } miodio;
51: } pinmux_reg2hw_wkup_detector_mreg_t;
52:
53: typedef struct packed {
54: logic [7:0] q;
55: } pinmux_reg2hw_wkup_detector_cnt_th_mreg_t;
56:
57: typedef struct packed {
58: logic [4:0] q;
59: } pinmux_reg2hw_wkup_detector_padsel_mreg_t;
60:
61: typedef struct packed {
62: logic q;
63: logic qe;
64: } pinmux_reg2hw_wkup_cause_mreg_t;
65:
66:
67: typedef struct packed {
68: logic [1:0] d;
69: } pinmux_hw2reg_dio_out_sleep_val_mreg_t;
70:
71: typedef struct packed {
72: logic d;
73: } pinmux_hw2reg_wkup_cause_mreg_t;
74:
75:
76: ///////////////////////////////////////
77: // Register to internal design logic //
78: ///////////////////////////////////////
79: typedef struct packed {
80: pinmux_reg2hw_periph_insel_mreg_t [31:0] periph_insel; // [660:469]
81: pinmux_reg2hw_mio_outsel_mreg_t [31:0] mio_outsel; // [468:277]
82: pinmux_reg2hw_mio_out_sleep_val_mreg_t [31:0] mio_out_sleep_val; // [276:213]
83: pinmux_reg2hw_dio_out_sleep_val_mreg_t [14:0] dio_out_sleep_val; // [212:168]
84: pinmux_reg2hw_wkup_detector_en_mreg_t [7:0] wkup_detector_en; // [167:160]
85: pinmux_reg2hw_wkup_detector_mreg_t [7:0] wkup_detector; // [159:120]
86: pinmux_reg2hw_wkup_detector_cnt_th_mreg_t [7:0] wkup_detector_cnt_th; // [119:56]
87: pinmux_reg2hw_wkup_detector_padsel_mreg_t [7:0] wkup_detector_padsel; // [55:16]
88: pinmux_reg2hw_wkup_cause_mreg_t [7:0] wkup_cause; // [15:0]
89: } pinmux_reg2hw_t;
90:
91: ///////////////////////////////////////
92: // Internal design logic to register //
93: ///////////////////////////////////////
94: typedef struct packed {
95: pinmux_hw2reg_dio_out_sleep_val_mreg_t [14:0] dio_out_sleep_val; // [37:8]
96: pinmux_hw2reg_wkup_cause_mreg_t [7:0] wkup_cause; // [7:0]
97: } pinmux_hw2reg_t;
98:
99: // Register Address
100: parameter logic [6:0] PINMUX_REGEN_OFFSET = 7'h 0;
101: parameter logic [6:0] PINMUX_PERIPH_INSEL0_OFFSET = 7'h 4;
102: parameter logic [6:0] PINMUX_PERIPH_INSEL1_OFFSET = 7'h 8;
103: parameter logic [6:0] PINMUX_PERIPH_INSEL2_OFFSET = 7'h c;
104: parameter logic [6:0] PINMUX_PERIPH_INSEL3_OFFSET = 7'h 10;
105: parameter logic [6:0] PINMUX_PERIPH_INSEL4_OFFSET = 7'h 14;
106: parameter logic [6:0] PINMUX_PERIPH_INSEL5_OFFSET = 7'h 18;
107: parameter logic [6:0] PINMUX_PERIPH_INSEL6_OFFSET = 7'h 1c;
108: parameter logic [6:0] PINMUX_MIO_OUTSEL0_OFFSET = 7'h 20;
109: parameter logic [6:0] PINMUX_MIO_OUTSEL1_OFFSET = 7'h 24;
110: parameter logic [6:0] PINMUX_MIO_OUTSEL2_OFFSET = 7'h 28;
111: parameter logic [6:0] PINMUX_MIO_OUTSEL3_OFFSET = 7'h 2c;
112: parameter logic [6:0] PINMUX_MIO_OUTSEL4_OFFSET = 7'h 30;
113: parameter logic [6:0] PINMUX_MIO_OUTSEL5_OFFSET = 7'h 34;
114: parameter logic [6:0] PINMUX_MIO_OUTSEL6_OFFSET = 7'h 38;
115: parameter logic [6:0] PINMUX_MIO_OUT_SLEEP_VAL0_OFFSET = 7'h 3c;
116: parameter logic [6:0] PINMUX_MIO_OUT_SLEEP_VAL1_OFFSET = 7'h 40;
117: parameter logic [6:0] PINMUX_DIO_OUT_SLEEP_VAL_OFFSET = 7'h 44;
118: parameter logic [6:0] PINMUX_WKUP_DETECTOR_EN_OFFSET = 7'h 48;
119: parameter logic [6:0] PINMUX_WKUP_DETECTOR0_OFFSET = 7'h 4c;
120: parameter logic [6:0] PINMUX_WKUP_DETECTOR1_OFFSET = 7'h 50;
121: parameter logic [6:0] PINMUX_WKUP_DETECTOR2_OFFSET = 7'h 54;
122: parameter logic [6:0] PINMUX_WKUP_DETECTOR3_OFFSET = 7'h 58;
123: parameter logic [6:0] PINMUX_WKUP_DETECTOR4_OFFSET = 7'h 5c;
124: parameter logic [6:0] PINMUX_WKUP_DETECTOR5_OFFSET = 7'h 60;
125: parameter logic [6:0] PINMUX_WKUP_DETECTOR6_OFFSET = 7'h 64;
126: parameter logic [6:0] PINMUX_WKUP_DETECTOR7_OFFSET = 7'h 68;
127: parameter logic [6:0] PINMUX_WKUP_DETECTOR_CNT_TH0_OFFSET = 7'h 6c;
128: parameter logic [6:0] PINMUX_WKUP_DETECTOR_CNT_TH1_OFFSET = 7'h 70;
129: parameter logic [6:0] PINMUX_WKUP_DETECTOR_PADSEL0_OFFSET = 7'h 74;
130: parameter logic [6:0] PINMUX_WKUP_DETECTOR_PADSEL1_OFFSET = 7'h 78;
131: parameter logic [6:0] PINMUX_WKUP_CAUSE_OFFSET = 7'h 7c;
132:
133:
134: // Register Index
135: typedef enum int {
136: PINMUX_REGEN,
137: PINMUX_PERIPH_INSEL0,
138: PINMUX_PERIPH_INSEL1,
139: PINMUX_PERIPH_INSEL2,
140: PINMUX_PERIPH_INSEL3,
141: PINMUX_PERIPH_INSEL4,
142: PINMUX_PERIPH_INSEL5,
143: PINMUX_PERIPH_INSEL6,
144: PINMUX_MIO_OUTSEL0,
145: PINMUX_MIO_OUTSEL1,
146: PINMUX_MIO_OUTSEL2,
147: PINMUX_MIO_OUTSEL3,
148: PINMUX_MIO_OUTSEL4,
149: PINMUX_MIO_OUTSEL5,
150: PINMUX_MIO_OUTSEL6,
151: PINMUX_MIO_OUT_SLEEP_VAL0,
152: PINMUX_MIO_OUT_SLEEP_VAL1,
153: PINMUX_DIO_OUT_SLEEP_VAL,
154: PINMUX_WKUP_DETECTOR_EN,
155: PINMUX_WKUP_DETECTOR0,
156: PINMUX_WKUP_DETECTOR1,
157: PINMUX_WKUP_DETECTOR2,
158: PINMUX_WKUP_DETECTOR3,
159: PINMUX_WKUP_DETECTOR4,
160: PINMUX_WKUP_DETECTOR5,
161: PINMUX_WKUP_DETECTOR6,
162: PINMUX_WKUP_DETECTOR7,
163: PINMUX_WKUP_DETECTOR_CNT_TH0,
164: PINMUX_WKUP_DETECTOR_CNT_TH1,
165: PINMUX_WKUP_DETECTOR_PADSEL0,
166: PINMUX_WKUP_DETECTOR_PADSEL1,
167: PINMUX_WKUP_CAUSE
168: } pinmux_id_e;
169:
170: // Register width information to check illegal writes
171: parameter logic [3:0] PINMUX_PERMIT [32] = '{
172: 4'b 0001, // index[ 0] PINMUX_REGEN
173: 4'b 1111, // index[ 1] PINMUX_PERIPH_INSEL0
174: 4'b 1111, // index[ 2] PINMUX_PERIPH_INSEL1
175: 4'b 1111, // index[ 3] PINMUX_PERIPH_INSEL2
176: 4'b 1111, // index[ 4] PINMUX_PERIPH_INSEL3
177: 4'b 1111, // index[ 5] PINMUX_PERIPH_INSEL4
178: 4'b 1111, // index[ 6] PINMUX_PERIPH_INSEL5
179: 4'b 0011, // index[ 7] PINMUX_PERIPH_INSEL6
180: 4'b 1111, // index[ 8] PINMUX_MIO_OUTSEL0
181: 4'b 1111, // index[ 9] PINMUX_MIO_OUTSEL1
182: 4'b 1111, // index[10] PINMUX_MIO_OUTSEL2
183: 4'b 1111, // index[11] PINMUX_MIO_OUTSEL3
184: 4'b 1111, // index[12] PINMUX_MIO_OUTSEL4
185: 4'b 1111, // index[13] PINMUX_MIO_OUTSEL5
186: 4'b 0011, // index[14] PINMUX_MIO_OUTSEL6
187: 4'b 1111, // index[15] PINMUX_MIO_OUT_SLEEP_VAL0
188: 4'b 1111, // index[16] PINMUX_MIO_OUT_SLEEP_VAL1
189: 4'b 1111, // index[17] PINMUX_DIO_OUT_SLEEP_VAL
190: 4'b 0001, // index[18] PINMUX_WKUP_DETECTOR_EN
191: 4'b 0001, // index[19] PINMUX_WKUP_DETECTOR0
192: 4'b 0001, // index[20] PINMUX_WKUP_DETECTOR1
193: 4'b 0001, // index[21] PINMUX_WKUP_DETECTOR2
194: 4'b 0001, // index[22] PINMUX_WKUP_DETECTOR3
195: 4'b 0001, // index[23] PINMUX_WKUP_DETECTOR4
196: 4'b 0001, // index[24] PINMUX_WKUP_DETECTOR5
197: 4'b 0001, // index[25] PINMUX_WKUP_DETECTOR6
198: 4'b 0001, // index[26] PINMUX_WKUP_DETECTOR7
199: 4'b 1111, // index[27] PINMUX_WKUP_DETECTOR_CNT_TH0
200: 4'b 1111, // index[28] PINMUX_WKUP_DETECTOR_CNT_TH1
201: 4'b 1111, // index[29] PINMUX_WKUP_DETECTOR_PADSEL0
202: 4'b 0011, // index[30] PINMUX_WKUP_DETECTOR_PADSEL1
203: 4'b 0001 // index[31] PINMUX_WKUP_CAUSE
204: };
205: endpackage
206:
207: