Advanced Multi-Simulation Concepts for Efficiency

advance n.w
1 / 38
Embed
Share

"Learn about multi-simulation principles, discrete event simulation, component views, simulation algorithms, and component evaluations to enhance efficiency in modeling complex systems."

  • Simulation
  • Efficiency
  • Multi-Simulation
  • Discrete Event
  • Component

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. ADVANCE Multi-simulation Concepts John Colley 10thNovember 2011 Southampton 1

  2. Introduction Motivation Discrete Event Simulation Principles Single-thread/Multi-thread Implementations Co/Multi-simulation Principles Two Simulators More than Two Simulators Continuous Simulation Principles Hybrid Continuous/Discrete Multi-simulation Summary 2

  3. Discrete Event Simulation: Motivation Dominant Verification Technology for Synchronous Digital Hardware and Systems on Chip $300 million per year Market Mature Tools (30 years of development) High Price Tools ($30k per seat + maintenance) Single Kernel, Multi-Language Tools for Model Re-use VHDL SystemVerilog SystemC (C++) C 3

  4. Discrete Event Simulation COMPONENT VIEW Components: A, B, C, D (processes) C1 Connections: C1, C2 (unidirectional) A B Ports: IN OUT SIMULATOR API GetValue(port) D HasChanged(port) C2 C SetValue(OUT port, val, delay) ScheduleEval(component, delay) 4

  5. The Two-list Simulation Algorithm t = n C1 A B update list t = 0 D C2 C evaluation list 5

  6. The Two-list Simulation Algorithm t = n C1 A B update list Why not just have a single, time-ordered list? t = 0 D C2 C evaluation list 6

  7. Time Zero Initialisation: Evaluate all Components C1 A B update list t = 0 D C2 C A B C D evaluation list 7

  8. Component evaluations call SetValue, ScheduleEval t = 50 EC t = 30 ED C1 t = 30 C2 A B update list t = 20 C1 t = 0 D C2 C evaluation list 8

  9. Component evaluations call SetValue, ScheduleEval t = 50 EC C: future eval t = 30 ED C1 t = 30 C2 D: future eval C: C2 new val A B update list t = 20 C1 A: C1 new val t = 0 D C2 C evaluation list 9

  10. Global Time is Advanced to t = 20 t = 50 EC t = 30 ED C1 t = 30 C2 A B update list t = 20 C1 t = 0 D C2 C evaluation list 10

  11. Add to eval list each component on C1 fanout t = 50 EC t = 30 ED C1 t = 30 C2 A B update list t = 20 C1 t = 0 D C2 C B D evaluation list 11

  12. B calls ScheduleEval with delay 40 t = 60 EB C1 t = 50 EC A B update list t = 30 ED t = 30 C2 t = 20 C1 D C2 C B D evaluation list 12

  13. Time advances to t = 30: two updates t = 60 EB C1 t = 50 EC A B update list t = 30 ED t = 30 C2 t = 20 C1 D C2 C evaluation list 13

  14. Time advances to t = 30: two updates, oneeval C1 A B t = 60 EB update list t = 50 EC t = 30 ED t = 30 C2 D C2 C D evaluation list 14

  15. Simple Algorithm, Complex Implementation for Performance C1 A B t = 60 EB update list t = 50 EC t = 30 ED t = 30 C2 D C2 C evaluation list 15

  16. Simple Algorithm, Complex Implementation for Performance C1 A B t = 60 EB update list Why not just have a single, time-ordered list? RACE t = 50 EC t = 30 ED t = 30 C2 D C2 C evaluation list 16

  17. Simulating Models without Discrete Delays Unit Delay C1 Each evaluate/update cycle advances time by one tick A B EB C1 update list D C2 C evaluation list 17

  18. The Simulation Testbench C1 B A Primary outputs Primary inputs D C2 C 18

  19. The Simulation Testbench C1 B A Primary outputs Primary inputs In principle, just another component using the API In practice, a complex model of the design environment: Constrained Random Test Generation Assertion Checking Functional Coverage Metrics D C2 C 19

  20. Discrete Event Simulation Languages: Hierarchy C1 B A D C2 C 20

  21. Discrete Event Simulation Languages: Hierarchy C1 B A D C2 C Hierarchy is flattened for simulation 21

  22. Discrete Event Simulation Languages: Function There must be an Entry Point to implement the Eval API call Eval callmust execute to completion Method call Actor Languages with Embedded Wait Eval call must resume at the Wait Point Implement as Finite State Machine Stored Current State represents the next Entry Point 22

  23. A Concurrent Simulator Implementation? t = n C1 A B update list t = 0 D C2 C evaluation list 23

  24. A Concurrent Simulator Implementation t = n C1 A B update list Atomic Insertion t = 0 D C2 C A B C D evaluation list EVAL Components in Parallel 24

  25. A Concurrent Simulator Implementation t = n C1 A B update list Atomic Insertion Amdahl s Law Revisited for Single Chip Systems Jo-Ann M. Paul and Brett H. Meyer, 2006 t = 0 D C2 C A B C D evaluation list EVAL Components in Parallel 25

  26. Event-Driven vs Process-Driven Event-Driven Single core, single process Process-Driven Threads OpenMP Portable Optimised for multi-core Python Generators (coroutines) Single core only (SimPy) 26

  27. What if Component D does not have a native implementation? t = n C1 A B update list C3 t = 0 D C2 C A B C D evaluation list 27

  28. Component D is simulated with a different Simulator: Co-Simulation t = n C1 A B update list C3 t = 0 D External Model C2 C A B C D evaluation list 28

  29. Master/Slave Co-Simulation Master Simulator C1 - - Master Event Queue Design Topology - Components - Connectors Initiates the Slave and establishes Inter-Process Communication A B - C3 D External Model Slave Simulator C2 C - - Slave Event Queue Slave Component 29

  30. Master/Slave Co-Simulation Co-Simulation C1 A B - - - Initialise Master Simulator Initialise Slave Simulator Get time Ts of next event from Slave Run Master until - Time = Ts OR - D sees change on C1 or C2 Get time Tm of next event from Master Tell Slave to run until - Time = Tm - B sees change on C3 C3 - D - External Model C2 C - 30

  31. What if B is represented by a 3rd Simulator? Master Simulator B C1 A External Model - - - Initialise Master Simulator Initialise Slave Simulator Get time Ts of next event from Slave Run Master until - Time = Ts OR - D sees change on C1 or C2 Get time Tm of next event from Master Tell Slave to run until - Time = Tm - B sees change on C3 C3 - D - External Model C2 C - 31

  32. What if B is represented by a 3rd Simulator? Master Simulator B C1 A External Model - - - Initialise Master Simulator Initialise Slave Simulator Get time Ts of next event from Slave Run Master until - Time = Ts OR - D sees change on C1 or C2 Get time Tm of next event from Master Tell Slave to run until - Time = Tm - B sees change on C3 C3 - Simulators run in Lock-Step D - External Model C2 C - 32

  33. Two Simulators, Slave Evaluates much more slowly than Master and Slave can Backtrack Co-Simulation C1 A B - - - - Initialise Master Simulator Initialise Slave Simulator Run Slave Run Master until D sees a change on C1 or C2 at time Tc If Slave time Ts < Tc - Continue running Slave until Tc Else - Slave backtracks to Tc Slave accepts new input value C3 - D External Model C2 - C - 33

  34. Continuous v Discrete Simulation Continuous Equation-based model cont01 Real x, y, z; equation x + y + z = 5.000; der(y) = x + 1.365; y = der(z) 1.875; end cont01; Discrete Assignment-based always @ (posedge clk) begin x <= x + 1 y <= x - 1 end 34

  35. Hybrid Modeling Continuous-time + Discrete-time Modeling Modelica when model t03 Real x, y, z; equation x + y + z = 5; when sample(0, 1) then x = x + 1; y = delay(x 1, 20); end when; end t03; 35

  36. What if B is represented by a Continuous Simulator? B C1 Multi-Simulation A External Model - A, C in Master multi-sim environment B in Continuous Simulator - Modelica - Simulink D in 3rd party Discrete Simulator IN/OUT interfaces to B must be Discrete - Modelica when - C3 - D External Model - C2 C 36

  37. Multi-sim Architecture ADVANCE Rodin Platform A ProB Multi-Simulation Core 3rd Party sim 3rd Party sim . . . 37

  38. Summary Discrete Event Simulation Two-List Algorithm for Deterministic Execution Event-driven or Process-driven Hardware/Software Continuous Simulation Modelica, Matlab/Simulink Co-Simulation/Multi-Simulation Optimisations for 2 Simulators More than 2 Simulators must run in Lock-Step Hybrid Continous/Discrete Simulation Discrete Interfaces 38

Related


More Related Content