Reply To: Expected alerts generation
Why OSVVM™? › Forums › OSVVM › Expected alerts generation › Reply To: Expected alerts generation
Two thoughts on this.
First, there is no need for an expected SLVERR to be an actual test case error. The following is from p37 of the Axi4_VC_user_guide.pdf that is in the documentation repository:
By default, the expected value for BRESP and RRESP are OKAY. When testing a subordinates response to an incorrect address, a SLVERR is expected. AXI4 models support the enumeration values OKAY, EXOKAY, SLVERR, and DECERR of type Axi4RespEnumType. The code below shows how to set BRESP and RRESP to expect a SLVERR for a single transfer.
-- Write transfer that expects a SLVERR SetAxi4Options(ManagerRec, BRESP, SLVERR) ; Write(ManagerRec, X"0002_0000", X"0002_0101" ) ; SetAxi4Options(ManagerRec, BRESP, OKAY) ; -- Read transfer that expects a SLVERR SetAxi4Options(ManagerRec, RRESP, SLVERR) ; Read(ManagerRec, X"0004_000C", Data) ; AffirmIfEqual(Data, X"0004_0404", "Manager Read Data: ") ; SetAxi4Options(ManagerRec, RRESP, OKAY) ;
If there is an error that you cannot catch, you can also tell EndOfTestReports that the test is expected to generate an error by using a negative value with the ExternalErrors field. The following code tells EndOfTestReports that to pass, the test must generate exactly 5 Errors.
EndOfTestReports(ExternalErrors => (FAILURE => 0, ERROR => -5, WARNING => 0)) ;
When summing up errors from FAILURE, ERROR, and WARNING, the absolute value is used on each set of values before the addition, so that if there is 1 FAILURE and 4 ERRORS, the test will signal that a total of two errors occurred: 1 FAILURE and 1 ERROR (because it was 1 less than the 5 expected errors).