Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/migen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f26ad97624f8
Choose a base ref
...
head repository: m-labs/migen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 25e4d2a2db43
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Apr 5, 2015

  1. Copy the full SHA
    8798ee8 View commit details
  2. Copy the full SHA
    25e4d2a View commit details
Showing with 15 additions and 13 deletions.
  1. +2 −2 examples/basic/two_dividers.py
  2. +2 −2 migen/fhdl/decorators.py
  3. +2 −0 migen/fhdl/std.py
  4. +3 −3 migen/genlib/fifo.py
  5. +6 −6 migen/genlib/misc.py
4 changes: 2 additions & 2 deletions examples/basic/two_dividers.py
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@
from migen.fhdl import verilog
from migen.genlib import divider

@DecorateModule(InsertReset)
@DecorateModule(InsertCE)
@ResetInserter()
@CEInserter()
class Example(Module):
def __init__(self, width):
d1 = divider.Divider(width)
4 changes: 2 additions & 2 deletions migen/fhdl/decorators.py
Original file line number Diff line number Diff line change
@@ -48,11 +48,11 @@ def __call__(self, victim):

@classmethod
def adhoc(cls, i, *args, **kwargs):
warnings.warn("deprecated, use the plain transformer", DeprecationWarning)
warnings.warn("deprecated, use the plain transformer", DeprecationWarning, 2)
return cls(*args, **kwargs)(i)

def DecorateModule(transformer, *args, **kwargs):
warnings.warn("deprecated, use the plain transformer", DeprecationWarning)
warnings.warn("deprecated, use the plain transformer", DeprecationWarning, 2)
return transformer.__self__(*args, **kwargs)

class ControlInserter(ModuleTransformer):
2 changes: 2 additions & 0 deletions migen/fhdl/std.py
Original file line number Diff line number Diff line change
@@ -3,3 +3,5 @@
from migen.fhdl.specials import TSTriple, Instance, Memory
from migen.fhdl.bitcontainer import log2_int, bits_for, flen, fiter, fslice, freversed
from migen.fhdl.decorators import DecorateModule, InsertCE, InsertReset, RenameClockDomains
from migen.fhdl.decorators import (CEInserter, ResetInserter,
ClockDomainsRenamer, ModuleTransformer)
6 changes: 3 additions & 3 deletions migen/genlib/fifo.py
Original file line number Diff line number Diff line change
@@ -158,7 +158,7 @@ class AsyncFIFO(Module, _FIFOInterface):
"""Asynchronous FIFO (first in, first out)
Read and write interfaces are accessed from different clock domains,
named `read` and `write`. Use `RenameClockDomains` to rename to
named `read` and `write`. Use `ClockDomainsRenamer` to rename to
other names.
{interface}
@@ -172,8 +172,8 @@ def __init__(self, width_or_layout, depth):

depth_bits = log2_int(depth, True)

produce = RenameClockDomains(GrayCounter(depth_bits+1), "write")
consume = RenameClockDomains(GrayCounter(depth_bits+1), "read")
produce = ClockDomainsRenamer("write")(GrayCounter(depth_bits+1))
consume = ClockDomainsRenamer("read")(GrayCounter(depth_bits+1))
self.submodules += produce, consume
self.comb += [
produce.ce.eq(self.writable & self.we),
12 changes: 6 additions & 6 deletions migen/genlib/misc.py
Original file line number Diff line number Diff line change
@@ -86,24 +86,24 @@ def get_cond(e):
sync.append(counterlogic)
return sync

@DecorateModule(InsertReset)
@DecorateModule(InsertCE)
@ResetInserter()
@CEInserter()
class FlipFlop(Module):
def __init__(self, *args, **kwargs):
self.d = Signal(*args, **kwargs)
self.q = Signal(*args, **kwargs)
self.sync += self.q.eq(self.d)

@DecorateModule(InsertReset)
@DecorateModule(InsertCE)
@ResetInserter()
@CEInserter()
class Counter(Module):
def __init__(self, *args, increment=1, **kwargs):
self.value = Signal(*args, **kwargs)
self.width = flen(self.value)
self.sync += self.value.eq(self.value+increment)

@DecorateModule(InsertReset)
@DecorateModule(InsertCE)
@ResetInserter()
@CEInserter()
class Timeout(Module):
def __init__(self, length):
self.reached = Signal()