From 56e0074f8e6beacb5d3ec5eb1c7e693f1d486691 Mon Sep 17 00:00:00 2001 From: Edwin Joy Date: Tue, 16 Apr 2024 10:22:16 +0530 Subject: [PATCH 1/5] instruction count populated only for non-self checks --- river_core/rivercore.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/river_core/rivercore.py b/river_core/rivercore.py index b587023..e0a160f 100644 --- a/river_core/rivercore.py +++ b/river_core/rivercore.py @@ -613,7 +613,8 @@ def rivercore_compile(config_file, test_list, coverage, verbosity, dut_flags, ref_json_data = [] for test, attr in test_dict.items(): test_wd = attr['work_dir'] - if not attr['self_checking']: + is_self_checking = attr['self_checking'] + if not is_self_checking: if not os.path.isfile(test_wd + '/dut.dump'): logger.error(f'{test:<30} : DUT dump is missing') test_dict[test]['result'] = 'Unavailable' @@ -627,6 +628,7 @@ def rivercore_compile(config_file, test_list, coverage, verbosity, dut_flags, success = False continue result, log, insnsize = utils.compare_signature(test_wd + '/dut.dump', test_wd + '/ref.dump') + test_dict[test]['num_instr'] = insnsize else: if not os.path.isfile(test_wd + '/dut.signature'): logger.error(f'{test:<30} : DUT signature is missing') @@ -637,7 +639,6 @@ def rivercore_compile(config_file, test_list, coverage, verbosity, dut_flags, result, log = utils.self_check(test_wd + '/dut.signature') test_dict[test]['result'] = result test_dict[test]['log'] = log - test_dict[test]['num_instr'] = insnsize if result == 'Passed': logger.info(f"{test:<30} : TEST {result.upper()}") else: From dc3aaa694cd510bf2333a9ec53d3ff0a1b13f1c0 Mon Sep 17 00:00:00 2001 From: Edwin Joy Date: Tue, 16 Apr 2024 10:23:49 +0530 Subject: [PATCH 2/5] Updated CHANGELOG --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e4a208..35814bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.4.3] - 2024-04-16 +- bug fixes; instruction count populated only for non-self-checking tests + ## [1.4.2] - 2024-01-18 - bug fixes pertaining to self-checking From 0bf966839fa6f9ccd5b839347550c242045b9622 Mon Sep 17 00:00:00 2001 From: Edwin Joy Date: Tue, 16 Apr 2024 10:26:15 +0530 Subject: [PATCH 3/5] =?UTF-8?q?Bump=20version:=201.4.2=20=E2=86=92=201.4.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- river_core/__init__.py | 2 +- setup.cfg | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/river_core/__init__.py b/river_core/__init__.py index 07888c4..a4762cd 100644 --- a/river_core/__init__.py +++ b/river_core/__init__.py @@ -4,4 +4,4 @@ __author__ = """InCore Semiconductors""" __email__ = 'info@incoresemi.com' -__version__ = '1.4.2' +__version__ = '1.4.3' diff --git a/setup.cfg b/setup.cfg index 026ef49..f5f4715 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.4.2 +current_version = 1.4.3 commit = True tag = True diff --git a/setup.py b/setup.py index 3cba508..25e7061 100644 --- a/setup.py +++ b/setup.py @@ -62,6 +62,6 @@ def read_requires(): tests_require=test_requirements, url= 'https://github.com/incoresemi/river_core', - version='1.4.2', + version='1.4.3', zip_safe=False, ) From 4dc60fe3ef7dde513e587388da7b579d81c9a028 Mon Sep 17 00:00:00 2001 From: Edwin Joy Date: Tue, 16 Apr 2024 10:45:24 +0530 Subject: [PATCH 4/5] added function to count instrs committed after self-check --- river_core/rivercore.py | 3 ++- river_core/utils.py | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/river_core/rivercore.py b/river_core/rivercore.py index e0a160f..6ab3cc7 100644 --- a/river_core/rivercore.py +++ b/river_core/rivercore.py @@ -628,7 +628,6 @@ def rivercore_compile(config_file, test_list, coverage, verbosity, dut_flags, success = False continue result, log, insnsize = utils.compare_signature(test_wd + '/dut.dump', test_wd + '/ref.dump') - test_dict[test]['num_instr'] = insnsize else: if not os.path.isfile(test_wd + '/dut.signature'): logger.error(f'{test:<30} : DUT signature is missing') @@ -637,6 +636,8 @@ def rivercore_compile(config_file, test_list, coverage, verbosity, dut_flags, success = False continue result, log = utils.self_check(test_wd + '/dut.signature') + insnsize = utils.get_file_size(test_wd + '/dut.dump') + test_dict[test]['num_instr'] = insnsize test_dict[test]['result'] = result test_dict[test]['log'] = log if result == 'Passed': diff --git a/river_core/utils.py b/river_core/utils.py index 33bb6aa..3a55309 100644 --- a/river_core/utils.py +++ b/river_core/utils.py @@ -34,6 +34,14 @@ def self_check(file1): rout = f'\nLine:{lineno} has a non-zero value indicating a fail' return result, rout +def get_file_size(file): + ''' + Function to give the number of lines + ''' + with open(f'{file}','r') as fd: + rcount = len(fd.readlines()) + return rcount + def compare_signature(file1, file2): ''' Function to check whether two signature files are equivalent. This funcion uses the From 6562b310522c1affcb2821dbd3b050b35b7966ea Mon Sep 17 00:00:00 2001 From: Edwin Joy Date: Tue, 16 Apr 2024 10:47:43 +0530 Subject: [PATCH 5/5] updated CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35814bb..e679ea7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [1.4.3] - 2024-04-16 -- bug fixes; instruction count populated only for non-self-checking tests +- bug fixes; instruction count functionality added to self-checks ## [1.4.2] - 2024-01-18 - bug fixes pertaining to self-checking