From 8347acacc9ce6898ba5370bc2c95d84538438801 Mon Sep 17 00:00:00 2001 From: Mateusz Gancarz Date: Tue, 25 Feb 2025 08:47:54 +0100 Subject: [PATCH] [#73220] add checking for duration and divider mismatches --- test_regress/driver.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test_regress/driver.py b/test_regress/driver.py index 1b33d5450..0c6ac4efa 100755 --- a/test_regress/driver.py +++ b/test_regress/driver.py @@ -114,6 +114,8 @@ class SAIFParser: self.top_instances = {} self.current_instance = None self.traversing_nets = False + self.duration = 0 + self.divider = '' def parse(self, saif_filename): with open(saif_filename, 'r') as saif_file: @@ -122,6 +124,14 @@ class SAIFParser: if not line: continue + match = re.search(r'\(DIVIDER\s+(.)', line) + if match: + self.divider = match.groups()[0] + + match = re.search(r'\s*\(DURATION\s+(\d+)', line) + if match: + self.duration = int(match.groups()[0]) + match = re.search(r'INSTANCE\s+([\w.]*)', line) if match: instance_name = match.groups()[0] @@ -2510,6 +2520,13 @@ class VlTest: def compare_saif_contents(self, first: SAIFParser, second: SAIFParser): """Test if second SAIF file has the same values as the first""" + + if first.duration != second.duration: + self.error(f"Duration of trace doesn't match: {first.duration} != {second.duration}") + + if first.divider != second.divider: + self.error(f"Dividers don't match: {first.divider} != {second.divider}") + for top_instance_name, top_instance in first.top_instances.items(): if top_instance_name not in second.top_instances: self.error(f"Top instance {top_instance_name} missing in other SAIF")