forked from M-Labs/artiq
1
0
Fork 0

kasli_generic: add edge counter support

This commit is contained in:
Sebastien Bourdeauducq 2019-05-09 17:19:11 +08:00
parent ead9a42842
commit fda3cb2482
1 changed files with 6 additions and 1 deletions

View File

@ -20,9 +20,14 @@ def peripheral_dio(module, peripheral):
} }
if len(peripheral["ports"]) != 1: if len(peripheral["ports"]) != 1:
raise ValueError("wrong number of ports") raise ValueError("wrong number of ports")
if peripheral.get("edge_counter", False):
edge_counter_cls = edge_counter.SimpleEdgeCounter
else:
edge_counter_cls = None
eem.DIO.add_std(module, peripheral["ports"][0], eem.DIO.add_std(module, peripheral["ports"][0],
ttl_classes[peripheral["bank_direction_low"]], ttl_classes[peripheral["bank_direction_low"]],
ttl_classes[peripheral["bank_direction_high"]]) ttl_classes[peripheral["bank_direction_high"]],
edge_counter_cls=edge_counter_cls)
def peripheral_urukul(module, peripheral): def peripheral_urukul(module, peripheral):