edec055b3545943f2c8c3e8b5399989af99544d6
1 from nmigen
.compat
.sim
import run_simulation
3 from soc
.TLB
.SetAssociativeCache
import SetAssociativeCache
5 from soc
.TestUtil
.test_helper
import assert_eq
, assert_ne
, assert_op
8 def set_sac(dut
, e
, c
, s
, t
, d
):
10 yield dut
.command
.eq(c
)
13 yield dut
.data_i
.eq(d
)
23 yield from set_sac(dut
, enable
, command
, cset
, tag
, data
)
31 yield from set_sac(dut
, enable
, command
, cset
, tag
, data
)
35 def test_assoc_cache():
36 dut
= SetAssociativeCache(4, 4, 4, 4)
37 run_simulation(dut
, tbench(
38 dut
), vcd_name
="Waveforms/test_set_associative_cache.vcd")
39 print("Set Associative Cache Unit Test Success")
42 if __name__
== "__main__":