Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

lasmicon: fix FSM reset state with delayed_enter

  • Loading branch information...
commit d753c52225dd96870c6b0add837898a255ea8287 1 parent 2f662bf
Sébastien Bourdeauducq authored July 15, 2013
4  milkymist/lasmicon/bankmachine.py
@@ -93,8 +93,6 @@ def __init__(self, geom_settings, timing_settings, address_align, bankn, req):
93 93
 		# Control and command generation FSM
94 94
 		fsm = FSM()
95 95
 		self.submodules += fsm
96  
-		fsm.delayed_enter("TRP", "ACTIVATE", timing_settings.tRP-1)
97  
-		fsm.delayed_enter("TRCD", "REGULAR", timing_settings.tRCD-1)
98 96
 		fsm.act("REGULAR",
99 97
 			If(self.refresh_req,
100 98
 				NextState("REFRESH")
@@ -140,3 +138,5 @@ def __init__(self, geom_settings, timing_settings, address_align, bankn, req):
140 138
 			track_close.eq(1),
141 139
 			If(~self.refresh_req, NextState("REGULAR"))
142 140
 		)
  141
+		fsm.delayed_enter("TRP", "ACTIVATE", timing_settings.tRP-1)
  142
+		fsm.delayed_enter("TRCD", "REGULAR", timing_settings.tRCD-1)
4  milkymist/lasmicon/multiplexer.py
@@ -149,8 +149,6 @@ def anti_starvation(timeout):
149 149
 		# Control FSM
150 150
 		fsm = FSM()
151 151
 		self.submodules += fsm
152  
-		fsm.delayed_enter("RTW", "WRITE", timing_settings.read_latency-1)
153  
-		fsm.delayed_enter("WTR", "READ", timing_settings.tWTR-1)
154 152
 		fsm.act("READ",
155 153
 			read_time_en.eq(1),
156 154
 			choose_req.want_reads.eq(1),
@@ -180,6 +178,8 @@ def anti_starvation(timeout):
180 178
 			steerer.sel[0].eq(STEER_REFRESH),
181 179
 			If(~refresher.req, NextState("READ"))
182 180
 		)
  181
+		fsm.delayed_enter("RTW", "WRITE", timing_settings.read_latency-1)
  182
+		fsm.delayed_enter("WTR", "READ", timing_settings.tWTR-1)
183 183
 		# FIXME: workaround for zero-delay loop simulation problem with Icarus Verilog
184 184
 		fsm.finalize()
185 185
 		self.comb += refresher.ack.eq(fsm.state == fsm.encoding["REFRESH"])

0 notes on commit d753c52

Please sign in to comment.
Something went wrong with that request. Please try again.