From 161d37053a3e8e2c66e933621212c35bad07f69e Mon Sep 17 00:00:00 2001 From: Piotr Rzeszut Date: Wed, 12 Jul 2023 13:11:43 +0200 Subject: [PATCH 1/2] Try both lower-case transformed design unit name as well as original format to fix issue with Verilog being case-sensitive. --- vunit/ui/library.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vunit/ui/library.py b/vunit/ui/library.py index b57e78e04..e04eec439 100644 --- a/vunit/ui/library.py +++ b/vunit/ui/library.py @@ -486,9 +486,12 @@ def test_bench(self, name): :returns: A :class:`.TestBench` object :raises: KeyError """ - name = name.lower() - - return TestBench(self._test_bench_list.get_test_bench(self._library_name, name), self) + name_lower = name.lower() + + try: + return TestBench(self._test_bench_list.get_test_bench(self._library_name, name_lower), self) + except: + return TestBench(self._test_bench_list.get_test_bench(self._library_name, name), self) def get_test_benches(self, pattern="*", allow_empty=False): """ From ea3132779b6746e658c584e5e2d334bbe4ddd219 Mon Sep 17 00:00:00 2001 From: Piotr Rzeszut Date: Thu, 5 Oct 2023 16:03:32 +0200 Subject: [PATCH 2/2] Move case-sensitivity check to get_test_bench (see #945) --- vunit/test/bench_list.py | 5 ++++- vunit/ui/library.py | 7 +------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/vunit/test/bench_list.py b/vunit/test/bench_list.py index 8cc13d035..68a5f011e 100644 --- a/vunit/test/bench_list.py +++ b/vunit/test/bench_list.py @@ -45,7 +45,10 @@ def _add_test_bench(self, test_bench): self._libraries[test_bench.library_name][test_bench.name] = test_bench def get_test_bench(self, library_name, name): - return self._libraries[library_name][name] + try: + return self._libraries[library_name][name] + except KeyError: + return self._libraries[library_name][name.lower()] def get_test_benches_in_library(self, library_name): return list(self._libraries.get(library_name, {}).values()) diff --git a/vunit/ui/library.py b/vunit/ui/library.py index e04eec439..840080e74 100644 --- a/vunit/ui/library.py +++ b/vunit/ui/library.py @@ -486,12 +486,7 @@ def test_bench(self, name): :returns: A :class:`.TestBench` object :raises: KeyError """ - name_lower = name.lower() - - try: - return TestBench(self._test_bench_list.get_test_bench(self._library_name, name_lower), self) - except: - return TestBench(self._test_bench_list.get_test_bench(self._library_name, name), self) + return TestBench(self._test_bench_list.get_test_bench(self._library_name, name), self) def get_test_benches(self, pattern="*", allow_empty=False): """