From 07d75f231abd808841bb2d34b9d67c3e35298a4a Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Tue, 25 Feb 2025 17:35:09 -0800 Subject: [PATCH] eth: Fix testbenches Signed-off-by: Alex Forencich --- .../taxi_eth_mac_10g_fifo/test_taxi_eth_mac_10g_fifo.py | 9 +++++---- .../test_taxi_eth_mac_phy_10g_fifo.py | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tb/eth/taxi_eth_mac_10g_fifo/test_taxi_eth_mac_10g_fifo.py b/tb/eth/taxi_eth_mac_10g_fifo/test_taxi_eth_mac_10g_fifo.py index 9f65b45..65a3e93 100644 --- a/tb/eth/taxi_eth_mac_10g_fifo/test_taxi_eth_mac_10g_fifo.py +++ b/tb/eth/taxi_eth_mac_10g_fifo/test_taxi_eth_mac_10g_fifo.py @@ -304,15 +304,16 @@ rtl_dir = os.path.abspath(os.path.join(tests_dir, '..', '..', '..', 'rtl')) def process_f_files(files): - lst = [] + lst = {} for f in files: if f[-2:].lower() == '.f': with open(f, 'r') as fp: l = fp.read().split() - lst.extend(process_f_files([os.path.join(os.path.dirname(f), x) for x in l])) + for f in process_f_files([os.path.join(os.path.dirname(f), x) for x in l]): + lst[os.path.basename(f)] = f else: - lst.append(f) - return list(dict.fromkeys(lst)) + lst[os.path.basename(f)] = f + return list(lst.values()) @pytest.mark.parametrize("dic_en", [1, 0]) diff --git a/tb/eth/taxi_eth_mac_phy_10g_fifo/test_taxi_eth_mac_phy_10g_fifo.py b/tb/eth/taxi_eth_mac_phy_10g_fifo/test_taxi_eth_mac_phy_10g_fifo.py index 496db38..1eea140 100644 --- a/tb/eth/taxi_eth_mac_phy_10g_fifo/test_taxi_eth_mac_phy_10g_fifo.py +++ b/tb/eth/taxi_eth_mac_phy_10g_fifo/test_taxi_eth_mac_phy_10g_fifo.py @@ -365,15 +365,16 @@ rtl_dir = os.path.abspath(os.path.join(tests_dir, '..', '..', '..', 'rtl')) def process_f_files(files): - lst = [] + lst = {} for f in files: if f[-2:].lower() == '.f': with open(f, 'r') as fp: l = fp.read().split() - lst.extend(process_f_files([os.path.join(os.path.dirname(f), x) for x in l])) + for f in process_f_files([os.path.join(os.path.dirname(f), x) for x in l]): + lst[os.path.basename(f)] = f else: - lst.append(f) - return list(dict.fromkeys(lst)) + lst[os.path.basename(f)] = f + return list(lst.values()) @pytest.mark.parametrize("dic_en", [1, 0])