Am unable to get proper transaction of "HWDATA" while doing INCR4 in AHB BURST

Am trying to make ahb transactions for incr4.for that i made below constraints in seq_item.

constraint m_hwdata_c{
(m_hburst == SINGLE) → (m_hwdata.m_hsize()==1);

            (m_hburst inside {WRAP4,INCR4}) -> (m_hwdata.m_hsize()==4);
            (m_hburst inside {WRAP8,INCR8}) -> (m_hwdata.m_hsize()==8);
            (m_hburst inside {WRAP16,INCR16}) -> (m_hwdata.m_hsize()==16);
    }

for the above constraints it showing error like below:
Error-[MRRE] Member reference resolution error
…/env/sll_ahb_seq_item.sv, 101
Member operator “.” cannot be used on object of type bit.
Expression: m_hwdata
Source info: m_hwdata.m_hsize

is there any otherway to constraints for hwdata while incr time…?

In reply to pullarao beerelli:

What type is m_hwdata?

i have declared like below in the seq_item.

rand e_htrans m_htrans;
rand e_hsize m_hsize;
rand e_hburst m_hburst;
rand e_hwrite m_hwrite;
rand bit[15:0] m_haddr;
rand bit [31:0] m_hwdata;

In reply to pullarao beerelli:


//Declare data as a dynamic array
rand bit [31:0] m_hwdata[];

constraint m_hwdata_c{
(m_hburst == SINGLE) -> (m_hwdata.size()==1);

(m_hburst inside {WRAP4,INCR4}) -> (m_hwdata.size()==4);
(m_hburst inside {WRAP8,INCR8}) -> (m_hwdata.size()==8);
(m_hburst inside {WRAP16,INCR16}) -> (m_hwdata.size()==16);
}


Regards,
Shanthi V A
www.maven-silicon.com

In reply to shanthi:

thanks shanthi.
now am able to increment.