Skip to content
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

Updated SpyGlass backend to support features in Synopsys Spyglass v2023.12 #449

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions edalize/spyglass.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class Spyglass(Edatool):

_description = """ Synopsys (formerly Atrenta) Spyglass Backend
_description = """ Synopsys Spyglass Backend (v2023.12)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the version hardcoded in the description here?


Spyglass performs static source code analysis on HDL code and checks for common
coding errors or coding style violations.
Expand All @@ -27,19 +27,22 @@ class Spyglass(Edatool):
methodology: "GuideWare/latest/block/rtl_handoff"
goals:
- lint/lint_rtl
goal_options:
- addrules { W164c W240 IfWithoutElse-ML } # New fiels
spyglass_options:
# prevent error SYNTH_5273 on generic RAM descriptions
- handlememory yes
rule_parameters:
# Allow localparam to be used in case labels (e.g. in state machines)
- handle_static_caselabels yes
- allow_combo_logic yes

"""

tool_options = {
"members": {"methodology": "String"},
"members": {
"methodology": "String",
},
"lists": {
"goals": "String",
"goal_options": "String", # New field
"spyglass_options": "String",
"rule_parameters": "String",
},
Expand All @@ -50,6 +53,7 @@ class Spyglass(Edatool):
tool_options_defaults = {
"methodology": "GuideWare/latest/block/rtl_handoff",
"goals": ["lint/lint_rtl"],
"goal_options": [], # New field
"spyglass_options": [],
"rule_parameters": [],
}
Expand All @@ -58,7 +62,7 @@ def _set_tool_options_defaults(self):
for key, default_value in self.tool_options_defaults.items():
if not key in self.tool_options:
logger.info(
"Set Spyglass tool option %s to default value %s"
"Set Spyglass tool option %s to default value %"
% (key, str(default_value))
)
self.tool_options[key] = default_value
Expand Down Expand Up @@ -136,6 +140,7 @@ def _vhdl_source(f):
"tclSource": "source",
"waiver": "read_file -type waiver",
"awl": "read_file -type awl",
"sgdc": "read_file -type sgdc", # Added support for SpyGlass Design Constraint file
}
_file_type = get_file_type(f)
if _file_type in file_types:
Expand Down
23 changes: 13 additions & 10 deletions edalize/templates/spyglass/spyglass-project.prj.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@


set_option projectwdir .
set_option language_mode mixed
set_option designread_enable_synthesis yes
set_option designread_disable_flatten no

### Options ###

# Make no only FATAL messages return a non-zero exit code, but also ERRORs and
# WARNINGs
set_option enable_pass_exit_codes yes

{% for option in tool_options.spyglass_options %}
set_option {{ option }}
{% endfor %}

### Files ###
{% for src_file in src_files if src_file|src_file_filter%}
{{ src_file|src_file_filter }}
{% endfor %}


{% if vlogparam -%}
set_option param {
{%- for k, v in vlogparam.items() %}{{ k }}={{ v|param_value_str }} {% endfor -%}
Expand All @@ -42,14 +42,17 @@ set_option incdir [list {{ incdirs|join(' ') }}]
set_option top {{ toplevel }}
{%- endif %}

{% if has_systemVerilog -%}
set_option enableSV09 yes
{%- endif %}

set_option active_methodology $SPYGLASS_HOME/{{ tool_options.methodology }}

current_methodology $SPYGLASS_HOME/{{ tool_options.methodology }}
{% if has_systemVerilog -%} # Modified such that it is not a specifc SV version
set_option enableSV yes
{%- endif %}

### Rule parameters ###
{% for rule_param in tool_options.rule_parameters %}
set_parameter {{ rule_param }}
{% endfor %}

### Goal options ###
{% for goal_option in tool_options.goal_options %}
set_goal_option {{ goal_option }}
{% endfor %}
Loading