Skip to content

Commit

Permalink
update rdptr size in status reg
Browse files Browse the repository at this point in the history
  • Loading branch information
Nitsirks committed Jan 4, 2025
1 parent fd22d50 commit 145f216
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/integration/rtl/caliptra_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -5301,7 +5301,7 @@
#define MBOX_CSR_MBOX_STATUS_SOC_HAS_LOCK_LOW (9)
#define MBOX_CSR_MBOX_STATUS_SOC_HAS_LOCK_MASK (0x200)
#define MBOX_CSR_MBOX_STATUS_MBOX_RDPTR_LOW (10)
#define MBOX_CSR_MBOX_STATUS_MBOX_RDPTR_MASK (0x1fffc00)
#define MBOX_CSR_MBOX_STATUS_MBOX_RDPTR_MASK (0x3fffc00)
#define CLP_MBOX_CSR_MBOX_UNLOCK (0x30020020)
#define MBOX_CSR_MBOX_UNLOCK (0x20)
#define MBOX_CSR_MBOX_UNLOCK_UNLOCK_LOW (0)
Expand Down
2 changes: 1 addition & 1 deletion src/integration/rtl/caliptra_reg_defines.svh
Original file line number Diff line number Diff line change
Expand Up @@ -5301,7 +5301,7 @@
`define MBOX_CSR_MBOX_STATUS_SOC_HAS_LOCK_LOW (9)
`define MBOX_CSR_MBOX_STATUS_SOC_HAS_LOCK_MASK (32'h200)
`define MBOX_CSR_MBOX_STATUS_MBOX_RDPTR_LOW (10)
`define MBOX_CSR_MBOX_STATUS_MBOX_RDPTR_MASK (32'h1fffc00)
`define MBOX_CSR_MBOX_STATUS_MBOX_RDPTR_MASK (32'h3fffc00)
`define CLP_MBOX_CSR_MBOX_UNLOCK (32'h30020020)
`define MBOX_CSR_MBOX_UNLOCK (32'h20)
`define MBOX_CSR_MBOX_UNLOCK_UNLOCK_LOW (0)
Expand Down
2 changes: 1 addition & 1 deletion src/soc_ifc/rtl/caliptra_top_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#define MBOX_CSR_MBOX_STATUS_SOC_HAS_LOCK_LOW (9)
#define MBOX_CSR_MBOX_STATUS_SOC_HAS_LOCK_MASK (0x200)
#define MBOX_CSR_MBOX_STATUS_MBOX_RDPTR_LOW (10)
#define MBOX_CSR_MBOX_STATUS_MBOX_RDPTR_MASK (0x1fffc00)
#define MBOX_CSR_MBOX_STATUS_MBOX_RDPTR_MASK (0x3fffc00)
#define CALIPTRA_TOP_REG_MBOX_CSR_MBOX_UNLOCK (0x20020)
#define MBOX_CSR_MBOX_UNLOCK (0x20)
#define MBOX_CSR_MBOX_UNLOCK_UNLOCK_LOW (0)
Expand Down
2 changes: 1 addition & 1 deletion src/soc_ifc/rtl/caliptra_top_reg_defines.svh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
`define MBOX_CSR_MBOX_STATUS_SOC_HAS_LOCK_LOW (9)
`define MBOX_CSR_MBOX_STATUS_SOC_HAS_LOCK_MASK (32'h200)
`define MBOX_CSR_MBOX_STATUS_MBOX_RDPTR_LOW (10)
`define MBOX_CSR_MBOX_STATUS_MBOX_RDPTR_MASK (32'h1fffc00)
`define MBOX_CSR_MBOX_STATUS_MBOX_RDPTR_MASK (32'h3fffc00)
`define CALIPTRA_TOP_REG_MBOX_CSR_MBOX_UNLOCK (32'h20020)
`define MBOX_CSR_MBOX_UNLOCK (32'h20)
`define MBOX_CSR_MBOX_UNLOCK_UNLOCK_LOW (0)
Expand Down
4 changes: 2 additions & 2 deletions src/soc_ifc/rtl/mbox.sv
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,8 @@ always_comb hwif_in.mbox_dlen.length.next = dmi_reg_wdata;

always_comb dmi_reg.MBOX_DLEN = hwif_out.mbox_dlen.length.value;
always_comb dmi_reg.MBOX_DOUT = hwif_out.mbox_dataout.dataout.value;
always_comb dmi_reg.MBOX_STATUS = {7'd0, /* [31:25] */
hwif_out.mbox_status.mbox_rdptr.value, /* [24:10]*/
always_comb dmi_reg.MBOX_STATUS = {6'd0, /* [31:26] */
hwif_out.mbox_status.mbox_rdptr.value, /* [25:10]*/
hwif_out.mbox_status.soc_has_lock.value, /* [9] */
hwif_out.mbox_status.mbox_fsm_ps.value, /* [8:6] */
hwif_out.mbox_status.ecc_double_error.value, /* [5] */
Expand Down
2 changes: 1 addition & 1 deletion src/soc_ifc/rtl/mbox_csr.rdl
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ addrmap mbox_csr {
[br]Caliptra Access: RO
[br]SOC Access: RO
[br]TAP Access [in debug/manuf mode]: RO";
sw=r; hw=rw;} mbox_rdptr[15] = 0;
sw=r; hw=rw;} mbox_rdptr[16] = 0;
} mbox_status;

reg {
Expand Down
12 changes: 6 additions & 6 deletions src/soc_ifc/rtl/mbox_csr.sv
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ module mbox_csr (
logic load_next;
} soc_has_lock;
struct packed{
logic [14:0] next;
logic [15:0] next;
logic load_next;
} mbox_rdptr;
} mbox_status;
Expand Down Expand Up @@ -242,7 +242,7 @@ module mbox_csr (
logic value;
} soc_has_lock;
struct packed{
logic [14:0] value;
logic [15:0] value;
} mbox_rdptr;
} mbox_status;
struct packed{
Expand Down Expand Up @@ -538,7 +538,7 @@ module mbox_csr (
assign hwif_out.mbox_status.soc_has_lock.value = field_storage.mbox_status.soc_has_lock.value;
// Field: mbox_csr.mbox_status.mbox_rdptr
always_comb begin
automatic logic [14:0] next_c;
automatic logic [15:0] next_c;
automatic logic load_next_c;
next_c = field_storage.mbox_status.mbox_rdptr.value;
load_next_c = '0;
Expand All @@ -551,7 +551,7 @@ module mbox_csr (
end
always_ff @(posedge clk or negedge hwif_in.cptra_rst_b) begin
if(~hwif_in.cptra_rst_b) begin
field_storage.mbox_status.mbox_rdptr.value <= 15'h0;
field_storage.mbox_status.mbox_rdptr.value <= 16'h0;
end else if(field_combo.mbox_status.mbox_rdptr.load_next) begin
field_storage.mbox_status.mbox_rdptr.value <= field_combo.mbox_status.mbox_rdptr.next;
end
Expand Down Expand Up @@ -634,8 +634,8 @@ module mbox_csr (
assign readback_array[7][5:5] = (decoded_reg_strb.mbox_status && !decoded_req_is_wr) ? field_storage.mbox_status.ecc_double_error.value : '0;
assign readback_array[7][8:6] = (decoded_reg_strb.mbox_status && !decoded_req_is_wr) ? field_storage.mbox_status.mbox_fsm_ps.value : '0;
assign readback_array[7][9:9] = (decoded_reg_strb.mbox_status && !decoded_req_is_wr) ? field_storage.mbox_status.soc_has_lock.value : '0;
assign readback_array[7][24:10] = (decoded_reg_strb.mbox_status && !decoded_req_is_wr) ? field_storage.mbox_status.mbox_rdptr.value : '0;
assign readback_array[7][31:25] = '0;
assign readback_array[7][25:10] = (decoded_reg_strb.mbox_status && !decoded_req_is_wr) ? field_storage.mbox_status.mbox_rdptr.value : '0;
assign readback_array[7][31:26] = '0;
assign readback_array[8][0:0] = (decoded_reg_strb.mbox_unlock && !decoded_req_is_wr) ? field_storage.mbox_unlock.unlock.value : '0;
assign readback_array[8][31:1] = '0;
assign readback_array[9][0:0] = (decoded_reg_strb.tap_mode && !decoded_req_is_wr) ? field_storage.tap_mode.enabled.value : '0;
Expand Down
4 changes: 2 additions & 2 deletions src/soc_ifc/rtl/mbox_csr_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ package mbox_csr_pkg;
} mbox_csr__mbox_status_ecc_double_error_38cec4b0_ecc_single_error_9c62b760__soc_has_lock__in_t;

typedef struct packed{
logic [14:0] next;
logic [15:0] next;
} mbox_csr__mbox_status_ecc_double_error_38cec4b0_ecc_single_error_9c62b760__mbox_rdptr__in_t;

typedef struct packed{
Expand Down Expand Up @@ -178,7 +178,7 @@ package mbox_csr_pkg;
} mbox_csr__mbox_status_ecc_double_error_38cec4b0_ecc_single_error_9c62b760__soc_has_lock__out_t;

typedef struct packed{
logic [14:0] value;
logic [15:0] value;
} mbox_csr__mbox_status_ecc_double_error_38cec4b0_ecc_single_error_9c62b760__mbox_rdptr__out_t;

typedef struct packed{
Expand Down
4 changes: 2 additions & 2 deletions src/soc_ifc/rtl/mbox_csr_uvm.sv
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ package mbox_csr_uvm;
mbox_csr__mbox_status_ecc_double_error_38cec4b0_ecc_single_error_9c62b760_bit_cg ecc_double_error_bit_cg[1];
mbox_csr__mbox_status_ecc_double_error_38cec4b0_ecc_single_error_9c62b760_bit_cg mbox_fsm_ps_bit_cg[3];
mbox_csr__mbox_status_ecc_double_error_38cec4b0_ecc_single_error_9c62b760_bit_cg soc_has_lock_bit_cg[1];
mbox_csr__mbox_status_ecc_double_error_38cec4b0_ecc_single_error_9c62b760_bit_cg mbox_rdptr_bit_cg[15];
mbox_csr__mbox_status_ecc_double_error_38cec4b0_ecc_single_error_9c62b760_bit_cg mbox_rdptr_bit_cg[16];
mbox_csr__mbox_status_ecc_double_error_38cec4b0_ecc_single_error_9c62b760_fld_cg fld_cg;
rand uvm_reg_field status;
rand uvm_reg_field ecc_single_error;
Expand Down Expand Up @@ -255,7 +255,7 @@ package mbox_csr_uvm;
this.soc_has_lock = new("soc_has_lock");
this.soc_has_lock.configure(this, 1, 9, "RO", 1, 'h0, 1, 1, 0);
this.mbox_rdptr = new("mbox_rdptr");
this.mbox_rdptr.configure(this, 15, 10, "RO", 1, 'h0, 1, 1, 0);
this.mbox_rdptr.configure(this, 16, 10, "RO", 1, 'h0, 1, 1, 0);
if (has_coverage(UVM_CVR_REG_BITS)) begin
foreach(status_bit_cg[bt]) status_bit_cg[bt] = new();
foreach(ecc_single_error_bit_cg[bt]) ecc_single_error_bit_cg[bt] = new();
Expand Down

0 comments on commit 145f216

Please sign in to comment.