diff options
Diffstat (limited to 'src/test')
-rwxr-xr-x | src/test/testcases/test.xml | 2 | ||||
-rw-r--r-- | src/test/testcases/testMatchStashPair.py | 64 | ||||
-rwxr-xr-x | src/test/testcases/testMatchStashPair.xml | 30 | ||||
-rw-r--r-- | src/test/testcases/testPSUSetStashPair.py | 276 | ||||
-rwxr-xr-x | src/test/testcases/testPSUSetStashPair.xml | 30 |
5 files changed, 402 insertions, 0 deletions
diff --git a/src/test/testcases/test.xml b/src/test/testcases/test.xml index aa4ac22f..9dd18c78 100755 --- a/src/test/testcases/test.xml +++ b/src/test/testcases/test.xml @@ -30,7 +30,9 @@ <testcase> <simcmd>p9Proc0.pib_psu->tppsu_tpbr_interrupt_msg_available=[NIL]</simcmd> </testcase> + <include>../simics/targets/p9_nimbus/sbeTest/testPSUSetStashPair.xml</include> <include>../simics/targets/p9_nimbus/sbeTest/testIstep.xml</include> + <include>../simics/targets/p9_nimbus/sbeTest/testMatchStashPair.xml</include> <include>../simics/targets/p9_nimbus/sbeTest/testScom.xml</include> <include>../simics/targets/p9_nimbus/sbeTest/testGeneric.xml</include> <!-- Memory access testcases --> diff --git a/src/test/testcases/testMatchStashPair.py b/src/test/testcases/testMatchStashPair.py new file mode 100644 index 00000000..95606266 --- /dev/null +++ b/src/test/testcases/testMatchStashPair.py @@ -0,0 +1,64 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/test/testcases/testMatchStashPair.py $ +# +# OpenPOWER sbe Project +# +# Contributors Listed Below - COPYRIGHT 2017 +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG +import sys +sys.path.append("targets/p9_nimbus/sbeTest" ) +import testUtil +import testMemUtil +err = False + +data =[0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08, + 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa, + 0xbb,0xbb,0xbb,0xbb,0xbb,0xbb,0xbb,0xbb, + 0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc, + 0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd, + 0xee,0xee,0xee,0xee,0xee,0xee,0xee,0xee, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xab,0xab,0xab,0xab,0xab,0xab,0xab,0xab, + 0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd,0xcd]; + +# MAIN Test Run Starts Here... +#------------------------------------------------- +def main( ): +# First Case without Fast Mode without LCO + testUtil.runCycles( 10000000 ) + # Get mem PBA - WO FMODE, WO LCO + readData = testMemUtil.getmem(0x08200000, 128, 0x02)[44:][:-12] + if(data == readData): + print ("Success - Write-Read PBA - WO FMODE, WO LCO") + else: + print data + print readData + raise Exception('data mistmach') +#------------------------------------------------- +# Calling all test code +#------------------------------------------------- +main() + +if err: + print ("\nTest Suite completed with error(s)") + #sys.exit(1) +else: + print ("\nTest Suite completed with no errors") + #sys.exit(0); + diff --git a/src/test/testcases/testMatchStashPair.xml b/src/test/testcases/testMatchStashPair.xml new file mode 100755 index 00000000..56e1d0a1 --- /dev/null +++ b/src/test/testcases/testMatchStashPair.xml @@ -0,0 +1,30 @@ +<!-- IBM_PROLOG_BEGIN_TAG --> +<!-- This is an automatically generated prolog. --> +<!-- --> +<!-- $Source: src/test/testcases/testMatchStashPair.xml $ --> +<!-- --> +<!-- OpenPOWER sbe Project --> +<!-- --> +<!-- Contributors Listed Below - COPYRIGHT 2017 --> +<!-- --> +<!-- --> +<!-- Licensed under the Apache License, Version 2.0 (the "License"); --> +<!-- you may not use this file except in compliance with the License. --> +<!-- You may obtain a copy of the License at --> +<!-- --> +<!-- http://www.apache.org/licenses/LICENSE-2.0 --> +<!-- --> +<!-- Unless required by applicable law or agreed to in writing, software --> +<!-- distributed under the License is distributed on an "AS IS" BASIS, --> +<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or --> +<!-- implied. See the License for the specific language governing --> +<!-- permissions and limitations under the License. --> +<!-- --> +<!-- IBM_PROLOG_END_TAG --> +<?xml version="1.0" encoding="UTF-8"?> + + <testcase> + <simcmd>run-python-file targets/p9_nimbus/sbeTest/testMatchStashPair.py</simcmd> + <exitonerror>yes</exitonerror> + </testcase> + diff --git a/src/test/testcases/testPSUSetStashPair.py b/src/test/testcases/testPSUSetStashPair.py new file mode 100644 index 00000000..378b101c --- /dev/null +++ b/src/test/testcases/testPSUSetStashPair.py @@ -0,0 +1,276 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/test/testcases/testPSUSetStashPair.py $ +# +# OpenPOWER sbe Project +# +# Contributors Listed Below - COPYRIGHT 2017 +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG + +import sys +import os +import struct +sys.path.append("targets/p9_nimbus/sbeTest" ) +import testPSUUtil +import testRegistry as reg +import testUtil + +#------------------------------- +# This is a Test Expected Data +#------------------------------- +''' +This data are the values or strings that needs to be validated for the test. +''' +''' +#------------------------------------------------------------------------------------------------------------------------------ +# SBE side test data - +#------------------------------------------------------------------------------------------------------------------------------ +''' +sbe_test_data1 = ( + #----------------------------------------------------------------------------------------------------- + # OP Reg ValueToWrite size Test Expected Data Description + #----------------------------------------------------------------------------------------------------- + # Stash CMD + ["write", reg.REG_MBOX0, "0000010000F0D707", 8, "None", "Writing to MBOX0 address"], + # Stash CMD key + ["write", reg.REG_MBOX1, "0000000000000001", 8, "None", "Writing to MBOX1 address"], + # Stash Addr + ["write", reg.REG_MBOX2, "AAAAAAAAAAAAAAAA", 8, "None", "Writing to MBOX2 address"], + ["write", reg.PSU_SBE_DOORBELL_REG_WO_OR, "8000000000000000", 8, "None", "Update SBE Doorbell register to interrupt SBE"], + ) +''' +''' +sbe_test_data2 = ( + #----------------------------------------------------------------------------------------------------- + # OP Reg ValueToWrite size Test Expected Data Description + #----------------------------------------------------------------------------------------------------- + # Stash CMD + ["write", reg.REG_MBOX0, "0000010000F0D707", 8, "None", "Writing to MBOX0 address"], + # Stash CMD key + ["write", reg.REG_MBOX1, "0000000000000002", 8, "None", "Writing to MBOX1 address"], + # Stash Addr + ["write", reg.REG_MBOX2, "BBBBBBBBBBBBBBBB", 8, "None", "Writing to MBOX2 address"], + ["write", reg.PSU_SBE_DOORBELL_REG_WO_OR, "8000000000000000", 8, "None", "Update SBE Doorbell register to interrupt SBE"], + ) +''' +''' +sbe_test_data3 = ( + #----------------------------------------------------------------------------------------------------- + # OP Reg ValueToWrite size Test Expected Data Description + #----------------------------------------------------------------------------------------------------- + # Stash CMD + ["write", reg.REG_MBOX0, "0000010000F0D707", 8, "None", "Writing to MBOX0 address"], + # Stash CMD key + ["write", reg.REG_MBOX1, "0000000000000003", 8, "None", "Writing to MBOX1 address"], + # Stash Addr + ["write", reg.REG_MBOX2, "CCCCCCCCCCCCCCCC", 8, "None", "Writing to MBOX2 address"], + ["write", reg.PSU_SBE_DOORBELL_REG_WO_OR, "8000000000000000", 8, "None", "Update SBE Doorbell register to interrupt SBE"], + ) +''' +''' +sbe_test_data4 = ( + #----------------------------------------------------------------------------------------------------- + # OP Reg ValueToWrite size Test Expected Data Description + #----------------------------------------------------------------------------------------------------- + # Stash CMD + ["write", reg.REG_MBOX0, "0000010000F0D707", 8, "None", "Writing to MBOX0 address"], + # Stash CMD key + ["write", reg.REG_MBOX1, "0000000000000004", 8, "None", "Writing to MBOX1 address"], + # Stash Addr + ["write", reg.REG_MBOX2, "DDDDDDDDDDDDDDDD", 8, "None", "Writing to MBOX2 address"], + ["write", reg.PSU_SBE_DOORBELL_REG_WO_OR, "8000000000000000", 8, "None", "Update SBE Doorbell register to interrupt SBE"], + ) +''' +''' +sbe_test_data5 = ( + #----------------------------------------------------------------------------------------------------- + # OP Reg ValueToWrite size Test Expected Data Description + #----------------------------------------------------------------------------------------------------- + # Stash CMD + ["write", reg.REG_MBOX0, "0000010000F0D707", 8, "None", "Writing to MBOX0 address"], + # Stash CMD key + ["write", reg.REG_MBOX1, "0000000000000005", 8, "None", "Writing to MBOX1 address"], + # Stash Addr + ["write", reg.REG_MBOX2, "EEEEEEEEEEEEEEEE", 8, "None", "Writing to MBOX2 address"], + ["write", reg.PSU_SBE_DOORBELL_REG_WO_OR, "8000000000000000", 8, "None", "Update SBE Doorbell register to interrupt SBE"], + ) +''' +''' +sbe_test_data6 = ( + #----------------------------------------------------------------------------------------------------- + # OP Reg ValueToWrite size Test Expected Data Description + #----------------------------------------------------------------------------------------------------- + # Stash CMD + ["write", reg.REG_MBOX0, "0000010000F0D707", 8, "None", "Writing to MBOX0 address"], + # Stash CMD key + ["write", reg.REG_MBOX1, "0000000000000006", 8, "None", "Writing to MBOX1 address"], + # Stash Addr + ["write", reg.REG_MBOX2, "FFFFFFFFFFFFFFFF", 8, "None", "Writing to MBOX2 address"], + ["write", reg.PSU_SBE_DOORBELL_REG_WO_OR, "8000000000000000", 8, "None", "Update SBE Doorbell register to interrupt SBE"], + ) +''' +''' +sbe_test_data7 = ( + #----------------------------------------------------------------------------------------------------- + # OP Reg ValueToWrite size Test Expected Data Description + #----------------------------------------------------------------------------------------------------- + # Stash CMD + ["write", reg.REG_MBOX0, "0000010000F0D707", 8, "None", "Writing to MBOX0 address"], + # Stash CMD key + ["write", reg.REG_MBOX1, "0000000000000007", 8, "None", "Writing to MBOX1 address"], + # Stash Addr + ["write", reg.REG_MBOX2, "ABABABABABABABAB", 8, "None", "Writing to MBOX2 address"], + ["write", reg.PSU_SBE_DOORBELL_REG_WO_OR, "8000000000000000", 8, "None", "Update SBE Doorbell register to interrupt SBE"], + ) +''' +''' +sbe_test_data8 = ( + #----------------------------------------------------------------------------------------------------- + # OP Reg ValueToWrite size Test Expected Data Description + #----------------------------------------------------------------------------------------------------- + # Stash CMD + ["write", reg.REG_MBOX0, "0000010000F0D707", 8, "None", "Writing to MBOX0 address"], + # Stash CMD key + ["write", reg.REG_MBOX1, "0000000000000008", 8, "None", "Writing to MBOX1 address"], + # Stash Addr + ["write", reg.REG_MBOX2, "CDCDCDCDCDCDCDCD", 8, "None", "Writing to MBOX2 address"], + ["write", reg.PSU_SBE_DOORBELL_REG_WO_OR, "8000000000000000", 8, "None", "Update SBE Doorbell register to interrupt SBE"], + ) +''' +#--------------------- +# Host side test data - SUCCESS +#--------------------- +''' +host_test_data_success = ( + #---------------------------------------------------------------------------------------------------------------- + # OP Reg ValueToWrite size Test Expected Data Description + #---------------------------------------------------------------------------------------------------------------- + ["read", reg.REG_MBOX4, "0", 8, "0000000000F0D707", "Reading Host MBOX4 data to Validate"], + ) + +''' +#----------------------------------------------------------------------- +# Do not modify - Used to simulate interrupt on Ringing Doorbell on Host +#----------------------------------------------------------------------- +''' +host_polling_data = ( + #---------------------------------------------------------------------------------------------------------------- + # OP Reg ValueToWrite size Test Expected Data Description + #---------------------------------------------------------------------------------------------------------------- + ["read", reg.PSU_HOST_DOORBELL_REG_WO_OR, "0", 8, "8000000000000000", "Reading Host Doorbell for Interrupt"], + ) + +#------------------------- +# Main Function +#------------------------- +def main(): + # Run Simics initially + testUtil.runCycles( 100000000 ); + # Intialize the class obj instances + regObj = testPSUUtil.registry() # Registry obj def for operation + + print "\n Execute SBE Test \n" + # HOST->SBE data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data1 ) + print "\n Poll on Host side for INTR ...\n" + #Poll on HOST DoorBell Register for interrupt + regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 ) + #SBE->HOST data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success ) + testUtil.runCycles( 10000000 ); + + print "\n Execute SBE Test \n" + # HOST->SBE data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data2 ) + print "\n Poll on Host side for INTR ...\n" + #Poll on HOST DoorBell Register for interrupt + regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 ) + #SBE->HOST data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success ) + testUtil.runCycles( 10000000 ); + + print "\n Execute SBE Test \n" + # HOST->SBE data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data3 ) + print "\n Poll on Host side for INTR ...\n" + #Poll on HOST DoorBell Register for interrupt + regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 ) + #SBE->HOST data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success ) + testUtil.runCycles( 10000000 ); + + print "\n Execute SBE Test \n" + # HOST->SBE data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data4 ) + print "\n Poll on Host side for INTR ...\n" + #Poll on HOST DoorBell Register for interrupt + regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 ) + #SBE->HOST data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success ) + testUtil.runCycles( 10000000 ); + + print "\n Execute SBE Test \n" + # HOST->SBE data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data5 ) + print "\n Poll on Host side for INTR ...\n" + #Poll on HOST DoorBell Register for interrupt + regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 ) + #SBE->HOST data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success ) + testUtil.runCycles( 10000000 ); + + print "\n Execute SBE Test \n" + # HOST->SBE data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data6 ) + print "\n Poll on Host side for INTR ...\n" + #Poll on HOST DoorBell Register for interrupt + regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 ) + #SBE->HOST data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success ) + testUtil.runCycles( 10000000 ); + + print "\n Execute SBE Test \n" + # HOST->SBE data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data7 ) + print "\n Poll on Host side for INTR ...\n" + #Poll on HOST DoorBell Register for interrupt + regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 ) + #SBE->HOST data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success ) + testUtil.runCycles( 10000000 ); + + print "\n Execute SBE Test \n" + # HOST->SBE data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data8 ) + print "\n Poll on Host side for INTR ...\n" + #Poll on HOST DoorBell Register for interrupt + regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 ) + #SBE->HOST data set execution + regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success ) + testUtil.runCycles( 10000000 ); + +if __name__ == "__main__": + main() + if err: + print ( "\nTest Suite completed with error(s)" ) + #sys.exit(1) + else: + print ( "\nTest Suite completed with no errors" ) + #sys.exit(0); + + diff --git a/src/test/testcases/testPSUSetStashPair.xml b/src/test/testcases/testPSUSetStashPair.xml new file mode 100755 index 00000000..36ae7c9f --- /dev/null +++ b/src/test/testcases/testPSUSetStashPair.xml @@ -0,0 +1,30 @@ +<!-- IBM_PROLOG_BEGIN_TAG --> +<!-- This is an automatically generated prolog. --> +<!-- --> +<!-- $Source: src/test/testcases/testPSUSetStashPair.xml $ --> +<!-- --> +<!-- OpenPOWER sbe Project --> +<!-- --> +<!-- Contributors Listed Below - COPYRIGHT 2017 --> +<!-- --> +<!-- --> +<!-- Licensed under the Apache License, Version 2.0 (the "License"); --> +<!-- you may not use this file except in compliance with the License. --> +<!-- You may obtain a copy of the License at --> +<!-- --> +<!-- http://www.apache.org/licenses/LICENSE-2.0 --> +<!-- --> +<!-- Unless required by applicable law or agreed to in writing, software --> +<!-- distributed under the License is distributed on an "AS IS" BASIS, --> +<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or --> +<!-- implied. See the License for the specific language governing --> +<!-- permissions and limitations under the License. --> +<!-- --> +<!-- IBM_PROLOG_END_TAG --> +<?xml version="1.0" encoding="UTF-8"?> + + <testcase> + <simcmd>run-python-file targets/p9_nimbus/sbeTest/testPSUSetStashPair.py</simcmd> + <exitonerror>yes</exitonerror> + </testcase> + |