X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fexperiment%2Fscore6600.py;h=456bb3ebfa07378682b2a1f4422deeb6b26d4117;hb=5d9f1eab12603ad0f9ce654b114cde087c199ac0;hp=9f7776d5657db6a64651c8e075baaa7493b42b43;hpb=7e3d314651634e031bd4b18c8482c7f5838dac1d;p=soc.git diff --git a/src/experiment/score6600.py b/src/experiment/score6600.py index 9f7776d5..456bb3eb 100644 --- a/src/experiment/score6600.py +++ b/src/experiment/score6600.py @@ -7,32 +7,101 @@ 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 IntFPIssueUnit, RegDecode +from scoreboard.issue_unit import IssueUnitGroup, IssueUnitArray, RegDecode from scoreboard.shadow import ShadowMatrix, BranchSpeculationRecord +from scoreboard.instruction_q import Instruction, InstructionQ from compalu import ComputationUnitNoDelay from alu_hier import ALU, BranchALU from nmutil.latch import SRLatch +from nmutil.nmoperator import eq from random import randint, seed from copy import deepcopy +from math import log -class CompUnits(Elaboratable): +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<= 4 if is_branch: branch_ok, branch_fail = dest @@ -625,28 +935,32 @@ def scoreboard_branch_sim(dut, alusim): # the other to be marked shadow branch "fail". # one out of each of these will be cancelled for ok, fl in zip(branch_ok, branch_fail): - instrs.append((ok[0], ok[1], ok[2], ok[3], (1, 0))) - instrs.append((fl[0], fl[1], fl[2], fl[3], (0, 1))) - print ("instr %d: (%d, %d, %d, %d, %d, %d)" % \ + if ok: + instrs.append((ok[0], ok[1], ok[2], ok[3], (1, 0))) + if fl: + instrs.append((fl[0], fl[1], fl[2], fl[3], (0, 1))) + print ("instr %d: (%d, %d, %d, %d, (%d, %d))" % \ (i, src1, src2, dest, op, shadow_on, shadow_off)) yield from int_instr(dut, op, src1, src2, dest, shadow_on, shadow_off) - yield - yield from wait_for_issue(dut) - branch_direction = yield dut.branch_direction_o # way branch went # wait for all instructions to stop before checking yield yield from wait_for_busy_clear(dut) i = -1 - for (src1, src2, dest, op, (shadow_on, shadow_off)) in siminsts: + while siminsts: + instr = siminsts.pop(0) + if instr is None: + continue + (src1, src2, dest, op, (shadow_on, shadow_off)) = instr i += 1 is_branch = op >= 4 if is_branch: branch_ok, branch_fail = dest dest = src2 - print ("sim %d: (%d, %d, %d, %d)" % (i, src1, src2, dest, op)) + print ("sim %d: (%d, %d, %d, %d, (%d, %d))" % \ + (i, src1, src2, dest, op, shadow_on, shadow_off)) branch_res = alusim.op(op, src1, src2, dest) if is_branch: if branch_res: @@ -661,25 +975,42 @@ def scoreboard_branch_sim(dut, alusim): def scoreboard_sim(dut, alusim): - yield dut.int_store_i.eq(1) + seed(0) - for i in range(1): + for i in range(50): # set random values in the registers for i in range(1, dut.n_regs): - val = 31+i*3 val = randint(0, (1<