from soc.experiment.test import pagetables
from soc.experiment.test.test_wishbone import wb_get
-#new unit added to this test case
+# new unit added to this test case
from soc.fu.mmu.pipe_data import MMUPipeSpec
from soc.fu.mmu.fsm import FSMMMUStage
-#for sending instructions to the FSM
+# for sending instructions to the FSM
from openpower.consts import MSR
from openpower.decoder.power_fields import DecodeFields
from openpower.decoder.power_fieldsn import SignalBitRange
from openpower.decoder.power_decoder2 import decode_spr_num
from openpower.decoder.power_enums import MicrOp
+
def test_TLBIE(dut):
yield dut.fsm.p.i_data.ctx.op.eq(MicrOp.OP_TLBIE)
yield dut.fsm.p.valid_i.eq(1)
yield
yield Display("OP_TLBIE test done")
+
def ldst_sim(dut):
- yield dut.mmu.rin.prtbl.eq(0x1000000) # set process table
+ yield dut.mmu.rin.prtbl.eq(0x1000000) # set process table
addr = 0x100e0
- data = 0xFF #just a single byte for this test
+ data = 0xFF # just a single byte for this test
#data = 0xf553b658ba7e1f51
yield from store(dut, addr, 0, data, 0)
yield
ld_data, data_ok, ld_addr = yield from load(dut, addr, 0, 0)
- print(data,data_ok,ld_addr)
- assert(ld_data==data)
+ print(data, data_ok, ld_addr)
+ assert(ld_data == data)
yield
yield from test_TLBIE(dut)
-
"""
-- not testing dzbz here --
data = 0
print("dzbz test passed")
"""
- dut.stop = True # stop simulation
+ dut.stop = True # stop simulation
########################################
reg_wid=64,
units=units)
- dut = TestLDSTCompUnit(16,pspec)
+ dut = TestLDSTCompUnit(16, pspec)
vl = rtlil.convertMMUFSM(dut, ports=dut.ports())
with open("test_ldst_comp_mmu1.il", "w") as f:
f.write(vl)
run_simulation(dut, ldst_sim(dut), vcd_name='test_ldst_comp.vcd')
########################################
+
+
class TestLDSTCompUnitRegSpecMMUFSM(LDSTCompUnit):
def __init__(self, pspec):
# link mmu and dcache together
dcache = self.l0.dcache
mmu = self.mmu
- m.d.comb += dcache.m_in.eq(mmu.d_out) # MMUToDCacheType
- m.d.comb += mmu.d_in.eq(dcache.m_out) # DCacheToMMUType
+ m.d.comb += dcache.m_in.eq(mmu.d_out) # MMUToDCacheType
+ m.d.comb += mmu.d_in.eq(dcache.m_out) # DCacheToMMUType
return m
+
def test_scoreboard_regspec_mmufsm():
m = Module()
dut.mem = pagetables.test1
dut.stop = False
- sim.add_sync_process(wrap(ldst_sim(dut))) # rename ?
+ sim.add_sync_process(wrap(ldst_sim(dut))) # rename ?
sim.add_sync_process(wrap(wb_get(dut)))
with sim.write_vcd('test_scoreboard_regspec_mmufsm.vcd'):
sim.run()
if __name__ == '__main__':
test_scoreboard_regspec_mmufsm()
- #only one test for now -- test_scoreboard_mmu()
+ # only one test for now -- test_scoreboard_mmu()