1

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?

Ben Reynwar
  • 1,547
  • 14
  • 21

2 Answers2

2

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.

seldridge
  • 2,704
  • 15
  • 19
0
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

Tampler
  • 385
  • 1
  • 9
  • I've looked through the implementation. I don't understand why three views are used rather than a single view. In the rocket-chip repository I can see lots of examples where "site" is getting used, a couple of examples where "up" is getting used and no examples of where "here" is getting used. Presumably there's a reason that three parameter sets are being used, rather than just one. – Ben Reynwar Nov 10 '18 at 20:51
  • Perhaps, that's a design artifact from an early life of Rocket. It's being under active development for about 5 years, so you may open a Pull Request and improve/refactor this, if you feel it is an important feature – Tampler Nov 10 '18 at 20:58
  • I'm just trying to understand the purpose. I thought maybe they related to global versus local module level parameters or something like that. – Ben Reynwar Nov 10 '18 at 21:05