There is a need to visualize what is going at lower layer of abstraction when we execute the high level or low level program on a Von Neuman machine. The projects aims to build a ARM language simulator to visualize the execution of ARM language(low level) instructions. As in case of advanced processors the concept of pipelining are used, the simulator should be able to visualize the execution of instructions using pipelining concept. The simulator should simulate the recursive function, if statements and for loops statement.
We developed the project using c++ and the concept of pipelining. Instruction are read from a file along with the latency of the instructions. The simulator was able to visualize the execution of the instruction and displayed the execution on the terminal.
- Open Terminal and cd Src_Code
- g++ -std=c++11 armSim.cpp -o processor_simulator
- ./processor_simulator input to simulator is given through latency.txt and in.txt
- Cmp and Branch(bge and bne) are considered to be one instruction.
- Pseudo Memory is of size 5000,label is assigned memory according to .data section.
- Input is taken from in.txt while latency data is taken from latency.txt
- Diffrent color are used for every pipeline stage.
- Instruction in particular stage is shown just below it in white color.
- If there is no instruction in particular stage then there will be nothing written below it.
- When instruction is flushed then it is shown by printing flush in that stage.
- Whereas when we need stall to remove hazard stall will be written below that stage.
- Add rd,rop1,rop2
- Add rd,rop1,#Imm
- Add SP,SP,#Imm
- Sub rd,rop1,rop2
- Sub rd,rop1,#Imm
- Sub SP,SP,#Imm
- Mul rd,rop1,rop2
- Mul rd,rop1,#Imm
- Mov rd,rop1
- Mov pc, lr
- Mov rd,#Imm
- Ldr rd,[rop1,#Imm]
- Ldr rd,[rop1]
- Ldr rd,=label
- Ldr LR,[SP,#Imm]
- Ldr rd,[SP,#Imm]
- Str rd,[rop1,#Imm]
- Str rd,[rop1]
- Str Lr,[SP,#Imm]
- Str rd,[SP,#Imm]
- cmp rop1,rop2 bge label
- cmp rop1,rop2 bne label
- Bl procedurelabel
- B label
- Exit