What do the (site, here, up) arguments mean when creating rocket-chip configurations?

510 Views Asked by At

When creating a new "Config" we define a function that takes three "View"s (site, here, up) as arguments. What is the meaning of these three Views?

2

There are 2 best solutions below

3
On BEST ANSWER

As purely a historical reference, take a look at the Chisel2 Advanced Parameterization Manual (with the huge caveat to not take this too literally as it's old). However, I believe that the motivation and discussion of site, here, and up still holds in sections 2.6, 2.7, 2.8, and 3.6.

Roughly, site, here, and up help with handling and resolving dependencies on other parameters.

site allows you to disambiguate different parameters that may have the same name, e.g., Width, based on a defined location. here allows parameters to query other parameters defined in the same group. up allows you to access a parent configuration's parameter object with the intended purpose being if you want to copy it while modifying parameters.

3
On
class Blah extends Config ((site, here, up)) {..}

is the parameter tuple, which allows partial function application. This allows partial configuration of the Rocket core and setting default parameters, preserving elasticity and type correctness.

You may check its implementation here