systemc semantics by actors and reduction techniques in model checking

48
SystemC Semantics by Actors and Reduction Techniques in Model Checking Marjan Sirjani Formal Methods Lab, ECE Dept. University of Tehran, Iran MoCC 2008 Eindhoven 1

Upload: orinda

Post on 15-Jan-2016

29 views

Category:

Documents


0 download

DESCRIPTION

SystemC Semantics by Actors and Reduction Techniques in Model Checking. Marjan Sirjani Formal Methods Lab, ECE Dept. University of Tehran, Iran MoCC 2008 Eindhoven. Outline of the Talk. Motivation and Goal SystemC Actors and Rebeca Coordinating Actors Mapping SystemC to Actors - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

SystemC Semantics by Actors and

Reduction Techniques in Model Checking

Marjan Sirjani Formal Methods Lab, ECE Dept.

University of Tehran, Iran

MoCC 2008Eindhoven 1

Page 2: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Outline of the Talk

Motivation and Goal SystemC Actors and Rebeca Coordinating Actors Mapping SystemC to Actors Model Checking SystemC Designs Conclusion

2

Page 3: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Motivation Integrating heterogeneous components Increasing complexity of microelectronic systems

Demand an appropriate increase in the level of abstraction in design =>

using SystemC and/or Actors

Sufficient verification/validation of complex designs High amount of effort for simulation

Demand a formal verification approach => mapping

3

Page 4: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Goal

A model for system-level design Modeling different levels of abstraction

Software TLM RTL

in a consistent manner.

Closer to the application domain

A tool for formal verification of system-level designs

4

Page 5: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Why SystemC?

A standard language for modeling embedded systems at system level

An object-oriented language supporting Modularity Concurrency Synchronization

5

Page 6: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Why Actor?

Actor-based design: high level of abstraction• Inherent Concurrency: provided by means

of concurrent actors• No threads• Actors: units of concurrency

• Event-driven computational model: message passing and event-driven execution of actors

6

Page 7: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Applications

Models: Actors

Programs: SystemC

Executables

Silicon Chips

7

Page 8: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

SystemC

8

Page 9: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

9

SystemC

A system-level design language

Design of the hardware and software components together at a high level of abstraction

Simulation kernel manages process interactions

9

Page 10: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

SystemC Modularity: SC_MODULE

Contains: ports, signals, variables, constructor, functions, processes

Concurrency: Processes SC_Method: atomic execution SC_Thread: wait statements

Synchronization: Events Explicit: event of type SC_EVENT

Calling notify() method Implicit: change of the value of signals

10

Page 11: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

11

SystemC Simulation Kernel

Each simulation cycle has two phases Evaluation

Execution of the ready to run processes Update

After delta time Signal Updates

Two dimension timing to implement concurrency Physical time Delta time

11

Page 12: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Actors and Rebeca

12

Page 13: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Traditional Actor

Agent-based model, introduced by Hewitt, 1970

Developed as a concurrent object-based language by Agha, 1980

Concurrent objects communicating with each other through asynchronous message passing

Actors know about the communicating partners Objects take messages from their queues and reacts

to them Do some computation Send messages to other objects

13

Page 14: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

14

Rebeca Language

Reactive Objects Language Actor-based

A Rebeca model is Set of concurrently executing reactive objects Interacting by Asynchronous messages

Page 15: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Rebeca Language

Rebecs are instances of Reactive Classes Reactive Classes

A queue for messages Message servers State variables

Rebecs are running concurrently Take a message from the queue and execute the

related message server atomically

15

Page 16: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Rebeca

Actor-based Inherent concurrency Units of modeling = units of concurrency Event-driven

Built for verification purposes model checking support compositional verification

Formal semantics Firm basis for verification

1616

Page 17: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

System Design Using Rebeca

System components are running concurrently

Considering a rebec for each component

Each component knows other components to which it interacts with and directly send messages to them

17

Page 18: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Rebec1

ComputationalActor 1

Rebec2

ComputationalActor 2

Rebec3

ComputationalActor 3

Rebec4

ComputationalActor 4

Rebec5

Computational Actor 5

18

Page 19: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Rebec1

ComputationalActor 1

Rebec2

ComputationalActor 2

Rebec3

ComputationalActor 3

Rebec4

ComputationalActor 4

Rebec5

Computational Actor 5

19

Page 20: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Rebec1

ComputationalActor 1

Rebec2

ComputationalActor 2

Rebec3

ComputationalActor 3

Rebec4

ComputationalActor 4

Rebec5

Computational Actor 5

20

Page 21: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Rebec1

ComputationalActor 1

Rebec2

ComputationalActor 2

Rebec3

ComputationalActor 3

Rebec4

ComputationalActor 4

Rebec5

Computational Actor 5

21

Page 22: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Rebec1

ComputationalActor 1

Rebec2

ComputationalActor 2

Rebec3

ComputationalActor 3

Rebec4

ComputationalActor 4

Rebec5

Computational Actor 5

22

Page 23: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Coordinating Actors

23

Page 24: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

New Generation of Actors

Keeping Actors as simple as possible Actors do not know about the scenarios which

activate other actors Moving towards component-based designs Extracting coordination parts from computational

parts A coordinating Actor is responsible for activating

other actors

24

Page 25: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Rebec1

ComputationalActor 1

Rebec2

ComputationalActor 2

Rebec3

ComputationalActor 3

Rebec4

ComputationalActor 4

Rebec5

CoordinatingActor

25

Page 26: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Rebec1

ComputationalActor 1

Rebec2

ComputationalActor 2

Rebec3

ComputationalActor 3

Rebec4

ComputationalActor 4

Rebec5

CoordinatingActor

26

Page 27: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Rebec1

ComputationalActor 1

Rebec2

ComputationalActor 2

Rebec3

ComputationalActor 3

Rebec4

ComputationalActor 4

Rebec5

CoordinatingActor

27

Page 28: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Rebec1

ComputationalActor 1

Rebec2

ComputationalActor 2

Rebec3

ComputationalActor 3

Rebec4

ComputationalActor 4

Rebec5

CoordinatingActor

28

Page 29: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Rebec1

ComputationalActor 1

Rebec2

ComputationalActor 2

Rebec3

ComputationalActor 3

Rebec4

ComputationalActor 4

Rebec5

CoordinatingActor

29

Page 30: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Rebec1

ComputationalActor 1

Rebec2

ComputationalActor 2

Rebec3

ComputationalActor 3

Rebec4

ComputationalActor 4

Rebec5

CoordinatingActor

30

Page 31: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Actors with a Coordinator

Actors: concurrent components communicate through ports and interact according to a common pattern of interaction

System components -> Concurrent components

Interaction patterns -> Component composition

Component behavior and component composition are orthogonal

31

Page 32: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Mapping SystemC to Rebeca

32

Page 33: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Modules and Processes

SystemC Construct Rebeca Construct

Module Reactive Class

Process (method & thread) Message server

Module instance A group of rebecs

33

Page 34: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Signals, Ports and variable

SystemC Construct

Rebeca Construct

Signal Two global variables

Port A local copy of the variable representing the attached signal

Variable One global variables

34

Page 35: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Events, Wait and Notify

35

SystemC Construct

Rebeca Construct

Event a global variable of type Boolean

Wait Rebeca wait statement

Notify an assignment on the variable representing the event

Page 36: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

SystemC Simulation Kernel

A specific reactive object is dedicated to handle the functionality of the simulation kernel

Becomes active when none of the other rebecs are active

Functionality: Checking sensitivity lists to find if any of the rebecs can be

activated Updating signal values Feeding new input to the system if all of the rebecs are still

inactive

36

Page 37: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Model Checking SystemC Designs

37

Page 38: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Rebeca Model Checkers

38

SystemC Model

LTL/CTLProperty

Sytra:Model andProperty

Transformer

(Including KasCPar as the compiler)

Rebeca ModelChecker

(Modere & SyMon)

Model CheckingResult

Rebeca Model

Page 39: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Modere Modere: Model checking Engine for Rebeca

Direct model checker of Rebeca

Generating state space based on the interleaving of all executable rebecs

Provides many abstraction and reduction techniques specific for Rebeca

Supports both LTL and CTL properties

39

Page 40: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

SyMon SyMon: Systemc Model checking Engine A verification engine customized according to

the behavior of SystemC simulation kernel: Executes processes one by one, with a non-

preemptive scheduling policy, according to a pre-specified order

Generating only one path of execution

Provides a significant amount of reduction in the size of the generated state space

40

Page 41: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Reduction Techniques:Based on SystemC Semantics Delta Cycles

Generating state space based on the interleaving of all executable rebecs N ready to run => N! states for delta cycles

Generating only one path of execution, assuming an order for executing rebecs N ready to run => N states for delta cycles

41

Page 42: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Reduction Techniques:Based on Rebeca Semantics Compositional Verificationn:

Abstracting environment as external messages

42

Page 43: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

43

Abstraction Techniques:

Bounded queues Abstracting external messages Queue length in model checking

Check overflow, supported by tool

Course grained interleaving Method execution as a transition (Atomic method execution)

Conventional data abstractions

Page 44: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

44

Partial Order and Symmetry Reduction Techniques Partial order reduction

Diamond parts in the state space Symmetry reduction

Like in dining philosophers (Ring-like topologies) The permutation relation shall preserve both

rebec types and known-rebec relation.

Page 45: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Case studies

The approach is applied on a set of case studies D-flip flop Shifter Bus arbiter Latched ALU 2-by-4 decoder Full adder Fibonacci generator GCD calculator

45

Page 46: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

A large case study: MIPS

Model SystemC

A processor supporting ALU, branch and memory operators 17 concurrent threads 96 signals, events and variables

Rebeca 18 rebec 136 global variable

Total number of states Modere: exploded SyMon: 345986

46

Page 47: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Work in Progress: Scheduling Using Time Automata and Task Automata to

verify schedulability of rebecs

47

Page 48: SystemC Semantics by Actors  and Reduction Techniques in Model Checking

Conclusion Define formal semantics of SystemC by means of

Rebeca

Model check SystemC designs According to the semantics of simulation kernel All interleavings

48