write pulse in issuer
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 9 Aug 2020 21:25:32 +0000 (22:25 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 9 Aug 2020 21:25:32 +0000 (22:25 +0100)
src/soc/simple/core.py

index fb341b103bad73060357be27ef95d8221b09be4e..91663c7aaad56f67b7728c855c3f01a0c57343a5 100644 (file)
@@ -35,6 +35,8 @@ from soc.config.test.test_loadstore import TestMemPspec
 from soc.decoder.power_enums import MicrOp
 import operator
 
+from nmutil.util import rising_edge
+
 
 # helper function for reducing a list of signals down to a parallel
 # ORed single signal.
@@ -292,11 +294,14 @@ class NonProductionCore(Elaboratable):
                     wrflag = Signal(name=name, reset_less=True)
                     comb += wrflag.eq(dest.ok & fu.busy_o)
 
-                    # connect request-read to picker input, and output to go-wr
+                    # connect request-write to picker input, and output to go-wr
                     fu_active = fu_bitdict[funame]
                     pick = fu.wr.rel_o[idx] & fu_active  # & wrflag
                     comb += wrpick.i[pi].eq(pick)
-                    comb += fu.go_wr_i[idx].eq(wrpick.o[pi] & wrpick.en_o)
+                    # create a single-pulse go write from the picker output
+                    wr_pick = Signal()
+                    comb += wr_pick.eq(wrpick.o[pi] & wrpick.en_o)
+                    comb += fu.go_wr_i[idx].eq(rising_edge(m, wr_pick))
                     # connect regfile port to input
                     print("reg connect widths",
                           regfile, regname, pi, funame,