- with m.If(self.s):
- m.d.sync += q_int.eq(1)
- with m.Elif(self.r):
- m.d.sync += q_int.eq(0)
-
- m.d.comb += self.q.eq(q_int)
- m.d.comb += self.qn.eq(~q_int)
+ if self.sync:
+ with m.If(self.s):
+ m.d.sync += q_int.eq(1)
+ with m.Elif(self.r):
+ m.d.sync += q_int.eq(0)
+ m.d.comb += self.q.eq(q_int)
+ m.d.comb += self.qn.eq(~q_int)
+ else:
+ with m.If(self.s):
+ m.d.sync += q_int.eq(1)
+ m.d.comb += self.q.eq(1)
+ m.d.comb += self.qn.eq(0)
+ with m.Elif(self.r):
+ m.d.sync += q_int.eq(0)
+ m.d.comb += self.q.eq(0)
+ m.d.comb += self.qn.eq(1)
+ with m.Else():
+ m.d.comb += self.q.eq(q_int)
+ m.d.comb += self.qn.eq(~q_int)