How to config xLen in rocket core?

302 Views Asked by At

I am trying to use rocket core as a baseline core and add some additional features for research purpose, but I can't find where or how to change the value "xLen".

1

There are 1 best solutions below

0
On BEST ANSWER

Rocket Chip uses a default XLen of 64 in it's DefaultConfig. However, this can be changed to 32 via a different top-level System configuration of DefaultRV32Config.

If you're working with the Rocket Chip emulator, you can compile these two different configurations with

cd emulator
CONFIG=DefaultConfig make
CONFIG=DefaultRV32Config make

For reference, take a look at the Rocket Chip System configurations defined in the system package as well as the subsystem configurations:

The former defines DefaultConfig and DefaultRV32Config. The latter defines WithRV32. WithRV32 is what changes XLen to 32 (and also sets fLen to 32). Alternatively, you can replicate the behavior of WithRV32 in your own subclass of Config.