From: Luke Kenneth Casson Leighton Date: Wed, 13 Mar 2019 04:26:24 +0000 (+0000) Subject: only process data if the input strobe is valid X-Git-Tag: ls180-24jan2020~1679 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b58c1a8f96dfaa63e89c7f3d7fd65f0fec9c1932;p=ieee754fpu.git only process data if the input strobe is valid --- diff --git a/src/add/example_buf_pipe.py b/src/add/example_buf_pipe.py index 337ce50e..fa52f3c7 100644 --- a/src/add/example_buf_pipe.py +++ b/src/add/example_buf_pipe.py @@ -40,7 +40,6 @@ """ from nmigen import Signal, Cat, Const, Mux, Module -from nmigen.compat.sim import run_simulation from nmigen.cli import verilog, rtlil class BufPipe: @@ -92,7 +91,8 @@ class BufPipe: # store result of processing in combinatorial temporary result = Signal(32) - m.d.comb += result.eq(self.process(self.i_data)) + with m.If(self.i_p_stb): # input is valid: process it + m.d.comb += result.eq(self.process(self.i_data)) with m.If(o_p_busyn): # not stalled m.d.sync += self.r_data.eq(result)