2012-03-25 00:56:59 +01:00
package rocket
import Chisel._
import Node._
import Constants._
2012-10-02 01:08:41 +02:00
import uncore._
2012-11-18 02:24:08 +01:00
import Util._
2012-03-25 00:56:59 +01:00
2013-01-07 22:38:59 +01:00
case class RocketConfiguration ( lnConf : LogicalNetworkConfiguration , co : CoherencePolicyWithUncached ,
2012-11-16 11:39:33 +01:00
icache : ICacheConfig , dcache : DCacheConfig ,
2012-11-18 02:24:08 +01:00
fpu : Boolean , vec : Boolean ,
2012-11-25 07:01:08 +01:00
fastLoadWord : Boolean = true ,
2013-01-06 12:47:17 +01:00
fastLoadByte : Boolean = false ,
fastMulDiv : Boolean = true )
2012-11-06 08:52:32 +01:00
{
val dcacheReqTagBits = 9 // enforce compliance with require()
2012-11-18 02:24:08 +01:00
val xprlen = 64
val nxpr = 32
val nxprbits = log2Up ( nxpr )
val rvc = false
2012-11-25 07:01:08 +01:00
if ( fastLoadByte ) require ( fastLoadWord )
2012-11-06 08:52:32 +01:00
}
2012-11-05 01:59:36 +01:00
2012-12-13 20:45:42 +01:00
class Tile ( resetSignal : Bool = null ) ( confIn : RocketConfiguration ) extends Component ( resetSignal ) with ClientCoherenceAgent
2012-03-25 00:56:59 +01:00
{
2012-11-18 02:24:08 +01:00
val memPorts = 2 + confIn . vec
2013-03-01 03:11:40 +01:00
val dcachePortID = 0
2012-11-18 02:24:08 +01:00
implicit val dcConf = confIn . dcache . copy ( reqtagbits = confIn . dcacheReqTagBits + log2Up ( memPorts ) , databits = confIn . xprlen )
2013-01-07 22:38:59 +01:00
implicit val lnConf = confIn . lnConf
2012-11-06 08:52:32 +01:00
implicit val conf = confIn . copy ( dcache = dcConf )
2012-03-25 00:56:59 +01:00
val io = new Bundle {
2013-01-07 22:38:59 +01:00
val tilelink = new TileLinkIO
2013-03-01 06:03:37 +01:00
val host = new HTIFIO ( lnConf . nClients )
2012-03-25 00:56:59 +01:00
}
2012-11-06 08:52:32 +01:00
2012-11-06 17:13:44 +01:00
val core = new Core
2013-01-16 00:50:37 +01:00
val icache = new Frontend ( ) ( confIn . icache , lnConf )
2012-10-08 07:37:29 +02:00
val dcache = new HellaCache
2012-03-25 00:56:59 +01:00
2012-11-06 17:13:44 +01:00
val arbiter = new MemArbiter ( memPorts )
2013-03-01 03:11:40 +01:00
arbiter . io . requestor ( dcachePortID ) <> dcache . io . mem
2012-11-06 17:13:44 +01:00
arbiter . io . requestor ( 1 ) <> icache . io . mem
2012-03-25 00:56:59 +01:00
2013-01-22 02:18:23 +01:00
io . tilelink . acquire <> arbiter . io . mem . acquire
io . tilelink . acquire_data <> dcache . io . mem . acquire_data
arbiter . io . mem . grant <> io . tilelink . grant
io . tilelink . grant_ack <> arbiter . io . mem . grant_ack
dcache . io . mem . probe <> io . tilelink . probe
io . tilelink . release_data <> dcache . io . mem . release_data
2013-03-01 03:11:40 +01:00
io . tilelink . release . valid : = dcache . io . mem . release . valid
dcache . io . mem . release . ready : = io . tilelink . release . ready
io . tilelink . release . bits : = dcache . io . mem . release . bits
io . tilelink . release . bits . payload . client_xact_id : = Cat ( dcache . io . mem . release . bits . payload . client_xact_id , UFix ( dcachePortID , log2Up ( memPorts ) ) ) // Mimic client id extension done by MemArbiter for Acquires from either cache)
2012-03-25 00:56:59 +01:00
2012-11-18 02:24:08 +01:00
if ( conf . vec ) {
2013-01-16 00:50:37 +01:00
val vicache = new Frontend ( ) ( ICacheConfig ( 128 , 1 , conf . co ) , lnConf ) // 128 sets x 1 ways (8KB)
2012-11-06 17:13:44 +01:00
arbiter . io . requestor ( 2 ) <> vicache . io . mem
core . io . vimem <> vicache . io . cpu
2012-03-25 00:56:59 +01:00
}
2012-11-06 17:13:44 +01:00
core . io . host <> io . host
core . io . imem <> icache . io . cpu
core . io . dmem <> dcache . io . cpu
2012-03-25 00:56:59 +01:00
}