From f963f3b1cd13cda316279a1443e90e6766ca5acd Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 8 Jun 2019 14:50:59 +0100 Subject: [PATCH] add 2nd test for mem dependency, use FU-Regs and FU-FU matrices --- src/scoreboard/fu_reg_matrix.py | 8 +- src/scoreboard/test_mem2_fu_matrix.py | 668 ++++++++++++++++++++++++++ 2 files changed, 674 insertions(+), 2 deletions(-) create mode 100644 src/scoreboard/test_mem2_fu_matrix.py diff --git a/src/scoreboard/fu_reg_matrix.py b/src/scoreboard/fu_reg_matrix.py index bac2ea33..d7f225b9 100644 --- a/src/scoreboard/fu_reg_matrix.py +++ b/src/scoreboard/fu_reg_matrix.py @@ -181,11 +181,15 @@ class FURegDepMatrix(Elaboratable): dc = dm[fu] # wire up inputs from module to row cell inputs (Cat is gooood) m.d.comb += [dc.dest_i.eq(self.dest_i), - dc.src_i[0].eq(self.src_i[0]), - dc.src_i[1].eq(self.src_i[1]), dc.rd_pend_i.eq(self.rd_pend_i), dc.wr_pend_i.eq(self.wr_pend_i), ] + # same for src + for i in range(self.n_src): + for fu in range(self.n_fu_row): + dc = dm[fu] + # wire up inputs from module to row cell inputs (Cat is gooood) + m.d.comb += dc.src_i[i].eq(self.src_i[i]) # accumulate rsel bits into read/write pending vectors. rd_pend_v = [] diff --git a/src/scoreboard/test_mem2_fu_matrix.py b/src/scoreboard/test_mem2_fu_matrix.py new file mode 100644 index 00000000..80b9e63f --- /dev/null +++ b/src/scoreboard/test_mem2_fu_matrix.py @@ -0,0 +1,668 @@ +from nmigen.compat.sim import run_simulation +from nmigen.cli import verilog, rtlil +from nmigen import Module, Const, Signal, Array, Cat, Elaboratable + +from regfile.regfile import RegFileArray, treereduce +from scoreboard.fu_fu_matrix import FUFUDepMatrix +from scoreboard.fu_reg_matrix import FURegDepMatrix +from scoreboard.global_pending import GlobalPending +from scoreboard.group_picker import GroupPicker +from scoreboard.issue_unit import IssueUnitGroup, IssueUnitArray, RegDecode +from scoreboard.shadow import ShadowMatrix, BranchSpeculationRecord + +from nmutil.latch import SRLatch +from nmutil.nmoperator import eq + +from random import randint, seed +from copy import deepcopy +from math import log + + +class Memory(Elaboratable): + def __init__(self, regwid, addrw): + self.ddepth = regwid/8 + depth = (1<>self.ddepth] + + def st(self, addr, data): + self.mem[addr>>self.ddepth] = data & ((1<