예제 #1
0
    def setUp(self):
        self.fake_bus = FakeBus()
        self.fake_tracker = FakeTracker()

        self.default_cache = Cache(
            0,  # Cache id.
            CachingTest._NUMBER_OF_CACHE_LINES,
            CachingTest._SIZE_OF_CACHE_LINE,
            self.fake_bus,
            self.fake_tracker,
            debug_mode=False)

        # Simulations for the test_trace tests.
        self.sc_simulation = SimulationEnvironment(
            CachingTest._NUMBER_OF_PROCESSORS,
            CachingTest._NUMBER_OF_CACHE_LINES,
            CachingTest._SIZE_OF_CACHE_LINE,
            "SC",
            debug_mode=True,  # Turn on to force consistency checks.
        )

        self.tso_simulation = SimulationEnvironment(
            CachingTest._NUMBER_OF_PROCESSORS,
            CachingTest._NUMBER_OF_CACHE_LINES,
            CachingTest._SIZE_OF_CACHE_LINE,
            "TSO",
            debug_mode=True,  # Turn on to force consistency checks.
            write_buffer_size=32,
            retire_at_count=1)
 def setUp(self):
     self.simulation = SimulationEnvironment(
         SimulationTest._NUMBER_OF_PROCESSORS,
         SimulationTest._NUMBER_OF_CACHE_LINES,
         SimulationTest._SIZE_OF_CACHE_LINE,
         # Always turn on debug mode, so that the sanity check in
         # SimulationEnvironment.simulate() execute.
         debug_mode=True)