Dolu1990 on dev
Fix #785 : When setInlineVerilo… (compare)
Dolu1990 on dev
Fix BmbToWishbone burst and bac… (compare)
Dolu1990 on dev
Fix symplify cache ? (compare)
@pwang7 assert(False, L"miaou $False", FAILURE) is fine for me
I prepared a simple example to illustrate the compiler error of the L"" interpolate in assert:
https://github.com/pwang7/SpinalAssertDemo
after clone the repo, just run ./run.sh
to compile and it shows the error:
./run.sh
+ export MILL_VERSION=0.10.3
+ [ ! -f mill ]
+ MILL=./mill --no-server
+ ./mill --no-server version
[1/1] version
0.10.3
+ mkdir -p ./rtl
+ ./mill --no-server _.runMain AssertDemo
[31/42] demo.compile
[info] compiling 1 Scala source to /home/pwang/Downloads/code/SpinalAssertDemo/out/demo/compile.dest/classes ...
[error] /home/pwang/Downloads/code/SpinalAssertDemo/demo/src/demo.scala:12:3: overloaded method assert with alternatives:
[error] (assertion: spinal.core.Bool,message: Seq[Any])(implicit loc: spinal.idslplugin.Location): spinal.core.internals.AssertStatement <and>
[error] (assertion: spinal.core.Bool,message: String)(implicit loc: spinal.idslplugin.Location): spinal.core.internals.AssertStatement <and>
[error] (assertion: spinal.core.Bool,severity: spinal.core.AssertNodeSeverity)(implicit loc: spinal.idslplugin.Location): spinal.core.internals.AssertStatement <and>
[error] (assertion: Boolean,message: => Any)(implicit loc: spinal.idslplugin.Location): Unit
[error] cannot be applied to (spinal.core.Bool, spinal.core.LiteralBuilder#LList)
[error] assert(False, L"${REPORT_TIME} time: ${io.input.payload}")
[error] ^
[error] one error found
1 targets failed
demo.compile Compilation failed
class TopLevel extends Component {
val io = new Bundle {
val sink_data = in UInt(1 bit)
val sink_data_valid = in Bool()
val source_pam4 = out UInt(2 bits)
// val source_pam4_valid = out Bool()
}
val sink_data_r = Reg(UInt(2 bits))
sink_data_r := (io.sink_data , io.sink_data)
@Dolu1990 thanks ! this is my code.
type mismatch;
[error] found : spinal.core.UInt
[error] required: (Any, Any)
[error] sink_data_r := (io.sink_data , io.sink_data)
[error] ^
start
should be enabledimport dut.io
io.start #= true
sbt compile
too
run
or a runMain
build.sbt
, add scalacOptions ++= Seq("-language:reflectiveCalls")
but I am not sure about what it does. And about the meaning of the warning, too ^^'
[warn] dropping dependency on node with no phase object: uncurry
class AesInterface extends Bundle {
val start = in Bool ()
val text, key = in UInt(128 bits)
val ready = out Bool ()
val cipher = out UInt (128 bits)
}
class Aes extends Component {
/* version with warnings
val io = new Bundle {
val start = in Bool ()
val text, key = in UInt (128 bits)
val ready = out Bool ()
val cipher = out UInt (128 bits)
}
*/
val io = new AesInterface
Also, defining interfaces this way could be good to document them and then generate documentation using sbt doc
.
It may seem strange, but it is kind of like defining entity then architecture ^^'
val yyy = new MyClass{
val xxx = 42
}
println(yyy.xxx) //Scala actualy use runtime reflection to access xxx from yyy, if i'm not wrong.