coreblocks
coreblocks copied to clipboard
Decoder rework
As we have seen in comment. Decoder can have a great impact on whole core results. On the one side it has a lot of combinational paths which can lower Fmax, on the other it have a lot of logic, which takes place and can impact negatively on optimising critical paths in other parts of core. Current decoder is mainly based on our first decoder implementation with only some later improvements. So in my opinion we need to refactor it, particularly because there are work to add V extension which adds 300 instructions to our current 100 instruction (so we will have 4 times more instructions to decode than now). First results shows that adding 100 new instructions to decode decrees Fmax by 2MHz (from 59MHz to 57MHz) and doubles simulation time for instruction decoding (also on old instructions).
My proposition:
We can create a separate decoder for each opcode (or subset of opcodes), thanks to that we can resign from extension specific "if"-s and simplify logic in each decoder (no longer need for taking care about csr
, fence
and vectors
in one module). Decoding in each decoder will be independent from rest, so it will support reducing combinational paths. In the end Decode
module can take all Decoders
and choose result from one based on the opcode.
This will simplify in future adding new opcodes/custom extensions, because only a new decoder will be needed without modifying the old ones.