From 98a6e9be187860dd52069e4df216b7b95361e773 Mon Sep 17 00:00:00 2001 From: Mateusz Gancarz Date: Fri, 21 Feb 2025 11:26:58 +0100 Subject: [PATCH] [#73220] add better condition for checking top instance status --- test_regress/driver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test_regress/driver.py b/test_regress/driver.py index 77cd639b0..8b354272d 100755 --- a/test_regress/driver.py +++ b/test_regress/driver.py @@ -127,7 +127,7 @@ class SAIFParser: instance = SAIFInstance(instance_name) - if instance_name.startswith("top"): + if self.current_instance == None: self.top_instances[instance_name] = instance else: self.current_instance.child_instances[instance_name] = instance @@ -172,7 +172,7 @@ class SAIFParser: current_signal.bits[int(bit_index)].transitions = int(toggle_count) match = re.match(r'\s+\)\s+', line) - if match and self.current_instance != self.top_instance: + if match: self.current_instance = self.current_instance.parent_instance @@ -2478,6 +2478,7 @@ class VlTest: self.vcd_identical(tmp, fn2) def compare_saif_instances(self, first: SAIFInstance, second: SAIFInstance): + print(f"Entering {first.scope_name}") for signal_name, signal in first.nets.items(): if signal_name not in second.nets: self.error(f"Signal {signal_name} doesn't exist in the second object\n") @@ -2501,7 +2502,6 @@ class VlTest: def compare_saif_contents(self, first: SAIFParser, second: SAIFParser): """Test if second SAIF file has the same values as the first""" - 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")