1
0

Merge remote-tracking branch 'origin/master' into jchang_test

This commit is contained in:
Jacob Chang
2016-12-09 16:56:49 -08:00
67 changed files with 950 additions and 270 deletions

View File

@ -4,9 +4,31 @@ package uncore.tilelink2
import Chisel._
import chisel3.internal.sourceinfo.{SourceInfo, SourceLine}
import config._
import diplomacy._
class TLMonitor(gen: () => TLBundleSnoop, edge: () => TLEdge, sourceInfo: SourceInfo) extends LazyModule
case class TLMonitorArgs(gen: () => TLBundleSnoop, edge: () => TLEdge, sourceInfo: SourceInfo, p: Parameters)
abstract class TLMonitorBase(args: TLMonitorArgs) extends LazyModule()(args.p)
{
implicit val sourceInfo = args.sourceInfo
def legalize(bundle: TLBundleSnoop, edge: TLEdge): Unit
var code_insertion = (bundle_monitor: TLBundleSnoop, edge: TLEdge) => {}
lazy val module = new LazyModuleImp(this) {
val io = new Bundle {
val in = args.gen().asInput
}
code_insertion(io.in, edge())
legalize(io.in, args.edge())
}
}
class TLMonitor(args: TLMonitorArgs) extends TLMonitorBase(args)
{
def extra(implicit sourceInfo: SourceInfo) = {
sourceInfo match {
@ -409,21 +431,9 @@ class TLMonitor(gen: () => TLBundleSnoop, edge: () => TLEdge, sourceInfo: Source
inflight := (inflight | a_set) & ~d_clr
}
def legalize(bundle: TLBundleSnoop, edge: TLEdge)(implicit sourceInfo: SourceInfo) {
legalizeFormat (bundle, edge)
legalizeMultibeat (bundle, edge)
def legalize(bundle: TLBundleSnoop, edge: TLEdge) {
legalizeFormat (bundle, edge)
legalizeMultibeat (bundle, edge)
legalizeSourceUnique(bundle, edge)
}
var code_insertion = (bundle_monitor: TLBundleSnoop, edge: TLEdge) => {}
lazy val module = new LazyModuleImp(this) {
val io = new Bundle {
val in = gen().asInput
}
code_insertion(io.in, edge())
legalize(io.in, edge())(sourceInfo)
}
}