def map_drivers(self, fragment, new_fragment):
for domain, signal in fragment.iter_drivers():
- new_fragment.drive(signal, domain)
+ new_fragment.add_driver(signal, domain)
def on_fragment(self, fragment):
new_fragment = Fragment()
if domain in self.domain_map:
domain = self.domain_map[domain]
for signal in signals:
- new_fragment.drive(signal, domain)
+ new_fragment.add_driver(signal, domain)
class DomainLowerer(FragmentTransformer, ValueTransformer, StatementTransformer):
self.s4.eq(ClockSignal("other")),
self.s5.eq(ResetSignal("other")),
)
- f.drive(self.s1, None)
- f.drive(self.s2, None)
- f.drive(self.s3, "sync")
+ f.add_driver(self.s1, None)
+ f.add_driver(self.s2, None)
+ f.add_driver(self.s3, "sync")
f = DomainRenamer("pix")(f)
self.assertRepr(f.statements, """
f.add_statements(
self.s1.eq(1)
)
- f.drive(self.s1, "sync")
+ f.add_driver(self.s1, "sync")
f = ResetInserter(self.c1)(f)
self.assertRepr(f.statements, """
self.s2.eq(0),
)
f.add_domains(ClockDomain("sync"))
- f.drive(self.s1, "sync")
- f.drive(self.s2, "pix")
+ f.add_driver(self.s1, "sync")
+ f.add_driver(self.s2, "pix")
f = ResetInserter({"pix": self.c1})(f)
self.assertRepr(f.statements, """
f.add_statements(
self.s2.eq(0)
)
- f.drive(self.s2, "sync")
+ f.add_driver(self.s2, "sync")
f = ResetInserter(self.c1)(f)
self.assertRepr(f.statements, """
f.add_statements(
self.s3.eq(0)
)
- f.drive(self.s3, "sync")
+ f.add_driver(self.s3, "sync")
f = ResetInserter(self.c1)(f)
self.assertRepr(f.statements, """
f.add_statements(
self.s1.eq(1)
)
- f.drive(self.s1, "sync")
+ f.add_driver(self.s1, "sync")
f = CEInserter(self.c1)(f)
self.assertRepr(f.statements, """
self.s1.eq(1),
self.s2.eq(0),
)
- f.drive(self.s1, "sync")
- f.drive(self.s2, "pix")
+ f.add_driver(self.s1, "sync")
+ f.add_driver(self.s2, "pix")
f = CEInserter({"pix": self.c1})(f)
self.assertRepr(f.statements, """
f1.add_statements(
self.s1.eq(1)
)
- f1.drive(self.s1, "sync")
+ f1.add_driver(self.s1, "sync")
f2 = Fragment()
f2.add_statements(
self.s2.eq(1)
)
- f2.drive(self.s2, "sync")
+ f2.add_driver(self.s2, "sync")
f1.add_subfragment(f2)
f1 = CEInserter(self.c1)(f1)