global recorder
global dat_vcd
sum_tt = gen_truth_table("term")
- mila.trigger.sum.write(sum_tt)
+ mila.trigger.sum.set(sum_tt)
mila.recorder.reset()
- recorder.size(rec_size)
- mila.recorder.offset(rec_offset)
+ recorder.set_size(rec_size)
+ mila.recorder.set_offset(rec_offset)
mila.recorder.arm()
print("-Recorder [Armed]")
print("-Waiting Trigger...", end=' ')
print("-Receiving Data...", end=' ')
sys.stdout.flush()
- dat_vcd += mila.recorder.read(size)
+ dat_vcd += mila.recorder.pull(size)
print("[Done]")
print("Capturing ...")
print("----------------------")
-term.write(0x0000, 0xFFFF)
+term.set(0x0000, 0xFFFF)
capture(rec_size)
mila_layout = [
self.enable.eq(1)
)
- # trig_hit rising_edge
hit_rising = RisingEdge(self.hit)
# connexion
_pull_stb_rising.get_fragment()
#
- #Driver
+ # Driver
#
def reset(self):
self.interface.write(self.bank.get_base() + REC_RST_BASE, 1)
def is_done(self):
return self.interface.read(self.bank.get_base() + REC_DONE_BASE) == 1
- def size(self, dat):
+ def set_size(self, dat):
self.interface.write_n(self.bank.get_base() + REC_SIZE_BASE, dat, 16)
- def offset(self, dat):
+ def set_offset(self, dat):
self.interface.write_n(self.bank.get_base() + REC_OFFSET_BASE, dat, 16)
- def read(self, size):
+ def pull(self, size):
r = []
for i in range(size):
self.interface.write(self.bank.get_base() + REC_READ_BASE, 1)
self.reg_p = RegParams("term_reg", 0, width, 2)
self.reg = None
- def get_registers_glue(self):
+ def get_registers_comb(self):
comb = [self.t.eq(self.reg.field.r[0*self.width:1*self.width])]
comb += [self.m.eq(self.reg.field.r[1*self.width:2*self.width])]
return comb
def get_fragment(self):
comb = [self.o.eq((self.m & self.i) == self.t)]
- comb += self.get_registers_glue()
+ comb += self.get_registers_comb()
return Fragment(comb)
#
# Driver
#
- def write(self, dat, mask=None):
+ def set(self, dat, mask=None):
if mask is None:
mask = (2**self.width)-1
self.interface.write_n(self.reg_p.base, mask, self.width)
self.high = Signal(width)
self.o = Signal()
- def get_registers_glue(self):
+ def get_registers_comb(self):
comb = [self.low.eq(self.reg.field.r[0*self.width:1*self.width])]
comb += [self.low.eq(self.reg.field.r[1*self.width:2*self.width])]
return comb
def get_fragment(self):
comb = [self.o.eq((self.i >= self.low) & (self.i <= self.high))]
- comb += self.get_registers_glue()
+ comb += self.get_registers_comb()
return Fragment(comb)
#
# Driver
#
- def write_low(self, dat):
+ def set_low(self, dat):
self.interface.write_n(self.reg_p.base, dat ,self.width)
- def write_high(self, dat):
+ def set_high(self, dat):
self.interface.write_n(self.reg_p.base + self.reg_p.words, dat ,self.width)
class EdgeDetector:
self.bo = Signal()
self.o = Signal()
- def get_registers_glue(self):
+ def get_registers_comb(self):
comb = []
i = 0
if "R" in self.mode:
comb += [self.o.eq(self.ro | self.fo | self.bo)]
# Registers
- comb += self.get_registers_glue()
+ comb += self.get_registers_comb()
return Fragment(comb, sync)
return r
return 0
- def write_r(self, dat):
+ def set_r(self, dat):
self.interface.write_n(self.reg_p.base + self.get_offset("R"), dat ,self.width)
- def write_f(self, dat):
+ def set_f(self, dat):
self.interface.write_n(self.reg_p.base + self.get_offset("F"), dat ,self.width)
- def write_b(self, dat):
+ def set_b(self, dat):
self.interface.write_n(self.reg_p.base + self.get_offset("B"), dat ,self.width)
class Sum:
self._lut_port = self._mem.get_port()
self._prog_port = self._mem.get_port(write_capable=True)
- def get_registers_glue(self):
+ def get_registers_comb(self):
comb = [
self.prog_adr.eq(self.reg.field.r[0:16]),
self.prog_dat.eq(self.reg.field.r[16]),
self.o.eq(self._o)
]
- comb += self.get_registers_glue()
+ comb += self.get_registers_comb()
return Fragment(comb, specials={self._mem})
#
- #Driver
+ # Driver
#
- def write(self, truth_table):
+ def set(self, truth_table):
for i in range(len(truth_table)):
val = truth_table[i]
we = 1<<17