Merge branch 'main' of gitlab.ensimag.fr:thillarj/FMN_2526S1_thillarj_chaboisa

This commit is contained in:
2025-11-13 10:13:53 +01:00

View File

@@ -7,19 +7,21 @@ import chisel3.simulator.scalatest.ChiselSim
object ZzTopCommon extends AnyFreeSpec with ChiselSim {
def expectedValuesFromAsm(path: String): Seq[BigInt] = {
val line =
Source.fromFile(path).getLines().find(_.startsWith("# expected:"))
line match {
case Some(l) =>
l.stripPrefix("# expected:")
Source
.fromFile(path)
.getLines()
.filter(_.startsWith("# expected:"))
.map(
_.stripPrefix("# expected:")
.split(",")
.map(_.trim)
.filter(_.nonEmpty)
.map(str => BigInt(str, 16))
.toSeq
case None =>
Seq.empty
}
)
.fold(Seq.empty)((acc, line) => {
acc.concat(line)
})
}
def failTrace(msg: String = "Erreur", trace: ListBuffer[String]): Unit = {