SIMMAC Virtual Machine Design Document
SIMMAC Virtual Machine Design Document
Supporting multiple input files from the command line, each with its own time quantum, is significant for SIMMAC as it allows the system to handle diverse program workloads simultaneously. This capability ensures that each program can be independently executed within its specified execution time, accommodating various processing requirements and improving overall system flexibility and responsiveness to different user needs .
The instruction register (IR) in the SIMMAC execution process is pivotal as it temporarily holds the current instruction fetched from memory. This enables the system to decode the instruction by identifying the opcode and operands. By storing the instruction in the IR, the machine can execute it effectively by breaking it down into actionable parts, which are then processed by the Arithmetic Logic Unit (ALU).
The Process Control Block (PCB) in the SIMMAC system is crucial for managing the execution of programs. It stores all necessary information to resume a program's execution. This includes current register values, which are recorded if a program's execution is interrupted due to the time limit in the round robin scheduling method. By maintaining this data in a PCB, SIMMAC can pause and later resume programs without loss of state, thereby supporting the parallel execution capabilities of the machine .
The PCB_Linkedlist in SIMMAC is structured as a linked list where each node corresponds to a PCB structure. This organization allows for efficient tracking and management of multiple programs as each node can store the process information and state of a program. As programs are executed and potentially paused, the linked list facilitates the management and retrieval of each program's state, enabling effective process scheduling and resource allocation .
The SIMMAC system uses the PCB (Process Control Block) to resume a program's execution after an interruption. When a program is halted due to the completion of its time quantum, the PCB stores the current register values. Upon resumption, these stored values allow the program to continue from the exact point of interruption, ensuring continuity and state preservation. This is crucial for the round robin scheduling, which requires programs to be paused and resumed repeatedly .
After a program's execution in SIMMAC, the system clears memory by removing the instructions for that program from the mem[][] array. This deallocates resources, ensuring memory is available for other programs, thus improving system efficiency by preventing memory bloat and ensuring optimal use of memory resources for concurrent program execution .
SIMMAC ensures fair execution of programs by implementing the round robin scheduling technique, where each program receives a time quantum, allowing all programs to execute in turn. When system resources are limited, this approach prevents any single program from starving resources by allocating time slices to all active programs in a cyclic order. This method achieves balanced CPU time distribution without favoritism, ensuring all programs progress towards completion .
The SIMMAC virtual machine employs the round robin technique to execute parallel programs by allocating each program a time quantum, a fixed time period for execution before moving to the next. This scheduling method is significant for parallel execution, as it ensures that each program gets CPU time in a cyclic order. This prevents any single program from monopolizing the CPU, enabling fair and efficient multi-program execution in constrained system resources .
The SIMMAC machine language supports several opcodes including ADD, SUB, LDA, STR, BRH, CBR, and LDI. Each instruction consists of an opcode and an operand. The operand functions alongside the opcode to either specify a value or address which determines the operation or data to be processed by the opcode. For example, the ADD opcode adds the value specified by the operand to a register .
SIMMAC allocates memory for instructions by storing each instruction in a character array named mem[][], with each element of the array representing an instruction node. This allows the system to manage multiple instructions loaded into memory simultaneously. For each program, a PCB_queue node is created to track its instructions, which are loaded into this memory array for execution .