30 lines
630 B
Python
30 lines
630 B
Python
|
from migen import *
|
||
|
from migen.build.generic_platform import *
|
||
|
|
||
|
|
||
|
def _eem_signal(i):
|
||
|
n = "d{}".format(i)
|
||
|
if i == 0:
|
||
|
n += "_cc"
|
||
|
return n
|
||
|
|
||
|
|
||
|
def _eem_pin(eem, i, pol):
|
||
|
return "eem{}:{}_{}".format(eem, _eem_signal(i), pol)
|
||
|
|
||
|
|
||
|
def default_iostandard(eem):
|
||
|
return IOStandard("LVDS_25")
|
||
|
|
||
|
|
||
|
def diff_io(eem, iostandard=default_iostandard):
|
||
|
return [("dio{}".format(eem), i,
|
||
|
Subsignal("p", Pins(_eem_pin(eem, i, "p"))),
|
||
|
Subsignal("n", Pins(_eem_pin(eem, i, "n"))),
|
||
|
iostandard(eem))
|
||
|
for i in range(8)]
|
||
|
|
||
|
|
||
|
def generate_pads(platform, eem):
|
||
|
platform.add_extension(diff_io(eem))
|