From 8d0d24c31746c2748075c3593f96427c1b20021d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 31 May 2020 19:45:12 +0100 Subject: [PATCH] remove unneeded code and inputs. convert to "naming" in CompUnit inputs --- .../fu/compunits/test/test_alu_compunit.py | 79 +++---------------- src/soc/fu/compunits/test/test_compunit.py | 18 ++++- 2 files changed, 24 insertions(+), 73 deletions(-) diff --git a/src/soc/fu/compunits/test/test_alu_compunit.py b/src/soc/fu/compunits/test/test_alu_compunit.py index 2d001a0e..6041cd3e 100644 --- a/src/soc/fu/compunits/test/test_alu_compunit.py +++ b/src/soc/fu/compunits/test/test_alu_compunit.py @@ -1,68 +1,9 @@ -from nmigen import Module, Signal -from nmigen.back.pysim import Simulator, Delay, Settle -from nmigen.test.utils import FHDLTestCase -from nmigen.cli import rtlil import unittest -from soc.decoder.isa.caller import ISACaller, special_sprs -from soc.decoder.power_decoder import (create_pdecode) -from soc.decoder.power_decoder2 import (PowerDecode2) -from soc.decoder.power_enums import (XER_bits, Function, InternalOp) -from soc.decoder.selectable_int import SelectableInt -from soc.simulator.program import Program -from soc.decoder.isa.all import ISA +from soc.decoder.power_enums import (XER_bits,) from soc.fu.alu.test.test_pipe_caller import TestCase, ALUTestCase, test_data from soc.fu.compunits.compunits import ALUFunctionUnit from soc.fu.compunits.test.test_compunit import TestRunner -from soc.experiment.compalu_multi import find_ok # hack -import random - -def set_cu_input(cu, idx, data): - rdop = cu.get_in_name(idx) - yield cu.src_i[idx].eq(data) - while True: - rd_rel_o = yield cu.rd.rel[idx] - print ("rd_rel %d wait HI" % idx, rd_rel_o, rdop, hex(data)) - if rd_rel_o: - break - yield - yield cu.rd.go[idx].eq(1) - while True: - yield - rd_rel_o = yield cu.rd.rel[idx] - if rd_rel_o: - break - print ("rd_rel %d wait HI" % idx, rd_rel_o) - yield - yield cu.rd.go[idx].eq(0) - - -def get_cu_output(cu, idx, code): - wrmask = yield cu.wrmask - wrop = cu.get_out_name(idx) - wrok = cu.get_out(idx) - fname = find_ok(wrok.fields) - wrok = yield getattr(wrok, fname) - print ("wr_rel mask", repr(code), idx, wrop, bin(wrmask), fname, wrok) - assert wrmask & (1<