• Tidak ada hasil yang ditemukan

Simulation Overview

N/A
N/A
Protected

Academic year: 2024

Membagikan "Simulation Overview"

Copied!
20
0
0

Teks penuh

(1)

Simulation Overview

Chang-Gun Lee ([email protected]) Assistant Professor

The School of Computer Science and Engineering Seoul National University

(2)

What is “Simulation”?

• Doing something without the real-system just like the real-system do t ll ?

– mentally?

– using computer?

• What is “just like the real-system do”?

– How much exact we want?

– Level of abstraction

• Why?

• Why?

– We can evaluate the performance in advance before actual implementation – Easy to change

• Simulation is …

– analysis tool for predicting the effect of changes

design tool to predict the performance of new system – design tool to predict the performance of new system

(3)

What to Simulate?

What to Simulate?

Digital Circuit

Processor Core Embedded System

Internet Wireless Sensor Network

(4)

Computer-based Simulation Computer based Simulation

real-system simulated-system

Morning

Alarm 20 i

Morning

Alarm Get o t from 20 min

Alarm

Get out from the bed

Enter the 20 min

2 min

Alarm Get out from

the bed Enter the

20 min 2 min Enter the

bathroom

Leave the bathroom &

30 min

Enter the bathroom

Leave the bathroom

& start eating the breakfast

30 min

10 min Leave the bathroom &

start eating the breakfast Make-up

10 min 15 min

breakfast

Make-up

Go out to meet girl friends

10 min 15 min Go out to meet

girl friends

real-time

girl friends

real time simulated time

real time

(real world) real-time

(computer world)

simulated-time (computer world)

(5)

Two things from the previous slide

• Real-Time vs. Simulated-Time

• Level of Abstraction

(6)

Real Time (Wall Clock Time) vs Real Time (Wall-Clock Time) vs.

Simulated Time

• How the time goes in the simulated world?

– Can be faster or slower than the real-time

– The simulated-time progresses following the The simulated time progresses following the event occurrence simulating the time-progress in the real world

in the real world

(7)

Level of Abstraction Level of Abstraction

Wh d i i h b h

• What you are doing in the bathroom

– Don’t care

We want to model the detail of what happen in the – We want to model the detail of what happen in the

bathroom.

• Depends on the needs of analysis p y

– We only care the time spent at home before leaving

– We want to know which action is most time consuming

• Typical levels of abstraction

– Circuit-level simulation

I t ti l l i l ti

– Instruction-level simulation

– Event-level simulation

(8)

Xilinx demo Xilinx demo

(circuit-level simulation) (c cu t eve s u at o )

• A sequential circuit

– Logical functionality – TimingTiming

(9)

Example: Analysis of Clocked Synchronous Circuit

X

J Q

O

CLK

A O

K

B

J K

Q K

B

i i

• A systematic way is necessary

(10)

Three Step Approach p pp

• Step 1: Equation (excitation and output)

• Step 2: Table (state and output)

• Step 3: State diagram

• Step 3: State diagram

(11)

Step 1: Excitation and Output Equations

• Derive Excitation and Output Equations from the schematic

A

A

X K X

J = , = ,

A B

A B

A A

Q K

X Q J

X K

X J

=

= , ,

, ,

B A

Q

Q

O =

(12)

St 2 St t /O t t T bl Step 2: State/Output Table

• Fill in the table from the previous equations

P.S. Input Output Excitation N.S.

QB QA X O JB KB JA KA QB QA

Q Q Q Q

0 0 0

a 0 0 1 1 0 0 1 0 0 1

0 1 0 a

b

0 0 1 0 1 0 1 0 1 0

0 0 1 1 0 1 1

1 0 0 b

0 0 0 0 1 1 0 1 1 0

0 0 0 1 1 0 1

1 1 0 c

1 0 1 0 1 0 1 0 1 0

0 0 1 1 1 1 1

d

0 0 0 0 1 1 0

(13)

Step 3: State Diagram

• Can you tell what this machine is doing?

0

b

0

a d

1 1

0

0

c/1

0

1 1

(14)

Example

CLK

X

1 0 1 0 0 1 1 0

Q

AA

Q

B

a a b a b d c a

O

(15)

68HC11 Simulator demo 68HC11 Simulator demo

(Instruction-level simulation)

( )

• Read 4bit switches and display the read through 7-Segment element.

– Instruction-level trace – Memory monitoring – Register monitoringg g

(16)

OMNet++ demo ( “mySamples/psNetwork” ) (Event-level simulation)

• A packet switching network with 2 routers and 4 hosts p g

– Host:

– Router:

AppGen + AppSink + NetworkLayer + OutputQueue NetworkLayer + OutputQueues for ouput ports

appGen appSink network layer network layer

network layer

Observe output queue length, message hop count, and end-to-end delay

Post visualization of data using “scalars” and “plove” tools

“scalars omnetpp.sca”, “plove omnetpp.vec”

(17)

ns-2 demo ( “ns example3.tcl” ) (Event-level simulation)

• A ring topology with 7 nodes

• Node 0 starts CBR traffic over UDP at time 0.5 sec, whose destination is Node 3

• Link between Node 1 and Node 2 downs during [1 sec, 2sec]

• Node 0’s traffic stops at 4.5 sec

CBR

6 5

network layer

UDP

0

4

network layer (DV) y

(DV)

duplex-link dropTail

1 3

Link Failure

t k l Sink

2

network layer (DV)

(18)

ns-2 demo ( ( “ns example4.tcl” ) )

• Three hosts (h0, h1, h2) send burst traffic to one sink (h4) via a router (r3)

H t B tT ffi + UDP + N t kL + D T ilQ

– Host: BurstTraffic + UDP + NetworkLayer + DropTailQueue – Router: NetworkLayer + DropTailQueues for ouput ports – Sink: Sink(LossMonitor) + NetworkLayer

• All flows start at 10 and stop at 50

Burst

network layer UDP

h0

network layer

sink0 sink1 sink2

(2s burst, 1s idle, 100kbps peak rate)

h0

1Mb

1Mbps 1Mbps

1Mbps

h1

(2s burst, 1s idle, 200kbps peak rate)

r3 h4

1Mbps

h2

(2s burst, 1s idle, 300kbps peak rate)

Visualize data using

“xgraph out.tr”

(19)

Workload Model

• In event-driven simulation, we have to characterize the , workload

– arrival rate of jobs

– jobs’ execution time in each resourcejobs execution time in each resource – interactions among jobs

• Deterministic model

i di i l – periodic arrivals

– constant execution times

• Stochastic model

– random arrivals (e.g., exponential inter-arrival time distribution) – random execution times (e.g., exponential execution times)

– We use a random number generator for thatWe use a random number generator for that

(20)

Disadvantage of Simulation g

• Simulation requires special training q p g

• There is an inevitable deviation from the reality

– How to make the deviation acceptable?

It i h d t lid t th t f i l ti

• It is hard to validate the correctness of your simulation

– How can you judge that your simulation is correct?

• Solution

– Work hard in this class

Referensi

Dokumen terkait

The active control for pantograph system is designed based on the interaction of contact wire and pantograph analysis using multi-body dynamic simulation (1)(2).. The combination

This thesis is concern about the simulation of biodiesel production from used frying oil (UFO) using alkaline-based catalysts, (i.e. sodium hydroxide, potassium hydroxide,

The proposed project will result in a prototype information dis- semination system that may be of commercial interest, a computer- based test bed for further

The purpose of this study was to determine the feasibility of computer- based simulation learning media on the subject of buffer solution in terms of validity and effectiveness of

20 credits Programmes must include:  Common computer architecture from personal to enterprise;  Operating system internals, relationship between hardware and operating system; 

Simulation-Based Search Self-play reinforcement learning can replace search Simulate games of self-play from root state St Apply RL to simulated experience Monte-Carlo Control =⇒

Integrated Nursing Education System iNES A simulated electronic health documentation, web- based application https://www.ines.sg from the National University Singapore NUS

Single image dehazing based upon visibility range through synthetic haze simulation ABSTRACT Outdoor images are typically degraded by light scattering and absorption from aerosols,