Skip to content

Commit

Permalink
sim._pyrtl: formatting. NFCI
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Nov 25, 2023
1 parent 89d1c9b commit e7b15e1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions amaranth/sim/_pyrtl.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

__all__ = ["PyRTLProcess"]


_USE_PATTERN_MATCHING = (sys.version_info >= (3, 10))


class PyRTLProcess(BaseProcess):
__slots__ = ("is_comb", "runnable", "passive", "run")

Expand Down Expand Up @@ -83,11 +85,11 @@ def on_value(self, value):
"simulate in reasonable time"
.format(src, len(value)))

v = super().on_value(value)
if isinstance(v, str) and len(v) > 1000:
code = super().on_value(value)
if isinstance(code, str) and len(code) > 1000:
# Avoid parser stack overflow on older Pythons.
return self.emitter.def_var("intermediate", v)
return v
return self.emitter.def_var("expr_split", code)
return code

def on_ClockSignal(self, value):
raise NotImplementedError # :nocov:
Expand Down

0 comments on commit e7b15e1

Please sign in to comment.