Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenXiangShan
XiangShan
提交
2ef221a9
X
XiangShan
项目概览
OpenXiangShan
/
XiangShan
8 个月 前同步成功
通知
1183
Star
3914
Fork
526
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
XiangShan
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2ef221a9
编写于
1月 08, 2021
作者:
L
LinJiawei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove brq test
上级
ec6b09ff
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
129 deletion
+0
-129
src/test/scala/xiangshan/backend/brq/BrqTest.scala
src/test/scala/xiangshan/backend/brq/BrqTest.scala
+0
-129
未找到文件。
src/test/scala/xiangshan/backend/brq/BrqTest.scala
已删除
100644 → 0
浏览文件 @
ec6b09ff
package
xiangshan.backend.brq
import
org.scalatest._
import
chiseltest._
import
chisel3._
import
chisel3.experimental.BundleLiterals._
import
chisel3.util._
import
chiseltest.experimental.TestOptionBuilder._
import
chiseltest.internal.VerilatorBackendAnnotation
import
org.scalatest.flatspec.AnyFlatSpec
import
org.scalatest.matchers.must.Matchers
import
top.Parameters
import
utils.XSLog
import
xiangshan._
import
xiangshan.testutils._
import
xiangshan.testutils.TestCaseGenerator._
import
scala.util.Random
// class BrqTest extends AnyFlatSpec
// with ChiselScalatestTester
// with Matchers
// with ParallelTestExecution
// with HasPartialDecoupledDriver {
// it should "redirect out-of-order, dequeue in-order" in {
// Parameters.set(Parameters.debugParameters)
// test(new Brq {
// AddSinks()
// }).withAnnotations(Seq()) { c =>
// def genEnqReq(x: => DecoupledIO[CfCtrl], pc: Long) = {
// chiselTypeOf(x.bits).Lit(
// _.cf.pc -> pc.U,
// _.cf.brUpdate.pnpc -> (pc+4).U
// )
// }
// def genExuWb(exuRedirect: => Valid[ExuOutput], tagIdx: Int, tagFlag: Boolean, target: Long) = {
// chiselTypeOf(exuRedirect.bits).Lit(
// _.redirect.brTag.value -> tagIdx.U,
// _.redirect.brTag.flag -> tagFlag.B,
// _.redirect.target -> target.U
// )
// }
// c.io.enqReqs.head.initSource().setSourceClock(c.clock)
// var brqPtrSeq = Seq[(BigInt, Boolean)]()
// for (i <- 0 until 10) {
// val enqPort = c.io.enqReqs.head
// enqPort.enqueuePartial(genEnqReq(enqPort, i * 0x1000))
// }
// var enqTags = List.tabulate(10)(i => i)
// val misPred = 6
// println(s"enqTags:$enqTags misPredTag:$misPred")
// enqTags = enqTags.take(misPred + 1)
// var commitTags, deqTags = List[Int]()
// def checkCommit = {
// if (c.io.out.valid.peek().litToBoolean) {
// commitTags = commitTags :+ c.io.redirect.bits.brTag.value.peek().litValue().toInt
// println(s"====commited tags:$commitTags====")
// }
// }
// def checkDeq = {
// if(c.io.out.valid.peek().litToBoolean){
// deqTags = deqTags :+ c.io.out.bits.uop.brTag.value.peek().litValue().toInt
// println(s"====deq tags:$deqTags====")
// }
// }
// println("====Start random write back====")
// val wbPort = c.io.exuRedirectWb.head
// //-----------------write back-----------------//
// while (enqTags.nonEmpty) {
// val idx = Random.nextInt(enqTags.size)
// val tag = enqTags(idx)
// println(s"====write tag:$tag back to Brq====")
// enqTags = enqTags.filter(x => x != tag)
// wbPort.valid.poke(true.B)
// wbPort.bits.pokePartial(
// genExuWb(wbPort, tag, tagFlag = false, if (tag == misPred) 0xffff else tag * 0x1000 + 4)
// )
// checkCommit
// c.clock.step(1)
// wbPort.valid.poke(false.B)
// for (i <- 0 until Random.nextInt(3)) {
// checkCommit
// c.clock.step(1)
// }
// }
// c.io.bcommit.poke((misPred+1).U)
// c.clock.step(1)
// c.io.bcommit.poke(0.U)
// while (deqTags.size != misPred+1) {
// checkCommit
// checkDeq
// c.clock.step(1)
// }
// c.clock.step(10)
// val left = commitTags.takeWhile(x => x!=misPred)
// val right = commitTags.dropWhile(x => x!=misPred).drop(1)
// println(s"commited before mispred: $left")
// println(s"commited after mispred: $right")
// def isValidCommitSeq(in: Seq[Int]): Boolean = {
// for(i <- 1 until in.size){
// if(in(i) == in(i-1)) return false
// }
// true
// }
// assert(isValidCommitSeq(left) && isValidCommitSeq(right))
// println(s"deq tags: $deqTags")
// def isValidDeqSeq(in: Seq[Int]): Boolean = {
// in.zipWithIndex.map(x => x._1==x._2).reduce(_&&_)
// }
// assert(isValidDeqSeq(deqTags))
// }
// }
// }
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录