[<<][rtl][>>][..]
Fri Aug 10 09:55:53 EDT 2018

SeqTerm and blocks

Blocks are always guarded by conditionals.  It seems simplest to get
rid of the ternary if expression, and convert everything to nested
block form.

Can this be done using Free?

First, make s-expression printout:


0 <- (INPUT)
3 <- (SUB (NODE 2) (CONST _:1))
4 <- (SLICE (NODE 2) 3 0)
5 <- (EQU (NODE 2) (CONST _:0))
6 <- (EQU (NODE 4) (CONST _:0))
7 <- (EQU (NODE 1) (CONST _:0))
8 <- (IF (NODE 0) (CONST _:0) (CONST _:1))
9 <- (EQU (NODE 1) (CONST _:1))
10 <- (IF (NODE 5) (CONST _:2) (NODE 1))
11 <- (IF (NODE 5) (CONST _:63) (NODE 3))
12 <- (EQU (NODE 1) (CONST _:2))
13 <- (IF (NODE 5) (CONST _:3) (NODE 1))
14 <- (IF (NODE 5) (CONST _:7) (NODE 3))
15 <- (EQU (NODE 1) (CONST _:3))
16 <- (AND (NODE 6) (NODE 0))
17 <- (IF (NODE 5) (CONST _:0) (NODE 1))
18 <- (IF (NODE 5) (CONST _:0) (NODE 3))
19 <- (IF (NODE 15) (CONST _:0) (CONST _:0))
20 <- (IF (NODE 15) (NODE 16) (CONST _:0))
21 <- (IF (NODE 15) (NODE 17) (CONST _:0))
22 <- (IF (NODE 15) (NODE 18) (CONST _:0))
23 <- (IF (NODE 12) (NODE 6) (NODE 19))
24 <- (IF (NODE 12) (CONST _:0) (NODE 20))
25 <- (IF (NODE 12) (NODE 13) (NODE 21))
26 <- (IF (NODE 12) (NODE 14) (NODE 22))
27 <- (IF (NODE 9) (CONST _:0) (NODE 23))
28 <- (IF (NODE 9) (CONST _:0) (NODE 24))
29 <- (IF (NODE 9) (NODE 10) (NODE 25))
30 <- (IF (NODE 9) (NODE 11) (NODE 26))
31 <- (IF (NODE 7) (CONST _:0) (NODE 27))
32 <- (IF (NODE 7) (CONST _:0) (NODE 28))
33 <- (IF (NODE 7) (NODE 8) (NODE 29))
34 <- (IF (NODE 7) (CONST _:3) (NODE 30))
1 <- (DELAY (NODE 33))
2 <- (DELAY (NODE 34))
36 <- (SLICE (NODE 35) 8 1)
37 <- (CONC (NODE 0) (NODE 36))
38 <- (IF (NODE 31) (NODE 37) (NODE 35))
35 <- (DELAY (NODE 38))


Then perform hoisting, something like:

19 <- (IF (NODE 15) (CONST _:0) (CONST _:0))
20 <- (IF (NODE 15) (NODE 16) (CONST _:0))
21 <- (IF (NODE 15) (NODE 17) (CONST _:0))
22 <- (IF (NODE 15) (NODE 18) (CONST _:0))


[19,20,21,20] <- IFS (NODE 15) 

      [19 <- (CONST _:0),
       20 <- (NODE 16),
       21 <- (NODE 17),
       22 <- (NODE 18)],

      [19 <- (CONST _:0),
       20 <- (CONST _:0),
       21 <- (CONST _:0),
       22 <- (CONST _:0)]

It's not actually that easy.  To make this readable, the nodes that
are not shared elsewhere should also be moved inside the blocks, so
they can later be eliminated.

I don't see how to express this easily.

Let it rest a bit.





[Reply][About]
[<<][rtl][>>][..]