forked from chipsalliance/rocket-chip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Tile to use cake pattern (chipsalliance#502)
* [rocket] Refactor Tile into cake pattern with traits * [rocket] cacheDataBits &etc in HasCoreParameters * [rocket] pass TLEdgeOut implicitly rather than relying on val edge in HasCoreParameters * [rocket] frontend and icache now diplomatic * [rocket] file name capitalization * [rocket] re-add hook for inserting externally-defined Cores * [rocket] add FPUCoreIO * [groundtest] move TL1 Config instances to where they are used * [unittest] remove legacy unit tests * [groundtest] remove legacy device tests
- Loading branch information
Showing
32 changed files
with
686 additions
and
519 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// See LICENSE.SiFive for license details. | ||
|
||
package coreplex | ||
|
||
import Chisel._ | ||
import config._ | ||
import diplomacy._ | ||
import rocket.{TileInterrupts, XLen} | ||
import uncore.tilelink2._ | ||
import util.GenericParameterizedBundle | ||
|
||
abstract class BareTile(implicit p: Parameters) extends LazyModule | ||
|
||
abstract class BareTileBundle[+L <: BareTile](_outer: L) extends GenericParameterizedBundle(_outer) { | ||
val outer = _outer | ||
implicit val p = outer.p | ||
} | ||
|
||
abstract class BareTileModule[+L <: BareTile, +B <: BareTileBundle[L]](_outer: L, _io: () => B) extends LazyModuleImp(_outer) { | ||
val outer = _outer | ||
val io = _io () | ||
} | ||
|
||
// Uses a tile-internal crossbar to provide a single TileLink master port | ||
trait TileNetwork { | ||
implicit val p: Parameters | ||
val module: TileNetworkModule | ||
val l1backend = LazyModule(new TLXbar) | ||
val masterNodes = List(TLOutputNode()) | ||
masterNodes.head := l1backend.node | ||
} | ||
|
||
trait TileNetworkBundle { | ||
val outer: TileNetwork | ||
val master = outer.masterNodes.head.bundleOut | ||
} | ||
|
||
trait TileNetworkModule { | ||
val outer: TileNetwork | ||
val io: TileNetworkBundle | ||
} | ||
|
||
abstract class BaseTile(implicit p: Parameters) extends BareTile | ||
with TileNetwork { | ||
override lazy val module = new BaseTileModule(this, () => new BaseTileBundle(this)) | ||
} | ||
|
||
class BaseTileBundle[+L <: BaseTile](_outer: L) extends BareTileBundle(_outer) | ||
with TileNetworkBundle { | ||
val hartid = UInt(INPUT, p(XLen)) | ||
val interrupts = new TileInterrupts()(p).asInput | ||
val resetVector = UInt(INPUT, p(XLen)) | ||
} | ||
|
||
class BaseTileModule[+L <: BaseTile, +B <: BaseTileBundle[L]](_outer: L, _io: () => B) extends BareTileModule(_outer, _io) | ||
with TileNetworkModule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.