bazelbuild / platforms

Constraint values for specifying platforms and toolchains
Apache License 2.0
108 stars 71 forks source link

Add a `riscv32` cpu constraint. #30

Closed cfrantz closed 2 years ago

cfrantz commented 3 years ago

We intend to use this contraint for cpu & compiler selection for the OpenTitan project. We are working on creating a riscv32 compiler configuration in the bazel-embedded project.

Signed-off-by: Chris Frantz cfrantz@google.com

cfrantz commented 3 years ago

Question: I've named this riscv32 based on the pre-existing entry for riscv64. However, among the riscv32 family, there are several sub-architecture features (ie: Integer instruction set, mul/div unit, compressed instructions, etc).

What is the appropriate definition here? To me, it seems the constraints here are high-level CPU/architecture constraints and that I shouldn't specify something like rv32imc here.

katre commented 3 years ago

You are correct: these are intended as high-level constraints and so riscv32 is appropriate.

If you had separate toolchains for different sub-architectures, I'd advise you to create a new constraint_setting for those, and use that to distinguish platforms and toolchains. I'd also advise you to keep those with the new toolchains, not in the @platforms repository, since they'd be specific to users of those custom toolchains.

aiuto commented 2 years ago

@cfrantz Sorry about the merge delay. A very clever auto-sync system failed us. We didn't notice. We have since replaced this system with something simpler. I'll merge now