2019-06-24 04:04:55 -04:00
|
|
|
# This file is Copyright (c) 2015-2018 Florent Kermarrec <florent@enjoy-digital.fr>
|
|
|
|
# License: BSD
|
|
|
|
|
2018-02-23 07:43:47 -05:00
|
|
|
from migen import *
|
2015-09-12 12:19:30 -04:00
|
|
|
|
|
|
|
from targets import *
|
|
|
|
|
2015-11-11 18:56:49 -05:00
|
|
|
from litex.build.generic_platform import *
|
|
|
|
from litex.build.xilinx.platform import XilinxPlatform
|
|
|
|
|
2020-02-26 16:02:14 -05:00
|
|
|
from litex.soc.integration.soc_core import SoCMini
|
2015-09-27 12:47:30 -04:00
|
|
|
|
2016-03-31 05:37:00 -04:00
|
|
|
from litescope import LiteScopeAnalyzer
|
2015-09-12 12:19:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
_io = [
|
2015-12-27 09:42:37 -05:00
|
|
|
("sys_clock", 0, Pins(1)),
|
|
|
|
("sys_reset", 1, Pins(1)),
|
2015-09-12 12:19:30 -04:00
|
|
|
("serial", 0,
|
2015-11-19 09:00:18 -05:00
|
|
|
Subsignal("tx", Pins(1)),
|
|
|
|
Subsignal("rx", Pins(1)),
|
2015-09-12 12:19:30 -04:00
|
|
|
),
|
2015-11-19 09:00:18 -05:00
|
|
|
("bus", 0, Pins(128))
|
2015-09-12 12:19:30 -04:00
|
|
|
]
|
|
|
|
|
2020-02-26 16:02:14 -05:00
|
|
|
|
2015-09-12 12:19:30 -04:00
|
|
|
class CorePlatform(XilinxPlatform):
|
|
|
|
name = "core"
|
|
|
|
def __init__(self):
|
|
|
|
XilinxPlatform.__init__(self, "", _io)
|
|
|
|
|
|
|
|
|
2020-02-26 16:02:14 -05:00
|
|
|
class Core(SoCMini):
|
2015-09-12 12:19:30 -04:00
|
|
|
platform = CorePlatform()
|
|
|
|
def __init__(self, platform, clk_freq=100*1000000):
|
|
|
|
self.clock_domains.cd_sys = ClockDomain("sys")
|
2015-12-27 09:42:37 -05:00
|
|
|
self.comb += [
|
|
|
|
self.cd_sys.clk.eq(platform.request("sys_clock")),
|
|
|
|
self.cd_sys.rst.eq(platform.request("sys_reset"))
|
|
|
|
]
|
2020-02-26 16:02:14 -05:00
|
|
|
SoCMini.__init__(self, platform, clk_freq, csr_data_width=32,
|
|
|
|
with_uart=True, uart_name="bridge",
|
|
|
|
ident="Litescope example design", ident_version=True,
|
2015-09-12 12:19:30 -04:00
|
|
|
)
|
|
|
|
|
2020-02-26 16:02:14 -05:00
|
|
|
self.submodules.analyzer = LiteScopeAnalyzer(platform.request("bus"), 512)
|
|
|
|
self.add_csr("analyzer")
|
2015-09-12 12:19:30 -04:00
|
|
|
|
|
|
|
default_subtarget = Core
|