1 |
3 |
sergeykhbr |
/**
|
2 |
|
|
* @file
|
3 |
|
|
* @copyright Copyright 2016 GNSS Sensor Ltd. All right reserved.
|
4 |
|
|
* @author Sergey Khabarov - sergeykhbr@gmail.com
|
5 |
|
|
* @brief CPU pipeline implementation.
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
#include "proc.h"
|
9 |
|
|
#include "api_utils.h"
|
10 |
|
|
|
11 |
|
|
namespace debugger {
|
12 |
|
|
|
13 |
|
|
Processor::Processor(sc_module_name name_) : sc_module(name_) {
|
14 |
|
|
|
15 |
|
|
SC_METHOD(comb);
|
16 |
|
|
sensitive << i_nrst;
|
17 |
|
|
sensitive << i_resp_ctrl_valid;
|
18 |
|
|
sensitive << w.f.pipeline_hold;
|
19 |
|
|
sensitive << w.e.valid;
|
20 |
|
|
sensitive << w.e.pipeline_hold;
|
21 |
|
|
sensitive << w.m.pipeline_hold;
|
22 |
|
|
sensitive << w.f.imem_req_valid;
|
23 |
|
|
sensitive << w.f.imem_req_addr;
|
24 |
|
|
sensitive << w.f.valid;
|
25 |
|
|
sensitive << dbg.clock_cnt;
|
26 |
|
|
sensitive << dbg.executed_cnt;
|
27 |
|
|
sensitive << dbg.core_addr;
|
28 |
|
|
sensitive << dbg.halt;
|
29 |
|
|
sensitive << dbg.core_wdata;
|
30 |
|
|
|
31 |
|
|
SC_METHOD(negedge_dbg_print);
|
32 |
|
|
sensitive << i_clk.neg();
|
33 |
|
|
|
34 |
|
|
fetch0 = new InstrFetch("fetch0");
|
35 |
|
|
fetch0->i_clk(i_clk);
|
36 |
|
|
fetch0->i_nrst(i_nrst);
|
37 |
|
|
fetch0->i_pipeline_hold(w_fetch_pipeline_hold);
|
38 |
|
|
fetch0->i_mem_req_ready(i_req_ctrl_ready);
|
39 |
|
|
fetch0->o_mem_addr_valid(w.f.imem_req_valid);
|
40 |
|
|
fetch0->o_mem_addr(w.f.imem_req_addr);
|
41 |
|
|
fetch0->i_mem_data_valid(i_resp_ctrl_valid);
|
42 |
|
|
fetch0->i_mem_data_addr(i_resp_ctrl_addr);
|
43 |
|
|
fetch0->i_mem_data(i_resp_ctrl_data);
|
44 |
|
|
fetch0->o_mem_resp_ready(o_resp_ctrl_ready);
|
45 |
|
|
fetch0->i_e_npc(w.e.npc);
|
46 |
|
|
fetch0->i_predict_npc(wb_npc_predict);
|
47 |
|
|
fetch0->o_predict_miss(w.f.predict_miss);
|
48 |
|
|
fetch0->o_mem_req_fire(w.f.req_fire);
|
49 |
|
|
fetch0->o_valid(w.f.valid);
|
50 |
|
|
fetch0->o_pc(w.f.pc);
|
51 |
|
|
fetch0->o_instr(w.f.instr);
|
52 |
|
|
fetch0->o_hold(w.f.pipeline_hold);
|
53 |
|
|
fetch0->i_br_fetch_valid(dbg.br_fetch_valid);
|
54 |
|
|
fetch0->i_br_address_fetch(dbg.br_address_fetch);
|
55 |
|
|
fetch0->i_br_instr_fetch(dbg.br_instr_fetch);
|
56 |
|
|
fetch0->o_instr_buf(w.f.instr_buf);
|
57 |
|
|
|
58 |
|
|
dec0 = new InstrDecoder("dec0");
|
59 |
|
|
dec0->i_clk(i_clk);
|
60 |
|
|
dec0->i_nrst(i_nrst);
|
61 |
|
|
dec0->i_any_hold(w_any_pipeline_hold);
|
62 |
|
|
dec0->i_f_valid(w.f.valid);
|
63 |
|
|
dec0->i_f_pc(w.f.pc);
|
64 |
|
|
dec0->i_f_instr(w.f.instr);
|
65 |
|
|
dec0->o_valid(w.d.instr_valid);
|
66 |
|
|
dec0->o_pc(w.d.pc);
|
67 |
|
|
dec0->o_instr(w.d.instr);
|
68 |
|
|
dec0->o_memop_store(w.d.memop_store);
|
69 |
|
|
dec0->o_memop_load(w.d.memop_load);
|
70 |
|
|
dec0->o_memop_sign_ext(w.d.memop_sign_ext);
|
71 |
|
|
dec0->o_memop_size(w.d.memop_size);
|
72 |
|
|
dec0->o_unsigned_op(w.d.unsigned_op);
|
73 |
|
|
dec0->o_rv32(w.d.rv32);
|
74 |
4 |
sergeykhbr |
dec0->o_compressed(w.d.compressed);
|
75 |
3 |
sergeykhbr |
dec0->o_isa_type(w.d.isa_type);
|
76 |
|
|
dec0->o_instr_vec(w.d.instr_vec);
|
77 |
|
|
dec0->o_exception(w.d.exception);
|
78 |
|
|
|
79 |
|
|
exec0 = new InstrExecute("exec0");
|
80 |
|
|
exec0->i_clk(i_clk);
|
81 |
|
|
exec0->i_nrst(i_nrst);
|
82 |
|
|
exec0->i_pipeline_hold(w_exec_pipeline_hold);
|
83 |
|
|
exec0->i_d_valid(w.d.instr_valid);
|
84 |
|
|
exec0->i_d_pc(w.d.pc);
|
85 |
|
|
exec0->i_d_instr(w.d.instr);
|
86 |
|
|
exec0->i_wb_done(w.m.valid);
|
87 |
|
|
exec0->i_memop_store(w.d.memop_store);
|
88 |
|
|
exec0->i_memop_load(w.d.memop_load);
|
89 |
|
|
exec0->i_memop_sign_ext(w.d.memop_sign_ext);
|
90 |
|
|
exec0->i_memop_size(w.d.memop_size);
|
91 |
|
|
exec0->i_unsigned_op(w.d.unsigned_op);
|
92 |
|
|
exec0->i_rv32(w.d.rv32);
|
93 |
4 |
sergeykhbr |
exec0->i_compressed(w.d.compressed);
|
94 |
3 |
sergeykhbr |
exec0->i_isa_type(w.d.isa_type);
|
95 |
|
|
exec0->i_ivec(w.d.instr_vec);
|
96 |
|
|
exec0->i_ie(csr.ie);
|
97 |
|
|
exec0->i_mtvec(csr.mtvec);
|
98 |
|
|
exec0->i_mode(csr.mode);
|
99 |
|
|
exec0->i_break_mode(dbg.break_mode);
|
100 |
|
|
exec0->i_unsup_exception(w.d.exception);
|
101 |
|
|
exec0->i_ext_irq(i_ext_irq);
|
102 |
|
|
exec0->i_dport_npc_write(dbg.npc_write);
|
103 |
|
|
exec0->i_dport_npc(wb_exec_dport_npc);
|
104 |
|
|
exec0->o_radr1(w.e.radr1);
|
105 |
|
|
exec0->i_rdata1(ireg.rdata1);
|
106 |
|
|
exec0->o_radr2(w.e.radr2);
|
107 |
|
|
exec0->i_rdata2(ireg.rdata2);
|
108 |
|
|
exec0->o_res_addr(w.e.res_addr);
|
109 |
|
|
exec0->o_res_data(w.e.res_data);
|
110 |
|
|
exec0->o_pipeline_hold(w.e.pipeline_hold);
|
111 |
|
|
exec0->o_xret(w.e.xret);
|
112 |
|
|
exec0->o_csr_addr(w.e.csr_addr);
|
113 |
|
|
exec0->o_csr_wena(w.e.csr_wena);
|
114 |
|
|
exec0->i_csr_rdata(csr.rdata);
|
115 |
|
|
exec0->o_csr_wdata(w.e.csr_wdata);
|
116 |
|
|
exec0->o_trap_ena(w.e.trap_ena);
|
117 |
|
|
exec0->o_trap_code(w.e.trap_code);
|
118 |
|
|
exec0->o_trap_pc(w.e.trap_pc);
|
119 |
|
|
exec0->o_memop_sign_ext(w.e.memop_sign_ext);
|
120 |
|
|
exec0->o_memop_load(w.e.memop_load);
|
121 |
|
|
exec0->o_memop_store(w.e.memop_store);
|
122 |
|
|
exec0->o_memop_size(w.e.memop_size);
|
123 |
|
|
exec0->o_memop_addr(w.e.memop_addr);
|
124 |
|
|
exec0->o_valid(w.e.valid);
|
125 |
|
|
exec0->o_pc(w.e.pc);
|
126 |
|
|
exec0->o_npc(w.e.npc);
|
127 |
|
|
exec0->o_instr(w.e.instr);
|
128 |
|
|
exec0->o_breakpoint(w.e.breakpoint);
|
129 |
|
|
exec0->o_call(w.e.call);
|
130 |
|
|
exec0->o_ret(w.e.ret);
|
131 |
|
|
|
132 |
|
|
mem0 = new MemAccess("mem0");
|
133 |
|
|
mem0->i_clk(i_clk);
|
134 |
|
|
mem0->i_nrst(i_nrst);
|
135 |
|
|
mem0->i_e_valid(w.e.valid);
|
136 |
|
|
mem0->i_e_pc(w.e.pc);
|
137 |
|
|
mem0->i_e_instr(w.e.instr);
|
138 |
|
|
mem0->i_res_addr(w.e.res_addr);
|
139 |
|
|
mem0->i_res_data(w.e.res_data);
|
140 |
|
|
mem0->i_memop_sign_ext(w.e.memop_sign_ext);
|
141 |
|
|
mem0->i_memop_load(w.e.memop_load);
|
142 |
|
|
mem0->i_memop_store(w.e.memop_store);
|
143 |
|
|
mem0->i_memop_size(w.e.memop_size);
|
144 |
|
|
mem0->i_memop_addr(w.e.memop_addr);
|
145 |
|
|
mem0->o_waddr(w.w.waddr);
|
146 |
|
|
mem0->o_wena(w.w.wena);
|
147 |
|
|
mem0->o_wdata(w.w.wdata);
|
148 |
|
|
mem0->i_mem_req_ready(i_req_data_ready);
|
149 |
|
|
mem0->o_mem_valid(o_req_data_valid);
|
150 |
|
|
mem0->o_mem_write(o_req_data_write);
|
151 |
|
|
mem0->o_mem_sz(o_req_data_size);
|
152 |
|
|
mem0->o_mem_addr(o_req_data_addr);
|
153 |
|
|
mem0->o_mem_data(o_req_data_data);
|
154 |
|
|
mem0->i_mem_data_valid(i_resp_data_valid);
|
155 |
|
|
mem0->i_mem_data_addr(i_resp_data_addr);
|
156 |
|
|
mem0->i_mem_data(i_resp_data_data);
|
157 |
|
|
mem0->o_mem_resp_ready(o_resp_data_ready);
|
158 |
|
|
mem0->o_hold(w.m.pipeline_hold);
|
159 |
|
|
mem0->o_valid(w.m.valid);
|
160 |
|
|
mem0->o_pc(w.m.pc);
|
161 |
|
|
mem0->o_instr(w.m.instr);
|
162 |
|
|
|
163 |
|
|
predic0 = new BranchPredictor("predic0");
|
164 |
|
|
predic0->i_clk(i_clk);
|
165 |
|
|
predic0->i_nrst(i_nrst);
|
166 |
|
|
predic0->i_req_mem_fire(w.f.req_fire);
|
167 |
|
|
predic0->i_resp_mem_valid(i_resp_ctrl_valid);
|
168 |
|
|
predic0->i_resp_mem_addr(i_resp_ctrl_addr);
|
169 |
|
|
predic0->i_resp_mem_data(i_resp_ctrl_data);
|
170 |
|
|
predic0->i_f_predic_miss(w.f.predict_miss);
|
171 |
|
|
predic0->i_e_npc(w.e.npc);
|
172 |
|
|
predic0->i_ra(ireg.ra);
|
173 |
|
|
predic0->o_npc_predict(wb_npc_predict);
|
174 |
|
|
|
175 |
|
|
|
176 |
|
|
iregs0 = new RegIntBank("iregs0");
|
177 |
|
|
iregs0->i_clk(i_clk);
|
178 |
|
|
iregs0->i_nrst(i_nrst);
|
179 |
|
|
iregs0->i_radr1(w.e.radr1);
|
180 |
|
|
iregs0->o_rdata1(ireg.rdata1);
|
181 |
|
|
iregs0->i_radr2(w.e.radr2);
|
182 |
|
|
iregs0->o_rdata2(ireg.rdata2);
|
183 |
|
|
iregs0->i_waddr(w.w.waddr);
|
184 |
|
|
iregs0->i_wena(w.w.wena);
|
185 |
|
|
iregs0->i_wdata(w.w.wdata);
|
186 |
|
|
iregs0->i_dport_addr(wb_ireg_dport_addr);
|
187 |
|
|
iregs0->i_dport_ena(dbg.ireg_ena);
|
188 |
|
|
iregs0->i_dport_write(dbg.ireg_write);
|
189 |
|
|
iregs0->i_dport_wdata(dbg.core_wdata);
|
190 |
|
|
iregs0->o_dport_rdata(ireg.dport_rdata);
|
191 |
|
|
|
192 |
|
|
iregs0->o_ra(ireg.ra); // Return address
|
193 |
|
|
|
194 |
|
|
csr0 = new CsrRegs("csr0");
|
195 |
|
|
csr0->i_clk(i_clk);
|
196 |
|
|
csr0->i_nrst(i_nrst);
|
197 |
|
|
csr0->i_xret(w.e.xret);
|
198 |
|
|
csr0->i_addr(w.e.csr_addr);
|
199 |
|
|
csr0->i_wena(w.e.csr_wena);
|
200 |
|
|
csr0->i_wdata(w.e.csr_wdata);
|
201 |
|
|
csr0->o_rdata(csr.rdata);
|
202 |
|
|
csr0->i_break_mode(dbg.break_mode);
|
203 |
|
|
csr0->i_breakpoint(w.e.breakpoint);
|
204 |
|
|
csr0->i_trap_ena(w.e.trap_ena);
|
205 |
|
|
csr0->i_trap_code(w.e.trap_code);
|
206 |
|
|
csr0->i_trap_pc(w.e.trap_pc);
|
207 |
|
|
csr0->o_ie(csr.ie);
|
208 |
|
|
csr0->o_mode(csr.mode);
|
209 |
|
|
csr0->o_mtvec(csr.mtvec);
|
210 |
|
|
csr0->i_dport_ena(dbg.csr_ena);
|
211 |
|
|
csr0->i_dport_write(dbg.csr_write);
|
212 |
|
|
csr0->i_dport_addr(dbg.core_addr);
|
213 |
|
|
csr0->i_dport_wdata(dbg.core_wdata);
|
214 |
|
|
csr0->o_dport_rdata(csr.dport_rdata);
|
215 |
|
|
|
216 |
|
|
dbg0 = new DbgPort("dbg0");
|
217 |
|
|
dbg0->i_clk(i_clk);
|
218 |
|
|
dbg0->i_nrst(i_nrst);
|
219 |
|
|
dbg0->i_dport_valid(i_dport_valid);
|
220 |
|
|
dbg0->i_dport_write(i_dport_write);
|
221 |
|
|
dbg0->i_dport_region(i_dport_region);
|
222 |
|
|
dbg0->i_dport_addr(i_dport_addr);
|
223 |
|
|
dbg0->i_dport_wdata(i_dport_wdata);
|
224 |
|
|
dbg0->o_dport_ready(o_dport_ready);
|
225 |
|
|
dbg0->o_dport_rdata(o_dport_rdata);
|
226 |
|
|
dbg0->o_core_addr(dbg.core_addr);
|
227 |
|
|
dbg0->o_core_wdata(dbg.core_wdata);
|
228 |
|
|
dbg0->o_csr_ena(dbg.csr_ena);
|
229 |
|
|
dbg0->o_csr_write(dbg.csr_write);
|
230 |
|
|
dbg0->i_csr_rdata(csr.dport_rdata);
|
231 |
|
|
dbg0->o_ireg_ena(dbg.ireg_ena);
|
232 |
|
|
dbg0->o_ireg_write(dbg.ireg_write);
|
233 |
|
|
dbg0->o_npc_write(dbg.npc_write);
|
234 |
|
|
dbg0->i_ireg_rdata(ireg.dport_rdata);
|
235 |
|
|
dbg0->i_pc(w.e.pc);
|
236 |
|
|
dbg0->i_npc(w.e.npc);
|
237 |
|
|
dbg0->i_e_call(w.e.call);
|
238 |
|
|
dbg0->i_e_ret(w.e.ret);
|
239 |
|
|
dbg0->i_e_valid(w.e.valid);
|
240 |
|
|
dbg0->i_m_valid(w.m.valid);
|
241 |
|
|
dbg0->o_clock_cnt(dbg.clock_cnt);
|
242 |
|
|
dbg0->o_executed_cnt(dbg.executed_cnt);
|
243 |
|
|
dbg0->o_halt(dbg.halt);
|
244 |
|
|
dbg0->i_ebreak(w.e.breakpoint);
|
245 |
|
|
dbg0->o_break_mode(dbg.break_mode);
|
246 |
|
|
dbg0->o_br_fetch_valid(dbg.br_fetch_valid);
|
247 |
|
|
dbg0->o_br_address_fetch(dbg.br_address_fetch);
|
248 |
|
|
dbg0->o_br_instr_fetch(dbg.br_instr_fetch);
|
249 |
|
|
dbg0->i_istate(i_istate);
|
250 |
|
|
dbg0->i_dstate(i_dstate);
|
251 |
|
|
dbg0->i_cstate(i_cstate);
|
252 |
|
|
dbg0->i_instr_buf(w.f.instr_buf);
|
253 |
|
|
|
254 |
|
|
reg_dbg = 0;
|
255 |
|
|
mem_dbg = 0;
|
256 |
|
|
};
|
257 |
|
|
|
258 |
|
|
Processor::~Processor() {
|
259 |
|
|
delete fetch0;
|
260 |
|
|
delete dec0;
|
261 |
|
|
delete exec0;
|
262 |
|
|
delete mem0;
|
263 |
|
|
delete predic0;
|
264 |
|
|
delete iregs0;
|
265 |
|
|
delete csr0;
|
266 |
|
|
delete dbg0;
|
267 |
|
|
if (reg_dbg) {
|
268 |
|
|
reg_dbg->close();
|
269 |
|
|
delete reg_dbg;
|
270 |
|
|
}
|
271 |
|
|
if (mem_dbg) {
|
272 |
|
|
mem_dbg->close();
|
273 |
|
|
delete mem_dbg;
|
274 |
|
|
}
|
275 |
|
|
}
|
276 |
|
|
|
277 |
|
|
void Processor::generateVCD(sc_trace_file *i_vcd, sc_trace_file *o_vcd) {
|
278 |
|
|
if (o_vcd) {
|
279 |
|
|
sc_trace(o_vcd, dbg.clock_cnt, "top/dbg_clock_cnt");
|
280 |
|
|
sc_trace(o_vcd, dbg.executed_cnt, "top/dbg_executed_cnt");
|
281 |
|
|
}
|
282 |
|
|
predic0->generateVCD(i_vcd, o_vcd);
|
283 |
|
|
csr0->generateVCD(i_vcd, o_vcd);
|
284 |
|
|
dbg0->generateVCD(i_vcd, o_vcd);
|
285 |
|
|
dec0->generateVCD(i_vcd, o_vcd);
|
286 |
|
|
exec0->generateVCD(i_vcd, o_vcd);
|
287 |
|
|
fetch0->generateVCD(i_vcd, o_vcd);
|
288 |
|
|
mem0->generateVCD(i_vcd, o_vcd);
|
289 |
|
|
iregs0->generateVCD(i_vcd, o_vcd);
|
290 |
|
|
}
|
291 |
|
|
|
292 |
|
|
void Processor::comb() {
|
293 |
|
|
w_fetch_pipeline_hold = w.e.pipeline_hold | w.m.pipeline_hold | dbg.halt;
|
294 |
|
|
w_any_pipeline_hold = w.f.pipeline_hold | w.e.pipeline_hold
|
295 |
|
|
| w.m.pipeline_hold | dbg.halt;
|
296 |
|
|
w_exec_pipeline_hold = w.f.pipeline_hold | w.m.pipeline_hold | dbg.halt;
|
297 |
|
|
|
298 |
|
|
wb_ireg_dport_addr = dbg.core_addr.read()(4, 0);
|
299 |
|
|
wb_exec_dport_npc = dbg.core_wdata.read()(BUS_ADDR_WIDTH-1, 0);
|
300 |
|
|
|
301 |
|
|
o_req_ctrl_valid = w.f.imem_req_valid;
|
302 |
|
|
o_req_ctrl_addr = w.f.imem_req_addr;
|
303 |
|
|
if (generate_ref_) {
|
304 |
|
|
o_time = dbg.executed_cnt;
|
305 |
|
|
} else {
|
306 |
|
|
o_time = dbg.clock_cnt;
|
307 |
|
|
}
|
308 |
|
|
}
|
309 |
|
|
|
310 |
|
|
void Processor::generateRef(bool v) {
|
311 |
|
|
generate_ref_ = v;
|
312 |
|
|
if (generate_ref_) {
|
313 |
|
|
reg_dbg = new ofstream("river_sysc_regs.log");
|
314 |
|
|
mem_dbg = new ofstream("river_sysc_mem.log");
|
315 |
|
|
mem_dbg_write_flag = false;
|
316 |
|
|
}
|
317 |
|
|
}
|
318 |
|
|
|
319 |
|
|
void Processor::negedge_dbg_print() {
|
320 |
|
|
if (!generate_ref_) {
|
321 |
|
|
return;
|
322 |
|
|
}
|
323 |
|
|
int sz;
|
324 |
|
|
if (w.m.valid.read()) {
|
325 |
|
|
uint64_t line_cnt = dbg.executed_cnt.read() + 1;
|
326 |
4 |
sergeykhbr |
sz = RISCV_sprintf(tstr, sizeof(tstr), "%8" RV_PRI64 "d [%08x]: ",
|
327 |
3 |
sergeykhbr |
line_cnt,
|
328 |
4 |
sergeykhbr |
w.m.pc.read().to_int());
|
329 |
3 |
sergeykhbr |
uint64_t prev_val = iregs0->r.mem[w.w.waddr.read().to_int()].to_int64();
|
330 |
|
|
uint64_t cur_val = w.w.wdata.read().to_int64();
|
331 |
|
|
if (w.w.waddr.read() == 0 || prev_val == cur_val) {
|
332 |
|
|
// not writing
|
333 |
|
|
sz += RISCV_sprintf(&tstr[sz], sizeof(tstr) - sz, "%s", "-\n");
|
334 |
|
|
} else {
|
335 |
|
|
sz += RISCV_sprintf(&tstr[sz], sizeof(tstr) - sz,
|
336 |
|
|
"%3s <= %016" RV_PRI64 "x\n",
|
337 |
|
|
IREGS_NAMES[w.w.waddr.read().to_int()], cur_val);
|
338 |
|
|
}
|
339 |
|
|
|
340 |
|
|
(*reg_dbg) << tstr;
|
341 |
|
|
reg_dbg->flush();
|
342 |
|
|
}
|
343 |
|
|
// Memory access debug:
|
344 |
|
|
if (i_resp_data_valid.read()) {
|
345 |
|
|
sz = RISCV_sprintf(tstr, sizeof(tstr), "%08x: [%08x] ",
|
346 |
|
|
w.m.pc.read().to_uint(),
|
347 |
|
|
i_resp_data_addr.read().to_uint());
|
348 |
|
|
if (mem_dbg_write_flag) {
|
349 |
|
|
sz += RISCV_sprintf(&tstr[sz], sizeof(tstr) - sz,
|
350 |
|
|
"<= %016" RV_PRI64 "x\n",
|
351 |
|
|
dbg_mem_write_value & dbg_mem_value_mask);
|
352 |
|
|
} else {
|
353 |
|
|
sz += RISCV_sprintf(&tstr[sz], sizeof(tstr) - sz,
|
354 |
|
|
"=> %016" RV_PRI64 "x\n",
|
355 |
|
|
i_resp_data_data.read().to_uint64() & dbg_mem_value_mask);
|
356 |
|
|
}
|
357 |
|
|
(*mem_dbg) << tstr;
|
358 |
|
|
mem_dbg->flush();
|
359 |
|
|
}
|
360 |
|
|
if (w.e.memop_store.read() || w.e.memop_load.read()) {
|
361 |
|
|
mem_dbg_write_flag = w.e.memop_store;
|
362 |
|
|
if (mem_dbg_write_flag) {
|
363 |
|
|
dbg_mem_write_value = w.e.res_data.read();
|
364 |
|
|
}
|
365 |
|
|
switch (w.e.memop_size.read()) {
|
366 |
|
|
case 0: dbg_mem_value_mask = 0xFFull; break;
|
367 |
|
|
case 1: dbg_mem_value_mask = 0xFFFFull; break;
|
368 |
|
|
case 2: dbg_mem_value_mask = 0xFFFFFFFFull; break;
|
369 |
|
|
default: dbg_mem_value_mask = ~0ull;
|
370 |
|
|
}
|
371 |
|
|
}
|
372 |
|
|
}
|
373 |
|
|
|
374 |
|
|
|
375 |
|
|
} // namespace debugger
|
376 |
|
|
|