【发布时间】:2017-08-31 12:50:50
【问题描述】:
我正在研究 RocketChip (RISC-V),请问是否有人可以解释这段代码。
class WithNCores(n: Int) extends Config((pname,site,here) => pname match {
case NTiles => n
case BuildTiles => {
List.tabulate(site(NTiles)){ i => (p: Parameters) =>
LazyModule(new RocketTile()(p.alterPartial({
case TileId => i
case TLId => "L1toL2"
case NUncachedTileLinkPorts => 1 + site(RoccNMemChannels)
})))
}
}
case _ => throw new CDEMatchError})
- 什么是 (pname,site,here) ?它的作用是什么?
- 这是什么意思 (pname,site,here) => pname match { ... }
谢谢
【问题讨论】: