1
0
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:
vikram9866 2016-07-18 18:10:43 +05:30
parent 310abe82ce
commit 0ec0cf7e94

View 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()