@@ -194,7 +194,7 @@ $$end
194194 { // ==== stage 1 ==========================================================
195195$$if DEBUG_swirl then
196196if (debug_on) {
197- __display("[1] cycle:%d reset:%b stall_cpu:%b refetch:%b refetch_addr:%x refetching:%b pc:%x",cycle,reset,stall_cpu,refetch,refetch_addr<<2,refetching,pc<<2 );
197+ __display("[1] cycle:%d reset:%b stall_cpu:%b refetch:%b refetch_addr:%x refetching:%b pc:%x",cycle,reset,stall_cpu,refetch,refetch_addr<<2,refetching,{pc,2b00} );
198198 __display("[1] cycle:%d imem.addr:%x imem.rdata:%x dmem.addr:%x dmem.rdata:%x",cycle,imem.addr<<2,imem.rdata,dmem.addr<<2,dmem.rdata);
199199}
200200$$end
@@ -228,9 +228,9 @@ $$if DEBUG_swirl then
228228if (debug_on) {
229229 if (~stall_cpu | on_stall) {
230230 __display("[1] cycle:%d instr: %x @%x (bubble:%b reset:%b refetch:%b hold:%b stall_cpu:%b alu_busy:%b rs1 %d rs2 %d)",
231- cycle,instr,pc<<2 ,bubble,reset,refetch,hold,stall_cpu,exec.working,xregsA.addr0,xregsB.addr0);
231+ cycle,instr,{pc,2b00} ,bubble,reset,refetch,hold,stall_cpu,exec.working,xregsA.addr0,xregsB.addr0);
232232 if (bpred) {
233- __display("[1] pc @%x following branch to @%x",pc<<2 ,imem.addr<<2);
233+ __display("[1] pc @%x following branch to @%x",{pc,2b00} ,imem.addr<<2);
234234 }
235235 }
236236}
@@ -308,7 +308,7 @@ $$end
308308$$if DEBUG_swirl then
309309if (debug_on) {
310310 if (~stall_cpu | on_stall) {
311- __display("[2] instr: %x @%x (bubble:%b bpred:%b) rA(%d):%x rB(%d):%x",instr,pc<<2 ,bubble,bpred,Rtype(instr).rs1,xregsA.rdata0,Rtype(instr).rs2,xregsB.rdata0);
311+ __display("[2] instr: %x @%x (bubble:%b bpred:%b) rA(%d):%x rB(%d):%x",instr,{pc,2b00} ,bubble,bpred,Rtype(instr).rs1,xregsA.rdata0,Rtype(instr).rs2,xregsB.rdata0);
312312 }
313313}
314314$$end
@@ -379,7 +379,7 @@ $$end
379379$$if DEBUG_swirl then
380380if (debug_on) {
381381 if (~stall_cpu | on_stall) {
382- __display("[3] instr: %x @%x (bubble:%b bpred:%b exec.r:%d)",instr,pc<<2 ,bubble,bpred,exec.r);
382+ __display("[3] instr: %x @%x (bubble:%b bpred:%b exec.r:%d)",instr,{pc,2b00} ,bubble,bpred,exec.r);
383383 }
384384}
385385$$end
@@ -407,7 +407,7 @@ $$end
407407$$if DEBUG_swirl then
408408if (debug_on) {
409409 if (~stall_cpu | on_stall) {
410- __display("[4] instr: %x @%x (bubble:%b bpred:%b alu_r:%d)",instr,pc<<2 ,bubble,bpred,alu_r);
410+ __display("[4] instr: %x @%x (bubble:%b bpred:%b alu_r:%d)",instr,{pc,2b00} ,bubble,bpred,alu_r);
411411 }
412412}
413413$$end
@@ -440,7 +440,7 @@ $$if SIMULATION then
440440 // check for unaligned loads (unsupported)
441441 if ((load|store) & ~bubble & ~jumping
442442 & (op[0,2]==2b10) & (alu_n[0,2] != 2b00)) {
443- __display("[cycle %d] ERROR @%h %h, unaligned access (%b) @%h",cycle,pc<<2 ,instr,store,alu_n);
443+ __display("[cycle %d] ERROR @%h %h, unaligned access (%b) @%h",cycle,{pc,2b00} ,instr,store,alu_n);
444444 __finish();
445445 }
446446$$end
@@ -473,16 +473,16 @@ $$if ICEV_VERILATOR_TRACE then
473473 // this is used by SOCs/ice-v-cmp, to track retired instr. and compare CPUs
474474 if (instr_done) {
475475 __verilog("$c32(\"cpu_retires(3,\",%,\",\",%,\",\",%,\",\",%,\");\");",
476- pc<<2 ,instr,xregsA.wenable1?Rtype(instr).rd:0,xregsA.wdata1);
476+ {pc,2b00} ,instr,xregsA.wenable1?Rtype(instr).rd:0,xregsA.wdata1);
477477 }
478478$$end
479479$$if DEBUG_swirl then
480480if (debug_on) {
481481 if (~stall_cpu | on_stall) {
482- __display("[5] instr: %x @%x (bubble:%b jump:%b bpred:%b load:%b alu_r:%d) nretired:%d",instr,pc<<2 ,bubble,jump,bpred,load,alu_r,nretired);
482+ __display("[5] instr: %x @%x (bubble:%b jump:%b bpred:%b load:%b alu_r:%d) nretired:%d",instr,{pc,2b00} ,bubble,jump,bpred,load,alu_r,nretired);
483483 if (instr_done) {
484484 __display("[5] ++++ %x (@%x) jump %b, wreg:[%d]=%x (%b) nretired:%d",
485- instr,pc<<2 ,jump,Rtype(instr).rd,xregsA.wdata1,xregsA.wenable1,nretired);
485+ instr,{pc,2b00} ,jump,Rtype(instr).rd,xregsA.wdata1,xregsA.wenable1,nretired);
486486 }
487487 }
488488 if (xregsA.wenable1) {
@@ -498,7 +498,7 @@ $$end
498498$$if TRACE_swirl then
499499 if (trace_on) {
500500 if (instr_done) {
501- __write("@%h %h ",pc<<2 ,instr);
501+ __write("@%h %h ",{pc,2b00} ,instr);
502502 last_cycle = cycle;
503503 if (xregsA.wenable1) {
504504 __display("x[%d]=%h",xregsA.addr1,xregsA.wdata1);
@@ -537,7 +537,7 @@ $$if DEBUG_swirl then
537537if (debug_on) {
538538 if (~stall_cpu | on_stall) {
539539 if (bpred & ~refetch) {
540- __display("[5] pc @%x branch predicted towards @%x (jump %b)",pc<<2 ,alu_n,jump);
540+ __display("[5] pc @%x branch predicted towards @%x (jump %b)",{pc,2b00} ,alu_n,jump);
541541 }
542542 if (refetch) {
543543 __display("[5] REFETCH to @%x (stall_cpu %b jump %b bpred %b)",refetch_addr<<2,stall_cpu,jump,bpred);
@@ -584,11 +584,11 @@ $$end
584584 xregsB.addr1 = xregsA.addr1;
585585$$if SIMULATION then
586586 if (xregsA_conflict_possible & xa_regR & ~stage2_bubble) {
587- __display("[cycle %d] ERROR reading from a written register (A) @%h",cycle,pc<<2 );
587+ __display("[cycle %d] ERROR reading from a written register (A) @%h",cycle,{pc,2b00} );
588588 __finish();
589589 }
590590 if (xregsB_conflict_possible & xb_regR & ~stage2_bubble & has_rs2) {
591- __display("[cycle %d] ERROR reading from a written register (B) @%h",cycle,pc<<2 );
591+ __display("[cycle %d] ERROR reading from a written register (B) @%h",cycle,{pc,2b00} );
592592 __finish();
593593 }
594594$$end
@@ -664,7 +664,7 @@ $$if ICEV_MULDIV then
664664 div32 div<reginputs>;
665665$$end
666666 // ==== select next address adder first input
667- int$addrW+3$ addr_a <: pcOrReg ? __signed({1b0,pc[0,$addrW-1$] ,2b0}) : xa;
667+ int$addrW+3$ addr_a <: pcOrReg ? __signed({1b0,pc,2b0}) : xa;
668668 // ==== select ALU second input
669669 int32 b <: regOrImm ? (xb) : imm_i;
670670 // ==== allows to do subtraction and all comparisons with a single adder
0 commit comments