Update on Strict Sequential Constructiveness Alexander - - PowerPoint PPT Presentation

update on strict sequential constructiveness
SMART_READER_LITE
LIVE PREVIEW

Update on Strict Sequential Constructiveness Alexander - - PowerPoint PPT Presentation

Update on Strict Sequential Constructiveness Alexander Schulz-Rosengarten Reinhard von Hanxleden and Michael Mendler Kiel University / Bamberg University 2 Sequential Constructiveness / SCL Variables x = 1; Sequence if x {


slide-1
SLIDE 1

Update on Strict Sequential Constructiveness

Alexander Schulz-Rosengarten

Reinhard von Hanxleden and Michael Mendler Kiel University / Bamberg University

slide-2
SLIDE 2

2

slide-3
SLIDE 3

3

Sequential Constructiveness / SCL x = 1; if x { x = 0 }; y = x

  • Variables
  • Sequence
  • Conditional
  • Fork-par-join
  • Goto
  • Pause
slide-4
SLIDE 4

4

x = 1; if x { x = 0 }; y = x Sequential Constructiveness / SCL fork x = 1 par x = x + 2 par y = x join R U I

slide-5
SLIDE 5

5

Recall P10

int x, y; { y = 0; //S0 fork x = 1; //S1 y = x //S2 par if y == 0 { //S3 x = 0 //S4 } join }

→ Speculation about execution of S4

slide-6
SLIDE 6

6

Thou shalt not Speculate

Idea: Ground SC in constructiveness in the spirit of Esterel (Berry-Constructiveness) Strict Sequential Constructiveness is Sequential Constructiveness without speculation

slide-7
SLIDE 7

7

Restricting Sequential Constructiveness

  • Use Esterel for analysis and code generation
  • Requires transformation from SCL to Esterel

SCL SSA SCL Esterel SSA Signal Encoding

slide-8
SLIDE 8

8

P10

int x, y; { y = 0; fork x = 1; y = x par if y == 0 { x = 0 } join } int x0, x1, y0, y1; { y0 = 0; fork x0 = 1; y1 = ?(x0, x1) par if y1 == 0 { x1 = 0 } join }

SSA

slide-9
SLIDE 9

9

P10

int x, y; { y = 0; fork x = 1; y = x par if y == 0 { x = 0 } join } int x0, x1, y0, y1; { y0 = 0; fork x0 = 1; y1 = conc(x0, x1) par if y1 == 0 { x1 = 0 } join }

SSA Esterel

slide-10
SLIDE 10

10

Variable Encoding

SCL Esterel x = true emit xp; emit x; x = false emit xp; x = conc(..) present conflict then emit error; else emit xp; present value then emit x end end

slide-11
SLIDE 11

11

P10

int x0, x1, y0, y1; { y0 = 0; fork x0 = 1; y1 = conc(x0, x1) par if y1 == 0 { x1 = 0 } join }

signal x0p, x0, x1p, x1 in signal y0p, y0, y1p, y1 in signal error in [ emit y0p; [ emit x0p; emit x0; present x0p and x1p and ((x0 and not x1) or (not x0 and x1)) then emit error else emit y1p; present (x0p and x0) or (x1p and x1) then emit y1 end end || present y1p and (not y1) then emit x1p end ] || signal err in present error then present err else emit err end end end signal ]

Esterel

slide-12
SLIDE 12

12

P10

int x0, x1, y0, y1; { y0 = 0; fork x0 = 1; y1 = conc(x0, x1) par if y1 == 0 { x1 = 0 } join }

signal x0p, x0, x1p, x1 in signal y0p, y0, y1p, y1 in signal error in [ emit y0p; [ emit x0p; emit x0; present x0p and x1p and ((x0 and not x1) or (not x0 and x1)) then emit error else emit y1p; present (x0p and x0) or (x1p and x1) then emit y1 end end || present y1p and (not y1) then emit x1p end ] || signal err in present error then present err else emit err end end end signal ]

Esterel

slide-13
SLIDE 13

13

signal x0p, x0, x1p, x1 in signal y0p, y0, y1p, y1 in signal error in [ emit y0p; [ emit x0p; emit x0; present x0p and x1p and ((x0 and not x1) or (not x0 and x1)) then emit error else emit y1p; present (x0p and x0) or (x1p and x1) then emit y1 end end || present y1p and (not y1) then emit x1p end ] || signal err in present error then present err else emit err end end end signal ]

P10

int x0, x1, y0, y1; { y0 = 0; fork x0 = 1; y1 = conc(x0, x1) par if y1 == 0 { x1 = 0 } join }

Esterel

present x0p and x1p and ((x0 and not x1) or (not x0 and x1)) then emit error else ...

slide-14
SLIDE 14

14

signal x0p, x0, x1p, x1 in signal y0p, y0, y1p, y1 in signal error in [ emit y0p; [ emit x0p; emit x0; present x0p and x1p and ((x0 and not x1) or (not x0 and x1)) then emit error else emit y1p; present (x0p and x0) or (x1p and x1) then emit y1 end end || present y1p and (not y1) then emit x1p end ] || signal err in present error then present err else emit err end end end signal ]

P10

int x0, x1, y0, y1; { y0 = 0; fork x0 = 1; y1 = conc(x0, x1) par if y1 == 0 { x1 = 0 } join }

Esterel

slide-15
SLIDE 15

15

P10

int x0, x1, y0, y1; { y0 = 0; fork x0 = 1; y1 = conc(x0, x1) par if y1 == 0 { x1 = 0 } join }

Not Berry Constructive → Not Strictly Sequentially Constructive

slide-16
SLIDE 16

16

New Compile Chain

SCCharts SCEst SCL Esterel

slide-17
SLIDE 17

17

SCChart: ABO

slide-18
SLIDE 18

18

SCEst

present S then unemit S else emit S; end; present S % do stuff end

slide-19
SLIDE 19

19

SSA Merge Functions for SC

  • Updates
  • Persistent Variables
  • Interface Variables
  • Loops

seq(x0, x1) conc(x0, x1)

Further issues:

slide-20
SLIDE 20

20

Update Value Merge

fork x = 1 par x = x + 2 par y = x join

slide-21
SLIDE 21

21

Update Value Merge

fork x0 = 1 par x1 = x0 + 2 par y = conc(x0, x1) join

slide-22
SLIDE 22

22

Update Value Merge

fork x0 = 1 par x1up = 2 par y = conc(x0, x1) join

slide-23
SLIDE 23

23

Update Value Merge

fork x0 = 1 par x1up = 2 par y = combine(+, x0, x1up) join

slide-24
SLIDE 24

24

Persistence of Merged Values

x0 = 1; if I { x1 = 0 } pause; y = seq(x0, x1) fork x0 = 1; if I { x1 = 0 } pause; y = pre(xreg) par l: xreg = seq(seq( pre(xreg), x0), x1); goto l //or terminate join

slide-25
SLIDE 25

25

Interface Variables

  • utput int x;

int x0, x1; fork x0 = 1; if I { x1 = 0 } par l: x = seq(x0, x1); goto l //or terminate join

  • utput int x0, x1;

x0 = 1 if I { x1 = 0 }

slide-26
SLIDE 26

26

Loops

x = 0; Loop: if I { x = 1 } y = x; pause; if J { x = 0 } goto Loop

fork x0 = 0; Loop: if I { x1 = 1 } y = seq(seq(seq(pre(xreg), x0), x2), x1); pause; if J { x2 = 0 } goto Loop par l: xreg = ...

slide-27
SLIDE 27

27

Current Limitations

  • Instantaneous loops
  • Goto structures
  • Static scheduling of updates
  • Some confmuent writes
slide-28
SLIDE 28

28

Alternative Dual-Rail Encoding

not_x \ x present absent present illegal false absent true undef

slide-29
SLIDE 29

29

Future Work The End

SCCharts SCEst SCL Esterel