From 7d91dc5b1a91bb91dd884f9048fa8432049710eb Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 6 Jun 2020 19:46:41 +0100 Subject: [PATCH] work out how to initialise memory directly --- src/soc/fu/compunits/test/test_compunit.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/soc/fu/compunits/test/test_compunit.py b/src/soc/fu/compunits/test/test_compunit.py index 602a9984..5e6fe2e9 100644 --- a/src/soc/fu/compunits/test/test_compunit.py +++ b/src/soc/fu/compunits/test/test_compunit.py @@ -1,4 +1,4 @@ -from nmigen import Module, Signal +from nmigen import Module, Signal, ResetSignal from nmigen.back.pysim import Simulator, Delay, Settle from nmutil.formaltest import FHDLTestCase from nmigen.cli import rtlil @@ -151,8 +151,7 @@ class TestRunner(FHDLTestCase): mem = l0.mem.mem memlist = [] for i in range(mem.depth): - memlist.append(sim.mem.ld(i*8, 8)) - mem.init = memlist + yield mem._array[i].eq(sim.mem.ld(i*8, 8)) print (mem, mem.depth, mem.width) print ("mem init", list(map(hex,memlist))) -- 2.30.2