Skip to content

Commit 46ed587

Browse files
committed
types.util.connect_port() is replaced.
1 parent 95dca85 commit 46ed587

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

veriloggen/core/vtypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def connect(self, value):
432432
wire_self = self.module.TmpWireLike(self)
433433
wire_self.assign(value)
434434
self.module.Always()(self(wire_self, blk=True))
435-
elif isinstance(self, Wire):
435+
elif isinstance(self, (Wire, Output)):
436436
self.assign(value)
437437
else:
438438
raise TypeError('connect() is not supported')

veriloggen/types/fifo.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ def __init__(self, m, name=None, datawidth=32, itype=None, otype=None,
3434
m, otype, name_almost_full, initval=0)
3535

3636
def connect(self, targ):
37-
util.connect_port(self.enq, targ.enq)
38-
util.connect_port(self.wdata, targ.wdata)
39-
util.connect_port(targ.full, self.full)
40-
util.connect_port(targ.almost_full, self.almost_full)
37+
self.enq.connect(targ.enq)
38+
self.wdata.connect(targ.wdata)
39+
targ.full.connect(self.full)
40+
targ.almost_full.connect(self.almost_full)
4141

4242

4343
class FifoReadInterface(object):
@@ -67,10 +67,10 @@ def __init__(self, m, name=None, datawidth=32, itype=None, otype=None,
6767
m, otype, name_almost_empty, initval=0)
6868

6969
def connect(self, targ):
70-
util.connect_port(self.deq, targ.deq)
71-
util.connect_port(targ.rdata, self.rdata)
72-
util.connect_port(targ.empty, self.empty)
73-
util.connect_port(targ.almost_empty, self.almost_empty)
70+
self.deq.connect(targ.deq)
71+
targ.rdata.connect(self.rdata)
72+
targ.empty.connect(self.empty)
73+
targ.almost_empty.connect(self.almost_empty)
7474

7575

7676
class FifoWriteSlaveInterface(FifoWriteInterface):

veriloggen/types/ram.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ def __init__(self, m, name=None, datawidth=32, addrwidth=10,
5252
self.enable = util.make_port(m, itype, name_enable, initval=0)
5353

5454
def connect(self, targ):
55-
util.connect_port(self.addr, targ.addr)
56-
util.connect_port(targ.rdata, self.rdata)
57-
util.connect_port(self.wdata, targ.wdata)
58-
util.connect_port(self.wenable, targ.wenable)
55+
self.addr.connect(targ.addr)
56+
targ.rdata.connect(self.rdata)
57+
self.wdata.connect(targ.wdata)
58+
self.wenable.connect(targ.wenable)
5959
if hasattr(self, 'enable'):
6060
if hasattr(targ, 'enable'):
61-
util.connect_port(self.enable, targ.enable)
61+
self.enable.connect(targ.enable)
6262
else:
63-
util.connect_port(self.enable, 1)
63+
self.enable.connect(1)
6464
else:
6565
if hasattr(targ, 'enable'):
6666
raise ValueError('no enable port')

0 commit comments

Comments
 (0)