SonalPinto / kronos

Kronos is a 3-stage in-order RISC-V RV32I_Zicsr_Zifencei core geared towards FPGA implementations
https://sonalpinto.github.io/kronos/#/
Apache License 2.0
67 stars 9 forks source link

Remove checks for reserved fields in decode stage for FENCE #3

Closed flaviens closed 1 year ago

flaviens commented 1 year ago

Hi there!

The RISC-V specification says

The unused fields in the FENCE instructions—rs1 and rd—are reserved for finer-grain fences in future extensions. For forward compatibility, base implementations shall ignore these fields.

Likewise, many fm and predecessor/successor set settings in Table 2.2 are also reserved for future use. Base implementations shall treat all such reserved configurations as normal fences with fm=0000.

Therefore, it seems that these checks should be removed.

Thanks! Flavien

SonalPinto commented 1 year ago

Agreed on the rs1/rd fields.

Additionally to what you stated about fm, the following adds to the argument that we can ignore the checks on fm and treat is as a "normal" fence - which is the only thing the core supports anyway.

The FENCE.TSO encoding was added as an optional extension to the original base FENCE instruction encoding. The base definition requires that implementations ignore any set bits and treat the FENCE as global, and so this is a backwards-compatible extension.

SonalPinto commented 1 year ago

How'd you even find this?