[reggen] Clean up some spaces above write/read-enable registers
This avoids some silly whitespace by only generating a blank line
before the block of write-enables and read-enables for a register if
that block is nonempty.
Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
diff --git a/hw/ip/aes/rtl/aes_reg_top.sv b/hw/ip/aes/rtl/aes_reg_top.sv
index 6e73d1c..527cc71 100644
--- a/hw/ip/aes/rtl/aes_reg_top.sv
+++ b/hw/ip/aes/rtl/aes_reg_top.sv
@@ -1279,13 +1279,6 @@
assign trigger_prng_reseed_we = addr_hit[30] & reg_we & !reg_error;
assign trigger_prng_reseed_wd = reg_wdata[3];
-
-
-
-
-
-
-
// Read data return
always_comb begin
reg_rdata_next = '0;
diff --git a/hw/ip/clkmgr/rtl/clkmgr_reg_top.sv b/hw/ip/clkmgr/rtl/clkmgr_reg_top.sv
index ec67f9c..15d55fa 100644
--- a/hw/ip/clkmgr/rtl/clkmgr_reg_top.sv
+++ b/hw/ip/clkmgr/rtl/clkmgr_reg_top.sv
@@ -308,8 +308,6 @@
assign clk_hints_clk_main_hmac_hint_we = addr_hit[1] & reg_we & !reg_error;
assign clk_hints_clk_main_hmac_hint_wd = reg_wdata[1];
-
-
// Read data return
always_comb begin
reg_rdata_next = '0;
diff --git a/hw/ip/csrng/rtl/csrng_reg_top.sv b/hw/ip/csrng/rtl/csrng_reg_top.sv
index 3467274..3abe448 100644
--- a/hw/ip/csrng/rtl/csrng_reg_top.sv
+++ b/hw/ip/csrng/rtl/csrng_reg_top.sv
@@ -1651,13 +1651,9 @@
assign ctrl_fifo_depth_sts_sel_we = addr_hit[5] & reg_we & !reg_error;
assign ctrl_fifo_depth_sts_sel_wd = reg_wdata[19:16];
-
-
assign cmd_req_we = addr_hit[7] & reg_we & !reg_error;
assign cmd_req_wd = reg_wdata[31:0];
-
-
assign genbits_vld_genbits_vld_re = addr_hit[9] & reg_re & !reg_error;
assign genbits_vld_genbits_fips_re = addr_hit[9] & reg_re & !reg_error;
@@ -1667,7 +1663,6 @@
assign halt_main_sm_we = addr_hit[11] & reg_we & !reg_error;
assign halt_main_sm_wd = reg_wdata[0];
-
assign int_state_num_we = addr_hit[13] & reg_we & !reg_error;
assign int_state_num_wd = reg_wdata[3:0];
@@ -1676,31 +1671,6 @@
assign hw_exc_sts_we = addr_hit[15] & reg_we & !reg_error;
assign hw_exc_sts_wd = reg_wdata[14:0];
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
assign err_code_test_we = addr_hit[17] & reg_we & !reg_error;
assign err_code_test_wd = reg_wdata[4:0];
diff --git a/hw/ip/dcd/rtl/dcd_reg_top.sv b/hw/ip/dcd/rtl/dcd_reg_top.sv
index 6559f4d..f7093b6 100644
--- a/hw/ip/dcd/rtl/dcd_reg_top.sv
+++ b/hw/ip/dcd/rtl/dcd_reg_top.sv
@@ -4348,14 +4348,6 @@
assign adc_chn1_filter_ctl_7_max_v_7_we = addr_hit[23] & reg_we & !reg_error;
assign adc_chn1_filter_ctl_7_max_v_7_wd = reg_wdata[27:18];
-
-
-
-
-
-
-
-
assign adc_wakeup_ctl_chn0_1_filter0_en_we = addr_hit[26] & reg_we & !reg_error;
assign adc_wakeup_ctl_chn0_1_filter0_en_wd = reg_wdata[0];
diff --git a/hw/ip/edn/rtl/edn_reg_top.sv b/hw/ip/edn/rtl/edn_reg_top.sv
index 82470ff..9bab470 100644
--- a/hw/ip/edn/rtl/edn_reg_top.sv
+++ b/hw/ip/edn/rtl/edn_reg_top.sv
@@ -958,8 +958,6 @@
assign sw_cmd_req_we = addr_hit[7] & reg_we & !reg_error;
assign sw_cmd_req_wd = reg_wdata[31:0];
-
-
assign reseed_cmd_we = addr_hit[9] & reg_we & !reg_error;
assign reseed_cmd_wd = reg_wdata[31:0];
@@ -969,13 +967,6 @@
assign max_num_reqs_between_reseeds_we = addr_hit[11] & reg_we & !reg_error;
assign max_num_reqs_between_reseeds_wd = reg_wdata[31:0];
-
-
-
-
-
-
-
assign err_code_test_we = addr_hit[13] & reg_we & !reg_error;
assign err_code_test_wd = reg_wdata[4:0];
diff --git a/hw/ip/entropy_src/rtl/entropy_src_reg_top.sv b/hw/ip/entropy_src/rtl/entropy_src_reg_top.sv
index b5dabba..38377eb 100644
--- a/hw/ip/entropy_src/rtl/entropy_src_reg_top.sv
+++ b/hw/ip/entropy_src/rtl/entropy_src_reg_top.sv
@@ -2457,9 +2457,6 @@
assign regwen_we = addr_hit[4] & reg_we & !reg_error;
assign regwen_wd = reg_wdata[0];
-
-
-
assign conf_enable_we = addr_hit[6] & reg_we & !reg_error;
assign conf_enable_wd = reg_wdata[1:0];
@@ -2666,14 +2663,6 @@
assign seed_we = addr_hit[44] & reg_we & !reg_error;
assign seed_wd = reg_wdata[3:0];
-
-
-
-
-
-
-
-
assign err_code_test_we = addr_hit[46] & reg_we & !reg_error;
assign err_code_test_wd = reg_wdata[4:0];
diff --git a/hw/ip/flash_ctrl/rtl/flash_ctrl_reg_top.sv b/hw/ip/flash_ctrl/rtl/flash_ctrl_reg_top.sv
index 6e35b3c..b242263 100644
--- a/hw/ip/flash_ctrl/rtl/flash_ctrl_reg_top.sv
+++ b/hw/ip/flash_ctrl/rtl/flash_ctrl_reg_top.sv
@@ -11586,11 +11586,6 @@
assign op_status_err_we = addr_hit[80] & reg_we & !reg_error;
assign op_status_err_wd = reg_wdata[1];
-
-
-
-
-
assign err_code_flash_err_we = addr_hit[82] & reg_we & !reg_error;
assign err_code_flash_err_wd = reg_wdata[0];
@@ -11606,18 +11601,12 @@
assign err_code_ecc_multi_err_we = addr_hit[82] & reg_we & !reg_error;
assign err_code_ecc_multi_err_wd = reg_wdata[4];
-
-
-
assign phy_alert_cfg_alert_ack_we = addr_hit[86] & reg_we & !reg_error;
assign phy_alert_cfg_alert_ack_wd = reg_wdata[0];
assign phy_alert_cfg_alert_trig_we = addr_hit[86] & reg_we & !reg_error;
assign phy_alert_cfg_alert_trig_wd = reg_wdata[1];
-
-
-
assign scratch_we = addr_hit[88] & reg_we & !reg_error;
assign scratch_wd = reg_wdata[31:0];
diff --git a/hw/ip/gpio/rtl/gpio_reg_top.sv b/hw/ip/gpio/rtl/gpio_reg_top.sv
index 5304d6c..304c433 100644
--- a/hw/ip/gpio/rtl/gpio_reg_top.sv
+++ b/hw/ip/gpio/rtl/gpio_reg_top.sv
@@ -606,7 +606,6 @@
assign intr_test_we = addr_hit[2] & reg_we & !reg_error;
assign intr_test_wd = reg_wdata[31:0];
-
assign direct_out_we = addr_hit[4] & reg_we & !reg_error;
assign direct_out_wd = reg_wdata[31:0];
assign direct_out_re = addr_hit[4] & reg_re & !reg_error;
diff --git a/hw/ip/hmac/rtl/hmac_reg_top.sv b/hw/ip/hmac/rtl/hmac_reg_top.sv
index 637f07f..0a7d679 100644
--- a/hw/ip/hmac/rtl/hmac_reg_top.sv
+++ b/hw/ip/hmac/rtl/hmac_reg_top.sv
@@ -1060,7 +1060,6 @@
assign status_fifo_depth_re = addr_hit[5] & reg_re & !reg_error;
-
assign wipe_secret_we = addr_hit[7] & reg_we & !reg_error;
assign wipe_secret_wd = reg_wdata[31:0];
@@ -1104,8 +1103,6 @@
assign digest_7_re = addr_hit[23] & reg_re & !reg_error;
-
-
// Read data return
always_comb begin
reg_rdata_next = '0;
diff --git a/hw/ip/keymgr/rtl/keymgr_reg_top.sv b/hw/ip/keymgr/rtl/keymgr_reg_top.sv
index aca3452..7cb6268 100644
--- a/hw/ip/keymgr/rtl/keymgr_reg_top.sv
+++ b/hw/ip/keymgr/rtl/keymgr_reg_top.sv
@@ -1747,7 +1747,6 @@
assign sw_share1_output_7_we = addr_hit[39] & reg_re & !reg_error;
assign sw_share1_output_7_wd = '1;
-
assign op_status_we = addr_hit[41] & reg_we & !reg_error;
assign op_status_wd = reg_wdata[1:0];
diff --git a/hw/ip/kmac/rtl/kmac_reg_top.sv b/hw/ip/kmac/rtl/kmac_reg_top.sv
index d833967..fa972ee 100644
--- a/hw/ip/kmac/rtl/kmac_reg_top.sv
+++ b/hw/ip/kmac/rtl/kmac_reg_top.sv
@@ -2247,7 +2247,6 @@
assign prefix_10_we = addr_hit[53] & reg_we & !reg_error;
assign prefix_10_wd = reg_wdata[31:0];
-
// Read data return
always_comb begin
reg_rdata_next = '0;
diff --git a/hw/ip/otbn/rtl/otbn_reg_top.sv b/hw/ip/otbn/rtl/otbn_reg_top.sv
index 5fac226..37962fb 100644
--- a/hw/ip/otbn/rtl/otbn_reg_top.sv
+++ b/hw/ip/otbn/rtl/otbn_reg_top.sv
@@ -675,20 +675,9 @@
assign status_re = addr_hit[5] & reg_re & !reg_error;
-
-
-
-
-
-
-
-
assign start_addr_we = addr_hit[7] & reg_we & !reg_error;
assign start_addr_wd = reg_wdata[31:0];
-
-
-
// Read data return
always_comb begin
reg_rdata_next = '0;
diff --git a/hw/ip/pwrmgr/rtl/pwrmgr_reg_top.sv b/hw/ip/pwrmgr/rtl/pwrmgr_reg_top.sv
index 4a8ebc7..485911b 100644
--- a/hw/ip/pwrmgr/rtl/pwrmgr_reg_top.sv
+++ b/hw/ip/pwrmgr/rtl/pwrmgr_reg_top.sv
@@ -755,14 +755,12 @@
assign wakeup_en_we = addr_hit[7] & reg_we & !reg_error;
assign wakeup_en_wd = reg_wdata[0];
-
assign reset_en_regwen_we = addr_hit[9] & reg_we & !reg_error;
assign reset_en_regwen_wd = reg_wdata[0];
assign reset_en_we = addr_hit[10] & reg_we & !reg_error;
assign reset_en_wd = reg_wdata[0];
-
assign wake_info_capture_dis_we = addr_hit[12] & reg_we & !reg_error;
assign wake_info_capture_dis_wd = reg_wdata[0];
diff --git a/hw/ip/rbox/rtl/rbox_reg_top.sv b/hw/ip/rbox/rtl/rbox_reg_top.sv
index 106c093..5f649bd 100644
--- a/hw/ip/rbox/rtl/rbox_reg_top.sv
+++ b/hw/ip/rbox/rtl/rbox_reg_top.sv
@@ -3857,12 +3857,6 @@
assign pin_out_value_key2_out_we = addr_hit[8] & reg_we & !reg_error;
assign pin_out_value_key2_out_wd = reg_wdata[5];
-
-
-
-
-
-
assign key_intr_ctl_pwrb_in_h2l_we = addr_hit[10] & reg_we & !reg_error;
assign key_intr_ctl_pwrb_in_h2l_wd = reg_wdata[0];
diff --git a/hw/ip/rv_plic/rtl/rv_plic_reg_top.sv b/hw/ip/rv_plic/rtl/rv_plic_reg_top.sv
index 20986b1..7a32fcd 100644
--- a/hw/ip/rv_plic/rtl/rv_plic_reg_top.sv
+++ b/hw/ip/rv_plic/rtl/rv_plic_reg_top.sv
@@ -3935,38 +3935,6 @@
if (addr_hit[37] && reg_we && (RV_PLIC_PERMIT[37] != (RV_PLIC_PERMIT[37] & reg_be))) wr_err = 1'b1 ;
end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
assign le_le_0_we = addr_hit[1] & reg_we & !reg_error;
assign le_le_0_wd = reg_wdata[0];
diff --git a/hw/ip/spi_device/rtl/spi_device_reg_top.sv b/hw/ip/spi_device/rtl/spi_device_reg_top.sv
index 9a9cdd6..836e7af 100644
--- a/hw/ip/spi_device/rtl/spi_device_reg_top.sv
+++ b/hw/ip/spi_device/rtl/spi_device_reg_top.sv
@@ -1481,8 +1481,6 @@
assign rxf_ptr_rptr_we = addr_hit[8] & reg_we & !reg_error;
assign rxf_ptr_rptr_wd = reg_wdata[15:0];
-
-
assign txf_ptr_wptr_we = addr_hit[9] & reg_we & !reg_error;
assign txf_ptr_wptr_wd = reg_wdata[31:16];
diff --git a/hw/ip/spi_host/rtl/spi_host_reg_top.sv b/hw/ip/spi_host/rtl/spi_host_reg_top.sv
index 1469be6..deb1f36 100644
--- a/hw/ip/spi_host/rtl/spi_host_reg_top.sv
+++ b/hw/ip/spi_host/rtl/spi_host_reg_top.sv
@@ -1836,19 +1836,6 @@
assign control_spien_we = addr_hit[3] & reg_we & !reg_error;
assign control_spien_wd = reg_wdata[31];
-
-
-
-
-
-
-
-
-
-
-
-
-
assign configopts_clkdiv_0_we = addr_hit[5] & reg_we & !reg_error;
assign configopts_clkdiv_0_wd = reg_wdata[15:0];
diff --git a/hw/ip/sram_ctrl/rtl/sram_ctrl_reg_top.sv b/hw/ip/sram_ctrl/rtl/sram_ctrl_reg_top.sv
index 1322f86..8d70807 100644
--- a/hw/ip/sram_ctrl/rtl/sram_ctrl_reg_top.sv
+++ b/hw/ip/sram_ctrl/rtl/sram_ctrl_reg_top.sv
@@ -398,7 +398,6 @@
assign ctrl_we = addr_hit[5] & reg_we & !reg_error;
assign ctrl_wd = reg_wdata[0];
-
// Read data return
always_comb begin
reg_rdata_next = '0;
diff --git a/hw/ip/trial1/rtl/trial1_reg_top.sv b/hw/ip/trial1/rtl/trial1_reg_top.sv
index 60134a8..d24a77c 100644
--- a/hw/ip/trial1/rtl/trial1_reg_top.sv
+++ b/hw/ip/trial1/rtl/trial1_reg_top.sv
@@ -1121,7 +1121,6 @@
assign rwtype4_field1_we = addr_hit[4] & reg_we & !reg_error;
assign rwtype4_field1_wd = reg_wdata[31:16];
-
assign w1ctype0_we = addr_hit[6] & reg_we & !reg_error;
assign w1ctype0_wd = reg_wdata[31:0];
@@ -1155,8 +1154,6 @@
assign mixtype0_field1_we = addr_hit[14] & reg_we & !reg_error;
assign mixtype0_field1_wd = reg_wdata[7:4];
-
-
assign mixtype0_field4_we = addr_hit[14] & reg_we & !reg_error;
assign mixtype0_field4_wd = reg_wdata[19:16];
@@ -1178,9 +1175,6 @@
assign rotype1_re = addr_hit[17] & reg_re & !reg_error;
-
-
-
assign rwtype7_we = addr_hit[19] & reg_we & !reg_error;
assign rwtype7_wd = reg_wdata[31:0];
diff --git a/hw/ip/usbdev/rtl/usbdev_reg_top.sv b/hw/ip/usbdev/rtl/usbdev_reg_top.sv
index b997fff..40a364b 100644
--- a/hw/ip/usbdev/rtl/usbdev_reg_top.sv
+++ b/hw/ip/usbdev/rtl/usbdev_reg_top.sv
@@ -6736,7 +6736,6 @@
assign wake_config_wake_ack_we = addr_hit[28] & reg_we & !reg_error;
assign wake_config_wake_ack_wd = reg_wdata[1];
-
// Read data return
always_comb begin
reg_rdata_next = '0;
diff --git a/hw/top_earlgrey/ip/ast/rtl/ast_reg_top.sv b/hw/top_earlgrey/ip/ast/rtl/ast_reg_top.sv
index 3e66a71..d980fd3 100644
--- a/hw/top_earlgrey/ip/ast/rtl/ast_reg_top.sv
+++ b/hw/top_earlgrey/ip/ast/rtl/ast_reg_top.sv
@@ -297,7 +297,6 @@
if (addr_hit[2] && reg_we && (AST_PERMIT[2] != (AST_PERMIT[2] & reg_be))) wr_err = 1'b1 ;
end
-
assign rwtype0_we = addr_hit[1] & reg_we & !reg_error;
assign rwtype0_wd = reg_wdata[31:0];
diff --git a/hw/top_earlgrey/ip/clkmgr/rtl/autogen/clkmgr_reg_top.sv b/hw/top_earlgrey/ip/clkmgr/rtl/autogen/clkmgr_reg_top.sv
index 3a5e634..bfbecfb 100644
--- a/hw/top_earlgrey/ip/clkmgr/rtl/autogen/clkmgr_reg_top.sv
+++ b/hw/top_earlgrey/ip/clkmgr/rtl/autogen/clkmgr_reg_top.sv
@@ -491,10 +491,6 @@
assign clk_hints_clk_main_otbn_hint_we = addr_hit[2] & reg_we & !reg_error;
assign clk_hints_clk_main_otbn_hint_wd = reg_wdata[3];
-
-
-
-
// Read data return
always_comb begin
reg_rdata_next = '0;
diff --git a/hw/top_earlgrey/ip/flash_ctrl/rtl/autogen/flash_ctrl_reg_top.sv b/hw/top_earlgrey/ip/flash_ctrl/rtl/autogen/flash_ctrl_reg_top.sv
index 6e35b3c..b242263 100644
--- a/hw/top_earlgrey/ip/flash_ctrl/rtl/autogen/flash_ctrl_reg_top.sv
+++ b/hw/top_earlgrey/ip/flash_ctrl/rtl/autogen/flash_ctrl_reg_top.sv
@@ -11586,11 +11586,6 @@
assign op_status_err_we = addr_hit[80] & reg_we & !reg_error;
assign op_status_err_wd = reg_wdata[1];
-
-
-
-
-
assign err_code_flash_err_we = addr_hit[82] & reg_we & !reg_error;
assign err_code_flash_err_wd = reg_wdata[0];
@@ -11606,18 +11601,12 @@
assign err_code_ecc_multi_err_we = addr_hit[82] & reg_we & !reg_error;
assign err_code_ecc_multi_err_wd = reg_wdata[4];
-
-
-
assign phy_alert_cfg_alert_ack_we = addr_hit[86] & reg_we & !reg_error;
assign phy_alert_cfg_alert_ack_wd = reg_wdata[0];
assign phy_alert_cfg_alert_trig_we = addr_hit[86] & reg_we & !reg_error;
assign phy_alert_cfg_alert_trig_wd = reg_wdata[1];
-
-
-
assign scratch_we = addr_hit[88] & reg_we & !reg_error;
assign scratch_wd = reg_wdata[31:0];
diff --git a/hw/top_earlgrey/ip/pwrmgr/rtl/autogen/pwrmgr_reg_top.sv b/hw/top_earlgrey/ip/pwrmgr/rtl/autogen/pwrmgr_reg_top.sv
index fed3648..86a7822 100644
--- a/hw/top_earlgrey/ip/pwrmgr/rtl/autogen/pwrmgr_reg_top.sv
+++ b/hw/top_earlgrey/ip/pwrmgr/rtl/autogen/pwrmgr_reg_top.sv
@@ -904,17 +904,12 @@
assign wakeup_en_en_2_we = addr_hit[7] & reg_we & !reg_error;
assign wakeup_en_en_2_wd = reg_wdata[2];
-
-
-
assign reset_en_regwen_we = addr_hit[9] & reg_we & !reg_error;
assign reset_en_regwen_wd = reg_wdata[0];
assign reset_en_we = addr_hit[10] & reg_we & !reg_error;
assign reset_en_wd = reg_wdata[0];
-
-
assign wake_info_capture_dis_we = addr_hit[13] & reg_we & !reg_error;
assign wake_info_capture_dis_wd = reg_wdata[0];
diff --git a/hw/top_earlgrey/ip/rv_plic/rtl/autogen/rv_plic_reg_top.sv b/hw/top_earlgrey/ip/rv_plic/rtl/autogen/rv_plic_reg_top.sv
index 88506a1..f5cac04 100644
--- a/hw/top_earlgrey/ip/rv_plic/rtl/autogen/rv_plic_reg_top.sv
+++ b/hw/top_earlgrey/ip/rv_plic/rtl/autogen/rv_plic_reg_top.sv
@@ -20714,182 +20714,6 @@
if (addr_hit[196] && reg_we && (RV_PLIC_PERMIT[196] != (RV_PLIC_PERMIT[196] & reg_be))) wr_err = 1'b1 ;
end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
assign le_0_le_0_we = addr_hit[6] & reg_we & !reg_error;
assign le_0_le_0_wd = reg_wdata[0];
diff --git a/hw/top_earlgrey/ip/sensor_ctrl/rtl/sensor_ctrl_reg_top.sv b/hw/top_earlgrey/ip/sensor_ctrl/rtl/sensor_ctrl_reg_top.sv
index 08a1070..655d8e7 100644
--- a/hw/top_earlgrey/ip/sensor_ctrl/rtl/sensor_ctrl_reg_top.sv
+++ b/hw/top_earlgrey/ip/sensor_ctrl/rtl/sensor_ctrl_reg_top.sv
@@ -1017,7 +1017,6 @@
assign alert_state_val_6_we = addr_hit[4] & reg_we & !reg_error;
assign alert_state_val_6_wd = reg_wdata[6];
-
// Read data return
always_comb begin
reg_rdata_next = '0;
diff --git a/util/reggen/reg_top.sv.tpl b/util/reggen/reg_top.sv.tpl
index 106f4df..d925c74 100644
--- a/util/reggen/reg_top.sv.tpl
+++ b/util/reggen/reg_top.sv.tpl
@@ -541,8 +541,13 @@
% endif
</%def>\
<%def name="we_gen(field, sig_name, hwext, shadowed, idx)">\
-
-% if field.swaccess.allows_write():
+<%
+ needs_we = field.swaccess.allows_write()
+ needs_re = (field.swaccess.allows_read() and hwext) or shadowed
+ space = '\n' if needs_we or needs_re else ''
+%>\
+${space}\
+% if needs_we:
% if field.swaccess.swrd() != SwRdAccess.RC:
assign ${sig_name}_we = addr_hit[${idx}] & reg_we & !reg_error;
assign ${sig_name}_wd = reg_wdata[${str_bits_sv(field.bits)}];
@@ -552,7 +557,7 @@
assign ${sig_name}_wd = '1;
% endif
% endif
-% if (field.swaccess.allows_read() and hwext) or shadowed:
+% if needs_re:
assign ${sig_name}_re = addr_hit[${idx}] & reg_re & !reg_error;
% endif
</%def>\