Merge pull request #46 from enjoy-digital/WritePrechargeFix

Update the write-to-precharge timings so it works with 1:2
This commit is contained in:
enjoy-digital 2018-09-25 20:59:36 +02:00 committed by GitHub
commit 869c8ee618
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,4 @@
import math
from migen import *
from migen.genlib.misc import WaitTimer
@ -84,7 +85,8 @@ class BankMachine(Module):
]
# Respect write-to-precharge specification
precharge_time = 2 + settings.timing.tWR - 1 + 1
write_latency = math.ceil(settings.phy.cwl / settings.phy.nphases)
precharge_time = write_latency + settings.timing.tWR - 1 + settings.timing.tCCD
precharge_timer = WaitTimer(precharge_time)
self.submodules += precharge_timer
self.comb += precharge_timer.wait.eq(~(cmd.valid & cmd.ready & cmd.is_write))