Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enh] use Misc() properties in trellis' PCF #221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions migen/build/lattice/icestorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,25 @@


def _build_pcf(named_sc, named_pc):
diamond2trellis_tr = {
"PULLUP_RESISTOR" : "-pullup_resistor",
"PULLUP" : "-pullup 1",
}
r = ""
for sig, pins, others, resname in named_sc:
misc = ""
for other in others:
if isinstance(other, Misc):
arg = other.misc
for diamond_arg in diamond2trellis_tr:
if diamond_arg in arg:
arg = arg.replace(diamond_arg, diamond2trellis_tr[diamond_arg])
misc += ' ' + arg
if len(pins) > 1:
for bit, pin in enumerate(pins):
r += "set_io {}[{}] {}\n".format(sig, bit, pin)
r += "set_io{} {}[{}] {}\n".format(misc, sig, bit, pin)
else:
r += "set_io {} {}\n".format(sig, pins[0])
r += "set_io{} {} {}\n".format(misc, sig, pins[0])
if named_pc:
r += "\n" + "\n\n".join(named_pc)
return r
Expand Down