4. Exercises

Exercises from the book using ssd.py:

$ python ./ssd.py -s 1 -B 3 -l 30 -n 2 -q

FTL   (empty)
Block 0          1          2
Page  0000000000 1111111111 2222222222
      0123456789 0123456789 0123456789
State iiiiiiiiii iiiiiiiiii iiiiiiiiii
Data
Live

cmd   0:: command(??) -> ??

FTL     7:  7
Block 0          1          2
Page  0000000000 1111111111 2222222222
      0123456789 0123456789 0123456789
State EEEEEEEvEE iiiiiiiiii iiiiiiiiii
Data         u
Live         +

cmd   1:: command(??) -> ??

FTL     7:  7  19: 19
Block 0          1          2
Page  0000000000 1111111111 2222222222
      0123456789 0123456789 0123456789
State EEEEEEEvEE EEEEEEEEEv iiiiiiiiii
Data         u            M
Live         +            +

$ python ./ssd.py -s 1 -B 3 -l 30 -n 2 -C

FTL   (empty)
Block 0          1          2
Page  0000000000 1111111111 2222222222
      0123456789 0123456789 0123456789
State iiiiiiiiii iiiiiiiiii iiiiiiiiii
Data
Live

cmd   0:: write(7, u) -> success
cmd   1:: write(19, M) -> success
     
$ python ./ssd.py -s 1 -B 3 -l 30 -n 2 -C -T log

FTL   (empty)
Block 0          1          2
Page  0000000000 1111111111 2222222222
      0123456789 0123456789 0123456789
State iiiiiiiiii iiiiiiiiii iiiiiiiiii
Data
Live

cmd   0:: write(7, u) -> success

FTL     7:  0
Block 0          1          2
Page  0000000000 1111111111 2222222222
      0123456789 0123456789 0123456789
State vEEEEEEEEE iiiiiiiiii iiiiiiiiii
Data  u
Live  +

cmd   1:: write(19, M) -> success

FTL     7:  0  19:  1
Block 0          1          2
Page  0000000000 1111111111 2222222222
      0123456789 0123456789 0123456789
State vvEEEEEEEE iiiiiiiiii iiiiiiiiii
Data  uM
Live  ++

$