LARD simulation system: LARD to C translation - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

LARD simulation system: LARD to C translation

Description:

LARD example. Types. Threads. Blocks. 1) Block declarations. 2) ... LARD code simulation 'Dhrystone' benchmark (~15000 instructions) 495,404 thread creations ... – PowerPoint PPT presentation

Number of Views:104
Avg rating:3.0/5.0
Slides: 14
Provided by: lilian82
Category:

less

Transcript and Presenter's Notes

Title: LARD simulation system: LARD to C translation


1
LARD simulation system LARD to C translation
Behavioralsimulation
Balsa
LARD
synthesis
circuits
2
LARD example
Divide_and_apply( minval(Ttype), maxval(T) )
expr(void) ( if (max-mingtMAX_diff) then
( middlevar(T). middle
(minmax)/2 Divide_and_apply( min,
middle) Divide_and_apply( middle, max
) ) else f( middlevar(T)
(minmax)/2. fct(middle) ) )
3
1) Block declarations2) Threads3) Types
( ( ( ) )
forever ( ) )
4
1) Block declarations2) Threads some figures3)
Types
  • LARD code simulation
  • Dhrystone benchmark (15000 instructions)
  • 495,404 thread creations
  • 34,767,587 thread switching
  • BALSA code simulation
  • hello world with spamulet (130 instructions)
  • 51,480 thread creations
  • 25,563,604 thread switching

Jabez 2 min
Jabez 1 min
5
1) Block declarations2) Threads thread
switching3) Types
F( ) sub_1b( ) ... ...
forever( sub_1b ) ... forever( expr )
while (1) expr( )
Method 1 switch stacks and
registers
6
1) Block declarations2) Threads thread
switching3) Types
Method 2
F( ) sub_1b( ) ... ...
forever( sub_1b ) ... forever( expr )
while (1) expr( )
Yield( )
Save sub_1b position
Save F position
Save expr, forever position
7
1) Block declarations2) Threads thread
switching3) Types
  • Method 2 saverestore sub-function
    states
  • Typical sub-routines chain
  • lt ? while ? function ? channel_send ? yield
    gt
  • switching cost
  • 4 saves 4 loads 4 function returns 4
    function calls

8
1) Block declarations2) Threads methods
comparison3) Types
  • Method 1 Method 2
  • stack switch sub-fonction state
  • saverestore

? switch speed 5x faster ?
? on the stack local vars difficult ?
already done ?
not optimal speed ?
? difficult getting thread info easy ?
9
1) Block declarations2) Threads Switching
method 23) Types
( ( ( ) )
forever ( ... Yield ) )
  • Analyse each fct and sub-fct
  • Need to saverestore thread?
  • Need debugging information?
  • Optimise argument passing

10
1) Block declarations2) Threads Results3) Types
Old
( Total 1545 s )
Lard2c
( Total 100 s )
( Total 61 s )
11
1) Block declarations2) Threads Conclusions3)
Types
  • Is it possible to switch threads faster ?
  • How to get debugging information ?
  • Easy variable control OR speed ?

Method 1 seems promising but
12
1) Block declarations2) Threads3) Types
  • Types represented by their size
  • string and mpint pointers to external
    structures
  • need to be explicitly initialised and destroyed
  • cant use generic functions

Divide_and_apply( minval(Ttype), maxval(T) )
expr(void) ( if (max-mingtMAX_diff) then
( middlevar(T). middle
(minmax)/2 Divide_and_apply( min,
middle) Divide_and_apply( middle, max
) ) else f( middlevar(T)
(minmax)/2. fct(middle) ) )
gt Need a new representation for types
13
Conclusions
  • Thread creation and switching can still be
    improved
  • Need new system for handling types
  • To get
  • Faster simulation
  • More robust (Types)
  • Saverestore simulations
Write a Comment
User Comments (0)
About PowerShow.com