Hao Cheng - PowerPoint PPT Presentation

About This Presentation
Title:

Hao Cheng

Description:

editor.dat. script.dat. Get_Instr. Get_Instr: read instructions from file into instr_type. ... Refer to project_intro.pdf. memory. segment table. ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 15
Provided by: csU73
Learn more at: http://www.cs.ucf.edu
Category:
Tags: cheng | editor | hao | pdf

less

Transcript and Presenter's Notes

Title: Hao Cheng


1
Simulator Project
Objective 2
Boot Get_Instr Cpu XPGM Mu
SetMAR 10 functions Fetch
Read Write Display_pgm
  • Hao Cheng
  • haocheng_at_cs.ucf.edu
  • 11-01-05

2
simulator
3
simulator
  • Interrupt_handler
  • Logon_service
  • Get_scripts
  • Next_pgm
  • Get_memory
  • loader
  • Dispatch
  • Xpgm
  • Cpu

editor.dat
4
Get_Instr
  • Get_Instr
  • read instructions from file into instr_type.
  • JUMP 2,0 address
  • SKIP 0 count
  • SIO 75 burst
  • DISK 2000 bytes
  • Refer to project_intro.pdf

5
memory
  • segment table.
  • MEMMAP calloc(2MAXSEGMENTS, sizeof(struct
    segment_type))
  • 2 MAXSEGMENTS (defined in config.dat)
  • kernel uses upper part
  • MEMMAPMAXSEGMENTS 2MAXSEGMENTS 1
  • user uses lower part MEMMAP0 MAXSEGMENTS
  • memory
  • MEM calloc(MEMSIZE, sizeof(struct instr_type))

6
boot
  • called from simulator.c
  • load kernel boot.dat
  • set MEMMAP segment table.
  • load code into MEM
  • call Display_pgm to write the content of memory
    to file.

7
boot.dat
  • format

8
boot
  • called from simulator.c
  • load kernel boot.dat
  • set MEMMAP segment table.
  • load code into MEM
  • call Display_pgm to write the content of memory
    to file. just refer to correct-output.

9
misc functions
  • XPGM context switching
  • Mu address translation
  • SetMAR memory address register
  • Fetch fetch instruction
  • Read identical to Fetch
  • Write write bytes to memory.

10
Cpu
  • set the MAR, set CPU.pc -gt MAR
  • fetch instruction from memory
  • decode and execute the instruction

11
SIO, WIO, END
  • CLOCK current simulation time.
  • SIO 75 burst - CPU cycle
  • Burst_time from cycle to time
  • occurrence time CLOCK burst time
  • add_event
  • update program counter.
  • CPU.pc.offset CPU.pc.offset 2

12
SKIP
  • SKIP n count
  • if n gt 0, skip the next instruction
  • n n 1
  • write back to memory call write()
  • CPU.pc.offset CPU.pc.offset 2
  • Cpu
  • if n 0, execute next instruction
  • CPU.pc.offset CPU.pc.offset 1
  • Cpu
  • always followed by JUMP

13
JUMP
  • JUMP 2,0 address
  • update CPU.pc
  • call Cpu().
  • unconditional jump
  • SKIP JUMP conditional jump

14
Questions?
Write a Comment
User Comments (0)
About PowerShow.com