more tests for frontend

This commit is contained in:
JanLJL
2019-08-30 12:28:04 +02:00
parent eeb55e8cf7
commit 0173481bec
2 changed files with 12 additions and 5 deletions

View File

@@ -7,7 +7,6 @@ from datetime import datetime as dt
from ruamel import yaml
from osaca.semantics import INSTR_FLAGS, KernelDG, SemanticsAppender
import osaca
class Frontend(object):
@@ -173,7 +172,7 @@ class Frontend(object):
)
def _print_header_report(self):
version = osaca.osaca.get_version()
version = 'v0.3.0'
adjust = 20
header = ''
header += 'Open Source Architecture Code Analyzer (OSACA) - {}\n'.format(version)

View File

@@ -55,17 +55,25 @@ class TestFrontend(unittest.TestCase):
# Tests
###########
def test_frontend_creation(self):
with self.assertRaises(ValueError):
Frontend()
with self.assertRaises(ValueError):
Frontend(arch='csx', path_to_yaml=os.path.join(self.MODULE_DATA_DIR, 'csx.yml'))
with self.assertRaises(ValueError):
Frontend(arch='THE_MACHINE')
Frontend(arch='zen1')
def test_frontend_x86(self):
dg = KernelDG(self.kernel_x86, self.parser_x86, self.machine_model_csx)
fe = Frontend(path_to_yaml=os.path.join(self.MODULE_DATA_DIR, 'csx.yml'))
fe.print_throughput_analysis(self.kernel_x86)
fe.print_throughput_analysis(self.kernel_x86, show_cmnts=False)
fe.print_latency_analysis(dg.get_critical_path())
def test_frontend_AArch64(self):
dg = KernelDG(self.kernel_AArch64, self.parser_AArch64, self.machine_model_tx2)
fe = Frontend(path_to_yaml=os.path.join(self.MODULE_DATA_DIR, 'vulcan.yml'))
fe.print_throughput_analysis(self.kernel_AArch64)
fe.print_latency_analysis(dg.get_critical_path())
fe.print_full_analysis(self.kernel_AArch64, dg, verbose=True)
##################
# Helper functions