Merge branch 'main' of gitlab.ensimag.fr:thillarj/FMN_2526S1_thillarj_chaboisa
This commit is contained in:
@@ -7,19 +7,21 @@ import chisel3.simulator.scalatest.ChiselSim
|
|||||||
|
|
||||||
object ZzTopCommon extends AnyFreeSpec with ChiselSim {
|
object ZzTopCommon extends AnyFreeSpec with ChiselSim {
|
||||||
def expectedValuesFromAsm(path: String): Seq[BigInt] = {
|
def expectedValuesFromAsm(path: String): Seq[BigInt] = {
|
||||||
val line =
|
Source
|
||||||
Source.fromFile(path).getLines().find(_.startsWith("# expected:"))
|
.fromFile(path)
|
||||||
line match {
|
.getLines()
|
||||||
case Some(l) =>
|
.filter(_.startsWith("# expected:"))
|
||||||
l.stripPrefix("# expected:")
|
.map(
|
||||||
|
_.stripPrefix("# expected:")
|
||||||
.split(",")
|
.split(",")
|
||||||
.map(_.trim)
|
.map(_.trim)
|
||||||
.filter(_.nonEmpty)
|
.filter(_.nonEmpty)
|
||||||
.map(str => BigInt(str, 16))
|
.map(str => BigInt(str, 16))
|
||||||
.toSeq
|
.toSeq
|
||||||
case None =>
|
)
|
||||||
Seq.empty
|
.fold(Seq.empty)((acc, line) => {
|
||||||
}
|
acc.concat(line)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
def failTrace(msg: String = "Erreur", trace: ListBuffer[String]): Unit = {
|
def failTrace(msg: String = "Erreur", trace: ListBuffer[String]): Unit = {
|
||||||
|
|||||||
Reference in New Issue
Block a user