on-internet
← Community

How to create ROM with VecInit(Array()) in Chisel?

Stack Overflow ·

I'm trying to declare a «rom» with VecInit() like it : val GbColors = VecInit(Array(GB_GREEN0, GB_GREEN1, GB_GREEN2, GB_GREEN3)) With GB_GREENx declared like it : class VgaColors extends Bundle { val red = UInt(6.W) val green = UInt(6.W) val blue = UInt(6.W) } //... object GbConst { //... /* "#9BBC0F"*/ val GB_GREEN0 = (new VgaColors()).Lit(_.red -> "h26".U(6.W), _.green -> "h2F".U(6.W), _.blue -> "h03".U(6.W)) /* "#8BAC0F"*/ val GB_GREEN1 = (new VgaColors()).Lit(_.red -> "h1E".U(6.W), _.green -> "h27".U(6.W), _.blue -> "h03".U(6.W)) /* "#306230"*/ val GB_GREEN2 = (new VgaColors()).Lit(_.red -

Comments

Sign in or sign up to comment and upvote.

No comments yet.