Simulation Of Computer Systems - IOE...
Transcript of Simulation Of Computer Systems - IOE...
![Page 1: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/1.jpg)
Simulation Of Computer Systems
Prof. S. Shakya
![Page 2: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/2.jpg)
Purpose & OverviewPurpose & Overview Computer systems are composed from timescales “flip” (10-11 sec) to
time a human interacts (seconds)
It is a multi level system
![Page 3: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/3.jpg)
Different Level abstractionsDifferent Level abstractions
![Page 4: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/4.jpg)
I/O System BehaviorI/O System Behavior Execution of computer program
-The program execution should be modeled
-Markov Chains are used for modeling inputs
The program execution is modeled with randomly sampled CPU and I/O service time
![Page 5: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/5.jpg)
Simulation ToolsSimulation Tools Different simulation tools exist for each level
VHDL (Very High Speed Integrated Circuit-VHSIC) Hardware Description Language
AT l l l f b-AT low level of abstraction
-Modular design
P b d t b d?-Process based or event based?
SMPL, CSIM,…
![Page 6: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/6.jpg)
P d E t O i t d Si l tiProcess and Event Oriented Simulation DES
Trace Driven
Event Based
Process based
It is like OS environment
Resource sharing
Mutual exclusion
S h Semaphore
Process communication
![Page 7: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/7.jpg)
P d E t O i t d Si l tiProcess and Event Oriented Simulation
![Page 8: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/8.jpg)
Model InputModel Input CPU (Instructions)
Memory (References)
Gate (signals)
![Page 9: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/9.jpg)
Virtual Memory ReferencingVirtual Memory Referencing Why VM is good?y g
Program is organized on units called pages
Physical memory is divided into page framesy y p g
Mapping is done by OS
Page fault?g
Replacement policy (hit ratio)
-Use simulation to find hit ratio fro some polices
Why VM work
-Working set (Finding them is OS challenges)well?
![Page 10: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/10.jpg)
Generating reference traceGenerating reference trace Stochastically ?
Direct execution
![Page 11: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/11.jpg)
High Level Computer SimulationHigh Level Computer Simulation good response time
We should find bottleneck (delay)
![Page 12: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/12.jpg)
Web site Server SystemWeb site Server System
![Page 13: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/13.jpg)
Web site Server SystemWeb site Server System Router have table of sessions
Web server has three queues of threads
Application server has two queues of threads
Goal is to find response time distribution
First we find bottleneck and then look how to reduce load at b ttl k d i h f h d li li bidi bottleneck during change of scheduling policy, biding applications to servers, increasing CPU and I/O devices
![Page 14: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/14.jpg)
W b it S S t tWeb site Server System parameters
![Page 15: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/15.jpg)
Process or event basedProcess or event based The website model is an excellent candidate for process
oriented approach!!
How can we model with event based simulation?
E b d f d Event based is focused on queries.
Process based is focused on servers.
![Page 16: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/16.jpg)
CPU SimulationCPU Simulation What is execution time?
The input is streams of instructions.
What is the bottleneck?
Main challenges is to avoid stalling
-Inputs are not ready
-Miss load
High performance CPU avoid it by recognizing
dd l b dadditional instructions can be executed
![Page 17: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/17.jpg)
PipelinePipeline Modern microprocessors add some additional
capabilities to exploit ILP (Instruction level
parallelism)
-Compiler or CPU?
Pipelining has long been recognized as way of
accelerating the execution of computer instructions.
![Page 18: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/18.jpg)
ILP CPUILP CPU Pipeline stages
-Instruction fetch
-Instruction decode
-Instruction issue (non order)
-Instruction execute
-Instruction complete
-Instruction graduate
![Page 19: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/19.jpg)
Simulation model of ILP CPUSimulation model of ILP CPU Fetch Read from simulated memory and cacheRead from simulated memory and cache Decode-Register mapping-Branch predictionBranch prediction Issue-Input registers must be available-Functional units must be available Execute & complete- Find branch-Register writingg g- Release functional units and registers Graduation- Find exceptionp
![Page 20: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/20.jpg)
Memory SimulationMemory Simulation One of the great challenges of computer architecture is
finding way to deal effectively with the increasing gap in operation speed between CPU and memory (Chart)
Solution is to use hierarchies of memories Solution is to use hierarchies of memories
-L1-L2-Main memory
We have data inconsistency We have data inconsistency
-Write through
-Write backWrite back
-Comparing them with simulation
![Page 21: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/21.jpg)
Memory SimulationMemory Simulation Increasing hit ratio
Replacement Policy (LRU)
Set associative
-Full associative
![Page 22: Simulation Of Computer Systems - IOE Notesioenotes.edu.np/.../10-Simulation-of-Computer-Systems.pdf · Memory Simulation One of the great challenges of computer architecture is finding](https://reader030.fdocuments.in/reader030/viewer/2022041002/5ea39f4619e27e22be2ab2fd/html5/thumbnails/22.jpg)
ReferenceReference Discrete Event system simulation, 4th Edition, Jerry Banks,
John S, Carson II, Barry L. Nelson, David M. Nicol, P. Shahabudeen