impossible to have rvalue for bit extract?

27 views
Skip to first unread message

Alexander Samoilov

unread,
Nov 17, 2013, 10:35:55 AM11/17/13
to chisel...@googlegroups.com
Let us define

    val io = new Bundle {
...
        val cline_2evict    = UInt(OUTPUT, width = num_levels)
...

got for a statement:

    io.cline_2evict(msb, msb) := state(0)

where msb is some value, say 39

PLRU.scala:49: error: reassignment to Node at /*? in class cache.PseudoLRU*/ Chisel.Bool(OUTPUT, width=1, connect to 1 inputs: ([Chisel.Extract] in cache.PseudoLRU)) in class cache.PseudoLRU
[error] (run-main) java.lang.IllegalStateException: CODE HAS 1 ERRORS/WARNINGS
java.lang.IllegalStateException: CODE HAS 1 ERRORS/WARNINGS
        at Chisel.ChiselError$.checkpoint(ChiselError.scala:119)

however assignment to the whole io.cline_2evict is fine, say the statement

    io.cline_2evict := UInt(0)

there were no errors.

What is the best way for assigning to a certain group of bits of UInt?
Create a new view as Vec[Bool] ?

Could you please give a piece of advice for a terse way for doing assignment for a group of bits?

Thanks!
Alexander

Jonathan Bachrach

unread,
Nov 17, 2013, 10:38:46 AM11/17/13
to chisel...@googlegroups.com
there is no way to assign to subset of Bits in Chisel at this time.
best way is to use Vec[Bool].
--
You received this message because you are subscribed to the Google Groups "chisel-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chisel-users...@googlegroups.com.
To post to this group, send email to chisel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chisel-users/63cf582b-2d14-43a8-806e-081f4f2056f0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Alexander Samoilov

unread,
Nov 17, 2013, 10:43:24 AM11/17/13
to chisel...@googlegroups.com

Ok, thanks!
Will try with temporary Vec[Bool]
Reply all
Reply to author
Forward
0 new messages