From 99b889a551f9be7854b24f94bcd75a7f81f18240 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 12 Jul 2012 20:13:31 +0200 Subject: [PATCH] framebuffer: clean shutdown --- milkymist/framebuffer/__init__.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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): -- 2.30.2