predecode: Work around apparent yosys/nextpnr bug
authorPaul Mackerras <paulus@ozlabs.org>
Thu, 4 Aug 2022 04:57:12 +0000 (14:57 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Tue, 9 Aug 2022 10:14:35 +0000 (20:14 +1000)
commit30f65741350630b88a25fa43a3ee5ecfe5cdeb39
tree9ddc400f83f932b96d9c4222202eefd3652835da
parent21ab36a0c0cc05501d036a160f3002d21b7cd9cd
predecode: Work around apparent yosys/nextpnr bug

This rearranges the synchronous process here to avoid setting fields
of pred(i) to zero or INSN_illegal when valid_in is '0'.
Experimentally, on ECP5 this acts like an asynchronous reset rather
than a synchronous reset.

Instead, handle possible indeterminate input for simulation by making
the maj_predecode and row_predecode fields of predec_t be unsigned
rather than insn_code (an enumerated type), and setting them to X when
the input word is indeterminate.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
predecode.vhdl