tillitis / tillitis-key1

Board designs, FPGA verilog, firmware for TKey, the flexible and open USB security key 🔑
https://www.tillitis.se
391 stars 24 forks source link

Cleanup CPU core instance configuration #84

Closed secworks closed 1 year ago

secworks commented 1 year ago

In the instantiation of the PicoRV32 core we configure the core to what we want But some of the custom configurations are the same as the default. We should only have explicit configurations in the instance where we want something different compared to the default. We should also analyze if there are any other changes we want, or don't want.

secworks commented 1 year ago

I've created the https://github.com/tillitis/tillitis-key1/tree/cpu_configuration branch for work, and made a first stab at the clean up. However I should compare our configuration with the defaults in the CPU source code, not the documentation.

secworks commented 1 year ago

The results from first attempt was not good. The core expanded. Deleted the branch mentioned above and create a new one. https://github.com/tillitis/tillitis-key1/tree/cpu_config_cleanup

secworks commented 1 year ago

The new branch contains a commit that removes options in the instance that are the same as what the core has as defaults. This should be 100% benign. Interestingly, disabling ENABLE_COUNTERS64 make the core grow with one LC. We therefore keep that option enabled (is enabled as desfault). (Enabling counters makes the core grow with many LCs.)

The commit: https://github.com/tillitis/tillitis-key1/commit/317561ad3203b0af95969e8f97ed909e3d823e68

secworks commented 1 year ago

The commit has been merged into main.