From: Florent Kermarrec Date: Mon, 29 Oct 2018 10:46:03 +0000 (+0100) Subject: boards/targets/versaecp55g: use new iowrapper support, basic led blink and ios working :) X-Git-Tag: 24jan2021_ls180~1546 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4eb314a25212e02ad13ed35f0a44c420648f1fff;p=litex.git boards/targets/versaecp55g: use new iowrapper support, basic led blink and ios working :) --- diff --git a/litex/boards/targets/versaecp55g_prjtrellis.py b/litex/boards/targets/versaecp55g_prjtrellis.py index fd972ed1..47c2a585 100755 --- a/litex/boards/targets/versaecp55g_prjtrellis.py +++ b/litex/boards/targets/versaecp55g_prjtrellis.py @@ -11,44 +11,16 @@ class BaseSoC(Module): def __init__(self, platform): self.clock_domains.cd_sys = ClockDomain() - sys_clk_pads = platform.request("clk100") - btn_pads = platform.request("user_dip_btn") - led0_pads = platform.request("user_led", 0) - led1_pads = platform.request("user_led", 1) - - # FIXME: no constraint file for now with prjtrellis - platform.lookup_request("clk100").attr.add(("LOC", "P3")) - platform.lookup_request("clk100").attr.add(("IO_TYPE", "LVDS")) - platform.lookup_request("user_dip_btn").attr.add(("LOC", "H2")) - platform.lookup_request("user_dip_btn").attr.add(("IO_TYPE", "LVCMOS15")) - platform.lookup_request("user_led", 0).attr.add(("LOC", "E16")) - platform.lookup_request("user_led", 0).attr.add(("IO_TYPE", "LVCMOS25")) - platform.lookup_request("user_led", 1).attr.add(("LOC", "D17")) - platform.lookup_request("user_led", 1).attr.add(("IO_TYPE", "LVCMOS25")) - - # FIXME: add TRELLIS_IO instance on all inputs/outputs - sys_clk_pads_i = Signal() - btn_pads_i = Signal() - led0_pads_i = Signal() - led1_pads_i = Signal() - self.specials += [ - Instance("TRELLIS_IO", p_DIR="INPUT", io_B=sys_clk_pads, o_O=sys_clk_pads_i), - Instance("TRELLIS_IO", p_DIR="INPUT", io_B=btn_pads, o_O=btn_pads_i), - Instance("TRELLIS_IO", p_DIR="OUTPUT", io_B=led0_pads, i_I=led0_pads_i), - Instance("TRELLIS_IO", p_DIR="OUTPUT", io_B=led1_pads, i_I=led1_pads_i), - ] - # crg - self.comb += self.cd_sys.clk.eq(sys_clk_pads_i) + self.comb += self.cd_sys.clk.eq(platform.request("clk100")) # led0 (blink) counter = Signal(32) self.sync += counter.eq(counter + 1) - self.comb += led0_pads_i.eq(counter[26]) + self.comb += platform.request("user_led", 0).eq(counter[26]) # led1 (btn) - self.comb += led1_pads_i.eq(btn_pads_i) - + self.comb += platform.request("user_led", 1).eq(platform.request("user_dip_btn", 0)) def main(): platform = versaecp55g.Platform(toolchain="prjtrellis")