Skip to content

Commit f003530

Browse files
committed
[hw,soc_proxy,rtl] Implement dummy register to keep reg port
Signed-off-by: Robert Schilling <[email protected]>
1 parent 57511ef commit f003530

File tree

15 files changed

+59
-27
lines changed

15 files changed

+59
-27
lines changed

hw/top_darjeeling/data/autogen/top_darjeeling.gen.hjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12198,7 +12198,7 @@
1219812198
{
1219912199
hart: 0x22030000
1220012200
}
12201-
size_byte: 0x10
12201+
size_byte: 0x20
1220212202
}
1220312203
]
1220412204
xbar: false

hw/top_darjeeling/doc/memory_map.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The main address space, shared between the CPU and DM
3030
| pinmux_aon | default | `0x30460000` | `0x800` | `0x200` | pinmux_aon |
3131
| aon_timer_aon | default | `0x30470000` | `0x40` | `0x10` | aon_timer_aon |
3232
| ast | default | `0x30480000` | `0x400` | `0x100` | ast |
33-
| soc_proxy | core | `0x22030000` | `0x10` | `0x4` | core device on soc_proxy |
33+
| soc_proxy | core | `0x22030000` | `0x20` | `0x8` | core device on soc_proxy |
3434
| sram_ctrl_ret_aon | regs | `0x30500000` | `0x40` | `0x10` | regs device on sram_ctrl_ret_aon |
3535
| rv_dm | regs | `0x21200000` | `0x10` | `0x4` | regs device on rv_dm |
3636
| rv_dm | mem | `0x40000` | `0x1000` | `0x400` | mem device on rv_dm |

hw/top_darjeeling/dv/autogen/xbar_env_pkg__params.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ tl_device_t xbar_devices[$] = '{
2626
'{32'h211e1000, 32'h211e107f}
2727
}},
2828
'{"soc_proxy__core", '{
29-
'{32'h22030000, 32'h2203000f}
29+
'{32'h22030000, 32'h2203001f}
3030
}},
3131
'{"soc_proxy__ctn", '{
3232
'{32'h40000000, 32'hbfffffff}

hw/top_darjeeling/dv/autogen/xbar_tgl_excl.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
-node tb.dut*.u_rom_ctrl1 regs_tl_*i.a_address[23:21]
4444
-node tb.dut*.u_rom_ctrl1 regs_tl_*i.a_address[28:25]
4545
-node tb.dut*.u_rom_ctrl1 regs_tl_*i.a_address[31:30]
46-
-node tb.dut*.u_soc_proxy core_tl_*i.a_address[15:4]
46+
-node tb.dut*.u_soc_proxy core_tl_*i.a_address[15:5]
4747
-node tb.dut*.u_soc_proxy core_tl_*i.a_address[24:18]
4848
-node tb.dut*.u_soc_proxy core_tl_*i.a_address[28:26]
4949
-node tb.dut*.u_soc_proxy core_tl_*i.a_address[31:30]

hw/top_darjeeling/ip/soc_proxy/data/soc_proxy.hjson

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,23 @@
313313

314314
registers: {
315315
core: [
316-
// no CSRs defined yet
316+
{
317+
name: "DUMMY"
318+
desc: '''
319+
Dummy register to keep the device port.
320+
Always returns 0.
321+
'''
322+
swaccess: "ro"
323+
hwaccess: "none"
324+
fields: [
325+
{
326+
name: "dummy"
327+
desc: "Dummy field"
328+
bits: "0"
329+
resval: 0
330+
}
331+
]
332+
}
317333
]
318334
}
319335

hw/top_darjeeling/ip/soc_proxy/rtl/soc_proxy_core_reg_top.sv

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module soc_proxy_core_reg_top (
2121

2222
import soc_proxy_reg_pkg::* ;
2323

24-
localparam int AW = 4;
24+
localparam int AW = 5;
2525
localparam int DW = 32;
2626
localparam int DBW = DW/8; // Byte Width
2727

@@ -52,9 +52,9 @@ module soc_proxy_core_reg_top (
5252

5353
// also check for spurious write enables
5454
logic reg_we_err;
55-
logic [3:0] reg_we_check;
55+
logic [4:0] reg_we_check;
5656
prim_reg_we_check #(
57-
.OneHotWidth(4)
57+
.OneHotWidth(5)
5858
) u_prim_reg_we_check (
5959
.clk_i(clk_i),
6060
.rst_ni(rst_ni),
@@ -159,6 +159,7 @@ module soc_proxy_core_reg_top (
159159
logic alert_test_recov_alert_external_1_wd;
160160
logic alert_test_recov_alert_external_2_wd;
161161
logic alert_test_recov_alert_external_3_wd;
162+
logic dummy_qs;
162163

163164
// Register instances
164165
// R[intr_state]: V(False)
@@ -706,13 +707,19 @@ module soc_proxy_core_reg_top (
706707
assign reg2hw.alert_test.recov_alert_external_3.qe = alert_test_qe;
707708

708709

710+
// R[dummy]: V(False)
711+
// constant-only read
712+
assign dummy_qs = 1'h0;
709713

710-
logic [3:0] addr_hit;
714+
715+
716+
logic [4:0] addr_hit;
711717
always_comb begin
712718
addr_hit[0] = (reg_addr == SOC_PROXY_INTR_STATE_OFFSET);
713719
addr_hit[1] = (reg_addr == SOC_PROXY_INTR_ENABLE_OFFSET);
714720
addr_hit[2] = (reg_addr == SOC_PROXY_INTR_TEST_OFFSET);
715721
addr_hit[3] = (reg_addr == SOC_PROXY_ALERT_TEST_OFFSET);
722+
addr_hit[4] = (reg_addr == SOC_PROXY_DUMMY_OFFSET);
716723
end
717724

718725
assign addrmiss = (reg_re || reg_we) ? ~|addr_hit : 1'b0 ;
@@ -723,7 +730,8 @@ module soc_proxy_core_reg_top (
723730
((addr_hit[0] & (|(SOC_PROXY_CORE_PERMIT[0] & ~reg_be))) |
724731
(addr_hit[1] & (|(SOC_PROXY_CORE_PERMIT[1] & ~reg_be))) |
725732
(addr_hit[2] & (|(SOC_PROXY_CORE_PERMIT[2] & ~reg_be))) |
726-
(addr_hit[3] & (|(SOC_PROXY_CORE_PERMIT[3] & ~reg_be)))));
733+
(addr_hit[3] & (|(SOC_PROXY_CORE_PERMIT[3] & ~reg_be))) |
734+
(addr_hit[4] & (|(SOC_PROXY_CORE_PERMIT[4] & ~reg_be)))));
727735
end
728736

729737
// Generate write-enables
@@ -802,6 +810,7 @@ module soc_proxy_core_reg_top (
802810
reg_we_check[1] = intr_enable_we;
803811
reg_we_check[2] = intr_test_we;
804812
reg_we_check[3] = alert_test_we;
813+
reg_we_check[4] = 1'b0;
805814
end
806815

807816
// Read data return
@@ -852,6 +861,10 @@ module soc_proxy_core_reg_top (
852861
reg_rdata_next[28] = '0;
853862
end
854863

864+
addr_hit[4]: begin
865+
reg_rdata_next[0] = dummy_qs;
866+
end
867+
855868
default: begin
856869
reg_rdata_next = '1;
857870
end

hw/top_darjeeling/ip/soc_proxy/rtl/soc_proxy_reg_pkg.sv

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ package soc_proxy_reg_pkg;
1111
parameter int NumAlerts = 29;
1212

1313
// Address widths within the block
14-
parameter int CoreAw = 4;
14+
parameter int CoreAw = 5;
1515

1616
// Number of registers for every interface
17-
parameter int NumRegsCore = 4;
17+
parameter int NumRegsCore = 5;
1818

1919
// Alert indices
2020
typedef enum int {
@@ -204,10 +204,11 @@ package soc_proxy_reg_pkg;
204204
} soc_proxy_core_hw2reg_t;
205205

206206
// Register offsets for core interface
207-
parameter logic [CoreAw-1:0] SOC_PROXY_INTR_STATE_OFFSET = 4'h 0;
208-
parameter logic [CoreAw-1:0] SOC_PROXY_INTR_ENABLE_OFFSET = 4'h 4;
209-
parameter logic [CoreAw-1:0] SOC_PROXY_INTR_TEST_OFFSET = 4'h 8;
210-
parameter logic [CoreAw-1:0] SOC_PROXY_ALERT_TEST_OFFSET = 4'h c;
207+
parameter logic [CoreAw-1:0] SOC_PROXY_INTR_STATE_OFFSET = 5'h 0;
208+
parameter logic [CoreAw-1:0] SOC_PROXY_INTR_ENABLE_OFFSET = 5'h 4;
209+
parameter logic [CoreAw-1:0] SOC_PROXY_INTR_TEST_OFFSET = 5'h 8;
210+
parameter logic [CoreAw-1:0] SOC_PROXY_ALERT_TEST_OFFSET = 5'h c;
211+
parameter logic [CoreAw-1:0] SOC_PROXY_DUMMY_OFFSET = 5'h 10;
211212

212213
// Reset values for hwext registers and their fields for core interface
213214
parameter logic [31:0] SOC_PROXY_INTR_TEST_RESVAL = 32'h 0;
@@ -248,15 +249,17 @@ package soc_proxy_reg_pkg;
248249
SOC_PROXY_INTR_STATE,
249250
SOC_PROXY_INTR_ENABLE,
250251
SOC_PROXY_INTR_TEST,
251-
SOC_PROXY_ALERT_TEST
252+
SOC_PROXY_ALERT_TEST,
253+
SOC_PROXY_DUMMY
252254
} soc_proxy_core_id_e;
253255

254256
// Register width information to check illegal writes for core interface
255-
parameter logic [3:0] SOC_PROXY_CORE_PERMIT [4] = '{
257+
parameter logic [3:0] SOC_PROXY_CORE_PERMIT [5] = '{
256258
4'b 1111, // index[0] SOC_PROXY_INTR_STATE
257259
4'b 1111, // index[1] SOC_PROXY_INTR_ENABLE
258260
4'b 1111, // index[2] SOC_PROXY_INTR_TEST
259-
4'b 1111 // index[3] SOC_PROXY_ALERT_TEST
261+
4'b 1111, // index[3] SOC_PROXY_ALERT_TEST
262+
4'b 0001 // index[4] SOC_PROXY_DUMMY
260263
};
261264

262265
endpackage

hw/top_darjeeling/ip/xbar_main/data/autogen/xbar_main.gen.hjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@
386386
{
387387
hart: 0x22030000
388388
}
389-
size_byte: 0x10
389+
size_byte: 0x20
390390
}
391391
]
392392
xbar: false

hw/top_darjeeling/ip/xbar_main/dv/autogen/xbar_cover.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
-node tb.dut tl_rom_ctrl1__regs_o.a_address[31:30]
4242
-node tb.dut tl_peri_o.a_address[27:23]
4343
-node tb.dut tl_peri_o.a_address[31:30]
44-
-node tb.dut tl_soc_proxy__core_o.a_address[15:4]
44+
-node tb.dut tl_soc_proxy__core_o.a_address[15:5]
4545
-node tb.dut tl_soc_proxy__core_o.a_address[24:18]
4646
-node tb.dut tl_soc_proxy__core_o.a_address[28:26]
4747
-node tb.dut tl_soc_proxy__core_o.a_address[31:30]

hw/top_darjeeling/ip/xbar_main/dv/autogen/xbar_env_pkg__params.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ tl_device_t xbar_devices[$] = '{
2929
'{32'h30000000, 32'h307fffff}
3030
}},
3131
'{"soc_proxy__core", '{
32-
'{32'h22030000, 32'h2203000f}
32+
'{32'h22030000, 32'h2203001f}
3333
}},
3434
'{"soc_proxy__ctn", '{
3535
'{32'h40000000, 32'hbfffffff}

0 commit comments

Comments
 (0)