1 from nmigen
import (C
, Module
, Signal
, Elaboratable
, Mux
, Cat
, Repl
, Signal
,
3 from nmigen
.cli
import main
4 from nmigen
.cli
import rtlil
5 from nmutil
.mask
import Mask
, masked
6 from nmutil
.util
import Display
7 from random
import randint
, seed
8 from nmigen
.sim
import Simulator
, Delay
, Settle
9 from nmutil
.util
import wrap
11 from soc
.config
.test
.test_pi2ls
import (pi_ld
, pi_st
, pi_ldst
, wait_busy
,
13 #from soc.config.test.test_pi2ls import pi_st_debug
14 from soc
.config
.test
.test_loadstore
import TestMemPspec
15 from soc
.config
.loadstore
import ConfigMemoryPortInterface
17 from soc
.fu
.ldst
.loadstore
import LoadStore1
18 from soc
.experiment
.mmu
import MMU
19 from soc
.experiment
.test
import pagetables
21 from nmigen
.compat
.sim
import run_simulation
22 from random
import random
23 from openpower
.test
.wb_get
import wb_get
24 from openpower
.test
import wb_get
as wbget
25 from openpower
.exceptions
import LDSTExceptionTuple
27 from soc
.config
.test
.test_fetch
import read_from_addr
28 from openpower
.decoder
.power_enums
import MSRSpec
35 pspec
= TestMemPspec(ldst_ifacetype
='mmu_cache_wb',
38 #disable_cache=True, # hmmm...
44 cmpi
= ConfigMemoryPortInterface(pspec
)
45 m
.submodules
.ldst
= ldst
= cmpi
.pi
46 m
.submodules
.mmu
= mmu
= MMU()
50 l_in
, l_out
= mmu
.l_in
, mmu
.l_out
51 d_in
, d_out
= dcache
.d_in
, dcache
.d_out
52 i_in
, i_out
= icache
.i_in
, icache
.i_out
# FetchToICache, ICacheToDecode
54 # link mmu, dcache and icache together
55 m
.d
.comb
+= dcache
.m_in
.eq(mmu
.d_out
) # MMUToDCacheType
56 m
.d
.comb
+= icache
.m_in
.eq(mmu
.i_out
) # MMUToICacheType
57 m
.d
.comb
+= mmu
.d_in
.eq(dcache
.m_out
) # DCacheToMMUType
59 # link ldst and MMU together
60 comb
+= l_in
.eq(ldst
.m_out
)
61 comb
+= ldst
.m_in
.eq(l_out
)
63 # add a debug status Signal: use "msg.str = "blah"
64 # then toggle with yield msg.eq(0); yield msg.eq(1)
65 debug_status
= Signal(8, decoder
=lambda _
: debug_status
.str)
66 m
.debug_status
= debug_status
72 def icache_read(dut
,addr
,priv
,virt
):
74 icache
= dut
.submodules
.ldst
.icache
78 yield i_in
.priv_mode
.eq(priv
)
79 yield i_in
.virt_mode
.eq(virt
)
81 yield i_in
.nia
.eq(addr
)
82 yield i_in
.stop_mark
.eq(0)
85 yield i_in
.nia
.eq(addr
)
87 valid
= yield i_out
.valid
88 failed
= yield i_out
.fetch_failed
89 while not valid
and not failed
:
91 valid
= yield i_out
.valid
92 failed
= yield i_out
.fetch_failed
96 insn
= yield i_out
.insn
100 return nia
, insn
, valid
, failed
103 test_exceptions
= True
109 print ("set debug message", msg
)
110 dut
.debug_status
.str = msg
# set the message
111 yield dut
.debug_status
.eq(0) # trigger an update
112 yield dut
.debug_status
.eq(1)
115 def _test_loadstore1_ifetch_iface(dut
, mem
):
116 """test_loadstore1_ifetch_iface
118 read in priv mode, non-virtual. tests the FetchUnitInterface
122 mmu
= dut
.submodules
.mmu
123 ldst
= dut
.submodules
.ldst
125 icache
= dut
.submodules
.ldst
.icache
128 print("=== test loadstore instruction (real) ===")
134 yield from debug(dut
, "real mem instruction")
135 # set address to 0x8, update mem[0x8] to 01234 | 0x5678<<32
136 # (have to do 64-bit writes into the dictionary-memory-emulated-thing)
139 expected_insn2
= 0x5678
140 expected_insn
= 0x1234
141 mem
[addr
] = expected_insn | expected_insn2
<<32
143 yield i_in
.priv_mode
.eq(1)
144 insn
= yield from read_from_addr(icache
, addr
, stall
=False)
146 nia
= yield i_out
.nia
# NO, must use FetchUnitInterface
147 print ("fetched %x from addr %x" % (insn
, nia
))
148 assert insn
== expected_insn
150 print("=== test loadstore instruction (2nd, real) ===")
151 yield from debug(dut
, "real mem 2nd (addr 0xc)")
153 insn2
= yield from read_from_addr(icache
, addr2
, stall
=False)
155 nia
= yield i_out
.nia
# NO, must use FetchUnitInterface
156 print ("fetched %x from addr2 %x" % (insn2
, nia
))
157 assert insn2
== expected_insn2
159 print("=== test loadstore instruction (done) ===")
161 yield from debug(dut
, "test done")
165 print ("fetched %x from addr %x" % (insn
, nia
))
166 assert insn
== expected_insn
170 def write_mem2(mem
, addr
, i1
, i2
):
171 mem
[addr
] = i1 | i2
<<32
173 def _test_loadstore1_ifetch_multi(dut
, mem
):
174 mmu
= dut
.submodules
.mmu
175 ldst
= dut
.submodules
.ldst
177 icache
= dut
.submodules
.ldst
.icache
178 assert wbget
.stop
== False
180 print ("set process table")
181 yield from debug(dut
, "set prtble")
182 yield mmu
.rin
.prtbl
.eq(0x1000000) # set process table
189 # TODO fetch instructions from multiple addresses
190 # should cope with some addresses being invalid
191 real_addrs
= [0,4,8,0,8,4,0,0,12]
192 write_mem2(mem
,0,0xF0,0xF4)
193 write_mem2(mem
,8,0xF8,0xFC)
195 yield i_in
.priv_mode
.eq(1)
196 for addr
in real_addrs
:
197 yield from debug(dut
, "real_addr "+hex(addr
))
198 # use the new interface in this test
200 insn
= yield from read_from_addr(icache
, addr
, stall
=False)
201 nia
= yield i_out
.nia
# NO, must use FetchUnitInterface
202 print ("TEST_MULTI: fetched %x from addr %x == %x" % (insn
, nia
,addr
))
203 assert insn
==0xF0+addr
205 yield i_in
.virt_mode
.eq(1)
207 virt_addrs
= [0x10200,0x10204,0x10208,0x10200,
208 0x102008,0x10204,0x10200,0x10200,0x10200C]
210 for addr
in virt_addrs
:
211 yield from debug(dut
, "virt_addr "+hex(addr
))
213 #TODO: use fetch interface here
214 ###################################
215 yield i_in
.priv_mode
.eq(0)
216 yield i_in
.virt_mode
.eq(1)
218 yield i_in
.stop_mark
.eq(0)
220 yield icache
.a_i_valid
.eq(1)
221 yield icache
.a_pc_i
.eq(addr
)
223 valid
= yield i_out
.valid
224 failed
= yield i_out
.fetch_failed
225 while not valid
and not failed
:
227 valid
= yield i_out
.valid
228 failed
= yield i_out
.fetch_failed
229 yield icache
.a_i_valid
.eq(0)
230 ###################################
231 print("TEST_MULTI: failed=",failed
) # this is reported wrong
238 def _test_loadstore1_ifetch(dut
, mem
):
239 """test_loadstore1_ifetch
241 this is quite a complex multi-step test.
243 * first (just because, as a demo) read in priv mode, non-virtual.
244 just like in experiment/icache.py itself.
246 * second, using the (usual) PTE for these things (which came originally
247 from gem5-experimental experiment/radix_walk_example.txt) do a
248 virtual-memory read through the *instruction* cache.
249 this is expected to FAIL
251 * third: mess about with the MMU, setting "iside" (instruction-side),
252 requesting an MMU RADIX LOOKUP. this triggers an itlb_load
253 (instruction-cache TLB entry-insertion)
255 * fourth and finally: retry the read of the instruction through i-cache.
256 this is now expected to SUCCEED
261 mmu
= dut
.submodules
.mmu
262 ldst
= dut
.submodules
.ldst
264 icache
= dut
.submodules
.ldst
.icache
267 print("=== test loadstore instruction (real) ===")
273 # first virtual memory test
275 print ("set process table")
276 yield from debug(dut
, "set prtble")
277 yield mmu
.rin
.prtbl
.eq(0x1000000) # set process table
280 yield from debug(dut
, "real mem instruction")
281 # set address to zero, update mem[0] to 01234
283 expected_insn
= 0x1234
284 mem
[addr
] = expected_insn
286 yield i_in
.priv_mode
.eq(1)
288 yield i_in
.nia
.eq(addr
)
289 yield i_in
.stop_mark
.eq(0)
290 yield i_m_in
.tlbld
.eq(0)
291 yield i_m_in
.tlbie
.eq(0)
292 yield i_m_in
.addr
.eq(0)
293 yield i_m_in
.pte
.eq(0)
298 # miss, stalls for a bit -- this one is different here
299 ##nia, insn, valid, failed = yield from icache_read(dut,addr,0,0)
304 yield i_in
.nia
.eq(addr
)
306 valid
= yield i_out
.valid
309 valid
= yield i_out
.valid
312 nia
= yield i_out
.nia
313 insn
= yield i_out
.insn
317 print ("fetched %x from addr %x" % (insn
, nia
))
318 assert insn
== expected_insn
320 print("=== test loadstore instruction (virtual) ===")
322 # look up i-cache expecting it to fail
324 yield from debug(dut
, "virtual instr req")
325 # set address to 0x10200, update mem[] to 5678
327 real_addr
= virt_addr
328 expected_insn
= 0x5678
329 mem
[real_addr
] = expected_insn
331 yield i_in
.priv_mode
.eq(0)
332 yield i_in
.virt_mode
.eq(1)
334 yield i_in
.nia
.eq(virt_addr
)
335 yield i_in
.stop_mark
.eq(0)
336 yield i_m_in
.tlbld
.eq(0)
337 yield i_m_in
.tlbie
.eq(0)
338 yield i_m_in
.addr
.eq(0)
339 yield i_m_in
.pte
.eq(0)
344 # miss, stalls for a bit
346 yield i_in
.nia
.eq(virt_addr
)
348 valid
= yield i_out
.valid
349 failed
= yield i_out
.fetch_failed
350 while not valid
and not failed
:
352 valid
= yield i_out
.valid
353 failed
= yield i_out
.fetch_failed
356 print ("failed?", "yes" if failed
else "no")
361 print("=== test loadstore instruction (instruction fault) ===")
363 yield from debug(dut
, "instr fault")
367 yield ldst
.priv_mode
.eq(0)
368 yield ldst
.instr_fault
.eq(1)
369 yield ldst
.maddr
.eq(virt_addr
)
370 # still broken -- investigate
371 # msr = MSRSpec(pr=?, dr=?, sf=0)
372 # ld_data, exctype, exc = yield from pi_ld(pi, virt_addr, 8, msr=msr)
374 yield ldst
.instr_fault
.eq(0)
376 done
= yield (ldst
.done
)
377 exc_info
= yield from get_exception_info(pi
.exc_o
)
378 if done
or exc_info
.happened
:
381 assert exc_info
.happened
== 0 # assert just before doing the fault set zero
382 yield ldst
.instr_fault
.eq(0)
387 print("=== test loadstore instruction (try instruction again) ===")
388 yield from debug(dut
, "instr virt retry")
389 # set address to 0x10200, update mem[] to 5678
391 real_addr
= virt_addr
392 expected_insn
= 0x5678
394 yield i_in
.priv_mode
.eq(0)
395 yield i_in
.virt_mode
.eq(1)
397 yield i_in
.nia
.eq(virt_addr
)
398 yield i_in
.stop_mark
.eq(0)
399 yield i_m_in
.tlbld
.eq(0)
400 yield i_m_in
.tlbie
.eq(0)
401 yield i_m_in
.addr
.eq(0)
402 yield i_m_in
.pte
.eq(0)
407 # miss, stalls for a bit
410 yield i_in.nia.eq(virt_addr)
412 valid = yield i_out.valid
413 failed = yield i_out.fetch_failed
414 while not valid and not failed:
416 valid = yield i_out.valid
417 failed = yield i_out.fetch_failed
419 nia = yield i_out.nia
420 insn = yield i_out.insn
424 nia
, insn
, valid
, failed
= yield from icache_read(dut
,virt_addr
,0,1)
426 yield from debug(dut
, "test done")
430 print ("failed?", "yes" if failed
else "no")
433 print ("fetched %x from addr %x" % (insn
, nia
))
434 assert insn
== expected_insn
439 def _test_loadstore1_invalid(dut
, mem
):
440 mmu
= dut
.submodules
.mmu
441 pi
= dut
.submodules
.ldst
.pi
444 print("=== test invalid ===")
447 msr
= MSRSpec(pr
=1, dr
=0, sf
=0) # set problem-state
448 ld_data
, exctype
, exc
= yield from pi_ld(pi
, addr
, 8, msr
=msr
)
449 print("ld_data", ld_data
, exctype
, exc
)
450 assert (exctype
== "slow")
451 invalid
= exc
.invalid
452 assert (invalid
== 1)
454 print("=== test invalid done ===")
459 def _test_loadstore1(dut
, mem
):
460 mmu
= dut
.submodules
.mmu
461 pi
= dut
.submodules
.ldst
.pi
462 ldst
= dut
.submodules
.ldst
# to get at DAR (NOT part of PortInterface)
465 yield mmu
.rin
.prtbl
.eq(0x1000000) # set process table
469 data
= 0xf553b658ba7e1f51
472 msr
= MSRSpec(pr
=0, dr
=0, sf
=0)
473 yield from pi_st(pi
, addr
, data
, 8, msr
=msr
)
476 ld_data
, exctype
, exc
= yield from pi_ld(pi
, addr
, 8, msr
=msr
)
477 assert ld_data
== 0xf553b658ba7e1f51
478 assert exctype
is None
480 ld_data
, exctype
, exc
= yield from pi_ld(pi
, addr
, 8, msr
=msr
)
481 assert ld_data
== 0xf553b658ba7e1f51
482 assert exctype
is None
484 print("do_dcbz ===============")
485 yield from pi_st(pi
, addr
, data
, 8, msr
=msr
, is_dcbz
=1)
486 print("done_dcbz ===============")
489 ld_data
, exctype
, exc
= yield from pi_ld(pi
, addr
, 8, msr
=msr
)
490 print("ld_data after dcbz")
493 assert exctype
is None
496 print("=== alignment error (ld) ===")
498 ld_data
, exctype
, exc
= yield from pi_ld(pi
, addr
, 8, msr
=msr
)
500 alignment
= exc
.alignment
501 happened
= exc
.happened
502 yield # wait for dsr to update
508 assert (happened
== 1)
509 assert (alignment
== 1)
511 assert (exctype
== "fast")
512 yield from wait_busy(pi
, debug
="pi_ld_E_alignment_error")
513 # wait is only needed in case of in exception here
514 print("=== alignment error test passed (ld) ===")
516 # take some cycles in between so that gtkwave separates out
523 print("=== alignment error (st) ===")
525 exctype
, exc
= yield from pi_st(pi
, addr
,0, 8, msr
=msr
)
527 alignment
= exc
.alignment
528 happened
= exc
.happened
532 assert (happened
== 1)
533 assert (alignment
==1)
535 assert (exctype
== "fast")
536 #???? yield from wait_busy(pi, debug="pi_st_E_alignment_error")
537 # wait is only needed in case of in exception here
538 print("=== alignment error test passed (st) ===")
542 print("=== no alignment error (ld) ===")
544 ld_data
, exctype
, exc
= yield from pi_ld(pi
, addr
, 8, msr
=msr
)
545 print("ld_data", ld_data
, exctype
, exc
)
547 alignment
= exc
.alignment
548 happened
= exc
.happened
552 assert (happened
== 0)
553 assert (alignment
== 0)
554 print("=== no alignment error done (ld) ===")
557 addrs
= [0x456920,0xa7a180,0x299420,0x1d9d60]
560 print("== RANDOM addr ==",hex(addr
))
561 ld_data
, exctype
, exc
= yield from pi_ld(pi
, addr
, 8, msr
=msr
)
562 print("ld_data[RANDOM]",ld_data
,exc
,addr
)
563 assert (exctype
== None)
566 print("== RANDOM addr ==",hex(addr
))
567 exc
= yield from pi_st(pi
, addr
,0xFF*addr
, 8, msr
=msr
)
568 assert (exctype
== None)
570 # readback written data and compare
572 print("== RANDOM addr ==",hex(addr
))
573 ld_data
, exctype
, exc
= yield from pi_ld(pi
, addr
, 8, msr
=msr
)
574 print("ld_data[RANDOM_READBACK]",ld_data
,exc
,addr
)
575 assert (exctype
== None)
576 assert (ld_data
== 0xFF*addr
)
578 print("== RANDOM addr done ==")
583 def _test_loadstore1_ifetch_invalid(dut
, mem
):
584 mmu
= dut
.submodules
.mmu
585 ldst
= dut
.submodules
.ldst
587 icache
= dut
.submodules
.ldst
.icache
590 print("=== test loadstore instruction (invalid) ===")
596 # first virtual memory test
598 print ("set process table")
599 yield from debug(dut
, "set prtbl")
600 yield mmu
.rin
.prtbl
.eq(0x1000000) # set process table
603 yield from debug(dut
, "real mem instruction")
604 # set address to zero, update mem[0] to 01234
606 expected_insn
= 0x1234
607 mem
[addr
] = expected_insn
609 yield i_in
.priv_mode
.eq(1)
611 yield i_in
.nia
.eq(addr
)
612 yield i_in
.stop_mark
.eq(0)
613 yield i_m_in
.tlbld
.eq(0)
614 yield i_m_in
.tlbie
.eq(0)
615 yield i_m_in
.addr
.eq(0)
616 yield i_m_in
.pte
.eq(0)
621 # miss, stalls for a bit
623 yield i_in
.nia
.eq(addr
)
625 valid
= yield i_out
.valid
626 nia
= yield i_out
.nia
629 valid
= yield i_out
.valid
632 nia
= yield i_out
.nia
633 insn
= yield i_out
.insn
638 print ("fetched %x from addr %x" % (insn
, nia
))
639 assert insn
== expected_insn
641 print("=== test loadstore instruction (virtual) ===")
642 yield from debug(dut
, "virtual instr req")
644 # look up i-cache expecting it to fail
646 # set address to 0x10200, update mem[] to 5678
648 real_addr
= virt_addr
649 expected_insn
= 0x5678
650 mem
[real_addr
] = expected_insn
652 yield i_in
.priv_mode
.eq(1)
653 yield i_in
.virt_mode
.eq(1)
655 yield i_in
.nia
.eq(virt_addr
)
656 yield i_in
.stop_mark
.eq(0)
657 yield i_m_in
.tlbld
.eq(0)
658 yield i_m_in
.tlbie
.eq(0)
659 yield i_m_in
.addr
.eq(0)
660 yield i_m_in
.pte
.eq(0)
665 # miss, stalls for a bit
667 yield i_in
.nia
.eq(virt_addr
)
669 valid
= yield i_out
.valid
670 failed
= yield i_out
.fetch_failed
671 while not valid
and not failed
:
673 valid
= yield i_out
.valid
674 failed
= yield i_out
.fetch_failed
677 print ("failed?", "yes" if failed
else "no")
682 print("=== test invalid loadstore instruction (instruction fault) ===")
684 yield from debug(dut
, "instr fault (perm err expected)")
687 yield ldst
.priv_mode
.eq(0)
688 yield ldst
.instr_fault
.eq(1)
689 yield ldst
.maddr
.eq(virt_addr
)
690 #ld_data, exctype, exc = yield from pi_ld(pi, virt_addr, 8, msr=msr)
692 yield ldst
.instr_fault
.eq(0)
694 done
= yield (ldst
.done
)
695 exc_info
= yield from get_exception_info(pi
.exc_o
)
696 if done
or exc_info
.happened
:
699 assert exc_info
.happened
== 1 # different here as expected
701 # TODO: work out what kind of exception occurred and check it's
702 # the right one. we *expect* it to be a permissions error because
703 # the RPTE leaf node in pagetables.test2 is marked as "non-executable"
704 # but we also expect instr_fault to be set because it is an instruction
706 print (" MMU lookup exception type?")
707 for fname
in LDSTExceptionTuple
._fields
:
708 print (" fname %20s %d" % (fname
, getattr(exc_info
, fname
)))
710 # ok now printed them out and visually inspected: check them with asserts
711 assert exc_info
.instr_fault
== 1 # instruction fault (yes!)
712 assert exc_info
.perm_error
== 1 # permissions (yes!)
713 assert exc_info
.rc_error
== 0
714 assert exc_info
.alignment
== 0
715 assert exc_info
.invalid
== 0
716 assert exc_info
.segment_fault
== 0
717 assert exc_info
.rc_error
== 0
719 yield from debug(dut
, "test done")
720 yield ldst
.instr_fault
.eq(0)
728 def test_loadstore1_ifetch_unit_iface():
730 m
, cmpi
= setup_mmu()
732 mem
= pagetables
.test1
734 # set this up before passing to Simulator (which calls elaborate)
735 icache
= m
.submodules
.ldst
.icache
736 icache
.use_fetch_interface() # this is the function which converts
737 # to FetchUnitInterface. *including*
738 # rewiring the Wishbone Bus to ibus
744 sim
.add_sync_process(wrap(_test_loadstore1_ifetch_iface(m
, mem
)))
745 # add two wb_get processes onto the *same* memory dictionary.
746 # this shouuuld work.... cross-fingers...
747 sim
.add_sync_process(wrap(wb_get(cmpi
.wb_bus(), mem
)))
748 sim
.add_sync_process(wrap(wb_get(icache
.ibus
, mem
))) # ibus not bus
749 with sim
.write_vcd('test_loadstore1_ifetch_iface.vcd',
750 traces
=[m
.debug_status
]): # include extra debug
754 def test_loadstore1_ifetch():
756 m
, cmpi
= setup_mmu()
758 mem
= pagetables
.test1
764 icache
= m
.submodules
.ldst
.icache
765 sim
.add_sync_process(wrap(_test_loadstore1_ifetch(m
, mem
)))
766 # add two wb_get processes onto the *same* memory dictionary.
767 # this shouuuld work.... cross-fingers...
768 sim
.add_sync_process(wrap(wb_get(cmpi
.wb_bus(), mem
)))
769 sim
.add_sync_process(wrap(wb_get(icache
.bus
, mem
)))
770 with sim
.write_vcd('test_loadstore1_ifetch.vcd',
771 traces
=[m
.debug_status
]): # include extra debug
775 def test_loadstore1():
777 m
, cmpi
= setup_mmu()
779 mem
= pagetables
.test1
785 sim
.add_sync_process(wrap(_test_loadstore1(m
, mem
)))
786 sim
.add_sync_process(wrap(wb_get(cmpi
.wb_bus(), mem
)))
787 with sim
.write_vcd('test_loadstore1.vcd'):
791 def test_loadstore1_invalid():
793 m
, cmpi
= setup_mmu()
801 sim
.add_sync_process(wrap(_test_loadstore1_invalid(m
, mem
)))
802 sim
.add_sync_process(wrap(wb_get(cmpi
.wb_bus(), mem
)))
803 with sim
.write_vcd('test_loadstore1_invalid.vcd'):
806 def test_loadstore1_ifetch_invalid():
807 m
, cmpi
= setup_mmu()
809 # this is a specially-arranged page table which has the permissions
810 # barred for execute on the leaf node (EAA=0x2 instead of EAA=0x3)
811 mem
= pagetables
.test2
817 icache
= m
.submodules
.ldst
.icache
818 sim
.add_sync_process(wrap(_test_loadstore1_ifetch_invalid(m
, mem
)))
819 # add two wb_get processes onto the *same* memory dictionary.
820 # this shouuuld work.... cross-fingers...
821 sim
.add_sync_process(wrap(wb_get(cmpi
.wb_bus(), mem
)))
822 sim
.add_sync_process(wrap(wb_get(icache
.bus
, mem
)))
823 with sim
.write_vcd('test_loadstore1_ifetch_invalid.vcd',
824 traces
=[m
.debug_status
]): # include extra debug
827 def test_loadstore1_ifetch_multi():
828 m
, cmpi
= setup_mmu()
831 # this is a specially-arranged page table which has the permissions
832 # barred for execute on the leaf node (EAA=0x2 instead of EAA=0x3)
833 mem
= pagetables
.test1
835 # set this up before passing to Simulator (which calls elaborate)
836 icache
= m
.submodules
.ldst
.icache
837 icache
.use_fetch_interface() # this is the function which converts
838 # to FetchUnitInterface. *including*
839 # rewiring the Wishbone Bus to ibus
845 sim
.add_sync_process(wrap(_test_loadstore1_ifetch_multi(m
, mem
)))
846 # add two wb_get processes onto the *same* memory dictionary.
847 # this shouuuld work.... cross-fingers...
848 sim
.add_sync_process(wrap(wb_get(cmpi
.wb_bus(), mem
)))
849 sim
.add_sync_process(wrap(wb_get(icache
.ibus
, mem
))) # ibus not bus
850 with sim
.write_vcd('test_loadstore1_ifetch_multi.vcd',
851 traces
=[m
.debug_status
]): # include extra debug
854 if __name__
== '__main__':
856 test_loadstore1_invalid()
857 test_loadstore1_ifetch() #FIXME
858 test_loadstore1_ifetch_invalid()
859 test_loadstore1_ifetch_unit_iface() # guess: should be working
860 test_loadstore1_ifetch_multi()