Lecture3 CPS Requirements
Lecture3 CPS Requirements
Seyed-Hosein Attarzadeh-Niaki
Review
• CPS design: hardware and software
• CPS software development process
• Model-based design
1
2/24/2023
SPECIFY S OFTWARE
S OFTWARE Test Plan & TestResults TEST
CREATE SW INTEGRATION
ARCHITECTURE Test Plan & TestResults TEST
IMPLEMENT
2
2/24/2023
Functional Requirements
Data collection requirements
• Calculate the actuating variables for the actuators in order to control the
controlled object directly.
Real-Time Requirements
• When Is a Computer System Real-Time?
3
2/24/2023
Real-Time Constraints
• CPS must meet real-time constraints (deadlines)
• A real-time system must react to stimuli from the
controlled object (or the operator) within the time
interval dictated by the environment.
execute
t
• If a result has utility even after the deadline has passed, the deadline is
classified as soft;
• otherwise it is firm;
• If severe consequences could result if a firm deadline is missed, the
deadline is called hard.
➢ A guaranteed system response has to be explained without statistical arguments
[Kopetz, 1997].
t
3. Possibility to specify timeouts
Stay in a certain state a maximum time.
4
2/24/2023
Efficiency Requirements
• CPS & ES must be efficient
– Code-size efficient
(especially for systems on a chip)
– Run-time efficient
– Weight efficient
– Cost efficient
– Energy efficient
Efficient software
design needed,
otherwise, the
price for software
flexibility cannot be
paid.
5
2/24/2023
Dependability Requirements
▪ CPS/ES must be dependable, in the sense of
•Reliability R(t) = probability of system working
correctly provided that is was working at t=0
•Maintainability M(d) = probability of system
working correctly d time units after error occurred.
•Availability: the fraction of time that the system
works
•Safety: no harm to be caused
•Security: confidential and authentic communication
Security Requirements
Defending against
Cyber crime („Annual U.S. Cybercrime Costs Estimated
at $100 Billion; …[Wall Street Journal, 22.7.2013])
Cyber attacks ( Stuxnet)
Cyber terrorism
Cyber war
Connectivity increases threats
entire production chains can be affected
local islands provide some encapsulation, but contradict idea of
global connectedness
➢ Nowadays, we may have cyber-physical attacks.
➢ Integration with physical domain complicates the security
Embedded Real-Time Systems 12
6
2/24/2023
Summary of
Extra-Functional Requirements
• Emergent properties (things hard to attribute to one
component)
– Performance, real-time deadlines
– Security, Safety, Dependability in general
– Size, Weight and Power consumption (“SWaP”)
• Often handled with an allocation budget across components
– Forbidden behaviors (“shall not do X”)
• Often in context of safety requirements
• “Safety function” is a way to ensure a negative behavior, but some
behaviors are emergent
• Design constraints
– Must meet a particular set of standards
– Must use a particular technology
– System cost, project deadline, project staffing
• Functional: elevator shall have peak speed of 11.3 meters/sec (if fastest
Product competitor is 11.2 meters/sec)
• Extra-functional: elevator shall have a patented diagnostic interface
Requirements • Constraint: elevator shall be compatible with BACnet, but need not use it
for internal functions
7
2/24/2023
Overly complex R-7.3: Pressing the red button shall activate Widget X, while pressing the blue button should
cause LED Z to blink instead of LED Y illuminating steadily, which would be accomplished via
the yellow button.
Describes R-8.3: Pressing button W shall cause two 16-bit integer values to be added, then …
implementation
8
2/24/2023
9
2/24/2023
Requirements Approaches
Text document with list of requirements UML Use Case Diagram
• Works best if domain experts already know reqts.
• Over time, this can converge to better requirements.
Prototyping
• Customers know it when they see it
• Sometimes a paper mock-up is enough
Functional decomposition
• Start with primary system functions
• Make more and more detailed lists of sub-functions
(creates a “functional architecture”)
https://goo.gl/qct5tL
Embedded Real-Time Systems 20
10
2/24/2023
• Areas addressed
– Functionality (what does it do)
– External interfaces (this is really
architecture, but is important to have it
in SRS)
– Performance (speed, real-time issues)
– Attributes (non-functional requirements
such as maintainability, reliability)
– Design constraints (applicable
standards, policies, etc.)
Example System:
Soda Vending Machine
• High Level Requirements: Make it
work like a real vending machine
• Simplification:
– Sodas cost some number of quarters
– All other coins are rejected (invisible
to your control system)
• Assume a Distributed System per
given diagram
– Processor for each button, coin
return controller, vending controller
– You get the message dictionary and
most of the requirements
specification (the “Architecture”)
11
2/24/2023
U6. Refill
Machine Vendor
12
2/24/2023
Use Cases R1 R2 R3 R4 R5 R6
U1. Customer
inserts a quarter X
U2. Customer
pushes a soda X X
button
U3. Customer
pushes coin return X
button
U4. Observe soda
availability X
U5. Collect money X
U6. Refill machine X X
Embedded Real-Time Systems 25
Simulink Requirements
13
2/24/2023
Next Lecture
• Models of computation
– Actor-based modeling
• Continuous Dynamics
– Causal systems
– Memoryless systems
– Linear time-invariant systems
• Read chapter 2 of LeeSeshia
• Review your knowledge from the “Signals &
Systems” course
Embedded Real-Time Systems 28
14