mirror of
https://github.com/RRZE-HPC/OSACA.git
synced 2025-12-16 09:00:05 +01:00
added first unittest for osaca
This commit is contained in:
16
tests/all_tests.py
Executable file
16
tests/all_tests.py
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr//bin/env python
|
||||
|
||||
import sys
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
sys.path[0:0] = ['.', '..']
|
||||
suite = unittest.TestLoader().loadTestsFromNames(
|
||||
[
|
||||
'test_osaca'
|
||||
]
|
||||
)
|
||||
|
||||
testresult = unittest.TextTestRunner(verbosity=2).run(suite)
|
||||
sys.exit(0 if testresult.wasSuccessful() else 1)
|
||||
22
tests/test_osaca.py
Executable file
22
tests/test_osaca.py
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
from io import StringIO
|
||||
import os
|
||||
|
||||
import unittest
|
||||
|
||||
sys.path.insert(0, '..')
|
||||
from osaca.osaca import Osaca
|
||||
|
||||
class TestOsaca(unittest.TestCase):
|
||||
def testIACABinary(self):
|
||||
out = StringIO()
|
||||
curr_dir = '/'.join(os.path.realpath(__file__).split('/')[:-1])
|
||||
osa = Osaca('IVB', curr_dir+'/testfiles/taxCalc-ivb-iaca', out)
|
||||
osa.inspect_with_iaca()
|
||||
result = out.getvalue()
|
||||
result = '\n'.join(result.split('\n')[-27:])
|
||||
with open(curr_dir+'/test_osaca_iaca.out', encoding='utf-8') as f:
|
||||
assertion = f.read()
|
||||
self.assertEqual(result, assertion)
|
||||
26
tests/test_osaca_iaca.out
Normal file
26
tests/test_osaca_iaca.out
Normal file
@@ -0,0 +1,26 @@
|
||||
Port Binding in Cycles Per Iteration:
|
||||
----------------------------------------------
|
||||
| Port | 0 | 1 | 2 | 3 | 4 | 5 |
|
||||
----------------------------------------------
|
||||
| Cycles | 4.0 | 5.0 | 3.0 | 3.0 | 2.0 | 2.0 |
|
||||
----------------------------------------------
|
||||
|
||||
|
||||
Ports Pressure in cycles
|
||||
| 0 | 1 | 2 | 3 | 4 | 5 |
|
||||
-------------------------------------------
|
||||
| | | 1.00 | 1.00 | | | lea 0x1(%rax,%rax,1),%edx
|
||||
| 0.50 | 1.00 | | | | 0.50 | vcvtsi2ss %edx,%xmm2,%xmm2
|
||||
| 1.00 | | | | | | vmulss %xmm2,%xmm0,%xmm3
|
||||
| | | 1.00 | 1.00 | | | lea 0x2(%rax,%rax,1),%ecx
|
||||
| | 1.00 | | | | | vaddss %xmm3,%xmm1,%xmm4
|
||||
| 0.33 | 0.33 | | | | 0.33 | vxorps %xmm1,%xmm1,%xmm1
|
||||
| 0.50 | 1.00 | | | | 0.50 | vcvtsi2ss %ecx,%xmm1,%xmm1
|
||||
| 1.00 | | | | | | vmulss %xmm1,%xmm0,%xmm5
|
||||
| | | 0.50 | 0.50 | 1.00 | | vmovss %xmm4,0x4(%rsp,%rax,8)
|
||||
| | 1.00 | | | | | vaddss %xmm5,%xmm4,%xmm1
|
||||
| | | 0.50 | 0.50 | 1.00 | | vmovss %xmm1,0x8(%rsp,%rax,8)
|
||||
| 0.33 | 0.33 | | | | 0.33 | inc %rax
|
||||
| 0.33 | 0.33 | | | | 0.33 | cmp $0x1f3,%rax
|
||||
| | | | | | | jb 400bc2 <main+0x62>
|
||||
Total number of estimated throughput: 5.0
|
||||
BIN
tests/testfiles/taxCalc-ivb-iaca
Executable file
BIN
tests/testfiles/taxCalc-ivb-iaca
Executable file
Binary file not shown.
Reference in New Issue
Block a user