CSCI1600: Embedded and Real Time Software

Slides:



Advertisements
Similar presentations
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Advertisements

Denise Landau Fundamentals of Problem Solving Finite State Machines Denise Landau 2013 AQA Computing COMP1.
CS 290C: Formal Models for Web Software Lecture 4: Implementing and Verifying Statecharts Specifications Using the Spin Model Checker Instructor: Tevfik.
Timed Automata.
3/20/20091 More State Machines. Multiple processes.
10/20/20081 Lab 6 – More State Machines. Multiple processes.
Lecture 6 & 7 System Models.
Software Engineering, COMP201 Slide 1 Protocol Engineering Protocol Specification using CFSM model Lecture 30.
10/13/ Lab 6 - Algorithmic State Machines ECE238L 10/13/2009.
THE OBJECT-ORIENTED DESIGN WORKFLOW Statechart Diagrams.
CS 290C: Formal Models for Web Software Lecture 2: Modeling States with Statecharts Instructor: Tevfik Bultan.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 10: Statecharts.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
02/06/05 “Investigating a Finite–State Machine Notation for Discrete–Event Systems” Nikolay Stoimenov.
System Models Hoang Huu Hanh, Hue University hanh-at-hueuni.edu.vn Lecture 6 & 7.
Modern VLSI Design 4e: Chapter 8 Copyright  2008 Wayne Wolf Topics Basics of register-transfer design: –data paths and controllers; –ASM charts. Pipelining.
CSCI1600: Embedded and Real Time Software Lecture 7: Modeling II: Discrete Systems Steven Reiss, Fall 2015.
CSCI1600: Embedded and Real Time Software Lecture 8: Modeling III: Hybrid Systems Steven Reiss, Fall 2015.
CSCI1600: Embedded and Real Time Software Lecture 11: Modeling IV: Concurrency Steven Reiss, Fall 2015.
CSCI1600: Embedded and Real Time Software Lecture 33: Worst Case Execution Time Steven Reiss, Fall 2015.
CSCI1600: Embedded and Real Time Software Lecture 6: Modeling I: Continuous Systems Steven Reiss, Fall 2015.
CSCI1600: Embedded and Real Time Software Lecture 9: Input Output Concepts Steven Reiss, Fall 2015.
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
CSCI1600: Embedded and Real Time Software Lecture 23: Real Time Scheduling I Steven Reiss, Fall 2015.
Dr Nick Mitchell (Room CM 224)
Finite State Machines (FSM) OR Finite State Automation (FSA) - are models of the behaviors of a system or a complex object, with a limited number of defined.
Digital System Design using VHDL
CSCI1600: Embedded and Real Time Software Lecture 16: Advanced Programming with I/O Steven Reiss, Fall 2015.
Modern VLSI Design 3e: Chapter 8 Copyright  1998, 2002 Prentice Hall PTR Topics n Basics of register-transfer design: –data paths and controllers; –ASM.
Finite Automata Chapter 1. Automatic Door Example Top View.
Models and Diagrams. Models A model is an abstract representation of something real or imaginary. Like a map, a model represents something A useful model.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
CSCI1600: Embedded and Real Time Software Lecture 15: Advanced Programming Concepts Steven Reiss, Fall 2015.
Laurea Triennale in Informatica – Corso di Ingegneria del Software I – A.A. 2006/2007 Andrea Polini VII. System Specification (I)
CSCI1600: Embedded and Real Time Software Lecture 10: Modeling IV: Compositions of State Machines Steven Reiss, Fall 2015.
George Mason University Finite State Machines Refresher ECE 545 Lecture 11.
CompSci 280 S Introduction to Software Development
Marlon Dumas Institute of Computer Science
ANALYSIS OF SEQUENTIAL CIRCUITS
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
FSM Controllers ENGR 110 #
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Dynamic Modeling Lecture # 37.
CSCI1600: Embedded and Real Time Software
Marlon Dumas Institute of Computer Science
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
EGR 2131 Unit 12 Synchronous Sequential Circuits
CSCI1600: Embedded and Real Time Software
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
CSCI1600: Embedded and Real Time Software
Presentation transcript:

CSCI1600: Embedded and Real Time Software Lecture 9: Modeling II: Discrete Systems Steven Reiss, Fall 2017 Should provide automata for the two/three different train problems.

Self-Driving Cars 15-Point Checklist http://www.nytimes.com/2016/09/21/technology/the-15- point-federal-checklist-for-self-driving-cars.html Lecture 8: Modeling Discrete Systems 2/24/2019

Embedded Systems Are sets of tasks If we want to understand the system The task is the primary abstraction to be used If we want to understand the system We need to understand the tasks We need to understand the interactions Between tasks With the environment (real world) Should we model the whole system Or should we just model the individual tasks Lecture 8: Modeling Discrete Systems 2/24/2019

How to Model a Task English description Formal mathematics Typically used first Imprecise, hard to check, incomplete Formal mathematics Very precise Difficult to understand and write (correctly) Hard to express external events Formal diagrams Combine formal math with understanding Diagrams make it easier to comprehend what is there Provide a framework for the math and understanding Lecture 8: Modeling Discrete Systems 2/24/2019

Modeling Control Systems Control oriented systems Typically respond to external stimuli Reaction based on previous interactions These determine the state of the system Stimulus moves system to a new state Control is state-oriented Natural model is finite state automata Also called a finite state machine Lecture 8: Modeling Discrete Systems 2/24/2019

Basic Finite State Automata What language does this recognize? ((a*b)a*cd(bd)*a)*(a*b)*a*c Lecture 8: Modeling Discrete Systems 2/24/2019

Problem Want to automatically trigger switch D Want to automatically trigger switch Only once if possible (not continually) When train goes from R to L What does sensing look like (at A, B, C, D) Events: A, 𝐴 , B, 𝐵 , C, 𝐶 , D, 𝐷 When should you trigger the switch What does the train look like to the sensor Triggers: c,d,c’, d’ – what is the expected sequence of events and when should you trigger Students should try to do this (use white board?) Lecture 8: Modeling Discrete Systems 2/24/2019

Problem Can only trigger one switch at a time Is it a FSA? Switch trigger Should be momentary (>100ms, <500ms) What does this task do? How many tasks should it be? Different approaches Is it a FSA? Queue-based approach is one way How is a queue implemented? Another is a simple set of flags, one per switch and we cycle through to find next one to trigger How do you prevent 2 trains from entering a block simultaneously from both ends going in opposite directions? Lecture 8: Modeling Discrete Systems 2/24/2019

Problem Problem: when is the train on which block Complexities D A B Problem Problem: when is the train on which block When is train completely on A/C or B or D side of switch Complexities Handling initial conditions Handling reversing directions Students should try to do this Lecture 8: Modeling Discrete Systems 2/24/2019

Issues with Basic FSA Need to specify actions Semi-external events: timers Internal events from other tasks Conditional events Multiple FSA’s in parallel (multiple tasks) Counters and other variables State space blowup Lecture 8: Modeling Discrete Systems 2/24/2019

Actions: Moore vs Mealy Machine Lecture 8: Modeling Discrete Systems 2/24/2019

Moore vs. Mealy Which is more useful? Are they equivalent? Lecture 8: Modeling Discrete Systems 2/24/2019

Extended State Machines Each arc has condition/action To traverse arc, condition must hold When traversing arc, action is taken There are a finite set of (bounded) variables Conditions can reference these Condition can be Event Time out Expression over variables Combination of the two Is the result still a finite state machine? Lecture 8: Modeling Discrete Systems 2/24/2019

Extended State Machines Actions Can access and change variables Can be { var := expression; … } Can do something external When no condition is true Stay in same state When multiple conditions are true What should be done Nondeterminism Allow priority specification Disallow Lecture 8: Modeling Discrete Systems 2/24/2019

Extended State Machines What does this do? Lecture 8: Modeling Discrete Systems 2/24/2019

Extended State Machines What does this do? Lecture 8: Modeling Discrete Systems 2/24/2019

Periodic Automata Specify a Period Extended automata Action taken every period Not on timeout Not when events occur Extended automata Variables, actions Good model for Arduino tasks What does this do

Periodic Automata Period = 100 ms What does this do Lecture 8: Modeling Discrete Systems 2/24/2019

Statecharts David Harel (80’s) Part of UML Extended FSM notation Lecture 8: Modeling Discrete Systems 2/24/2019

Meta States Hierarchical Automata Start states Stop states Enter States Lecture 8: Modeling Discrete Systems 2/24/2019

Homework Read Chapter 4 Exercises 4.3, 4.5, 4.7 Lecture 8: Modeling Discrete Systems 2/24/2019