Skip to content

Commit 0ed20e0

Browse files
authored
Merge pull request #17 from edwin7026/self_check_bug_fixes
Self check bug fixes
2 parents d33109d + 6562b31 commit 0ed20e0

File tree

6 files changed

+18
-5
lines changed

6 files changed

+18
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5+
## [1.4.3] - 2024-04-16
6+
- bug fixes; instruction count functionality added to self-checks
7+
58
## [1.4.2] - 2024-01-18
69
- bug fixes pertaining to self-checking
710

river_core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
__author__ = """InCore Semiconductors"""
66
__email__ = '[email protected]'
7-
__version__ = '1.4.2'
7+
__version__ = '1.4.3'

river_core/rivercore.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ def rivercore_compile(config_file, test_list, coverage, verbosity, dut_flags,
613613
ref_json_data = []
614614
for test, attr in test_dict.items():
615615
test_wd = attr['work_dir']
616-
if not attr['self_checking']:
616+
is_self_checking = attr['self_checking']
617+
if not is_self_checking:
617618
if not os.path.isfile(test_wd + '/dut.dump'):
618619
logger.error(f'{test:<30} : DUT dump is missing')
619620
test_dict[test]['result'] = 'Unavailable'
@@ -635,9 +636,10 @@ def rivercore_compile(config_file, test_list, coverage, verbosity, dut_flags,
635636
success = False
636637
continue
637638
result, log = utils.self_check(test_wd + '/dut.signature')
639+
insnsize = utils.get_file_size(test_wd + '/dut.dump')
640+
test_dict[test]['num_instr'] = insnsize
638641
test_dict[test]['result'] = result
639642
test_dict[test]['log'] = log
640-
test_dict[test]['num_instr'] = insnsize
641643
if result == 'Passed':
642644
logger.info(f"{test:<30} : TEST {result.upper()}")
643645
else:

river_core/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ def self_check(file1):
3434
rout = f'\nLine:{lineno} has a non-zero value indicating a fail'
3535
return result, rout
3636

37+
def get_file_size(file):
38+
'''
39+
Function to give the number of lines
40+
'''
41+
with open(f'{file}','r') as fd:
42+
rcount = len(fd.readlines())
43+
return rcount
44+
3745
def compare_signature(file1, file2):
3846
'''
3947
Function to check whether two signature files are equivalent. This funcion uses the

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.4.2
2+
current_version = 1.4.3
33
commit = True
44
tag = True
55

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ def read_requires():
6262
tests_require=test_requirements,
6363
url=
6464
'https://github.com/incoresemi/river_core',
65-
version='1.4.2',
65+
version='1.4.3',
6666
zip_safe=False,
6767
)

0 commit comments

Comments
 (0)