-
Notifications
You must be signed in to change notification settings - Fork 21
Parameterization
Shows parameterization system used in Sodor:
https://github.com/librecores/riscv-sodor/blob/fpga/src/fpgatop/top.scala line 25 set up the config objet, which is MasterConfig, and a field of MasterConfig, which is the key ExtMem
MasterConfig is implicitly sent everywhere so, p(ExtMem) performs lookup, to return MasterConfig.. then use .Foo to get Foo value out of MasterConfig
Use to pass external mem values -- pass parameter -- ExtMem
hand parameters https://github.com/librecores/riscv-sodor/blob/fpga/src/fpgatop/top.scala#L41
mem to tile link: line 32 -- define class, include an implicit, called "p" of type Parameters, which carries a case object with Parameters interface https://github.com/librecores/riscv-sodor/blob/fpga/src/fpgatop/memtotl.scala#L52 use p(ExtMem) to extract the value needed -- p(ExtMem) extracts the object ExtMem, and then access its fields