From: whitequark Date: Wed, 8 Jul 2020 06:29:34 +0000 (+0000) Subject: back.pysim: simplify. NFC. X-Git-Tag: 24jan2021_ls180~24 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=90e2a991f0660a215995e94ec4083b7b0f080753;p=nmigen.git back.pysim: simplify. NFC. --- diff --git a/nmigen/back/pysim.py b/nmigen/back/pysim.py index 57480b2..71b1b95 100644 --- a/nmigen/back/pysim.py +++ b/nmigen/back/pysim.py @@ -463,9 +463,9 @@ class _RHSValueCompiler(_ValueCompiler): return f"0" @classmethod - def compile(cls, state, value, *, mode, inputs=None): + def compile(cls, state, value, *, mode): emitter = _Emitter() - compiler = cls(state, emitter, mode=mode, inputs=inputs) + compiler = cls(state, emitter, mode=mode) emitter.append(f"result = {compiler(value)}") return emitter.flush() @@ -553,13 +553,6 @@ class _LHSValueCompiler(_ValueCompiler): self.emitter.append(f"pass") return gen - @classmethod - def compile(cls, state, stmt, *, inputs=None, outputs=None): - emitter = _Emitter() - compiler = cls(state, emitter, inputs=inputs, outputs=outputs) - compiler(stmt) - return emitter.flush() - class _StatementCompiler(StatementVisitor, _Compiler): def __init__(self, state, emitter, *, inputs=None, outputs=None): @@ -609,12 +602,12 @@ class _StatementCompiler(StatementVisitor, _Compiler): raise NotImplementedError # :nocov: @classmethod - def compile(cls, state, stmt, *, inputs=None, outputs=None): + def compile(cls, state, stmt): output_indexes = [state.get_signal(signal) for signal in stmt._lhs_signals()] emitter = _Emitter() for signal_index in output_indexes: emitter.append(f"next_{signal_index} = slots[{signal_index}].next") - compiler = cls(state, emitter, inputs=inputs, outputs=outputs) + compiler = cls(state, emitter) compiler(stmt) for signal_index in output_indexes: emitter.append(f"slots[{signal_index}].set(next_{signal_index})")