Skip to content

Commit aa375a9

Browse files
committed
csr: use separate id regs for virtual device
1 parent cc6a338 commit aa375a9

File tree

12 files changed

+420
-184
lines changed

12 files changed

+420
-184
lines changed

src/csr/I3CCSR.sv

Lines changed: 138 additions & 42 deletions
Large diffs are not rendered by default.

src/csr/I3CCSR_covergroups.svh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,8 +1609,8 @@
16091609

16101610
endgroup
16111611

1612-
/*----------------------- I3CCSR__I3C_EC__STDBYCTRLMODE____RSVD_0 COVERGROUPS -----------------------*/
1613-
covergroup I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_0_bit_cg with function sample(input bit reg_bit);
1612+
/*----------------------- I3CCSR__I3C_EC__STDBYCTRLMODE__STBY_CR_VIRUTAL_DEVICE_CHAR COVERGROUPS -----------------------*/
1613+
covergroup I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRUTAL_DEVICE_CHAR_bit_cg with function sample(input bit reg_bit);
16141614
option.per_instance = 1;
16151615
reg_bit_cp : coverpoint reg_bit {
16161616
bins value[2] = {0,1};
@@ -1621,11 +1621,17 @@
16211621
}
16221622

16231623
endgroup
1624-
covergroup I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_0_fld_cg with function sample(
1625-
input bit [32-1:0] __rsvd
1624+
covergroup I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRUTAL_DEVICE_CHAR_fld_cg with function sample(
1625+
input bit [15-1:0] PID_HI,
1626+
input bit [8-1:0] DCR,
1627+
input bit [5-1:0] BCR_VAR,
1628+
input bit [3-1:0] BCR_FIXED
16261629
);
16271630
option.per_instance = 1;
1628-
__rsvd_cp : coverpoint __rsvd;
1631+
PID_HI_cp : coverpoint PID_HI;
1632+
DCR_cp : coverpoint DCR;
1633+
BCR_VAR_cp : coverpoint BCR_VAR;
1634+
BCR_FIXED_cp : coverpoint BCR_FIXED;
16291635

16301636
endgroup
16311637

@@ -1743,8 +1749,8 @@
17431749

17441750
endgroup
17451751

1746-
/*----------------------- I3CCSR__I3C_EC__STDBYCTRLMODE____RSVD_1 COVERGROUPS -----------------------*/
1747-
covergroup I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_1_bit_cg with function sample(input bit reg_bit);
1752+
/*----------------------- I3CCSR__I3C_EC__STDBYCTRLMODE__STBY_CR_VIRTUAL_DEVICE_PID_LO COVERGROUPS -----------------------*/
1753+
covergroup I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRTUAL_DEVICE_PID_LO_bit_cg with function sample(input bit reg_bit);
17481754
option.per_instance = 1;
17491755
reg_bit_cp : coverpoint reg_bit {
17501756
bins value[2] = {0,1};
@@ -1755,11 +1761,11 @@
17551761
}
17561762

17571763
endgroup
1758-
covergroup I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_1_fld_cg with function sample(
1759-
input bit [32-1:0] __rsvd
1764+
covergroup I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRTUAL_DEVICE_PID_LO_fld_cg with function sample(
1765+
input bit [32-1:0] PID_LO
17601766
);
17611767
option.per_instance = 1;
1762-
__rsvd_cp : coverpoint __rsvd;
1768+
PID_LO_cp : coverpoint PID_LO;
17631769

17641770
endgroup
17651771

src/csr/I3CCSR_pkg.sv

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -686,14 +686,6 @@ package I3CCSR_pkg;
686686
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_DEVICE_ADDR__DYNAMIC_ADDR_VALID__in_t DYNAMIC_ADDR_VALID;
687687
} I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_DEVICE_ADDR__in_t;
688688

689-
typedef struct packed{
690-
logic [31:0] next;
691-
} I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_0____rsvd__in_t;
692-
693-
typedef struct packed{
694-
I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_0____rsvd__in_t __rsvd;
695-
} I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_0__in_t;
696-
697689
typedef struct packed{
698690
logic next;
699691
} I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_STATUS__AC_CURRENT_OWN__in_t;
@@ -781,14 +773,6 @@ package I3CCSR_pkg;
781773
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_INTR_STATUS__CCC_FATAL_RSTDAA_ERR_STAT__in_t CCC_FATAL_RSTDAA_ERR_STAT;
782774
} I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_INTR_STATUS__in_t;
783775

784-
typedef struct packed{
785-
logic [31:0] next;
786-
} I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_1____rsvd__in_t;
787-
788-
typedef struct packed{
789-
I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_1____rsvd__in_t __rsvd;
790-
} I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_1__in_t;
791-
792776
typedef struct packed{
793777
logic next;
794778
} I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_INTR_SIGNAL_ENABLE__ACR_HANDOFF_OK_REMAIN_SIGNAL_EN__in_t;
@@ -983,10 +967,8 @@ package I3CCSR_pkg;
983967
typedef struct packed{
984968
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_CONTROL__in_t STBY_CR_CONTROL;
985969
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_DEVICE_ADDR__in_t STBY_CR_DEVICE_ADDR;
986-
I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_0__in_t __rsvd_0;
987970
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_STATUS__in_t STBY_CR_STATUS;
988971
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_INTR_STATUS__in_t STBY_CR_INTR_STATUS;
989-
I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_1__in_t __rsvd_1;
990972
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_INTR_SIGNAL_ENABLE__in_t STBY_CR_INTR_SIGNAL_ENABLE;
991973
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_INTR_FORCE__in_t STBY_CR_INTR_FORCE;
992974
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_CCC_CONFIG_GETCAPS__in_t STBY_CR_CCC_CONFIG_GETCAPS;
@@ -2211,12 +2193,27 @@ package I3CCSR_pkg;
22112193
} I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_CAPABILITIES__out_t;
22122194

22132195
typedef struct packed{
2214-
logic [31:0] value;
2215-
} I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_0____rsvd__out_t;
2196+
logic [14:0] value;
2197+
} I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRUTAL_DEVICE_CHAR__PID_HI__out_t;
2198+
2199+
typedef struct packed{
2200+
logic [7:0] value;
2201+
} I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRUTAL_DEVICE_CHAR__DCR__out_t;
2202+
2203+
typedef struct packed{
2204+
logic [4:0] value;
2205+
} I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRUTAL_DEVICE_CHAR__BCR_VAR__out_t;
2206+
2207+
typedef struct packed{
2208+
logic [2:0] value;
2209+
} I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRUTAL_DEVICE_CHAR__BCR_FIXED__out_t;
22162210

22172211
typedef struct packed{
2218-
I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_0____rsvd__out_t __rsvd;
2219-
} I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_0__out_t;
2212+
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRUTAL_DEVICE_CHAR__PID_HI__out_t PID_HI;
2213+
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRUTAL_DEVICE_CHAR__DCR__out_t DCR;
2214+
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRUTAL_DEVICE_CHAR__BCR_VAR__out_t BCR_VAR;
2215+
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRUTAL_DEVICE_CHAR__BCR_FIXED__out_t BCR_FIXED;
2216+
} I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRUTAL_DEVICE_CHAR__out_t;
22202217

22212218
typedef struct packed{
22222219
logic value;
@@ -2337,11 +2334,11 @@ package I3CCSR_pkg;
23372334

23382335
typedef struct packed{
23392336
logic [31:0] value;
2340-
} I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_1____rsvd__out_t;
2337+
} I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRTUAL_DEVICE_PID_LO__PID_LO__out_t;
23412338

23422339
typedef struct packed{
2343-
I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_1____rsvd__out_t __rsvd;
2344-
} I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_1__out_t;
2340+
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRTUAL_DEVICE_PID_LO__PID_LO__out_t PID_LO;
2341+
} I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRTUAL_DEVICE_PID_LO__out_t;
23452342

23462343
typedef struct packed{
23472344
logic value;
@@ -2531,12 +2528,12 @@ package I3CCSR_pkg;
25312528
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_CONTROL__out_t STBY_CR_CONTROL;
25322529
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_DEVICE_ADDR__out_t STBY_CR_DEVICE_ADDR;
25332530
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_CAPABILITIES__out_t STBY_CR_CAPABILITIES;
2534-
I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_0__out_t __rsvd_0;
2531+
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRUTAL_DEVICE_CHAR__out_t STBY_CR_VIRUTAL_DEVICE_CHAR;
25352532
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_STATUS__out_t STBY_CR_STATUS;
25362533
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_DEVICE_CHAR__out_t STBY_CR_DEVICE_CHAR;
25372534
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_DEVICE_PID_LO__out_t STBY_CR_DEVICE_PID_LO;
25382535
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_INTR_STATUS__out_t STBY_CR_INTR_STATUS;
2539-
I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_1__out_t __rsvd_1;
2536+
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRTUAL_DEVICE_PID_LO__out_t STBY_CR_VIRTUAL_DEVICE_PID_LO;
25402537
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_INTR_SIGNAL_ENABLE__out_t STBY_CR_INTR_SIGNAL_ENABLE;
25412538
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_INTR_FORCE__out_t STBY_CR_INTR_FORCE;
25422539
I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_CCC_CONFIG_GETCAPS__out_t STBY_CR_CCC_CONFIG_GETCAPS;

src/csr/I3CCSR_sample.svh

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,28 +1939,34 @@
19391939
end
19401940
endfunction
19411941

1942-
/*----------------------- I3CCSR__I3C_EC__STDBYCTRLMODE____RSVD_0 SAMPLE FUNCTIONS -----------------------*/
1943-
function void I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_0::sample(uvm_reg_data_t data,
1942+
/*----------------------- I3CCSR__I3C_EC__STDBYCTRLMODE__STBY_CR_VIRUTAL_DEVICE_CHAR SAMPLE FUNCTIONS -----------------------*/
1943+
function void I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRUTAL_DEVICE_CHAR::sample(uvm_reg_data_t data,
19441944
uvm_reg_data_t byte_en,
19451945
bit is_read,
19461946
uvm_reg_map map);
19471947
m_current = get();
19481948
m_data = data;
19491949
m_is_read = is_read;
19501950
if (get_coverage(UVM_CVR_REG_BITS)) begin
1951-
foreach(__rsvd_bit_cg[bt]) this.__rsvd_bit_cg[bt].sample(data[0 + bt]);
1951+
foreach(PID_HI_bit_cg[bt]) this.PID_HI_bit_cg[bt].sample(data[1 + bt]);
1952+
foreach(DCR_bit_cg[bt]) this.DCR_bit_cg[bt].sample(data[16 + bt]);
1953+
foreach(BCR_VAR_bit_cg[bt]) this.BCR_VAR_bit_cg[bt].sample(data[24 + bt]);
1954+
foreach(BCR_FIXED_bit_cg[bt]) this.BCR_FIXED_bit_cg[bt].sample(data[29 + bt]);
19521955
end
19531956
if (get_coverage(UVM_CVR_FIELD_VALS)) begin
1954-
this.fld_cg.sample( data[31:0]/*__rsvd*/ );
1957+
this.fld_cg.sample( data[15:1]/*PID_HI*/ , data[23:16]/*DCR*/ , data[28:24]/*BCR_VAR*/ , data[31:29]/*BCR_FIXED*/ );
19551958
end
19561959
endfunction
19571960

1958-
function void I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_0::sample_values();
1961+
function void I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRUTAL_DEVICE_CHAR::sample_values();
19591962
if (get_coverage(UVM_CVR_REG_BITS)) begin
1960-
foreach(__rsvd_bit_cg[bt]) this.__rsvd_bit_cg[bt].sample(__rsvd.get_mirrored_value() >> bt);
1963+
foreach(PID_HI_bit_cg[bt]) this.PID_HI_bit_cg[bt].sample(PID_HI.get_mirrored_value() >> bt);
1964+
foreach(DCR_bit_cg[bt]) this.DCR_bit_cg[bt].sample(DCR.get_mirrored_value() >> bt);
1965+
foreach(BCR_VAR_bit_cg[bt]) this.BCR_VAR_bit_cg[bt].sample(BCR_VAR.get_mirrored_value() >> bt);
1966+
foreach(BCR_FIXED_bit_cg[bt]) this.BCR_FIXED_bit_cg[bt].sample(BCR_FIXED.get_mirrored_value() >> bt);
19611967
end
19621968
if (get_coverage(UVM_CVR_FIELD_VALS)) begin
1963-
this.fld_cg.sample( __rsvd.get_mirrored_value() );
1969+
this.fld_cg.sample( PID_HI.get_mirrored_value() , DCR.get_mirrored_value() , BCR_VAR.get_mirrored_value() , BCR_FIXED.get_mirrored_value() );
19641970
end
19651971
endfunction
19661972

@@ -2098,28 +2104,28 @@
20982104
end
20992105
endfunction
21002106

2101-
/*----------------------- I3CCSR__I3C_EC__STDBYCTRLMODE____RSVD_1 SAMPLE FUNCTIONS -----------------------*/
2102-
function void I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_1::sample(uvm_reg_data_t data,
2107+
/*----------------------- I3CCSR__I3C_EC__STDBYCTRLMODE__STBY_CR_VIRTUAL_DEVICE_PID_LO SAMPLE FUNCTIONS -----------------------*/
2108+
function void I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRTUAL_DEVICE_PID_LO::sample(uvm_reg_data_t data,
21032109
uvm_reg_data_t byte_en,
21042110
bit is_read,
21052111
uvm_reg_map map);
21062112
m_current = get();
21072113
m_data = data;
21082114
m_is_read = is_read;
21092115
if (get_coverage(UVM_CVR_REG_BITS)) begin
2110-
foreach(__rsvd_bit_cg[bt]) this.__rsvd_bit_cg[bt].sample(data[0 + bt]);
2116+
foreach(PID_LO_bit_cg[bt]) this.PID_LO_bit_cg[bt].sample(data[0 + bt]);
21112117
end
21122118
if (get_coverage(UVM_CVR_FIELD_VALS)) begin
2113-
this.fld_cg.sample( data[31:0]/*__rsvd*/ );
2119+
this.fld_cg.sample( data[31:0]/*PID_LO*/ );
21142120
end
21152121
endfunction
21162122

2117-
function void I3CCSR__I3C_EC__StdbyCtrlMode____rsvd_1::sample_values();
2123+
function void I3CCSR__I3C_EC__StdbyCtrlMode__STBY_CR_VIRTUAL_DEVICE_PID_LO::sample_values();
21182124
if (get_coverage(UVM_CVR_REG_BITS)) begin
2119-
foreach(__rsvd_bit_cg[bt]) this.__rsvd_bit_cg[bt].sample(__rsvd.get_mirrored_value() >> bt);
2125+
foreach(PID_LO_bit_cg[bt]) this.PID_LO_bit_cg[bt].sample(PID_LO.get_mirrored_value() >> bt);
21202126
end
21212127
if (get_coverage(UVM_CVR_FIELD_VALS)) begin
2122-
this.fld_cg.sample( __rsvd.get_mirrored_value() );
2128+
this.fld_cg.sample( PID_LO.get_mirrored_value() );
21232129
end
21242130
endfunction
21252131

0 commit comments

Comments
 (0)