2013-05-22 11:10:13 -04:00
|
|
|
from migen.fhdl.std import *
|
2011-12-13 11:33:12 -05:00
|
|
|
from migen.bus import wishbone
|
|
|
|
|
2013-03-10 14:32:38 -04:00
|
|
|
class LM32(Module):
|
2011-12-13 11:33:12 -05:00
|
|
|
def __init__(self):
|
2012-02-15 10:55:13 -05:00
|
|
|
self.ibus = i = wishbone.Interface()
|
|
|
|
self.dbus = d = wishbone.Interface()
|
2012-11-29 17:38:04 -05:00
|
|
|
self.interrupt = Signal(32)
|
2011-12-18 16:02:05 -05:00
|
|
|
self.ext_break = Signal()
|
2013-03-10 14:32:38 -04:00
|
|
|
|
|
|
|
###
|
|
|
|
|
|
|
|
i_adr_o = Signal(32)
|
|
|
|
d_adr_o = Signal(32)
|
|
|
|
self.specials += Instance("lm32_top",
|
2013-03-18 12:44:01 -04:00
|
|
|
Instance.Input("clk_i", ClockSignal()),
|
|
|
|
Instance.Input("rst_i", ResetSignal()),
|
2012-02-15 10:55:13 -05:00
|
|
|
|
2012-09-10 17:47:06 -04:00
|
|
|
Instance.Input("interrupt", self.interrupt),
|
|
|
|
#Instance.Input("ext_break", self.ext_break),
|
|
|
|
|
2013-03-10 14:32:38 -04:00
|
|
|
Instance.Output("I_ADR_O", i_adr_o),
|
2012-09-10 17:47:06 -04:00
|
|
|
Instance.Output("I_DAT_O", i.dat_w),
|
|
|
|
Instance.Output("I_SEL_O", i.sel),
|
|
|
|
Instance.Output("I_CYC_O", i.cyc),
|
|
|
|
Instance.Output("I_STB_O", i.stb),
|
|
|
|
Instance.Output("I_WE_O", i.we),
|
|
|
|
Instance.Output("I_CTI_O", i.cti),
|
2012-12-06 14:57:00 -05:00
|
|
|
Instance.Output("I_LOCK_O"),
|
2012-09-10 17:47:06 -04:00
|
|
|
Instance.Output("I_BTE_O", i.bte),
|
|
|
|
Instance.Input("I_DAT_I", i.dat_r),
|
|
|
|
Instance.Input("I_ACK_I", i.ack),
|
|
|
|
Instance.Input("I_ERR_I", i.err),
|
2012-12-06 14:57:00 -05:00
|
|
|
Instance.Input("I_RTY_I", 0),
|
2012-02-15 10:55:13 -05:00
|
|
|
|
2013-03-10 14:32:38 -04:00
|
|
|
Instance.Output("D_ADR_O", d_adr_o),
|
2012-09-10 17:47:06 -04:00
|
|
|
Instance.Output("D_DAT_O", d.dat_w),
|
|
|
|
Instance.Output("D_SEL_O", d.sel),
|
|
|
|
Instance.Output("D_CYC_O", d.cyc),
|
|
|
|
Instance.Output("D_STB_O", d.stb),
|
|
|
|
Instance.Output("D_WE_O", d.we),
|
|
|
|
Instance.Output("D_CTI_O", d.cti),
|
2012-12-06 14:57:00 -05:00
|
|
|
Instance.Output("D_LOCK_O"),
|
2012-09-10 17:47:06 -04:00
|
|
|
Instance.Output("D_BTE_O", d.bte),
|
|
|
|
Instance.Input("D_DAT_I", d.dat_r),
|
|
|
|
Instance.Input("D_ACK_I", d.ack),
|
|
|
|
Instance.Input("D_ERR_I", d.err),
|
2012-12-06 14:57:00 -05:00
|
|
|
Instance.Input("D_RTY_I", 0))
|
2011-12-13 11:33:12 -05:00
|
|
|
|
2013-03-10 14:32:38 -04:00
|
|
|
self.comb += [
|
|
|
|
self.ibus.adr.eq(i_adr_o[2:]),
|
|
|
|
self.dbus.adr.eq(d_adr_o[2:])
|
2011-12-13 11:33:12 -05:00
|
|
|
]
|