Implemented SOMEBITS/MOSTBITS emubd powerloss behavior

These emulate powerloss behavior where only some of the bits being
progged are actually progged if there is a powerloss. This behavior was
the original motivation for our ecksums/fcrcs, so it's good to have this
tested.

As a simplification, these only test the extremes:

- LFS_EMUBD_POWERLOSS_SOMEBITS => one bit progged
- LFS_EMUBD_POWERLOSS_MOSTBITS => all-but-one bit progged

Also they flips bits instead of preserving exact partial prog behavior,
but this is allowed (progs can have any intermediate value), has the
same effect as partial progs, and should encourage failed progs.

This required a number of tweaks in emubd: moved powerloss before prog,
moved mutate after powerloss, etc, but these shouldn't affect other
powerloss behaviors. Handling powerloss after prog was only to avoid
power_cycles=1 being useless, it's not strictly required.

Good news is testing so far suggests our ecksum design is sound.
This commit is contained in:
Christopher Haster
2024-06-06 16:38:26 -05:00
parent e06964269e
commit b4af52bc72
6 changed files with 379 additions and 175 deletions
+5
View File
@@ -16865,6 +16865,7 @@ code = '''
// create a null tag hole
rbyd = init_rbyd;
lfsr_bd_erase(&lfs, rbyd.blocks[0]) => 0;
lfsr_rbyd_commit(&lfs, &rbyd, -1, LFSR_ATTRS(
LFSR_ATTR(
LFSR_TAG_UATTR(0), 0,
@@ -16913,6 +16914,7 @@ code = '''
// create a null tag hole
rbyd = init_rbyd;
lfsr_bd_erase(&lfs, rbyd.blocks[0]) => 0;
lfsr_rbyd_commit(&lfs, &rbyd, -1, LFSR_ATTRS(
LFSR_ATTR(
LFSR_TAG_UATTR(0), 0,
@@ -16971,6 +16973,7 @@ code = '''
// create a null tag hole
rbyd = init_rbyd;
lfsr_bd_erase(&lfs, rbyd.blocks[0]) => 0;
lfsr_rbyd_commit(&lfs, &rbyd, -1, LFSR_ATTRS(
LFSR_ATTR(
LFSR_TAG_UATTR(0), 0,
@@ -17028,6 +17031,7 @@ code = '''
// create a null tag hole
rbyd = init_rbyd;
lfsr_bd_erase(&lfs, rbyd.blocks[0]) => 0;
lfsr_rbyd_commit(&lfs, &rbyd, -1, LFSR_ATTRS(
LFSR_ATTR(
LFSR_TAG_UATTR(0), 0,
@@ -17095,6 +17099,7 @@ code = '''
// create a null tag hole
rbyd = init_rbyd;
lfsr_bd_erase(&lfs, rbyd.blocks[0]) => 0;
lfsr_rbyd_commit(&lfs, &rbyd, -1, LFSR_ATTRS(
LFSR_ATTR(
LFSR_TAG_UATTR(0), 0,