Skip to content

Commit 09b3b56

Browse files
committed
Some type missmatches between to_verilog and from_verilog about functioncall are resolved.
1 parent 385c954 commit 09b3b56

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed
File renamed without changes.

tests/function/_function.py renamed to tests/_function/_function.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def mkLed():
4747
If(count == 1023)(
4848
count(0)
4949
).Else(
50-
#count( FunctionCall(inc.name, count, 1) + 1 - 1 )
50+
#count( FunctionCall(inc, count, 1) + 1 - 1 )
5151
count( inc.call(count, 1) + 1 - 1 )
5252
)
5353
))
File renamed without changes.

veriloggen/function.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ def next(self, r):
4848
return self.__call__(r)
4949

5050
def call(self, *args):
51-
return FunctionCall(self.name, *args)
51+
return FunctionCall(self, *args)
5252

5353
class FunctionCall(vtypes._Numeric):
54-
def __init__(self, name, *args):
55-
self.name = name
54+
def __init__(self, func, *args):
55+
self.func = func
5656
self.args = tuple(args)

veriloggen/to_verilog.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,9 @@ def visit_Function(self, node):
470470
return vast.Identifier(name)
471471

472472
def visit_FunctionCall(self, node):
473-
name = vast.Identifier(node.name)
473+
func = self.visit(node.func)
474474
args = tuple([ self.visit(a) for a in node.args ])
475-
return vast.FunctionCall(name, args)
475+
return vast.FunctionCall(func, args)
476476

477477
#---------------------------------------------------------------------------
478478
def visit_Task(self, node):

0 commit comments

Comments
 (0)