Ejemplo n.º 1
0
    def __init__(self):
        self.bus = bus.Bus()
        self.memory = memory.Memory(self.bus)
        self.L2C0 = L2.L2(0, self.bus, self.memory)
        self.L2C1 = L2.L2(1, self.bus, self.memory)
        self.directoryController = directoryController.DirectoryController(
            self.L2C0, self.L2C1, self.memory, self.bus)
        self.C0 = chip.Chip(0, self.memory, self.bus, self.directoryController,
                            self.L2C0)
        self.C1 = chip.Chip(1, self.memory, self.bus, self.directoryController,
                            self.L2C1)

        self.window = Tk()
        self.tableL1P0C0 = Treeview(self.window, height=2)
        self.tableL1P1C0 = Treeview(self.window, height=2)
        self.tableL1P0C1 = Treeview(self.window, height=2)
        self.tableL1P1C1 = Treeview(self.window, height=2)
        self.tableL2C0 = Treeview(self.window, height=4)
        self.tableL2C1 = Treeview(self.window, height=4)
        self.tableMemory = Treeview(self.window, height=16)

        self.t1 = threading.Thread(target=self.C0.run)
        self.t2 = threading.Thread(target=self.C1.run)
        self.t3 = threading.Thread(target=self.directoryController.runL2toMem)
        self.t4 = threading.Thread(target=self.directoryController.runMemtoL2)
        self.t5 = threading.Thread(target=self.updateMemories)
Ejemplo n.º 2
0
 def test_player_total_chips(self):
     player_1 = player.Player("Yildiz")
     player_1.add_chip(chip.Chip(yildor.diamond))
     player_1.add_chip(chip.Chip(yildor.sapphire))
     player_1.add_chip(chip.Chip(yildor.emerald))
     player_1.add_chip(chip.Chip(yildor.ruby))
     player_1.add_chip(chip.Chip(yildor.onyx))
     self.assertTrue(player_1.total_num_chips() == 5)
Ejemplo n.º 3
0
 def test_player_remove_one_diamond_chip_when_chips(self):
     player_1 = player.Player("Yildiz")
     chip_1 = chip.Chip(yildor.diamond)
     player_1.add_chip(chip_1)
     player_1.add_chip(chip_1)
     self.assertTrue(player_1.diamond_chips == 2)
     player_1.remove_chip(chip_1)
     self.assertTrue(player_1.diamond_chips == 1)
Ejemplo n.º 4
0
 def test_player_add_one_onyx_chip(self):
     player_1 = player.Player("Yildiz")
     chip_1 = chip.Chip(yildor.onyx)
     player_1.add_chip(chip_1)
Ejemplo n.º 5
0
 def test_player_add_one_ruby_chip(self):
     player_1 = player.Player("Yildiz")
     chip_1 = chip.Chip(yildor.ruby)
     player_1.add_chip(chip_1)
Ejemplo n.º 6
0
 def test_player_add_one_emerald_chip(self):
     player_1 = player.Player("Yildiz")
     chip_1 = chip.Chip(yildor.emerald)
     player_1.add_chip(chip_1)
Ejemplo n.º 7
0
 def test_player_add_one_sapphire_chip(self):
     player_1 = player.Player("Yildiz")
     chip_1 = chip.Chip(yildor.sapphire)
     player_1.add_chip(chip_1)
Ejemplo n.º 8
0
 def test_player_add_one_diamond_chip(self):
     player_1 = player.Player("Yildiz")
     chip_1 = chip.Chip(yildor.diamond)
     player_1.add_chip(chip_1)