Skip to content

Commit

Permalink
sim/gtkwave: Update/fix SignalNamespace import (And make it public in…
Browse files Browse the repository at this point in the history
… fhdl/namer).
  • Loading branch information
enjoy-digital committed Nov 9, 2023
1 parent 4b9c866 commit 4ba3ad5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions litex/build/sim/gtkwave.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from migen import *

from litex.gen.fhdl.namer import Namespace
from litex.gen.fhdl.namer import SignalNamespace

from litex.soc.interconnect import stream

Expand Down Expand Up @@ -52,7 +52,7 @@ class GTKWSave:
"""

def __init__(self,
vns: Namespace,
vns: SignalNamespace,
savefile: str,
dumpfile: str,
filtersdir: str = None,
Expand All @@ -62,7 +62,7 @@ def __init__(self,
`prefix` is prepended to all signal names and defaults to the one used by Litex simulator.
"""
self.vns = vns # Namespace output of Builder.build, required to resolve signal names
self.vns = vns # SignalNamespace output of Builder.build, required to resolve signal names
self.prefix = prefix
self.savefile = savefile
self.dumpfile = dumpfile
Expand Down
6 changes: 3 additions & 3 deletions litex/gen/fhdl/namer.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def _build_signal_name_dict(signals):

# Signal Namespace Class ---------------------------------------------------------------------------

class _SignalNamespace:
class SignalNamespace:
"""
A _SignalNamespace object manages unique naming for signals within a hardware design.
Expand Down Expand Up @@ -463,14 +463,14 @@ def build_signal_namespace(signals, reserved_keywords=set()):
reserved_keywords (set, optional): A set of keywords that cannot be used as signal names.
Returns:
Namespace: An object that contains the mapping of signals to unique names and provides methods to access them.
SignalNamespace: An object that contains the mapping of signals to unique names and provides methods to access them.
"""

# Create the primary signal-to-name dictionary.
pnd = _build_signal_name_dict(signals)

# Initialize the namespace with reserved keywords and the primary mapping.
namespace = _SignalNamespace(pnd, reserved_keywords)
namespace = SignalNamespace(pnd, reserved_keywords)

# Handle signals with overridden names, ensuring they are processed in a consistent order.
signals_with_name_override = filter(lambda s: s.name_override is not None, signals)
Expand Down

0 comments on commit 4ba3ad5

Please sign in to comment.