2013-05-22 11:11:09 -04:00
|
|
|
from migen.fhdl.std import *
|
2013-02-22 17:19:37 -05:00
|
|
|
from migen.genlib.complex import *
|
2013-01-05 08:18:36 -05:00
|
|
|
from migen.fhdl import verilog
|
|
|
|
|
2013-03-12 11:45:28 -04:00
|
|
|
class Example(Module):
|
2015-04-13 14:07:07 -04:00
|
|
|
def __init__(self):
|
|
|
|
w = Complex(32, 42)
|
|
|
|
A = SignalC(16)
|
|
|
|
B = SignalC(16)
|
|
|
|
Bw = SignalC(16)
|
|
|
|
C = SignalC(16)
|
|
|
|
D = SignalC(16)
|
|
|
|
self.comb += Bw.eq(B*w)
|
|
|
|
self.sync += [
|
|
|
|
C.eq(A + Bw),
|
|
|
|
D.eq(A - Bw)
|
|
|
|
]
|
2013-01-05 08:18:36 -05:00
|
|
|
|
2013-03-12 11:45:28 -04:00
|
|
|
print(verilog.convert(Example()))
|