5 * https://bugs.libre-soc.org/show_bug.cgi?id=51
8 # NOTE: to use cxxsim, export NMIGEN_SIM_MODE=cxxsim from the shell
9 # Also, check out the cxxsim nmigen branch, and latest yosys from git
14 # here is the logic which takes test cases and "executes" them.
15 # in this instance (TestRunner) its job is to instantiate both
16 # a Libre-SOC nmigen-based HDL instance and an ISACaller python
17 # simulator. it's also responsible for performing the single
18 # step and comparison.
19 from soc
.simple
.test
.test_runner
import TestRunner
22 from openpower
.simulator
.program
import Program
23 from openpower
.endian
import bigendian
24 from openpower
.test
.common
import TestAccumulatorBase
26 class DCBZTestCase(TestAccumulatorBase
):
28 def case_1_dcbz(self
):
30 initial_regs
= [0] * 32
31 initial_regs
[1] = 0x0004
32 initial_regs
[2] = 0x0008
33 initial_mem
= {0x0000: (0x5432123412345678, 8),
34 0x0008: (0xabcdef0187654321, 8),
35 0x0020: (0x1828384822324252, 8),
37 self
.add_case(Program(lst
, bigendian
), initial_regs
,
38 initial_mem
=initial_mem
)
42 if __name__
== "__main__":
45 unittest
.main(exit
=False)
46 suite
= unittest
.TestSuite()
48 # add other test cases later
49 suite
.addTest(TestRunner(DCBZTestCase().test_data
, svp64
=svp64
,
52 runner
= unittest
.TextTestRunner()