-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Working Xcelium + Indago support with single command commpilation plus a basic rerun script for Xcelium #866
base: master
Are you sure you want to change the base?
Changes from all commits
862d5fc
f85ba24
9ef0feb
1717700
d204405
fbd3c7c
cfc070a
12301ac
e7fc206
36d1d17
aa7ae54
9d3f446
cd70d5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
# You can obtain one at http://mozilla.org/MPL/2.0/. | ||
# | ||
# Copyright (c) 2014-2021, Lars Asplund lars.anders.asplund@gmail.com | ||
|
||
""" | ||
Perform necessary modifications to VUnit Verilog code to support | ||
Cadence Xcelium | ||
""" | ||
|
||
import os | ||
import re | ||
from pathlib import Path | ||
|
||
|
||
def replace_stop_by_finish(file_name): | ||
""" | ||
Replace $stop by $finish | ||
""" | ||
|
||
with Path(file_name).open("r", encoding="iso-8859-1") as fptr: | ||
text = fptr.read() | ||
|
||
text = text.replace("$stop(", "$finish(") | ||
|
||
with Path(file_name).open("w", encoding="iso-8859-1") as fptr: | ||
fptr.write(text) | ||
|
||
|
||
def add_finish_after_error(file_name): | ||
""" | ||
Add $finish after a $error | ||
""" | ||
|
||
with Path(file_name).open("r", encoding="iso-8859-1") as fptr: | ||
text = fptr.read() | ||
|
||
text = re.sub(r"(\$error\(.*\))", "\\1; $finish(1)", text) | ||
|
||
with Path(file_name).open("w", encoding="iso-8859-1") as fptr: | ||
fptr.write(text) | ||
|
||
|
||
def main(): | ||
""" | ||
Remove xcelium incompatabilities from source code | ||
""" | ||
Hardolaf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
where = "../vunit/verilog" | ||
root = os.path.abspath(os.path.join(os.path.dirname(__file__), where)) | ||
for base, _, files in os.walk(root): | ||
for file_name in files: | ||
if file_name.endswith(".sv") or file_name.endswith(".svh"): | ||
Hardolaf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
replace_stop_by_finish(os.path.join(base, file_name)) | ||
add_finish_after_error(os.path.join(base, file_name)) | ||
|
||
|
||
if __name__ == "__main__": | ||
#main() | ||
print("nothing to do") |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,22 +38,7 @@ class IncisiveInterface(SimulatorInterface): # pylint: disable=too-many-instanc | |
|
||
sim_options = [ListOfStringOption("incisive.irun_sim_flags")] | ||
|
||
@staticmethod | ||
def add_arguments(parser): | ||
""" | ||
Add command line arguments | ||
""" | ||
group = parser.add_argument_group("Incisive irun", description="Incisive irun-specific flags") | ||
group.add_argument( | ||
"--cdslib", | ||
default=None, | ||
help="The cds.lib file to use. If not given, VUnit maintains its own cds.lib file.", | ||
) | ||
group.add_argument( | ||
"--hdlvar", | ||
default=None, | ||
help="The hdl.var file to use. If not given, VUnit does not use a hdl.var file.", | ||
) | ||
# NOTE: Incisive shares the command-line arguments with Xcelium | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment relates to the code that was removed, this should be in a commit message instead. I personally don't think this comment is needed, but I would clean it up to include There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO we could even remove all traces of Incisive, its last release was in 2015, everything after that was called Xcelium. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would the Incisive from 2015 work with the new Xcelium interface? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I honestly don't know. Our codebase is incompatible with Incisive due to reliance on newer System Verilog features. |
||
|
||
@classmethod | ||
def from_args(cls, args, output_path, **kwargs): | ||
|
@@ -102,14 +87,14 @@ def find_cds_root_irun(self): | |
""" | ||
Finds irun cds root | ||
""" | ||
return subprocess.check_output([str(Path(self._prefix) / "cds_root"), "irun"]).splitlines()[0] | ||
return subprocess.check_output([str(Path(self._prefix) / "cds_root"), "irun"]).splitlines()[0].decode() | ||
|
||
def find_cds_root_virtuoso(self): | ||
""" | ||
Finds virtuoso cds root | ||
""" | ||
try: | ||
return subprocess.check_output([str(Path(self._prefix) / "cds_root"), "virtuoso"]).splitlines()[0] | ||
return subprocess.check_output([str(Path(self._prefix) / "cds_root"), "virtuoso"]).splitlines()[0].decode() | ||
except subprocess.CalledProcessError: | ||
return None | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be removed as it is no longer necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it needed for older versions of Xcelium?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. It was added by @rodrigomelo9 in their original PR and was made irrelevant by our inclusion of the patches to the files in this PR.