mirror of
https://github.com/RRZE-HPC/OSACA.git
synced 2026-01-04 18:20:09 +01:00
added unittest
This commit is contained in:
@@ -16,9 +16,31 @@ class TestOsaca(unittest.TestCase):
|
||||
osa = Osaca('IVB', curr_dir+'/testfiles/taxCalc-ivb-iaca', out)
|
||||
osa.inspect_with_iaca()
|
||||
result = out.getvalue()
|
||||
print(result)
|
||||
result = '\n'.join(result.split('\n')[-27:])
|
||||
# print(result)
|
||||
with open(curr_dir+'/test_osaca_iaca.out', encoding='utf-8') as f:
|
||||
assertion = f.read()
|
||||
self.assertEqual(assertion, result)
|
||||
|
||||
# Test ASM file with IACA marker in two lines
|
||||
def testIACAasm1(self):
|
||||
out = StringIO()
|
||||
curr_dir = '/'.join(os.path.realpath(__file__).split('/')[:-1])
|
||||
osa = Osaca('IVB', curr_dir+'/testfiles/taxCalc-ivb-iaca.S', out)
|
||||
osa.inspect_with_iaca()
|
||||
result = out.getvalue()
|
||||
result = '\n'.join(result.split('\n')[-27:])
|
||||
with open(curr_dir+'/test_osaca_iaca_asm.out', encoding='utf-8') as f:
|
||||
assertion = f.read()
|
||||
self.assertEqual(assertion, result)
|
||||
|
||||
# Test ASM file with IACA marker in four lines
|
||||
def testIACAasm2(self):
|
||||
out = StringIO()
|
||||
curr_dir = '/'.join(os.path.realpath(__file__).split('/')[:-1])
|
||||
osa = Osaca('IVB', curr_dir+'/testfiles/taxCalc-ivb-iaca2.S', out)
|
||||
osa.inspect_with_iaca()
|
||||
result = out.getvalue()
|
||||
result = '\n'.join(result.split('\n')[-27:])
|
||||
with open(curr_dir+'/test_osaca_iaca_asm.out', encoding='utf-8') as f:
|
||||
assertion = f.read()
|
||||
self.assertEqual(assertion, result)
|
||||
|
||||
26
tests/test_osaca_iaca_asm.out
Normal file
26
tests/test_osaca_iaca_asm.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 1(%rax,%rax), %edx
|
||||
| 0.50 | 1.00 | | | | 0.50 | vcvtsi2ss %edx, %xmm2, %xmm2
|
||||
| 1.00 | | | | | | vmulss %xmm2, %xmm0, %xmm3
|
||||
| | | 1.00 | 1.00 | | | lea 2(%rax,%rax), %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, 4(%rsp,%rax,8)
|
||||
| | 1.00 | | | | | vaddss %xmm5, %xmm4, %xmm1
|
||||
| | | 0.50 | 0.50 | 1.00 | | vmovss %xmm1, 8(%rsp,%rax,8)
|
||||
| 0.33 | 0.33 | | | | 0.33 | incq %rax
|
||||
| 0.33 | 0.33 | | | | 0.33 | cmpq $499, %rax
|
||||
| | | | | | | jb ..B1.4
|
||||
Total number of estimated throughput: 5.0
|
||||
Reference in New Issue
Block a user