Skip to content

Commit

Permalink
Fix ltspice raw + report lint's time:
Browse files Browse the repository at this point in the history
- fix path on windows for ltspice postprocessing
- format into time the total time of lint sim
- fix powershell script add to PATH
  • Loading branch information
LudwigCRON committed Sep 14, 2020
1 parent 9f703da commit 4b7946d
Show file tree
Hide file tree
Showing 6 changed files with 715 additions and 709 deletions.
6 changes: 4 additions & 2 deletions analog/tools/ltspice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ def run(asc: str):
# do not allow the WM to decorate window
window_path = io.StringIO()
executor.sh_exec("winepath -w '%s'" % asc, window_path, NOERR=True, NOOUT=True)
asc = window_path.getvalue().strip().replace("\\", "/")
asc = utils.normpath(window_path.getvalue().strip())
else:
ltspice = "XVIIx64.exe"
# start the simulation
gen = executor.ish_exec('%s -Run "%s"' % (ltspice, asc), SIM_LOG, MAX_TIMEOUT=300, NOERR=True)
gen = executor.ish_exec(
'%s -Run "%s"' % (ltspice, asc), SIM_LOG, MAX_TIMEOUT=300, NOERR=True
)
proc = next(gen)
# watch the log file to determine when
# the simulation ends
Expand Down
3 changes: 3 additions & 0 deletions analog/tools/parsers/ltspice_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

sys.path.append(os.environ["REFLOW"])

import common.utils as utils
import common.relog as relog


Expand Down Expand Up @@ -46,11 +47,13 @@ def load_raw(filename):
Returns
dict with structure described above.
"""
filename = utils.normpath(filename)
if not filename.endswith(".raw"):
for raw in Path(filename).rglob("**/*.raw"):
if not ".op.raw" in str(raw):
filename = str(raw)
break
filename = utils.normpath(filename)
print(filename)
ret, header = {}, []
mode, data, time = None, None, None
Expand Down
2 changes: 1 addition & 1 deletion common/templates/report.html.mako
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def get_block_name(block: dict):
<td>${lint.get("name")}</td>
<td>${"%d" % lint.get("warnings")}</td>
<td>${"%d" % lint.get("errors")}</td>
<td>${lint.get("total_time")}</td>
<td>${to_time(lint.get("total_time"))}</td>
</tr>
% endfor
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion envs/bin/create
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def update_active(env_dir: str = "./"):
[
"# Add base path of ReFlow\n",
'$env:REFLOW = "%s"\n' % REFLOW_DIR,
'$env:PATH = "%s:" + $env:PATH\n' % REFLOW_BIN,
'$env:PATH = "%s;" + $env:PATH\n' % REFLOW_BIN,
"Function reflow_run {python '%s' @args}\n"
% os.path.join(REFLOW_BIN, "run"),
"Function reflow_create {python '%s' @args}\n"
Expand Down
3 changes: 2 additions & 1 deletion envs/bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ if __name__ == "__main__":
if not any(dict(args._get_kwargs()).values()):
parser.print_help()
exit(0)

# execution path
CURRENT_DIR = utils.normpath(CURRENT_DIR)
# the default configuration
default_config = utils.normpath(os.path.join(REFLOW_DIR, "./default.config"))
# load a local configuration if there is one
Expand Down
Loading

0 comments on commit 4b7946d

Please sign in to comment.