get arty a7-100t functional
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 4 Feb 2022 13:37:08 +0000 (13:37 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 4 Feb 2022 13:37:08 +0000 (13:37 +0000)
Makefile
README.txt
sim.py
versa_ecp5.py

index 1bfeeb3e7747128f2886a762cad0a3d11ac29109..18916edcccdf0a7976ff25b59091b4440ac2dd6a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -42,3 +42,7 @@ versaecp5:
 
 versaecp5load:
        ./versa_ecp5.py --sys-clk-freq=55e6 --load
+
+artya7100t:
+       python3 ./versa_ecp5.py --sys-clk-freq=100e6 --build  --fpga=artya7100t \
+                    --toolchain=symbiflow
index 3d008ebf7092cfa3d0f73115338064932c0df034..b7eb1414fe9951a5cb62fff6e67f5225248fd4a4 100644 (file)
@@ -13,3 +13,10 @@ same thing: first build libresoc.v and copy it to the libresoc/ directory
 
 ./versa_ecp5.py --sys-clk-freq=55e6 --build --yosys-nowidelut
 ./versa_ecp5.py --sys-clk-freq=55e6 --load
+
+# arty a7 build
+
+export PATH=$PATH:/usr/local/symbiflow/bin/:/usr/local/symbiflow/vtr/bin/
+./versa_ecp5.py --sys-clk-freq=100e6 --build  --fpga=artya7100t \
+                    --toolchain=symbiflow
+
diff --git a/sim.py b/sim.py
index 44fcf1b5da8936dc254d39fc740a6ee2d17b17d9..f4ec8dce544e5ede1ec909d86cd28a7b3d2df08b 100755 (executable)
--- a/sim.py
+++ b/sim.py
@@ -59,10 +59,10 @@ class LibreSoCSim(SoCSDRAM):
         #ram_fname = "/tmp/test.bin"
         #ram_fname = "/home/lkcl/src/libresoc/microwatt/" \
         #            "micropython/firmware.bin"
-        #ram_fname = "/home/lkcl/src/libresoc/microwatt/" \
-        #            "tests/xics/xics.bin"
         ram_fname = "/home/lkcl/src/libresoc/microwatt/" \
-                    "tests/decrementer/decrementer.bin"
+                    "tests/xics/xics.bin"
+        #ram_fname = "/home/lkcl/src/libresoc/microwatt/" \
+        #            "tests/decrementer/decrementer.bin"
         #ram_fname = "/home/lkcl/src/libresoc/microwatt/" \
         #            "hello_world/hello_world.bin"
         ram_fname = "/home/lkcl/src/libresoc/microwatt/" \
index 73f3dcd8efddbfe45b9816963cc397c080627155..4b6b1284dda4a571b2d178ccb0ccff39b0dcf859 100755 (executable)
@@ -6,6 +6,9 @@ import sys
 
 import litex_boards.targets.versa_ecp5 as versa_ecp5
 import litex_boards.targets.ulx3s as ulx3s
+#import litex_boards.targets.arty as arty
+import digilent_arty as arty
+
 from litex.build.lattice.trellis import trellis_args, trellis_argdict
 
 from litex.soc.integration.soc_sdram import (soc_sdram_args,
@@ -110,6 +113,27 @@ class ULX3S85FTestSoC(ulx3s.BaseSoC):
         self.comb += self.cpu.jtag_tdi.eq(jtag_tdi)
         self.comb += jtag_tdo.eq(self.cpu.jtag_tdo)
 
+
+class ArtyTestSoC(arty.BaseSoC):
+    def __init__(self, sys_clk_freq=int(100e6), **kwargs):
+        kwargs["integrated_rom_size"] = 0x10000
+        #kwargs["integrated_main_ram_size"] = 0x1000
+        kwargs["csr_data_width"] = 32
+        kwargs['csr_address_width'] = 15 # limit to 0x8000
+        kwargs["l2_size"] = 0
+        #bus_data_width = 16,
+
+        arty.BaseSoC.__init__(self,
+            sys_clk_freq = sys_clk_freq,
+            cpu_type     = "external",
+            cpu_cls      = LibreSoC,
+            cpu_variant  = "standardjtag",
+            #cpu_cls      = Microwatt,
+            variant      = "a7-100",
+            toolchain    = "symbiflow",
+            **kwargs)
+
+
 # Build
 # ----------------------------------------------------------------------------
 
@@ -126,18 +150,23 @@ def main():
     parser.add_argument("--toolchain", default="trellis", help="Gateware toolchain to use, trellis (default) or diamond")
 
     builder_args(parser)
-    trellis_args(parser)
     soc_sdram_args(parser)
     args = parser.parse_args()
 
     if args.fpga == "versa_ecp5":
+        trellis_args(parser)
         soc = VersaECP5TestSoC(sys_clk_freq=int(float(args.sys_clk_freq)),
                                **soc_sdram_argdict(args))
 
     elif args.fpga == "ulx3s85f":
+        trellis_args(parser)
         soc = ULX3S85FTestSoC(sys_clk_freq=int(float(args.sys_clk_freq)),
                               **soc_sdram_argdict(args))
 
+    elif args.fpga == "artya7100t":
+        soc = ArtyTestSoC(sys_clk_freq=int(float(args.sys_clk_freq)),
+                              **soc_sdram_argdict(args))
+
     else:
         soc = VersaECP5TestSoC(sys_clk_freq=int(float(args.sys_clk_freq)),
                                **soc_sdram_argdict(args))