From 175a3fbe3ce4e07a647c0c2712fb46498f18bf35 Mon Sep 17 00:00:00 2001 From: Peter McGoron Date: Fri, 28 Oct 2022 18:07:19 -0400 Subject: [PATCH] write arty SoC generator --- arty_test/soc.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 arty_test/soc.py diff --git a/arty_test/soc.py b/arty_test/soc.py new file mode 100644 index 0000000..e3406d8 --- /dev/null +++ b/arty_test/soc.py @@ -0,0 +1,38 @@ +# Construct SoC. + +from migen import ClockSignal +from litex_boards.targets.digilent_arty import BaseSoC +from litex_boards.platforms.digilent_arty import Platform, Builder +from litescope import LiteScopeAnalyzer + +platform = Platform(variant="a7-100") +platform.add_source("../boothmul.v") + +class TestPlatform(BaseSoC): + def __init__(self, platform, constwid = 48, inwid = 48): + BaseSoC.__init__( + with_uartbone = True, + toolchain = "symbiflow", + platform = platform + ) + + self.const_in = CSRStorage(constwid) + self.inval = CSRStorage(inwid) + self.outval = CSRStatus(const_wid + inwid) + self.arm = CSRStorage(arm) + self.fin = CSRStatus(arm) + + self.specials += Instance("boothmul", + p_A1_LEN = constwid, + p_A2_LEN = inwid, + A2LEN_SIZ = math.ceil(math.log2(inwid) + 1) + 1, + clk = ClockSignal(), + a1 = self.const_in.storage, + a2 = self.inval.storage, + outn = self.outval.status, + i_arm = self.arm.storage, + fin = self.fin.status + ) + +builder = Builder(TestPlatform(platform), csr_csv="csr.csv") +builder.build()