[dv,flash_ctrl] Fix breakage for prog_flash
Description
A big breakage of flash_ctrl tests performing flash_prog was introduced in #22804.
That PR missed running a full regression, or it would have found these breakages. My apologies. The change in that PR fixed the randomization for writes in a specific sequence by adjusting randomization. However, the changes also affected all other sequences, most of which were not prepared for it.
The best fix is conceptually simple but delicate: currently the class randomization happens before, and independently of choosing the flash op, and the error modes. The pattern is, for example
this.randomize() randcase cfg.seq_cfg.otf_wr_pct: prog_flash(...); cfg.seq_cfg.otf_rd_pct: read_flash(...); ... endcase
And the flash_op_t op field is set inside either prog_flash, read_flash, or others.
This means the class randomization cannot set per-op variables correctly, like preventing program resolution faults, half word updates, or preventing multiple programs to the same word with no erase between.
The proposed solution is to create a constraint for rand_op.op like
rand_op.op dist { FlashOpProgram := cfg.otf_wr_pct, FlashOpRead := cfg.otf_rd_pct, ...}
And solve op before fractions and address.