EECS 222: Embedded System Modeling: Lecture 9: Overview
EECS 222: Embedded System Modeling: Lecture 9: Overview
EECS 222:
Embedded System Modeling
Lecture 9
Rainer Dömer
Lecture 9: Overview
• SLDL Semantics
– Concepts and Goals
• Execution and Simulation Semantics
– Motivating Examples (SpecC)
– Motivating Examples (SystemC)
• Simulation Semantics
– Discrete Event Simulation (DES)
– DES Algorithm for SpecC
– DES Algorithm for SystemC
SLDL Semantics
• Essential Concepts in Embedded System Models
– Behavioral hierarchy
• Concurrency, state transitions, exception handling
– Structural hierarchy and connectivity
– Synchronization and communication
– Timing
SLDL must support these concepts in syntax and semantics
• Language semantics define the meaning of constructs
– Execution semantics (for modeling, simulation, and synthesis)
– Deterministic vs. non-deterministic behavior
– Preemptive vs. non-preemptive concurrency
– Atomic operations
– Safe synchronization and communication
SLDL Semantics
• Language Semantics are needed for …
– System designer
• Description and modeling
– Electronic Design Automation (EDA) tools
• Validation (compilation, simulation, estimation)
• Analysis (verification, property checking)
• Synthesis (implementation)
– Documentation and standardization
• Objective
Clearly define the execution semantics of the SLDL
• Requirements and Goals
– Precision (no ambiguities)
– Abstraction (no implementation details)
– Formality (enable formal reasoning)
– Simplicity (easy understanding)
EECS222: Embedded System Modeling, Lecture 9 (c) 2019 R. Doemer 4
SLDL Semantics
• Defining Artifacts Available (SpecC and SystemC)
– Documentation
• Language Reference Manual (LRM)
set of rules written in English (somewhat formal)
• Abstract simulation algorithm
set of valid implementations (abstract, but not general)
– Reference implementation
• SpecC Reference Compiler and Simulator,
SystemC Proof-of-Concept Implementation
one instance of a valid implementation (very specific)
• Compliance test bench
set of specific test cases (specific, but incomplete)
– Formal execution semantics
• Time-interval formalism (only exists for SpecC)
rule-based formalism (mathematical, but incomplete)
• Abstract State Machines
fully formal approach (algebraic notation, not easy to understand)
EECS222: Embedded System Modeling, Lecture 9 (c) 2019 R. Doemer 5
SC_CTOR(Top)
{ SC_THREAD(th1);
SC_THREAD(th2);
}
};
SC_CTOR(Top)
{ SC_THREAD(th1);
SC_THREAD(th2);
}
};
SC_CTOR(Top)
{ SC_THREAD(th1);
SC_THREAD(th2);
}
};
Simulation Semantics
• Discrete Event Simulation (DES) Algorithm for SpecC
– available in LRM (appendix), good for documentation
abstract definition (defines a set of valid implementations)
not general (possibly incomplete)
• Definitions:
– At any time, each thread t is in one of the following sets:
• READY: set of threads ready to execute (initially root thread)
• WAIT: set of threads suspended by wait (initially Ø)
• WAITFOR: set of threads suspended by waitfor (initially Ø)
– Notified events are stored in a set N
• notify e1 adds event e1 to N
• wait e1 will wakeup when e1 is in N
• Consumption of event e means event e is taken out of N
• Expiration of notified events means N is set to Ø
Simulation Semantics
• Discrete Event Simulation (DES) Algorithm for SpecC
Start
Select thread tREADY, execute t
YES
notify Add notified events to N
YES
wait Move tREADY to WAIT
YES
waitfor Move tREADY to WAITFOR
NO
NO
READY=Ø
YES
Move all tWAIT waiting for events eN to READY
Set N=Ø
NO
READY=Ø
YES
Update simulation time, move earliest tWAITFOR to READY
NO
READY=Ø
YES
EECS222: Embedded System Modeling, Lecture 9 Stop (c) 2019 R. Doemer 18
Simulation Semantics
• Discrete Event Simulation (DES) Algorithm for SpecC
– Conforms to general Discrete Event (DE) Simulation
• utilizes delta-cycle mechanism (i.e. inner event loop)
• closely matches execution semantics of other languages
– SystemC
– VHDL
– Verilog
– Features
• clearly specifies the simulation semantics
• is easy to understand
• is straight-forward to implement
– Generality
• is one valid implementation of the semantics
• other valid implementations may exist as well
Simulation Semantics
• Discrete Event Simulation (DES) Algorithm for SystemC
Simulation Semantics
• Discrete Event Simulation (DES) Algorithm for SystemC