/// <summary> /// Instantiates an instance of the Processor /// </summary> /// <param name="bus">IOBus used for communication</param> /// <param name="pc">Starting ProgramCounter line to start at</param> /// <param name="id">Processor ID</param> public ThreadedProcessor(IOBus bus, int pc, int id) : base(bus, pc) { thread = new ThreadManager { ID = id, Sequencer = new System.Threading.Thread(this.Process) }; }
/// <summary> /// Instantiates an instance of the Processor and starts it immediately /// </summary> /// <param name="bus">IOBus used for communication</param> /// <param name="pc">Starting ProgramCounter line to start at</param> /// <param name="id">Processor ID</param> /// <param name="autorun">Whether the processor should start processing after instantiation</param> public ThreadedProcessor(IOBus bus, int pc, int id, bool autorun) : this(bus, pc, id) { if (autorun) { this.Run(register.ProgramCounter); } }
/// <summary> /// Instantiates a new Processor object, and start the Processor thread /// </summary> /// <remarks> /// Contributors: /// Caiden K. /// Brad V. /// </remarks> /// <param name="bus">GUI interface for input and output of data</param> public Processor(IOBus bus) { // Internal component instantiation register.Status = 0; register.ProgramCounter = 0; register.Accumulator = 0; ALU = new ArithmeticLogicUnit(); Bus = bus; }
public System() { _mem = new PhysicalMemory(1024); _io = new IOBus(); _cpu = new Processor(_mem, _io); // Attach IO devices _fdlp = new FDLP(_mem, _cpu); _io.RegisterDevice(1, _fdlp); }
/// <summary> /// Schedules a processor to be run in the scheduler queue /// </summary> /// <remarks> /// Contributors: /// Caiden K. /// </remarks> public static void ScheduleProcessor(IOBus bus, int id) { if (processorQueue.ContainsKey(id)) { throw new System.ArgumentException($"Processor with id {id} already exists!"); } // Instantiate a new ThreadedProcessor and insert it into the processorQueue. // Set PC to 0 until future development allows custom PC value. processorQueue.Add(id, new ThreadedProcessor(bus, 0, id)); }
/// <summary> /// Instantiates a new form instance and creates a new IOBus object for use with processors /// </summary> public MainForm() { InitializeComponent(); bus = new IOBus(ExecuteGUIAction, DisplayMemory, PromptUserForInput, PromptUserForSixDigitInput, DisplayRuntimeData, DisplayOutput); ResetForm(); }
public void TestScheduleProcessor() { List <ThreadedProcessor> EXPECTED = new List <ThreadedProcessor>(); IOBus bus = new IOBus(); Scheduler.ScheduleProcessor(bus, 1); Scheduler.ScheduleProcessor(bus, 2); // Test, it should throw an exception when attempting to add another // procesor with the same ID as previous Scheduler.ScheduleProcessor(bus, 1); }
public RidgeSystem() { _scheduler = new Scheduler(); _mem = new Memory.MemoryController(8192); _io = new IOBus(); _cpu = new Processor(_mem, _io); _mem.AttachCPU(_cpu); // Attach IO devices _fdlp = new FDLP(0x1, this); _io.RegisterDevice(0x1, _fdlp); _priamController = new PriamDiskController(0x2, this); _io.RegisterDevice(0x2, _priamController); //_display = new Display(0x4, this); //_io.RegisterDevice(0x4, _display); //_io.RegisterDevice(0x5, _display); }
/// <summary> /// Instantiates a new Processor object, and start the Processor thread /// </summary> /// <remarks> /// Contributors: /// Caiden K. /// Brad V. /// </remarks> /// <param name="pc">Starting memory address for the processor to run</param> /// <param name="bus">GUI interface for input and output of data</param> public Processor(IOBus bus, int pc) : this(bus) { register.ProgramCounter = pc; }
public BaseBlock() { this.inputs = new IOBus(this); this.outputs = new IOBus(this, false); this.IsChanged = true; }
public Processor(IPhysicalMemory mem, IOBus io) { _mem = mem; _io = io; }