SVA : How to call a function ?

93 views
Skip to first unread message

RSGUPTA

unread,
Jan 22, 2009, 3:24:17 AM1/22/09
to Advanced Verification Methodology User Group
Hello,
I wanted to know how to call a function from property:
For Example if i have a function as described below:

// Function to calculate the next address for a burst transfers.

function logic [31:0] next_addr (logic [31:0] burst_addr);

case (HSIZE)

BYTE : return burst_haddr+1;
HALFWORD : return burst_haddr+2;
WORD : return burst_haddr+4;

endcase

endfunction // next_addr

How can call this function in a property?
Else someone can give me a simple example to demonstrate a function
call.

Thanks.

Ajeetha Kumari

unread,
Jan 22, 2009, 8:52:22 AM1/22/09
to avm-...@googlegroups.com
Hi,
SVA allows sequence_match_item that allows any function/task call.
For instance:

property ahb_p;
@(posedge clk) hreq |=> [*1:5] hresp == OK, next_addr(cur_addr);
endproperty : ahb_p

Untested code both from syntax and from protocol perspective, but
should get you going with the directions.

Feel free to expand if needed.

BTW - we have a SVA class lined up for Feb 2nd as part of our week
long SystemVerilog class in Bangalore. Contact me offline if
interested in enrolling.

Ajeetha, CVC
www.noveldv.com
--
Ajeetha Kumari
* A Pragmatic Approach to VMM Adoption
* SystemVerilog Assertions Handbook
* Using PSL/SUGAR
Design Verification Consultant,
Contemporary Verification Consultants Private Limited,
Bangalore, India, http://www.noveldv.com
Reply all
Reply to author
Forward
0 new messages