Skip to content

Commit

Permalink
fhdl: pad support in fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Bourdeauducq committed Dec 10, 2011
1 parent 4d1a960 commit a49ecc4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions migen/fhdl/structure.py
Expand Up @@ -194,15 +194,20 @@ def __hash__(self):
return id(self) return id(self)


class Fragment: 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.comb = _sl(comb)
self.sync = _sl(sync) self.sync = _sl(sync)
self.instances = instances self.instances = instances
self.pads = pads


def __add__(self, other): 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): def __iadd__(self, other):
self.comb.l += other.comb.l self.comb.l += other.comb.l
self.sync.l += other.sync.l self.sync.l += other.sync.l
self.instances += other.instances self.instances += other.instances
return self self.pads |= other.pads
return self
2 changes: 2 additions & 0 deletions migen/fhdl/verilog.py
Expand Up @@ -118,6 +118,8 @@ def Convert(f, ios=set(), name="top", clkname="sys_clk", rstname="sys_rst"):


clks = Signal(name=clkname) clks = Signal(name=clkname)
rsts = Signal(name=rstname) rsts = Signal(name=rstname)

ios |= f.pads


sigs = ListSignals(f) sigs = ListSignals(f)
targets = ListTargets(f) targets = ListTargets(f)
Expand Down

0 comments on commit a49ecc4

Please sign in to comment.