- def putpb(self, data):
- self.put(self.ss_item, self.es_item, self.out_python, data)
-
- def putb(self, data):
- self.put(self.ss_item, self.es_item, self.out_ann, data)
-
- def putpw(self, data):
- self.put(self.ss_word, self.es_word, self.out_python, data)
-
- def putw(self, data):
- self.put(self.ss_word, self.es_word, self.out_ann, data)
-
- def handle_bits(self, item, used_pins):
-
- # If a word was previously accumulated, then emit its annotation
- # now after its end samplenumber became available.
- if self.saved_word is not None:
- if self.options['wordsize'] > 0:
- self.es_word = self.samplenum
- self.putw([1, [self.fmt_word.format(self.saved_word)]])
- self.putpw(['WORD', self.saved_word])
- self.saved_word = None
-
- # Defer annotations for individual items until the next sample
- # is taken, and the previous sample's end samplenumber has
- # become available.
- if self.first:
- # Save the start sample and item for later (no output yet).
- self.ss_item = self.samplenum
- self.first = False
- self.saved_item = item
- else:
- # Output the saved item (from the last CLK edge to the current).
- self.es_item = self.samplenum
- self.putpb(['ITEM', self.saved_item])
- self.putb([0, [self.fmt_item.format(self.saved_item)]])
- self.ss_item = self.samplenum
- self.saved_item = item
-
- # Get as many items as the configured wordsize specifies.
- if not self.items:
- self.ss_word = self.samplenum
- self.items.append(item)
- ws = self.options['wordsize']
- if len(self.items) < ws:
+ def putg(self, ss, es, ann, txts):
+ self.put(ss, es, self.out_ann, [ann, txts])
+
+ def putpy(self, ss, es, ann, data):
+ self.put(ss, es, self.out_python, [ann, data])
+
+ def flush_word(self, bus_width):
+ if not self.word_items: