Skip to content

Commit

Permalink
Merge pull request #135 from nturley/patch-1
Browse files Browse the repository at this point in the history
add test for issue 134
  • Loading branch information
jandecaluwe committed Nov 29, 2015
2 parents 9dffa04 + d60568a commit 480d228
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions myhdl/test/bugs/test_issue134.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""
When an interface signal gets passed into a function, it
can get renamed to the name of the argument. When the
function is called multiple times, this causes name collisions """

from __future__ import absolute_import
import pytest
from myhdl import *
from myhdl.conversion import analyze

class AB:
def __init__(self):
self.a = Signal(bool(False))
self.b = Signal(bool(False))

def invert(sigin, sigout):
@always_comb
def foo():
sigout.next = not sigin
return foo

def issue_134(ab_in, ab_out):
""" Instantiate an inverter for each signal """
inverta = invert(ab_in.a, ab_out.a)
invertb = invert(ab_in.b, ab_out.b)
return inverta, invertb

@pytest.mark.xfail
def test_issue_134():
""" check for port name collision"""
assert analyze(issue_134, AB(), AB()) == 0

0 comments on commit 480d228

Please sign in to comment.