From abf6d1c3d6173ba7eec9b75d6f1c290c037c2ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Boczar?= Date: Tue, 11 Feb 2020 12:54:01 +0100 Subject: [PATCH] test: add random address generation to BIST --- litedram/frontend/bist.py | 71 +++++++++++++++++++++++++-------------- 1 file changed, 46 insertions(+), 25 deletions(-) diff --git a/litedram/frontend/bist.py b/litedram/frontend/bist.py index 5f3c071..0032792 100644 --- a/litedram/frontend/bist.py +++ b/litedram/frontend/bist.py @@ -131,22 +131,29 @@ def get_ashift_awidth(dram_port): class _LiteDRAMBISTGenerator(Module): def __init__(self, dram_port): ashift, awidth = get_ashift_awidth(dram_port) - self.start = Signal() - self.done = Signal() - self.run = Signal() - self.ready = Signal() - self.base = Signal(awidth) - self.length = Signal(awidth) - self.random = Signal() - self.ticks = Signal(32) + self.start = Signal() + self.done = Signal() + self.run = Signal() + self.ready = Signal() + self.base = Signal(awidth) + self.end = Signal(awidth) + self.length = Signal(awidth) + self.random_data = Signal() + self.random_addr = Signal() + self.ticks = Signal(32) # # # # Data / Address generators ---------------------------------------------------------------- data_gen = Generator(31, n_state=31, taps=[27, 30]) # PRBS31 - addr_gen = CEInserter()(Counter(awidth)) + addr_gen = Generator(31, n_state=31, taps=[27, 30]) self.submodules += data_gen, addr_gen - self.comb += data_gen.random_enable.eq(self.random) + self.comb += data_gen.random_enable.eq(self.random_data) + self.comb += addr_gen.random_enable.eq(self.random_addr) + + # mask random address to the range