From: Florent Kermarrec Date: Sat, 15 Sep 2012 18:22:02 +0000 (+0200) Subject: fix bug put_ptr on start, separate put / get processes X-Git-Tag: 24jan2021_ls180~2575^2~140 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=88d5a593efc5d22c5eec1ae4ab731d9238978d65;p=litex.git fix bug put_ptr on start, separate put / get processes --- diff --git a/migScope/recorder.py b/migScope/recorder.py index e141a292..2d84ca02 100644 --- a/migScope/recorder.py +++ b/migScope/recorder.py @@ -44,26 +44,36 @@ class Storage: If(self.rst, self._put_cnt.eq(0), self._put_ptr.eq(0), - self._get_cnt.eq(0), - self._get_ptr.eq(0), self.run.eq(0) ).Elif(self.start & ~self.run, self._put_cnt.eq(0), - self._get_cnt.eq(0), - self._get_ptr.eq(self._put_ptr-self.offset), - self.run.eq(1) + self.run.eq(1), + If(self.put, + self._put_cnt.eq(self._put_cnt+1), + self._put_ptr.eq(self._put_ptr+1) + ) ).Elif(self.done, self.run.eq(0) ).Elif(self.put & ~self.done, self._put_cnt.eq(self._put_cnt+1), self._put_ptr.eq(self._put_ptr+1) + ), + + + If(self.rst, + self._get_cnt.eq(0), + self._get_ptr.eq(0), + ).Elif(self.start & ~self.run, + self._get_cnt.eq(0), + self._get_ptr.eq(self._put_ptr-self.offset-1), ).Elif(self.get, self._get_cnt.eq(self._get_cnt+1), self._get_ptr.eq(self._get_ptr+1) ) + ] comb += [ - If((self._put_cnt == size_minus_offset-1) & self.run, + If((self._put_cnt == size_minus_offset-2) & self.run, self.done.eq(1) ).Else( self.done.eq(0) @@ -208,7 +218,7 @@ class Recorder: self.storage.put_dat.eq(self.trig_dat) ] - + return self.bank.get_fragment()+\ self.storage.get_fragment()+self.sequencer.get_fragment()+\ Fragment(comb=comb, sync=sync)