Skip to content

Commit

Permalink
Fix profiles on newer yosys version (kuznia-rdzeni/coreblocks#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
lekcyjna123 authored Mar 12, 2024
1 parent 11a7167 commit 07048db
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions transactron/utils/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def escape_verilog_identifier(identifier: str) -> str:
# The standard says how to escape a identifier, but not when. So this is
# a non-exhaustive list of characters that Yosys escapes (it is used
# by Amaranth when generating Verilog code).
characters_to_escape = [".", "$"]
characters_to_escape = [".", "$", "-"]

for char in characters_to_escape:
if char in identifier:
Expand All @@ -160,10 +160,7 @@ def escape_verilog_identifier(identifier: str) -> str:

def get_signal_location(signal: Signal, name_map: "SignalDict") -> list[str]:
raw_location = name_map[signal]

# Amaranth escapes identifiers when generating Verilog code, but returns non-escaped identifiers
# in the name map, so we need to escape it manually.
return [escape_verilog_identifier(component) for component in raw_location]
return raw_location


def collect_metric_locations(name_map: "SignalDict") -> dict[str, MetricLocation]:
Expand Down

0 comments on commit 07048db

Please sign in to comment.