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/nmigen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 371dc8bebe0f
Choose a base ref
...
head repository: m-labs/nmigen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c8e92c0612ed
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Apr 22, 2019

  1. compat.fhdl.specials: fix Tristate, TSTriple.

    * fix TSTriple instance.
    * TSTriple, Tristate: tag as Elaboratable
    peteut authored and whitequark committed Apr 22, 2019
    Copy the full SHA
    c8e92c0 View commit details
Showing with 4 additions and 3 deletions.
  1. +4 −3 nmigen/compat/fhdl/specials.py
7 changes: 4 additions & 3 deletions nmigen/compat/fhdl/specials.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

from ...tools import deprecated, extend
from ...hdl.ast import *
from ...hdl.ir import Elaboratable
from ...hdl.mem import Memory as NativeMemory
from ...hdl.ir import Fragment, Instance
from .module import Module as CompatModule
@@ -10,7 +11,7 @@
__all__ = ["TSTriple", "Instance", "Memory", "READ_FIRST", "WRITE_FIRST", "NO_CHANGE"]


class TSTriple:
class TSTriple(Elaboratable):
def __init__(self, bits_sign=None, min=None, max=None, reset_o=0, reset_oe=0, reset_i=0,
name=None):
self.o = Signal(bits_sign, min=min, max=max, reset=reset_o,
@@ -30,7 +31,7 @@ def get_tristate(self, io):
return Tristate(io, self.o, self.oe, self.i)


class Tristate:
class Tristate(Elaboratable):
def __init__(self, target, o, oe, i=None):
self.target = target
self.triple = TSTriple()
@@ -49,7 +50,7 @@ def elaborate(self, platform):
p_WIDTH=len(self.target),
i_EN=self.triple.oe,
i_A=self.triple.o,
o_Y=self.io,
o_Y=self.target,
)

f = m.elaborate(platform)