Skip to content

Commit 971e00e

Browse files
Merge pull request #345 from Silabs-ArjanB/ArjanB_dm_halt_addr_i
Replaced DM_HALTADDRESS parameter by dm_halt_addr_i pin
2 parents 7e1c91f + b0fbe34 commit 971e00e

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

rtl/riscv_core.sv

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ module riscv_core
3939
#(
4040
parameter PULP_CLUSTER = 0,
4141
parameter FPU = 0,
42-
parameter PULP_ZFINX = 0,
43-
parameter DM_HALTADDRESS = 32'h1A110800
42+
parameter PULP_ZFINX = 0
4443
)
4544
(
4645
// Clock and Reset
@@ -50,8 +49,9 @@ module riscv_core
5049
input logic clock_en_i, // enable clock, otherwise it is gated
5150
input logic scan_cg_en_i, // enable all clock gates for testing
5251

53-
// Core ID, Cluster ID and boot address are considered more or less static
52+
// Core ID, Cluster ID, debug mode halt address and boot address are considered more or less static
5453
input logic [31:0] boot_addr_i,
54+
input logic [31:0] dm_halt_addr_i,
5555
input logic [31:0] hart_id_i,
5656

5757
// Instruction memory interface
@@ -475,8 +475,7 @@ module riscv_core
475475
#(
476476
.N_HWLP ( N_HWLP ),
477477
.RDATA_WIDTH ( INSTR_RDATA_WIDTH ),
478-
.FPU ( FPU ),
479-
.DM_HALTADDRESS ( DM_HALTADDRESS )
478+
.FPU ( FPU )
480479
)
481480
if_stage_i
482481
(
@@ -486,6 +485,9 @@ module riscv_core
486485
// boot address
487486
.boot_addr_i ( boot_addr_i[31:1] ),
488487

488+
// debug mode halt address
489+
.dm_halt_addr_i ( dm_halt_addr_i[31:2] ),
490+
489491
// trap vector location
490492
.m_trap_base_addr_i ( mtvec ),
491493
.m_trap_base_addrx_i ( mtvecx ),

rtl/riscv_if_stage.sv

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ module riscv_if_stage
3232
#(
3333
parameter N_HWLP = 2,
3434
parameter RDATA_WIDTH = 32,
35-
parameter FPU = 0,
36-
parameter DM_HALTADDRESS = 32'h1A110800
35+
parameter FPU = 0
3736
)
3837
(
3938
input logic clk,
@@ -44,9 +43,12 @@ module riscv_if_stage
4443
input logic [23:0] m_trap_base_addrx_i,
4544
input logic [23:0] u_trap_base_addr_i,
4645
input logic [1:0] trap_addr_mux_i,
47-
// Used for boot address
46+
// Boot address
4847
input logic [30:0] boot_addr_i,
4948

49+
// Debug mode halt address
50+
input logic [29:0] dm_halt_addr_i,
51+
5052
// instruction request control
5153
input logic req_i,
5254

@@ -142,7 +144,7 @@ module riscv_if_stage
142144
unique case (exc_pc_mux_i)
143145
EXC_PC_EXCEPTION: exc_pc = { trap_base_addr, 8'h0 }; //1.10 all the exceptions go to base address
144146
EXC_PC_IRQ: exc_pc = { trap_base_addr, 1'b0, exc_vec_pc_mux_i[4:0], 2'b0 }; // interrupts are vectored
145-
EXC_PC_DBD: exc_pc = { DM_HALTADDRESS };
147+
EXC_PC_DBD: exc_pc = { dm_halt_addr_i, 2'b0 };
146148
default:;
147149
endcase
148150
end

tb/core/riscv_wrapper.sv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ module riscv_wrapper
6666
#(
6767
.PULP_CLUSTER(PULP_CLUSTER),
6868
.FPU(FPU),
69-
.PULP_ZFINX(PULP_ZFINX),
70-
.DM_HALTADDRESS(DM_HALTADDRESS))
69+
.PULP_ZFINX(PULP_ZFINX))
7170
riscv_core_i
7271
(
7372
.clk_i ( clk_i ),
@@ -77,6 +76,7 @@ module riscv_wrapper
7776
.scan_cg_en_i ( 1'b0 ),
7877

7978
.boot_addr_i ( BOOT_ADDR ),
79+
.dm_halt_addr_i ( DM_HALTADDRESS ),
8080
.hart_id_i ( 32'h0 ),
8181

8282
.instr_addr_o ( instr_addr ),

0 commit comments

Comments
 (0)