1 / 58

Embedded Systems and Software

Embedded Systems and Software. Ed F. Deprettere, Todor Stefanov, Hristo Nikolov {edd, stefanov, nikolov}@liacs.nl Leiden Embedded Research Center Spring 2010 http://www.liacs.nl/~cserc/EMBSYST/ESSOFIA2010. Design-flow. Explore, modify, select instances.

Download Presentation

Embedded Systems and Software

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. Embedded Systems and Software Ed F. Deprettere, Todor Stefanov, Hristo Nikolov {edd, stefanov, nikolov}@liacs.nl Leiden Embedded Research Center Spring 2010 http://www.liacs.nl/~cserc/EMBSYST/ESSOFIA2010 05ESSOFIA

  2. 05ESSOFIA Design-flow Explore, modify, select instances System-level design space exploration Synthesizable VHDL C/C++ code for processors MP-SoC Sequential application Sequential application C program Library of IP cores Library of IP cores KPNgen Automatic Parallelization Sesame High-level Models Platform specification Mapping specification Parallel application specification Kahn Process Network System Level Common XML Interface RTL-level Models System-level synthesis ESPAM RTL Level Multi-processor System on Chip (Synthesizable VHDL and C/C++ code for processors) Xilinx Platform Studio (XPS)

  3. 05ESSOFIA System Level. Is level of abstraction well above RTL level. process network application specification is at system level implementation execution platform specification should be at same level. Design opportunities are high. Modeling and evaluation efforts are low. Accuracy is low.

  4. 05ESSOFIA Design Pyramid idea high low back of the envelope calculation abstraction opportunities effort estimation analytical accuracy abstract executabe simulation cycle true RTL synthesizable low high alternatives/design space

  5. 05ESSOFIA Stepwise refinement abstraction pyramid idea back of envelope L details system level model alternatives H rt level design space

  6. 05ESSOFIA System Level Design Space back of envelope L details system level model alternatives H rt level design space

  7. 05ESSOFIA At system level PU PU PU Bus Shared Memory An embedded system is modeled as a triplet {application model, architecture model, mapping specification} application mapping architecture Example.

  8. 05ESSOFIA System Level Models Y-Chart Separation of Concerns architecture model application model functional behavior timing behavior mapping (not functional) (not timed) performance analysis

  9. 05ESSOFIA initialR F outputR G inputSamples System Level Models Daedalus Application Models are Process Networks

  10. 05ESSOFIA System Level Models Daedalus Architecture Models are multi-processors on a chip – that are sufficiently close to the application PN models. Examples are,

  11. 05ESSOFIA Typical Architectures program/data memory communication memory p1 communication controller1 data/control progr./data bus program/data memory communication memory p-n communication Controller-n communication component (crossbar) p-x can be ISA micro-processor or dedicated Read/Execute/Write module

  12. 05ESSOFIA Typical Architectures read execute write control program/data memory communication memory p1 communication controller1 progr./data bus fifo IP1 OP1 program/data memory communication memory OP2 fifo IP2 p-n communication Controller-n cc communication component

  13. 05ESSOFIA Typical Architectures Large FIFO Also Hierarchical Memory program/data memory communication memory communication memory p1 level-2 data memory controller communication controller1 data/control progr./data bus program/data memory communication memory communication memory p-n communication Controller-n level-2 memory communication component (crossbar)

  14. 05ESSOFIA Matching of Models The matching of application and architecture models is crucial. The PN model may have a bad mapping on other architectures (for example the IBM CELL processor)

  15. 05ESSOFIA Cell BE (broadband engine) EIB = element interconnection bus Power Processor Element (PPE) (64 bit Power PC with VMX) 2x 12.98 GB/sec SRAM I/O controller Mem controller EIB I/O controller Mem controller SRAM 76.8 GB/sec SPE 5 SPE = synergetic processor elements (SIMD) SPE 1 SPE 6 SPE 2 SPE 3 SPE 7 SPE 4 SPE 8

  16. 05ESSOFIA SPE Even pipe Odd pipe Local Store 256 Kbytes High speed RAM FP Integer Logical Byte ops Load Store Byte Branch ops 128x128 bit registers control 1024 bits (continuously) MMU + DMA I/O EIB

  17. 05ESSOFIA Applications Applications Estimation Models Applications Mapping Applications Applications Cycle Acc. Models Applications Matlab/ Mathematica Mapping Performance Numbers Cycle Acc. Simulator Performance Numbers Applications Applications VHDL Models Applications Mapping VHDL Simulator Performance Numbers Stack of Y-charst Specify and Explore at Different Abstraction Levels move down into lower abstraction levels (keep the concept of separation of concerns) Move Down into Lower Abstractions

  18. 05ESSOFIA Performance Evaluation (to generate performance numbers) Can be done analytically (estimation) may help pruning the design space Mostly done through simulation

  19. 05ESSOFIA Evaluation through co-simulation • Basic principle: • Application (or functional) simulator drives architecture • (or platform) simulator • The models interact via traces of actions • Traces are produced on-line or off-line Application model (workload) Trace is linearly ordered sequence of abstract instructions Read, Execute, Write trace trace trace Architecture model

  20. 05ESSOFIA Trace Driven Simulation W E(F) R W E(G) R F = pointer to function or code in library Trace : Symbolic Instructions tw= fw(check for room, store data, signal data) te=fe(Execute(G)) G is pointer to processor in labrary tr= fr(checkfor data, load data, signal room)

  21. 05ESSOFIA Symbolic Programs Trace driven co-simulation is restricted because traces do only contain instructions that model dataflow but not Control flow. Control cannot be modeled. Classic lower level (‘high”-level synthesis) modeling is usual based on the CDFG graph (control dataflow graph), which is an executable graphical representation of a (piece of) program code. Executable statement Y N ? Executable statement Executable statement

  22. 05ESSOFIA Symbolic program Is similar to CDFG but more abstract: nodes are coarser, and not executable. B (Boolean T/F) Switch Control trace F1 F2 Symbolic program B=T Select Fi non-executable symbolic Execute instructions Control trace contains actual outcomes.

  23. 05ESSOFIA Symbolic programs Application model (workload) Control trace contains actual outcomes of data dependent conditionals (for a particular input data) Only then disappear unknowns and can we go back to classic symbolic instruction traces. Symbolic program Control trace Symbolic instructions trace Architecture model

  24. 05ESSOFIA Design Space Exploration What to do with performance numbers? Search for architecture(s) that is (are) best suited (in some sense) for our application. Generally good trade-off for conflicting goals.

  25. 05ESSOFIA Applications Mapping Performance Evaluation Performance Numbers Feed back and Improve Architecture Use different Mapping strategies Suggest architectural improvements Rewrite the applications Three different ways to improve the performance of a system

  26. 05ESSOFIA Applications Mapping Performance Analysis Performance Numbers Design Space Exploration Architecture Use different Mapping strategies Some Optimization Procedure Given Metrics

  27. 05ESSOFIA Objectives find one or more application-architecture model pairs that satisfy a number or requirements and constraints. • For example: • Certain processes must run on certain processors or • processor types. • Some processes must be mapped on same processor • Some communications must be mapped on specific paths • Restrictions on Resource Sharing Policies • Performance should be max., cost min.

  28. 05ESSOFIA Optimization Design space exploration is an large ill-posed optimization problem: properties of optimization space not known. Deterministic methods (like branch and bound) are all NP-hard. They guarantee asymptotic convergence. Heuristic random search methods are easy to implement and ‘fast’. They ensure convergence in probability.

  29. 05ESSOFIA Optimization methods Most practical methods are in essence random search (meta) heuristics, easy to implement with ‘black box’ function evaluation. They are not greedy (avoid local optima). X Y f f need not be an explicit math. function Iterative improvement with regard to quality measure. Few Or no assumptions about problem being optimized. The performance of a method depends on the type of problem.

  30. 05ESSOFIA Optimization methods • based on classic single objective optimization • methods • different objectives are weighted • one solution at each iteration • probabilistic search methods • simulated annealing • population based search methods • evolutionary algorithms • genetic algorithms • one population at each iteration

  31. 05ESSOFIA Simulated Annealing Each point s in search space is analogous to a state of a physical system. The function E(s) to be minimized is analogous to the internal energy of the system at that state. The optimization method moves the system to a state of minimum energy, starting from an initial memory Moving from a state s to a state s’ is based on a probability function P(e, e’, T), where e and e’ are the energies in the two states, and T is a parameter called temperature.

  32. 05ESSOFIA Simulated annealing P(e, e’, T) P must have the property that it is positive for e’ > e so that the algorithm can go out of a local optimum: a state that is worse than the global Optimum, yet better than the neighboring states. But when T goes to zero, P must tend to go to zero as well when e’ > e and positive when e > e’ to go ‘downhill’. Once T=0, the algorithms becomes greedy: goes only ‘downhill’. T is decreased gradually all the time

  33. 05ESSOFIA Simulated annealing The algorithm converges to global optimum for t ∞(practical tinf is usually larger that exhaustive search time). Fast cooling Slow cooling Image pixels whit similar colours are caused to attract at short range and to repel at larger distances.

  34. 05ESSOFIA Multi-objective Optimization DSE is an example of a multi-objective optimization problem. Analytical solution only for single objective or parameter. min f(x) xεX x decision or optimization parameter In general: min [f1(x), f2(x), f3(x), . . . ,fn(x)] fi(x) objective function T s.t. g(x) ≤ 0, h(x) = 0, xl ≤ x ≤ xu g and h constraints x

  35. 05ESSOFIA Multi-objective Optimization It is generally not possible to have the minimum for all fi(x) The following concepts are crucial in defining the best solution(s). If f and g are m-dimensional vector functions, then f dominates g if and only if 1) fi ≥ gi all i, and 2) there is a j s.t. fj > gj.

  36. 05ESSOFIA Multi-objective Optimization If f and g are m-dimensional real valued vector functions, then f dominates g if and only if 1) fi ≥ gi all i, and 2) there is a j s.t. fj > gj. f f2 dominated by f f1 Let F be a set of vectors in m-dimensional real valued vector space. Then, the set * F := {g in F | no f in F dominates g} is called the Pareto set.

  37. 05ESSOFIA Multi-objective Optimization Maximize (y1, y2, y3, . . . , yk) = f(x1, x2, x3, . . . ,xn) y2 better Pareto optimal (not dominated) Incompatible worse y1 Pareto set = set of all Pareto-optimal solutions

  38. 05ESSOFIA Multi-objective Optimization X2 y2 dominated f Pareto opt. X1 y1 decision space objective space Difficulties: 1. large search space 2. Multiple optima

  39. 05ESSOFIA Black-box optimization Objective function decision vector x objective vector y (e.g., simulation model) optimization algorithm to evaluate f (direct search)

  40. 05ESSOFIA Traditional approach parameters multiple objectives single objective transformation Yi Y example: weighing y2 wi (i=1,2, . .) Yi Y transformation y= Σwi y1

  41. 05ESSOFIA Evolutionary/Genetic algorithms Optimization parameters are encoded as genes of separate Individuals. Each individual’s combination of parameters Represents a possible candidate solution. A population Of individuals evolves during multiple generations towards ‘better’ solutions. Individuals in generation are ordered with respect to a fitness measure. The fit candidates are selected to undergo mutation and recombination. This gives new generation.

  42. 05ESSOFIA Evolutionary Algorithms Principle of evolution parent select parents initialize recombination populatio BEGIN INITIALIZE population with random candidate solution; EVALUATE each candidate REPEAT UNTIL (TERMINATION COND. is satisfied) DO 1. SELECT pairs of parents 2. RECOMBINE pairs of parents 3. MUTATE resulting offspring 4. EVALUATE new candidates 5. SELECT individuals for next generation OD END mutation terminate offspring survivor select

  43. 05ESSOFIA Evolutionary Algorithms • Components of Evolutionary Algorithms • Representation (definition of individuals) • Fitness Assignment • Population • Parent selection mechanism (mating) • Variation operators • Survivor selection mechanism Genetic Algorithms and programming (Evolution Strategy and evolutionary programming)

  44. 05ESSOFIA Genetic algorithms (GA) Representation of individuals: binary vectors Genotype Phenotype 1 1 0 1 0 Integer Processor of some type . . .

  45. 05ESSOFIA GA Mutation 1 1 0 1 0 1 1 1 1 0 each bit flipped with probability p

  46. 05ESSOFIA GA Mutation scramble permutation rearrange . . . swap 1 1 0 1 0 1 1 0 1 0 1 0 1 0 1 1 0 0 1 1

  47. 05ESSOFIA GA Crossover One-point crossover 1 1 0 0 1 0 0 1 0 1 0 0 1 1 0 N-point crossover 1 1 0 1 0 1 1 0 1 0 1 1 1 0 0 0 0 1 0 1 0 0 0 0 1 Uniform crossover: each bit are flipped with fixed probability (typically .5)

  48. 05ESSOFIA Outline of simple Algorithm Item1 = no Item2 = no Item3 = yes Item4 = yes 0 0 1 1 = 1 solution 0 1 1 1 fitness = 19 encoding fitness evaluation mating selection environmental Selection (survivor) mutation recombination 0 1 0 0 0 0 1 1 0 0 1 1 1 0 1 1 0 0 0 0

  49. 05ESSOFIA GA-How can it work? mutation and crossover are quite arbitrary, how can it converge? Evolution: Selection Pressure “survival of the fittest” • if a bad solution is created • it will get eliminated in the next reproduction operation • if the offspring is good • likely to get more copies in next reproduction operation • likely to achieve crossover with other good solutions

  50. 05ESSOFIA Parent and Survivor Selection Fitness proportionate or roulette-wheel selection If fi is the fitness of individual i in the population Then it is selected with probability pi = fi /Σfj j • Disadvantages • outstanding individuals take over entire population quickly • when fitness values are close together, almost no selection • pressure.

More Related