32 #include "params/FastModelPL330.hh"
40 scx_evs_PL330(_name), clockPeriod(params.clock),
41 dma(amba_m, params.
name +
".dma", -1),
42 pioS(amba_s, params.
name +
".pio_s", -1),
43 pioNs(amba_s_ns, params.
name +
".pio_ns", -1),
44 irqAbortReceiver(
"irq_abort_receiver")
46 set_parameter(
"pl330.fifo_size", params.fifo_size);
47 set_parameter(
"pl330.max_transfer", params.max_transfer);
48 set_parameter(
"pl330.generate_clear", params.generate_clear);
49 set_parameter(
"pl330.activate_delay", params.activate_delay);
50 set_parameter(
"pl330.revision", params.revision);
51 set_parameter(
"pl330.p_max_irqs", params.max_irqs);
52 set_parameter(
"pl330.p_buffer_depth", params.buffer_depth);
53 set_parameter(
"pl330.p_lsq_read_size", params.lsq_read_size);
54 set_parameter(
"pl330.p_lsq_write_size", params.lsq_write_size);
55 set_parameter(
"pl330.p_read_issuing_capability",
56 params.read_issuing_capability);
57 set_parameter(
"pl330.p_write_issuing_capability",
58 params.write_issuing_capability);
59 set_parameter(
"pl330.p_axi_bus_width_param", params.axi_bus_width);
60 set_parameter(
"pl330.p_cache_line_words", params.cache_line_words);
61 set_parameter(
"pl330.p_cache_lines", params.cache_lines);
62 set_parameter(
"pl330.p_max_channels", params.max_channels);
63 set_parameter(
"pl330.p_controller_nsecure", params.controller_nsecure);
64 set_parameter(
"pl330.p_irq_nsecure", params.irq_nsecure);
65 set_parameter(
"pl330.p_periph_nsecure", params.periph_nsecure);
66 set_parameter(
"pl330.p_controller_boots", params.controller_boots);
67 set_parameter(
"pl330.p_reset_pc", params.reset_pc);
68 set_parameter(
"pl330.p_max_periph", params.max_periph);
69 set_parameter(
"pl330.p_perip_request_acceptance_0",
70 params.perip_request_acceptance_0);
71 set_parameter(
"pl330.p_perip_request_acceptance_1",
72 params.perip_request_acceptance_1);
73 set_parameter(
"pl330.p_perip_request_acceptance_2",
74 params.perip_request_acceptance_2);
75 set_parameter(
"pl330.p_perip_request_acceptance_3",
76 params.perip_request_acceptance_3);
77 set_parameter(
"pl330.p_perip_request_acceptance_4",
78 params.perip_request_acceptance_4);
79 set_parameter(
"pl330.p_perip_request_acceptance_5",
80 params.perip_request_acceptance_5);
81 set_parameter(
"pl330.p_perip_request_acceptance_6",
82 params.perip_request_acceptance_6);
83 set_parameter(
"pl330.p_perip_request_acceptance_7",
84 params.perip_request_acceptance_7);
85 set_parameter(
"pl330.p_perip_request_acceptance_8",
86 params.perip_request_acceptance_8);
87 set_parameter(
"pl330.p_perip_request_acceptance_9",
88 params.perip_request_acceptance_9);
89 set_parameter(
"pl330.p_perip_request_acceptance_10",
90 params.perip_request_acceptance_10);
91 set_parameter(
"pl330.p_perip_request_acceptance_11",
92 params.perip_request_acceptance_11);
93 set_parameter(
"pl330.p_perip_request_acceptance_12",
94 params.perip_request_acceptance_12);
95 set_parameter(
"pl330.p_perip_request_acceptance_13",
96 params.perip_request_acceptance_13);
97 set_parameter(
"pl330.p_perip_request_acceptance_14",
98 params.perip_request_acceptance_14);
99 set_parameter(
"pl330.p_perip_request_acceptance_15",
100 params.perip_request_acceptance_15);
101 set_parameter(
"pl330.p_perip_request_acceptance_16",
102 params.perip_request_acceptance_16);
103 set_parameter(
"pl330.p_perip_request_acceptance_17",
104 params.perip_request_acceptance_17);
105 set_parameter(
"pl330.p_perip_request_acceptance_18",
106 params.perip_request_acceptance_18);
107 set_parameter(
"pl330.p_perip_request_acceptance_19",
108 params.perip_request_acceptance_19);
109 set_parameter(
"pl330.p_perip_request_acceptance_20",
110 params.perip_request_acceptance_20);
111 set_parameter(
"pl330.p_perip_request_acceptance_21",
112 params.perip_request_acceptance_21);
113 set_parameter(
"pl330.p_perip_request_acceptance_22",
114 params.perip_request_acceptance_22);
115 set_parameter(
"pl330.p_perip_request_acceptance_23",
116 params.perip_request_acceptance_23);
117 set_parameter(
"pl330.p_perip_request_acceptance_24",
118 params.perip_request_acceptance_24);
119 set_parameter(
"pl330.p_perip_request_acceptance_25",
120 params.perip_request_acceptance_25);
121 set_parameter(
"pl330.p_perip_request_acceptance_26",
122 params.perip_request_acceptance_26);
123 set_parameter(
"pl330.p_perip_request_acceptance_27",
124 params.perip_request_acceptance_27);
125 set_parameter(
"pl330.p_perip_request_acceptance_28",
126 params.perip_request_acceptance_28);
127 set_parameter(
"pl330.p_perip_request_acceptance_29",
128 params.perip_request_acceptance_29);
129 set_parameter(
"pl330.p_perip_request_acceptance_30",
130 params.perip_request_acceptance_30);
131 set_parameter(
"pl330.p_perip_request_acceptance_31",
132 params.perip_request_acceptance_31);
138 allocateIrq(0, params.port_irq_0_connection_count);
139 allocateIrq(1, params.port_irq_1_connection_count);
140 allocateIrq(2, params.port_irq_2_connection_count);
141 allocateIrq(3, params.port_irq_3_connection_count);
142 allocateIrq(4, params.port_irq_4_connection_count);
143 allocateIrq(5, params.port_irq_5_connection_count);
144 allocateIrq(6, params.port_irq_6_connection_count);
145 allocateIrq(7, params.port_irq_7_connection_count);
146 allocateIrq(8, params.port_irq_8_connection_count);
147 allocateIrq(9, params.port_irq_9_connection_count);
148 allocateIrq(10, params.port_irq_10_connection_count);
149 allocateIrq(11, params.port_irq_11_connection_count);
150 allocateIrq(12, params.port_irq_12_connection_count);
151 allocateIrq(13, params.port_irq_13_connection_count);
152 allocateIrq(14, params.port_irq_14_connection_count);
153 allocateIrq(15, params.port_irq_15_connection_count);
154 allocateIrq(16, params.port_irq_16_connection_count);
155 allocateIrq(17, params.port_irq_17_connection_count);
156 allocateIrq(18, params.port_irq_18_connection_count);
157 allocateIrq(19, params.port_irq_19_connection_count);
158 allocateIrq(20, params.port_irq_20_connection_count);
159 allocateIrq(21, params.port_irq_21_connection_count);
160 allocateIrq(22, params.port_irq_22_connection_count);
161 allocateIrq(23, params.port_irq_23_connection_count);
162 allocateIrq(24, params.port_irq_24_connection_count);
163 allocateIrq(25, params.port_irq_25_connection_count);
164 allocateIrq(26, params.port_irq_26_connection_count);
165 allocateIrq(27, params.port_irq_27_connection_count);
166 allocateIrq(28, params.port_irq_28_connection_count);
167 allocateIrq(29, params.port_irq_29_connection_count);
168 allocateIrq(30, params.port_irq_30_connection_count);
169 allocateIrq(31, params.port_irq_31_connection_count);
172 for (
int i = 0;
i < 32;
i++) {
184 for (
auto &pin: port)
185 status ? pin->raise() : pin->lower();
193 for (
int i = 0;
i < params.port_irq_abort_connection_count;
i++) {
203 auto abort_change = [
this](
bool status) {
205 status ? pin->raise() : pin->lower();
225 if (if_name ==
"dma") {
227 }
else if (if_name ==
"pio_s") {
229 }
else if (if_name ==
"pio_ns") {
231 }
else if (if_name.substr(0, 4) ==
"irq_") {
232 auto suffix = if_name.substr(4);
234 if (suffix ==
"abort")
241 if (suffix.size() == 1 && isdigit(suffix[0])) {
242 port = suffix[0] -
'0';
243 }
else if (suffix.size() == 2 && isdigit(suffix[0]) &&
244 isdigit(suffix[1])) {
245 port = (suffix[1] -
'0') * 10 + (suffix[0] -
'0');
247 if (port != -1 && port <
irqPort.size())
251 return scx_evs_PL330::gem5_getPort(if_name, idx);