lowRISC / opentitan

OpenTitan: Open source silicon root of trust
https://www.opentitan.org
Apache License 2.0
2.46k stars 736 forks source link

[otbn] Duplicated error code list #4450

Open rswarbrick opened 3 years ago

rswarbrick commented 3 years ago

The list of OTBN error codes is duplicated, appearing in these 3 places:

We should probably list them in the hjson and generate the other files. Easy enough for the documentation and ISS. For the SV code, maybe we could get reggen to generate the list, and then move the list to otbn_reg_pkg.sv.

imphil commented 3 years ago

And one more: The DIF

GregAC commented 3 years ago

I have a slight preference for a separate file for the RTL. It seems a bit of a shame to include all of the reggen/top-level interface specific stuff just to get hold of the error codes. In particular OTBN is pretty standalone at the moment, you can grab the relevant RTL and put it into a non OpenTitan environment easily enough. You could just manually pull out the errors codes if you did such a thing to drop the otbn_reg_pkg import but keeping them separate emphasizes OTBN core should remain as loosely coupled to the other OT things as possible.

tjaychen commented 2 years ago

@GregAC @rswarbrick do you guys want to close this issue? I know this area has been heavily discussed and implemented, so the issue is probably either stale or already addressed.

rswarbrick commented 2 years ago

It's still duplicated, with comments pointing at the other lists. Might be worth keeping it as a low-priority future enhancement.