8/9/2019 Modelling of Embedded System.pptx
1/34
Embedded SystemsEEE 540
Session 4
Anshul Mittal
Asst. Professor (Sr.) (SENSE)
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
2/34
Session #b$e%ti"es
• !nderstand Embedded SystemModellin& ' lo &ra*h+ SM+ Petrinets,
8/9/2019 Modelling of Embedded System.pptx
3/34
-uestions
• hat are the units inside a *ro%essorand hat are their fun%tionalities/
• hat is the nal sta&e of softarethat is *ut into mi%ro%ontroll /
• 1an the re2uirements %han&e in thedesi&n life %y%le/
8/9/2019 Modelling of Embedded System.pptx
4/34
Ansers
• !nits inside a *ro%essor 3 Pro&ramlo !nit+ 1ontrol !nit
• inal sta&e of softare is %alled #MIma&e.
• It de*ends on the %om*any *oli%y.
8/9/2019 Modelling of Embedded System.pptx
5/34
6 M#7E88IN9 /
• Modellin& a system before ma:in& it into a*rodu%t is mandatory.
for e& 3 If a desi&ner is *osted ith a %hallen&e ofma:in& an ele"ator + the desi&ner should rstmodel it.
• Modellin& ill hel* the desi&ner to understand thesystem better and ill in%rease the %onden%ele"el.
• Many modellin& te%hni2ues are a"ailable and it isu*to the desi&ner to ma:e a %hoi%e out of it.
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
6/34
y*i%al Embedded System
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
7/34
inite State Ma%hine ( SM )
• inite state ma%hine is a sim*le modellin&a**roa%h that is "ery useful to understandin& asystem+ hoe"er %om*le; the system may be.
• SM a model %om*osed of – the number of nite states+
– the *ossible transitions beteen the nite states +
– a%tions %aused due to transitions and it shall also shohat an a%tion ould be ta:en.
•
he SM modellin& ill start ith one of the statesa"ailable. It %an be 2uoted as SA in thedia&ram. It ill &o throu&h series of transitions andmay nally end ith any of the states a"ailable.
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
8/34
8/9/2019 Modelling of Embedded System.pptx
9/34
inite State Ma%hine
• here are se"eral a%tion ty*es – Entry a%tion ? hi%h is *erformed hen enterin& a state
– E;it a%tion ? hi%h is *erformed hen e;itin& a state
– In*ut a%tion ? hi%h is *erformed de*endin& on *resent stateand in*ut %onditions
– ransition a%tion ? hi%h is *erformed hen *erformin& a%ertain transition
• he 1urrent state is basi%ally determined by the *aststates. In short or to be more *re%ise it re%ords the%han&es from the startin& *oint to *resent state.
• Number of states is basi%ally &o"erned by the numberof @its in the memory+ for e;am*le+ if memory is 4bits lon& there ould be B *ossible states.
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
10/34
inite State Ma%hine
• #ther than state there are fe other terms as ellsu%h as transition and a%tion. – A transition is an indi%ation of a state %han&e that has
ha**ened as a result of meetin& a %ondition
– An a%tion is sim*ly a des%ri*tion of an a%ti"ity that hasto be *erformed at a &i"en *oint of time. A%tions %an be*erformed at entry+ e;it+ transition and in*ut.
• here are to di
8/9/2019 Modelling of Embedded System.pptx
11/34
inite State Ma%hine
• All states of an SM are said to be eithera%%e*tin& or not a%%e*tin&.
• At the time hen all in*ut is *ro%essed if the%urrent state is a%%e*tin& state+ the in*ut is
a%%e*ted otherise it is re$e%ted.“FSM basically works on the principle of CURRENTSTATE and INUT to deter!ine the ne"t state#“
•
i&ure indi%ates the SM *rin%i*le
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
12/34
8/9/2019 Modelling of Embedded System.pptx
13/34
inite State Ma%hine
• 1onsider that the ele"ator has been de*loyed in =Foor buildin&.
• Ele"ator initially shall be in idle state in any one ofthe three Foors.
• Ele"ator system does mo"in& u* and don basedon the re2uest &i"en by the user.
• Assume that ele"ator is in &round Foor and user&ot into ele"ator and has &i"en re2uest to mo"e
to Gnd Foor – rom idle state after re%ei"in& the in*ut from user the
%ontroller desi&ned for the ele"ator ill %om*are thein*ut ith the %urrent Foor number.
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
14/34
inite State Ma%hine
– If &reater it is o"ert that the ele"ator has to mo"e u*and %are should be ta:en that door should not o*enhen the lift is in motion. So disablin& the door o*enfun%tion durin& motion is mu%h a**re%iable.
– After rea%hin& the Foor the door has to be :e*t o*en forsome time (5 se%onds) so that user %an ste* out andill :ee* it o*en until a ne re2uest %omes in.
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
15/34
inite State Ma%hine
• he di
8/9/2019 Modelling of Embedded System.pptx
16/34
Softare A**li%ations
•
he folloin& %on%e*ts are %ommonly used tobuild softare a**li%ations ith nite statema%hines – Automata based *ro&rammin&
– E"ent dri"en SM
– Virtual SM (VSM)
• he model used for modellin& is *urely based onones %omfort and e;*ertise ith the method.
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
17/34
Perti Net 9ra*h
• @i*artite ei&hted dire%ted &ra*h – Pla%es 3 1ir%les
– ransitions 3 bars and bo;es
– Ar%s 3 arros labelled ith ei&hts
•
o:ens 3 @la%: dots
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
18/34
ransition rin& rule
• A mar:in& is %han&ed a%%ordin& to the folloin&rules – A transition is enabled if there are enou&h to:ens in
ea%h in*ut *la%e.
– An enabled transition may or may not re. – he rin& of a transition modies mar:in& by %onsumin&
to:ens from the in*ut *la%es and *rodu%in& to:ens inout*ut *la%es.
8/9/2019 Modelling of Embedded System.pptx
19/34
8/9/2019 Modelling of Embedded System.pptx
20/34
Perti Net Modellin&
•Petri net is *rimarily used for studyin& thedynami% %on%urrent beha"ior of netor: basedsystems here there is a dis%rete Fo.
• he basi% elements of *etri net modellin& are
*la%es and transitions. An ar% is the third elementbein& used hi%h e;ists only from a transition to*la%e or *la%e to a transition.
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
21/34
8/9/2019 Modelling of Embedded System.pptx
22/34
Syn%hroniDation
•
his *ro*erty is sim*le here transition t ill beenabled only hen atleast one to:en is there atea%h of its in*ut *la%es.
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
23/34
8/9/2019 Modelling of Embedded System.pptx
24/34
1on%urran%y
• his is one of the most im*ortant *ro*erties or*etri nets.
• ere in this %ase shon t and tG are %on%urrent. his ma:es *etri nets to be used to modelsystems of distributed %ontrol ith multi*le
*ro%ess e;e%utin& %on%urrently in time.
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
25/34
1onFi%t
•1onsider a situation here t and tG are bothready to re but the rin& of any leads todisablin& of the other transition.
• his is li:e a deadlo%: situation.
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
26/34
An E;am*le
•1onsider a situation here t and tG are bothready to re but the rin& of any leads todisablin& of the other transition.
• his is li:e a deadlo%: situation.
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
27/34
An E;am*le
•1ho%late Vendin& Ma%hine
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
28/34
An E;am*le
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
29/34
An E;am*le
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
30/34
An E;am*le
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
31/34
An E;am*le
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
32/34
An E;am*le
VI !ni"ersity
• inally the user ill &et the 51%ho%late.
• Ad"anta&e of *etri net Is that it &i"es"isual e
8/9/2019 Modelling of Embedded System.pptx
33/34
1on%lusion
•
Embedded System 1an be modelled usin& Fo&ra*hs+ SM or *etri nets. he sele%tion ofmethodolo&y is *urely based on users%on"inien%e.
•
Petri nets ha"e fe im*ortant *ro*erties su%h asse2uential e;e%ution+ syn%hroniDation+ mer&in&+1on%urran%y and %onFi%t.
VI !ni"ersity
8/9/2019 Modelling of Embedded System.pptx
34/34
han: 6ou