1
0

Generated *.d file of tests now kept in order

-Changed Set to LinkedHashSet in Testing.scala
This commit is contained in:
Christopher Celio 2015-09-11 18:36:04 -07:00
parent c8a7deb950
commit c9d89226fb

View File

@ -3,11 +3,12 @@
package rocketchip package rocketchip
import Chisel._ import Chisel._
import scala.collection.mutable.LinkedHashSet
abstract class RocketTestSuite { abstract class RocketTestSuite {
val dir: String val dir: String
val makeTargetName: String val makeTargetName: String
val names: Set[String] val names: LinkedHashSet[String]
def postScript = s""" def postScript = s"""
$$(addprefix $$(output_dir)/, $$(addsuffix .hex, $$($makeTargetName))): $$(output_dir)/%.hex: $dir/%.hex $$(addprefix $$(output_dir)/, $$(addsuffix .hex, $$($makeTargetName))): $$(output_dir)/%.hex: $dir/%.hex
@ -26,13 +27,13 @@ run-$makeTargetName-debug: $$(addprefix $$(output_dir)/, $$(addsuffix .vpd, $$($
""" """
} }
class AssemblyTestSuite(makePrefix: String, toolsPrefix: String, val names: Set[String])(envName: String) extends RocketTestSuite { class AssemblyTestSuite(makePrefix: String, toolsPrefix: String, val names: LinkedHashSet[String])(envName: String) extends RocketTestSuite {
val dir = "$(base_dir)/riscv-tools/riscv-tests/isa" val dir = "$(base_dir)/riscv-tools/riscv-tests/isa"
val makeTargetName = makePrefix + "-" + envName + "-asm-tests" val makeTargetName = makePrefix + "-" + envName + "-asm-tests"
override def toString = s"$makeTargetName = \\\n" + names.map(n => s"\t$toolsPrefix-$envName-$n").mkString(" \\\n") + postScript override def toString = s"$makeTargetName = \\\n" + names.map(n => s"\t$toolsPrefix-$envName-$n").mkString(" \\\n") + postScript
} }
class BenchmarkTestSuite(makePrefix: String, val dir: String, val names: Set[String]) extends RocketTestSuite { class BenchmarkTestSuite(makePrefix: String, val dir: String, val names: LinkedHashSet[String]) extends RocketTestSuite {
val makeTargetName = makePrefix + "-bmark-tests" val makeTargetName = makePrefix + "-bmark-tests"
override def toString = s"$makeTargetName = \\\n" + names.map(n => s"\t$n.riscv").mkString(" \\\n") + postScript override def toString = s"$makeTargetName = \\\n" + names.map(n => s"\t$n.riscv").mkString(" \\\n") + postScript
} }
@ -73,35 +74,35 @@ run-$kind-tests-fast: $$(addprefix $$(output_dir)/, $$(addsuffix .run, $targets)
} }
object DefaultTestSuites { object DefaultTestSuites {
val rv32uiNames = Set( val rv32uiNames = LinkedHashSet(
"simple", "add", "addi", "and", "andi", "auipc", "beq", "bge", "bgeu", "blt", "bltu", "bne", "fence_i", "simple", "add", "addi", "and", "andi", "auipc", "beq", "bge", "bgeu", "blt", "bltu", "bne", "fence_i",
"j", "jal", "jalr", "lb", "lbu", "lh", "lhu", "lui", "lw", "or", "ori", "sb", "sh", "sw", "sll", "slli", "j", "jal", "jalr", "lb", "lbu", "lh", "lhu", "lui", "lw", "or", "ori", "sb", "sh", "sw", "sll", "slli",
"slt", "slti", "sra", "srai", "srl", "srli", "sub", "xor", "xori") "slt", "slti", "sra", "srai", "srl", "srli", "sub", "xor", "xori")
val rv32ui = new AssemblyTestSuite("rv32ui", "rv32ui", rv32uiNames)(_) val rv32ui = new AssemblyTestSuite("rv32ui", "rv32ui", rv32uiNames)(_)
val rv32umNames = Set("mul", "mulh", "mulhsu", "mulhu", "div", "divu", "rem", "remu") val rv32umNames = LinkedHashSet("mul", "mulh", "mulhsu", "mulhu", "div", "divu", "rem", "remu")
val rv32um = new AssemblyTestSuite("rv32um", "rv32ui", rv32umNames)(_) val rv32um = new AssemblyTestSuite("rv32um", "rv32ui", rv32umNames)(_)
val rv32uaNames = Set("amoadd_w", "amoand_w", "amoor_w", "amoxor_w", "amoswap_w", "amomax_w", "amomaxu_w", "amomin_w", "amominu_w") val rv32uaNames = LinkedHashSet("amoadd_w", "amoand_w", "amoor_w", "amoxor_w", "amoswap_w", "amomax_w", "amomaxu_w", "amomin_w", "amominu_w")
val rv32ua = new AssemblyTestSuite("rv32ua", "rv32ui", rv32uaNames)(_) val rv32ua = new AssemblyTestSuite("rv32ua", "rv32ui", rv32uaNames)(_)
val rv64uiNames = Set("addw", "addiw", "ld", "lwu", "sd", "slliw", "sllw", "sltiu", "sltu", "sraiw", "sraw", "srliw", "srlw", "subw") val rv64uiNames = LinkedHashSet("addw", "addiw", "ld", "lwu", "sd", "slliw", "sllw", "sltiu", "sltu", "sraiw", "sraw", "srliw", "srlw", "subw")
val rv64ui = new AssemblyTestSuite("rv64ui", "rv64ui", rv32uiNames ++ rv64uiNames)(_) val rv64ui = new AssemblyTestSuite("rv64ui", "rv64ui", rv32uiNames ++ rv64uiNames)(_)
val rv64umNames = Set("divuw", "divw", "mulw", "remuw", "remw") val rv64umNames = LinkedHashSet("divuw", "divw", "mulw", "remuw", "remw")
val rv64um = new AssemblyTestSuite("rv64um", "rv64ui", rv32umNames ++ rv64umNames)(_) val rv64um = new AssemblyTestSuite("rv64um", "rv64ui", rv32umNames ++ rv64umNames)(_)
val rv64uaNames = rv32uaNames.map(_.replaceAll("_w","_d")) val rv64uaNames = rv32uaNames.map(_.replaceAll("_w","_d"))
val rv64ua = new AssemblyTestSuite("rv64ua", "rv64ui", rv32uaNames ++ rv64uaNames)(_) val rv64ua = new AssemblyTestSuite("rv64ua", "rv64ui", rv32uaNames ++ rv64uaNames)(_)
val rv64ufNames = Set("ldst", "move", "fsgnj", "fcmp", "fcvt", "fcvt_w", "fclass", "fadd", "fdiv", "fmin", "fmadd", "structural") val rv64ufNames = LinkedHashSet("ldst", "move", "fsgnj", "fcmp", "fcvt", "fcvt_w", "fclass", "fadd", "fdiv", "fmin", "fmadd", "structural")
val rv64uf = new AssemblyTestSuite("rv64uf", "rv64uf", rv64ufNames)(_) val rv64uf = new AssemblyTestSuite("rv64uf", "rv64uf", rv64ufNames)(_)
val rv64ufNoDiv = new AssemblyTestSuite("rv64uf", "rv64uf", rv64ufNames - "fdiv")(_) val rv64ufNoDiv = new AssemblyTestSuite("rv64uf", "rv64uf", rv64ufNames - "fdiv")(_)
val rv64siNames = Set("csr", "illegal", "ma_fetch", "ma_addr", "scall", "sbreak", "wfi") val rv64siNames = LinkedHashSet("csr", "illegal", "ma_fetch", "ma_addr", "scall", "sbreak", "wfi")
val rv64si = new AssemblyTestSuite("rv64si", "rv64si", rv64siNames)(_) val rv64si = new AssemblyTestSuite("rv64si", "rv64si", rv64siNames)(_)
val rv64miNames = Set("csr", "mcsr", "wfi", "dirty", "illegal", "ma_addr", "ma_fetch", "sbreak", "scall", "timer") val rv64miNames = LinkedHashSet("csr", "mcsr", "wfi", "dirty", "illegal", "ma_addr", "ma_fetch", "sbreak", "scall", "timer")
val rv64mi = new AssemblyTestSuite("rv64mi", "rv64mi", rv64miNames)(_) val rv64mi = new AssemblyTestSuite("rv64mi", "rv64mi", rv64miNames)(_)
// TODO: "rv64ui-pm-lrsc", "rv64mi-pm-ipi", // TODO: "rv64ui-pm-lrsc", "rv64mi-pm-ipi",
@ -109,16 +110,16 @@ object DefaultTestSuites {
val rv64u = List(rv64ui, rv64um, rv64ua) val rv64u = List(rv64ui, rv64um, rv64ua)
val rv64i = List(rv64ui, rv64si, rv64mi) val rv64i = List(rv64ui, rv64si, rv64mi)
val bmarks = new BenchmarkTestSuite("basic", "$(base_dir)/riscv-tools/riscv-tests/benchmarks", Set( val bmarks = new BenchmarkTestSuite("basic", "$(base_dir)/riscv-tools/riscv-tests/benchmarks", LinkedHashSet(
"median", "multiply", "qsort", "towers", "vvadd", "mm", "dhrystone", "spmv", "mt-vvadd", "mt-matmul")) "median", "multiply", "qsort", "towers", "vvadd", "mm", "dhrystone", "spmv", "mt-vvadd", "mt-matmul"))
val mtBmarks = new BenchmarkTestSuite("mt", "$(base_dir)/riscv-tools/riscv-tests/mt", val mtBmarks = new BenchmarkTestSuite("mt", "$(base_dir)/riscv-tools/riscv-tests/mt",
((0 to 4).map("vvadd"+_) ++ LinkedHashSet(((0 to 4).map("vvadd"+_) ++
List("ad","ae","af","ag","ai","ak","al","am","an","ap","aq","ar","at","av","ay","az", List("ad","ae","af","ag","ai","ak","al","am","an","ap","aq","ar","at","av","ay","az",
"bb","bc","bf","bh","bj","bk","bm","bo","br","bs","ce","cf","cg","ci","ck","cl", "bb","bc","bf","bh","bj","bk","bm","bo","br","bs","ce","cf","cg","ci","ck","cl",
"cm","cs","cv","cy","dc","df","dm","do","dr","ds","du","dv").map(_+"_matmul")).toSet) "cm","cs","cv","cy","dc","df","dm","do","dr","ds","du","dv").map(_+"_matmul")): _*))
val zscaleBmarks = new BenchmarkTestSuite("zscale", "$(base_dir)/zscale/sw", Set( val zscaleBmarks = new BenchmarkTestSuite("zscale", "$(base_dir)/zscale/sw", LinkedHashSet(
"led", "mbist")) "led", "mbist"))
} }