Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fhdl: pad support in fragments

  • Loading branch information...
commit a49ecc4331a373b9a63a836ca2523db63f88d1e7 1 parent 4d1a960
@sbourdeauducq sbourdeauducq authored
Showing with 10 additions and 3 deletions.
  1. +8 −3 migen/fhdl/structure.py
  2. +2 −0  migen/fhdl/verilog.py
View
11 migen/fhdl/structure.py
@@ -194,15 +194,20 @@ def __hash__(self):
return id(self)
class Fragment:
- def __init__(self, comb=StatementList(), sync=StatementList(), instances=[]):
+ def __init__(self, comb=StatementList(), sync=StatementList(), instances=[], pads=set()):
self.comb = _sl(comb)
self.sync = _sl(sync)
self.instances = instances
+ self.pads = pads
def __add__(self, other):
- return Fragment(self.comb.l + other.comb.l, self.sync.l + other.sync.l, self.instances + other.instances)
+ return Fragment(self.comb.l + other.comb.l,
+ self.sync.l + other.sync.l,
+ self.instances + other.instances,
+ self.pads | other.pads)
def __iadd__(self, other):
self.comb.l += other.comb.l
self.sync.l += other.sync.l
self.instances += other.instances
- return self
+ self.pads |= other.pads
+ return self
View
2  migen/fhdl/verilog.py
@@ -118,6 +118,8 @@ def Convert(f, ios=set(), name="top", clkname="sys_clk", rstname="sys_rst"):
clks = Signal(name=clkname)
rsts = Signal(name=rstname)
+
+ ios |= f.pads
sigs = ListSignals(f)
targets = ListTargets(f)
Please sign in to comment.
Something went wrong with that request. Please try again.