bridging functional and architectural aspects of controller … · 2018. 4. 3. · need new methods...

20
Bridging Functional and Architectural Aspects of Controller Design in Cyber- Physical System Liangpeng Guo EECS Department, UC Berkeley 6/7/2013

Upload: others

Post on 15-Oct-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Bridging Functional and Architectural Aspects

of Controller Design in Cyber-Physical System Liangpeng Guo

EECS Department, UC Berkeley 6/7/2013

Page 2: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Gap between Function and Architecture

•  Function: describe the functionality of the design – Behaviors that the system should implement

•  Architecture: provides various platform targets (configurations of resources that implement certain functions)

•  The functionality is modeled on high abstraction level with heterogeneous MoCs – High level abstraction without implementation

details •  Correctness of the CPS is sensitive to the

implementation –  e.g. WCET of controller, delay of communication

channels

Page 3: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

A Functional Model without Implementation Details

Page 4: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Functional Behaviors are Affected by Implementation Details

Page 5: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Need New Methods & Tools for Bridging Functional & Architectural

Aspects •  Approach 1: refine functional model by adding

implementation details –  E.g. add bus model

•  Potential problems: –  The model becomes complicated to understand and

modify –  Environment/language for modeling function is not suitable

for architecture. –  Semantic restriction: difficult to model complex architecture

in functional environment •  Approach 2: construct the function using

architectural primitives –  E.g. programming language

•  Potential problems: –  Lose the abstraction of the functionality –  Hard to analyze and verify

Page 6: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Need New Methods & Tools for Bridging Functional & Architectural

Aspects •  Approach 3: make assumptions (contracts) that

decouple the function and architecture –  E.g. assume a bounded communication delay

•  Potential problems: –  Making ‘appropriate’ assumptions is hard –  Assumptions of the functional model about the

architecture significantly impact the Software/Hardware implementation

–  Inappropriate assumptions may restrict the design choices and lead to costly or infeasible architecture

Page 7: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Aspect-Oriented Modeling

Joint modeling of implementation architecture and functional design to enable effective architecture exploration and assessment of the behavioral consequences of architectural choices.

–  What is the performance? How this modifies the behavior? Does this satisfy the vertical contract?

–  Investigate different design choices for the same functional model

Page 8: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Aspect-Oriented Modeling •  Map functional and architectural models without

significant changes •  Enable co-simulation and performance estimation of the

mapped model •  Provide interfaces to explore design and performance

trade-offs

Architectural  Candidates  

P1   P2  

P3   S4  

BUS1  

BUS2  

Sensors,  Processors,  Messages  on  buses  

Func1onal  Model  Sensor  

Sensor   Fusion  Task  

Object  ID  Task   Act.  

Task  Signals

 

tasks,  signals  

Simula1on  of  Mapped  Model  

Performance  es1ma1ons   Mapping,  parameters,  …  

Designers  (or  run-­‐1me  system)  

Page 9: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Example 1: Simplified BCU Controller

•  Decide the power sources for AC buses –  Input: fault signals of power sources and contactors –  Output: control signals for contactors –  Constraint: power sources are never paralleled

Decide  the  power  source  of  the  right  bus  

Generate  control  signals  for  contactors  

Decide  the  power  source  of  the  leD  bus  

Page 10: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Functional Model in Ptolemy

•  Model each part as a FSM

•  Compose FSMs into a Synchronous Reactive (SR) Model

•  SR Director is modified to make the model mappable

Page 11: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Map to Arch Model in SystemC

Page 12: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Preliminary Co-simulation Results

•  Candidate 1 –  High-speed single

processor

•  Candidate 2 –  Slow-speed dual

processors –  low synchronization

overhead

•  Candidate 3 –  Medium speed dual

processors –  high synchronization

overhead

ALP:  leD  controller  ARP:  right  controller  CSG:  control  signal  generator  

Page 13: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Example 2: printingpress controller

Physical  part:  Con1nuous  Models  

Electrical  part:  Controllers  

Page 14: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Mapping Configuration

P1des  MoC  

Page 15: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Mapping Configuration

Task  0  

Task  1  

Task  2  

Page 16: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Round-Robin Scheduling •  Architectural model

–  Designed in a language and environment that are comfortable for architecture designer

•  Example 1: RR scheduling

Page 17: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Priority-based Scheduling

•  Example 1: priority-based scheduling

Page 18: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Performance Annotation

•  The basic performance annotation can be customized in a csv file

Page 19: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

Summary

•  A simulation-based architecture exploration framework – Separate function/architecture models – Change mapping without significantly

modifying models – Evaluate performance, – Explore architectural candidates and

‘discover’ new architectures

Page 20: Bridging Functional and Architectural Aspects of Controller … · 2018. 4. 3. · Need New Methods & Tools for Bridging Functional & Architectural Aspects • Approach 1: refine

THANK YOU