# Rising Edge
if "R" in self.mode:
if self.pipe:
- sync += [self.ro.eq(self.i & (~self.i_d))]
+ sync += [self.ro.eq(self.r_mask & self.i & (~self.i_d))]
else:
- comb += [self.ro.eq(self.i & (~ self.i_d))]
+ comb += [self.ro.eq(self.r_mask & self.i & (~ self.i_d))]
else:
comb += [self.ro.eq(0)]
# Falling Edge
if "F" in self.mode:
if self.pipe:
- sync += [self.fo.eq((~ self.i) & self.i_d)]
+ sync += [self.fo.eq(self.f_mask & (~ self.i) & self.i_d)]
else:
- comb += [self.fo.eq((~ self.i) & self.i_d)]
+ comb += [self.fo.eq(self.f_mask & (~ self.i) & self.i_d)]
else:
comb += [self.fo.eq(0)]
# Both
if "B" in self.mode:
if self.pipe:
- sync += [self.bo.eq(self.i != self.i_d)]
+ sync += [self.bo.eq(self.b_mask & self.i != self.i_d)]
else:
- comb += [self.bo.eq(self.i != self.i_d)]
+ comb += [self.bo.eq(self.b_mask & self.i != self.i_d)]
else:
comb += [self.bo.eq(0)]
#Output
comb+= [self.dat.eq(self.in_dat)]
- return frag + _sum.get_fragment() + Fragment(comb=comb, sync=sync)
+ return frag + Fragment(comb=comb, sync=sync)
class Storage:
import migScope
#
-#Test RangeDetector
+#Test Term
#
#term = migScope.Term(32,True)
#v = verilog.convert(term.get_fragment())
#v = verilog.convert(recorder.get_fragment())
#print(v)
-
+#
+#Test Trigger
+#
term0 = migScope.Term(32)
-term1 = migScope.Term(32)
-term2 = migScope.Term(32)
+term1 = migScope.RangeDetector(32)
+term2 = migScope.EdgeDetector(32)
term3 = migScope.Term(32)
trigger0 = migScope.Trigger(0,32,64,[term0, term1, term2, term3])
v = verilog.convert(trigger0.get_fragment())
print(v)
+