else:
s.wr(self.ce, 1)
print("Cycle: " + str(s.cycle_counter) + " Count: " + str(s.rd(self.count)))
+ do_simulation.initialize = True
def get_fragment(self):
sync = [If(self.ce, self.count.eq(self.count + 1))]
self.mem = Memory(16, 2**12, p, init=list(range(20)))
def do_simulation(self, s):
- if s.cycle_counter >= 0:
- value = s.rd(self.mem, s.cycle_counter)
- print(value)
- if value == 10:
- s.interrupt = True
+ value = s.rd(self.mem, s.cycle_counter)
+ print(value)
+ if value == 10:
+ s.interrupt = True
def get_fragment(self):
return Fragment(memories=[self.mem], sim=[self.do_simulation])