According to this spec in 11.4.12, this should be bob = {foo[8:1]}[3:0]. However, I was having issues with this as well. I think there should be an AST pass that does slice propogation, to turn it into bob = foo[4:1]
As is the workaround for most of these bugs, you have to manually create a temporary wire of foo.bar
If you do
Then somewhere in a model you try to do the following:
This will translate to verilog as something along the lines of:
Which is not valid, see:
According to this spec in 11.4.12, this should be
bob = {foo[8:1]}[3:0]
. However, I was having issues with this as well. I think there should be an AST pass that does slice propogation, to turn it intobob = foo[4:1]
As is the workaround for most of these bugs, you have to manually create a temporary wire of
foo.bar