html5-img
1 / 29

S T A R S

ST atic A nalysis of R eactive S ystems. S T A R S. Felice Balarin Cadence Berkeley Labs. Discrete System Example. For a given processor, can I process all workload between two ticks ? How much bus traffic will I generate? How much energy will I use?. Voice Mail Pager. play. tick.

lucian
Télécharger la présentation

S T A R S

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. STatic Analysis of Reactive Systems S T A R S Felice Balarin Cadence Berkeley Labs

  2. Discrete System Example • For a given processor, can I process all workload between two ticks? • How much bus traffic will I generate? • How much energy will I use? Voice Mail Pager play tick network request sample control buffer message frame

  3. Solutions • Prototyping • expensive, comes very late in the design cycle • Simulation • limited number of test vectors • need estimates on timing, energy, bus traffic, ... • STARS: STatic Analysis of Reactive Systems • valid upper bound for any input

  4. STARS A methodology for worst-case analysis of discrete systems that can be used to find a conservative bound on response time. • and power • and bus utilization

  5. Busy Busy VM pager Timing Analysis • STARS gives an upper bound on processor busy period for ANY input sequence play tick network request sample control buffer message frame buffer control Idle

  6. Outline • STARS theory • simple • timing • VCC implementation • Automatic abstraction

  7. play frame tick SIGNATURE pl tk Fenv rq sm pl = 1 fr = 2 tk = 3 Fcntr Fbfr ms fr SIGNATURE ABSTRACTION STARS overview • given T find s that is worse than signature of any execution window of length T • let T be time required to process inputs with signature s play tick network request sample control buffer message frame

  8. Signatures • in practice, counting “events” • state transitions may be considered events • combinations of events may have separate counters • may need linear constraints over counters • less events is “better than” () more events

  9. system t t+T t t+T q = exists F s,T F( s, T) Signature Abstractions Estimate output signature based on input signature and length • must be conservative (ideally, not more than necessary) 

  10. Signature Abstraction: Practice Different approaches for • environment • mostly manual • useful for simulation test-benches, formal verification, ... • depends mostly on time • system • need to analyze code • could be automated for restricted class of systems • mostly depends on signatures

  11. Signature Abstractions: Environment • at least 625s between messages • Fms (s, T) = T/625 + 1 • tick has 125s period • Ftk (s, T) = T/125 + 1 • at most 1 play a second • Fpl (s, T) = T/1,000,000 + 1 play tick network request sample control buffer message frame

  12. Signature Abstraction: Buffer BUFFER: if ( present ( frame ) { samples = frame; last = 50; } if ( present ( tick ) && last > 0) { emit sample ( samples[ last -- ] ); if ( last == 20 ) emit request(); } play tick network request sample control buffer message frame Frq (s, T) = min( fr, tk/30) Fsm (s, T) = min( tk, 50*fr )

  13. t t+T Fix-point Theorem If: • s = F(s, T), • s is worse than signature of initial state, then s is worse than signature of any execution segment of length T  s

  14. Solving Fix-Point Equations Simple iteration lets be the signature of initial state repeat s = F (s, T) until convergence works because F is monotone, so s either converges, or grows beyond any reasonable bounds

  15. s  W(s) Task 2 Task 1 Idle Workload Function Estimates required processor time from signatures • must be conservative

  16. Workload Function: VM pager BUFFER: if ( present ( frame ) { samples = frame; last = 50; } if ( present ( tick ) && last > 0) { emit sample ( samples[ last -- ] ); if ( last == 20 ) emit request(); } play tick network request sample control buffer message frame 1 line = 10 time units W(s) = 20*fr + 20*sm + ...

  17. STARS • Pick a signature • Chose a signature abstraction F and workload function W and verify they and conservative • Solve s = F(s,T) T = W(s) • Tis a bound on response time the processor cannot be continuously busy for more than T time units

  18. (More) Realistic Voice Mail Pager • 16 modules • ~ 4000 lines of C++ code annotated with timing estimates • build signature abstractions manually • 150 lines of C code

  19. VMP First experiment • model environment so that a single message is received and then played • same as DES test-bench • max busy period: • DES: 82 s(simulating 8s took ~ 30 s) • STARS: 83 s(took 16 ms to compute)

  20. 50x125 125 1 2 3 29 30 31 49 50 message, play VMP second experiment • same as first except: • don’t limit the environment to a single message • max busy period: • STARS 148 s (more than 125 s between two ticks) • DES: can find input that has 146 s 66s wide window in a 6250 s period

  21. Outline • STARS theory • simple • timing • VCC implementation • Automatic abstraction

  22. VCC • FUNCTION • a network of communicating processes • ARCHITECTURE • processors, ASICs, buses, memories • MAPPING • allows performance estimation Functional simulation, Performance analysis Export to implementation, STatic Analys

  23. VCC Function Specification • Black Box C++ • can emit events on output ports • can detect events on input ports • Init() function executed once at the beginning • Run() function can be executed if there are some input events can be simulated cannot be estimated

  24. VCC Function Specification • White Box C • point_entry_init() instead of Init() • point_entry_run() instead of Run() can be converted to Black Box and simulated can be estimated, converted to Black Box annotated with performance estimates and simulated

  25. Extended Black Box for STARS • there is a counter counting the number of events on each port • the user can define additional counters • add starsAbstraction() to Init() and Run() • starsAbstraction() is used by STARS • starsAbstraction() can be verified by executing it during the simulation using monitors

  26. How it fits in VCC (black.h) #include "black_interface.h" // generated by "fabricate" #ifndef _black_h_ #define _black_h_ class CPP_MODEL_IMPLEMENTATION : public CPP_MODEL_INTERFACE { public: CPP_MODEL_IMPLEMENTATION(const ModuleProto &, InstanceInit &); void Run(); void Init(); ... starsCounter incount; void starsAbstraction(); }; #endif ...

  27. How it fits in VCC (black.cpp) #include "black.h" #include <assert.h> CPP_MODEL_IMPLEMENTATION::CPP_MODEL_IMPLEMENTATION(const ModuleProto &proto, InstanceInit &inst) : CPP_MODEL_INTERFACE(proto, inst), queueStore_(0) { } void CPP_MODEL_IMPLEMENTATION::Init() { incount.Initialize("incount",this); starsMonitor * m = monitor(); cts_ = ((int)InitialCTS.Value().value() == 0) ? false : true; queueSize_ = (int)MaximumQueueSize.Value().value(); ...

  28. How it fits in VCC (black.cpp) ... void CPP_MODEL_IMPLEMENTATION::Run() { if (CleartoSend.Enabled()) { incount++; if (incount.total() == 1000) incount.mgr()->runStars(); ... } void CPP_MODEL_IMPLEMENTATION::starsAbstraction() { QueueInput.count.setBound(25590); QueueOutput.count.setBound(QueueInput.count); incount.setBound(QueueInput.count/2+10); } ...

  29. S T A R S

More Related