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