In reply to Lavin786:
I ran your code with no issues. The output file ‘write.txt’ was generated and had the expected entries:
a[3:0]=0000–select=00–y=0
a[3:0]=0001–select=00–y=0
a[3:0]=0010–select=00–y=0
a[3:0]=0011–select=00–y=0
…
Perhaps you are having a tool specific issue. If so, you will need to contact your tool vendor for support.