Add "setundef -undef"

Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
Clifford Wolf 2018-03-12 13:52:35 +01:00
parent efaef82f75
commit 83ffb23739
1 changed files with 11 additions and 0 deletions

View File

@ -40,6 +40,9 @@ struct SetundefWorker
if (next_bit_mode == 1)
return RTLIL::State::S1;
if (next_bit_mode == 4)
return RTLIL::State::Sx;
// xorshift32
next_bit_state ^= next_bit_state << 13;
next_bit_state ^= next_bit_state >> 17;
@ -81,6 +84,9 @@ struct SetundefPass : public Pass {
log(" -one\n");
log(" replace with bits set (1)\n");
log("\n");
log(" -undef\n");
log(" replace with undef (x) bits, may be used with -undriven\n");
log("\n");
log(" -anyseq\n");
log(" replace with $anyseq drivers (for formal)\n");
log("\n");
@ -123,6 +129,11 @@ struct SetundefPass : public Pass {
worker.next_bit_mode = 2;
continue;
}
if (args[argidx] == "-undef") {
got_value = true;
worker.next_bit_mode = 4;
continue;
}
if (args[argidx] == "-init") {
init_mode = true;
continue;