From: Sebastien Bourdeauducq Date: Thu, 12 Jul 2012 18:13:31 +0000 (+0200) Subject: framebuffer: clean shutdown X-Git-Tag: 24jan2021_ls180~3103 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=99b889a551f9be7854b24f94bcd75a7f81f18240;p=litex.git framebuffer: clean shutdown --- diff --git a/milkymist/framebuffer/__init__.py b/milkymist/framebuffer/__init__.py index 28f17db8..28254e07 100644 --- a/milkymist/framebuffer/__init__.py +++ b/milkymist/framebuffer/__init__.py @@ -69,9 +69,10 @@ class _FrameInitiator(Actor): def get_fragment(self): # TODO: make address updates atomic token = self.token("frame") + stb = self.endpoints["frame"].stb + ack = self.endpoints["frame"].ack comb = [ - self.busy.eq(0), - self.endpoints["frame"].stb.eq(self._enable.field.r), + self.busy.eq(stb), token.hres.eq(self._hres.field.r), token.hsync_start.eq(self._hsync_start.field.r), token.hsync_end.eq(self._hsync_end.field.r), @@ -80,10 +81,15 @@ class _FrameInitiator(Actor): token.vsync_start.eq(self._vsync_start.field.r), token.vsync_end.eq(self._vsync_end.field.r), token.vscan.eq(self._vscan.field.r), - token.base.eq(self._base.field.r[self._alignment_bits:]), token.length.eq(self._length.field.r[self._alignment_bits:]) ] - return Fragment(comb) + sync = [ + If(ack | ~stb, + stb.eq(self._enable.field.r), + token.base.eq(self._base.field.r[self._alignment_bits:]) + ) + ] + return Fragment(comb, sync) class VTG(Actor): def __init__(self):