diff --git a/analog/tools/ltspice/__init__.py b/analog/tools/ltspice/__init__.py index 9e0a7d3..cc00bc1 100644 --- a/analog/tools/ltspice/__init__.py +++ b/analog/tools/ltspice/__init__.py @@ -59,7 +59,7 @@ def run(asc: str): if sys.platform == "darwin": ltspice = "/Applications/LTspice.app/Contents/MacOS/LTspice" elif sys.platform == "unix" or "linux" in sys.platform: - ltspice = 'wine "%s"' % shutil.which("XVIIx64.exe") + ltspice = 'wine "%s"' % utils.wine.locate("XVIIx64.exe") asc = "z:%s" % asc else: ltspice = "XVIIx64.exe" diff --git a/analog/tools/ltspice_view/__init__.py b/analog/tools/ltspice_view/__init__.py index aa58684..06848cd 100644 --- a/analog/tools/ltspice_view/__init__.py +++ b/analog/tools/ltspice_view/__init__.py @@ -26,7 +26,7 @@ def run(raw: str): if sys.platform == "darwin": ltspice = "/Applications/LTspice.app/Contents/MacOS/LTspice" elif sys.platform == "unix" or "linux" in sys.platform: - ltspice = 'wine "%s"' % shutil.which("XVIIx64.exe") + ltspice = 'wine "%s"' % utils.wine.locate("XVIIx64.exe") raw = "z:%s" % raw else: ltspice = "XVIIx64.exe" diff --git a/common/executor.py b/common/executor.py index 8c55d73..a55d052 100644 --- a/common/executor.py +++ b/common/executor.py @@ -61,7 +61,6 @@ def sh_exec( if return_code: raise subprocess.CalledProcessError(return_code, cmd) except (OSError, subprocess.CalledProcessError) as exception: - relog.error("Exception occured: ", str(exception)) return False except subprocess.TimeoutExpired: relog.error("Unexpected executer timeout") @@ -125,7 +124,6 @@ def ish_exec( if return_code: raise subprocess.CalledProcessError(return_code, cmd) except (OSError, subprocess.CalledProcessError) as exception: - relog.error("Exception occured: ", str(exception)) return False except subprocess.TimeoutExpired: relog.error("Unexpected executer timeout") diff --git a/common/utils/__init__.py b/common/utils/__init__.py index f4b8a95..75b3958 100644 --- a/common/utils/__init__.py +++ b/common/utils/__init__.py @@ -7,5 +7,6 @@ import common.utils.tools as tools import common.utils.graphs as graphs import common.utils.parsers as parsers +import common.utils.wine as wine from common.utils.run import * diff --git a/common/utils/wine.py b/common/utils/wine.py new file mode 100644 index 0000000..af1158a --- /dev/null +++ b/common/utils/wine.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +import os + +from pathlib import Path + + +def locate(program: str): + """ + locate where an exe file is store in a wine installation + wine load application in WINEPREFIX (by default $HOME/.wine) + """ + wineprefix = os.getenv("WINEPREFIX") or os.path.join(os.getenv("HOME"), ".wine") + ans = [] + for file in Path(wineprefix).rglob("**/*.exe"): + if program in str(file): + ans.append(str(file)) + return ans[-1] diff --git a/digital/tools/iverilog/__init__.py b/digital/tools/iverilog/__init__.py index bbf3a9d..7d29a95 100755 --- a/digital/tools/iverilog/__init__.py +++ b/digital/tools/iverilog/__init__.py @@ -23,14 +23,16 @@ def transform_flags(flags: str) -> str: flags = flags.strip() - if "-DEFINE " in flags: - flags = flags.replace("-DEFINE ", "+define+") - if "-define " in flags: - flags = flags.replace("-define ", "+define+") - if "-PARAM " in flags: - flags = flags.replace("-PARAM ", "+parameter+") - if "-param " in flags: - flags = flags.replace("-param ", "+parameter+") + # replace any values found by the key + matches = { + "+define+": ["-DEFINE ", "-define ", "-D", "-d"], + "+parameter+": ["-PARAM ", "-param ", "-P", "-p"], + } + for output, inputs in matches.items(): + for i in inputs: + if i in flags: + flags = flags.replace(i, output) + # generate a string flags = [flag for flag in flags.split(" ") if not flag.startswith("-g")] return " ".join(flags) @@ -78,12 +80,18 @@ def compile(generation, flags): "iverilog -g%s -grelative-include %s -Wall -o %s -c %s" % (generation, flags, EXE, SRCS) ) - executor.sh_exec( - "iverilog -g%s -grelative-include %s -Wall -o %s -c %s" - % (generation, flags, EXE, SRCS), - PARSER_LOG, - MAX_TIMEOUT=20, - ) + try: + executor.sh_exec( + "iverilog -g%s -grelative-include %s -Wall -o %s -c %s" + % (generation, flags, EXE, SRCS), + PARSER_LOG, + MAX_TIMEOUT=20, + ) + # ignore return code error + # as message is already displayed in stdout + # and in the log file + except subprocess.CalledProcessError: + pass def run(lint: bool = False): diff --git a/tests/.tmp_report/report.html b/tests/.tmp_report/report.html index 8e42305..df3b9c8 100644 --- a/tests/.tmp_report/report.html +++ b/tests/.tmp_report/report.html @@ -87,13 +87,13 @@

tests

-

Monday, 11. May 2020 18:19

+

Sunday, 31. May 2020 20:02

- Errors:26 + Errors:382
- Warnings:8 + Warnings:16
- Elapsed Time:42.540s + Elapsed Time:1m44.951s

@@ -115,7 +115,7 @@

Monday, 11. May 2020 18:19

- 4/4 - - 5.162s + 29.219s @@ -126,7 +126,7 @@

Monday, 11. May 2020 18:19

6/6 8/8 0/6 - 0.404s + 0.363s @@ -134,10 +134,10 @@

Monday, 11. May 2020 18:19

digital - 9/9 - 11/11 - 2/9 - 2.749s + 10/10 + 14/14 + 3/12 + 4.770s @@ -148,7 +148,7 @@

Monday, 11. May 2020 18:19

- 4/4 - - 5.162s + 29.219s @@ -161,6 +161,17 @@

Monday, 11. May 2020 18:19

- - + + + + testcases + + + - + 1/4 + - + 0.956s + @@ -181,28 +192,28 @@

Simulation

- xor + ota 0 0 - 1.15s + 8.270s - schmitt + filter 0 0 - 1.21s + 9.87s - ota + schmitt 0 0 - 1.12s + 3.276s - filter + xor 0 0 - 2.114s + 8.586s @@ -224,40 +235,40 @@

Lint

- s2 + s 0 0 - 15.0 + 7.0 - youpi + fast_clock 0 0 - 15.0 + 7.0 - fast_clock + s2 0 0 - 15.0 + 7.0 tb 0 0 - 15.0 + 7.0 - s + UFC 0 0 - 16.0 + 7.0 - UFC + youpi 0 0 - 15.0 + 7.0 @@ -272,52 +283,52 @@

Simulation

- s2 + s 0 0 - 0.23s + 0.46s - youpi + fast_clock 0 0 - 0.24s + 0.44s - fast_clock + s2 0 0 - 0.23s + 0.45s - tb + n 0 0 - 0.24s + 0.13s - n + n2 0 0 - 0.23s + 0.14s - s + tb 0 0 - 0.23s + 0.45s - n2 + UFC 0 0 - 0.24s + 0.13s - UFC + youpi 0 0 - 0.25s + 0.12s @@ -332,40 +343,40 @@

Code coverage

- s2 + s 0 - 1 - 0.21s + 2 + 0.24s - youpi + fast_clock 0 - 1 - 0.20s + 2 + 0.6s - fast_clock + s2 0 - 1 - 0.21s + 2 + 0.23s tb 0 - 1 - 0.21s + 3 + 0.23s - s + UFC 0 - 1 - 0.21s + 4 + 0.6s - UFC + youpi 0 - 1 - 0.20s + 3 + 0.7s @@ -384,58 +395,64 @@

Lint

- s2 + mako 0 0 - 15.0 + 11.0 - youpi + generic_sar 0 0 - 15.0 + 9.0 - fast_clock + simple 0 0 - 15.0 + 7.0 - tb + s 0 0 - 15.0 + 7.0 - s + fast_clock 0 0 - 16.0 + 7.0 - UFC + s2 0 0 - 15.0 + 7.0 - mako + tb 0 0 - 22.0 + 7.0 - generic_sar + UFC + 0 + 0 + 7.0 + + + youpi 0 0 - 20.0 + 7.0 simple 0 0 - 15.0 + 7.0 @@ -450,70 +467,88 @@

Simulation

- s2 + mako + 2 0 + 1.69s + + + generic_sar + 2 0 - 0.23s + 1.67s - youpi + simple 0 0 - 0.24s + 0.14s - fast_clock + mako + 2 0 + 1.64s + + + generic_sar + 2 0 - 0.23s + 1.63s - tb + s 0 0 - 0.24s + 0.46s - n + fast_clock 0 0 - 0.23s + 0.44s - s + s2 0 0 - 0.23s + 0.45s + + + n + 0 + 0 + 0.13s n2 0 0 - 0.24s + 0.14s - UFC + tb 0 0 - 0.25s + 0.45s - mako - 2 + UFC 0 - 1.102s + 0 + 0.13s - generic_sar - 2 + youpi + 0 0 - 1.92s + 0.12s simple 0 0 - 0.23s + 0.15s @@ -528,58 +563,76 @@

Code coverage

- s2 + mako 0 - 1 - 0.21s + 0 + 0.11s - youpi + generic_sar 0 - 1 - 0.20s + 3 + 0.31s - fast_clock + simple 0 - 1 - 0.21s + 0 + 0.7s - tb + mako 0 1 - 0.21s + 0.13s - s + generic_sar 0 1 - 0.21s + 0.10s - UFC + s 0 - 1 - 0.20s + 2 + 0.24s - mako + fast_clock 0 + 2 + 0.6s + + + s2 0 - 0.28s + 2 + 0.23s - generic_sar + tb 0 - 1 + 3 0.23s + + UFC + 0 + 4 + 0.6s + + + youpi + 0 + 3 + 0.7s + simple 0 0 - 0.20s + 0.9s @@ -601,28 +654,28 @@

Simulation

- xor + ota 0 0 - 1.15s + 8.270s - schmitt + filter 0 0 - 1.21s + 9.87s - ota + schmitt 0 0 - 1.12s + 3.276s - filter + xor 0 0 - 2.114s + 8.586s @@ -640,6 +693,52 @@

Lint

Simulation

No simulations
+

Code coverage

+
No coverage simulations
+ +
+ + testcases + +

Lint

+
No lints
+ +

Simulation

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
idwarningserrorstotal time
60meg040.215s
50meg020.212s
32meg000.212s
100meg01480.317s
+

Code coverage

No coverage simulations
diff --git a/tests/Batch.list b/tests/Batch.list index a7af5cb..0abe928 100644 --- a/tests/Batch.list +++ b/tests/Batch.list @@ -1,2 +1,3 @@ analog digital +platform/testcases diff --git a/tests/digital/mako/Sources.list b/tests/digital/mako/Sources.list index 4dbfc01..7365ba7 100644 --- a/tests/digital/mako/Sources.list +++ b/tests/digital/mako/Sources.list @@ -3,4 +3,5 @@ basic_wrapper.v.mako: ../generic_sar/ COV_FLAGS = -NOWARN MCRDEF -COV_FLAGS+= -define sar.NSTEPS=10 \ No newline at end of file +COV_FLAGS+= -define sar.NSTEPS=10 +COV_MODULES=sar \ No newline at end of file diff --git a/tests/digital/mako/basic_wrapper.v b/tests/digital/mako/basic_wrapper.v index 0e0cbf9..da01c11 100644 --- a/tests/digital/mako/basic_wrapper.v +++ b/tests/digital/mako/basic_wrapper.v @@ -24,6 +24,13 @@ module basic_wrapper ( output wire O output wire Ob */ +/*======== rs_nor ======== + M rs_nor: 4 pins and 0 parameters + input wire A + input wire B + output wire O + output wire Ob +*/ /*======== sar ======== M sar: 15 pins and 2 parameters input wire rstb