From: Aleksandar Kostovic Date: Thu, 14 Feb 2019 09:16:54 +0000 (+0100) Subject: Turned the normalise_2 verilog state into nmigen X-Git-Tag: ls180-24jan2020~2019 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=362b54b6e73894ccca070f53cee4b5817cf3b47f;p=ieee754fpu.git Turned the normalise_2 verilog state into nmigen --- diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index c197d735..df100d1c 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -251,6 +251,20 @@ class FPADD: round_bit.eq(tot[1]), sticky.eq(tot[0]) ] + + with m.State("normalise_2"): + with m.If(z_e < -126): + m.d.sync +=[ + z_e.eq(z_e + 1), + z_m.eq(z_m >> 1), + guard.eq(z_m[0]), + round_bit.eq(guard), + sticky.eq(sticky | round_bit) + ] + + with m.Else(): + m.next = "round" + return m """