增加警告
This commit is contained in:
parent
bd1b011046
commit
b26a306cb1
4
CPU.py
4
CPU.py
|
@ -2,6 +2,7 @@ import queue
|
||||||
from Memory import Memory
|
from Memory import Memory
|
||||||
from error import *
|
from error import *
|
||||||
import pathlib
|
import pathlib
|
||||||
|
import warnings
|
||||||
import program
|
import program
|
||||||
import importlib
|
import importlib
|
||||||
|
|
||||||
|
@ -37,7 +38,7 @@ class Core:
|
||||||
|
|
||||||
def loadProgram(self, code):
|
def loadProgram(self, code):
|
||||||
# 加载程序至cmdMemroy
|
# 加载程序至cmdMemroy
|
||||||
self.cmdMemory.write_batch(0,code)
|
self.cmdMemory.write_batch(0, code)
|
||||||
|
|
||||||
def fetchInstruction(self):
|
def fetchInstruction(self):
|
||||||
# 取指令
|
# 取指令
|
||||||
|
@ -89,6 +90,7 @@ class Core:
|
||||||
|
|
||||||
class MultiCoreCPU:
|
class MultiCoreCPU:
|
||||||
def __init__(self, num_cores, registers, dt_memory, cmd_memory_size=-1):
|
def __init__(self, num_cores, registers, dt_memory, cmd_memory_size=-1):
|
||||||
|
warnings.warn("该类型CPU有BUG")
|
||||||
self.cores = []
|
self.cores = []
|
||||||
|
|
||||||
self.programs = queue.Queue(maxsize=num_cores)
|
self.programs = queue.Queue(maxsize=num_cores)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user