mirror of
https://github.com/myhdl/myhdl.git
synced 2024-12-14 07:44:38 +08:00
added issue 185
This commit is contained in:
parent
310abe82ce
commit
0ec0cf7e94
30
myhdl/test/bugs/test_issue_185.py
Normal file
30
myhdl/test/bugs/test_issue_185.py
Normal file
@ -0,0 +1,30 @@
|
||||
from myhdl import *
|
||||
|
||||
def shift_left(c, a, b):
|
||||
c.next = a << b
|
||||
|
||||
@block
|
||||
def shifter(reset, clock, opa, opb, result):
|
||||
|
||||
@always_seq(clock.posedge, reset = reset)
|
||||
def assign():
|
||||
shift_left(result, opa, opb)
|
||||
|
||||
return assign
|
||||
|
||||
|
||||
def convert():
|
||||
|
||||
clock = Signal(bool(0))
|
||||
reset = ResetSignal(0, active=True, async=True)
|
||||
|
||||
opa = Signal(intbv(0)[4:])
|
||||
opb = Signal(intbv(0)[4:])
|
||||
result = Signal(intbv(0)[10:])
|
||||
|
||||
inst = shifter(reset, clock, opa, opb, result)
|
||||
inst.convert(hdl='VHDL')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
convert()
|
Loading…
x
Reference in New Issue
Block a user