The address decoding in reg.v should not be in bytes, since the address unit in SOPC core is in words.
wire cs_00 = (addr_in7:2==const_007:2)? 1'b1: 1'b0; shows that the internal decoding ignores the lower 2 bits of the input address.
Does the addr_in7:0 in top level cause any address mismatch when integrating in SOPC Builder? I will try to add test cases to the sim/sopc folder today.
Meanwhile, please provide further details as how this is causing trouble.
Hi Frank,
This bug is solved by adding two alternative address mode: address in byte and address in word. In normal instantiation, the address unit is byte; in SOPC builder, the address unit is word. So both the top-level and sopc example simulation runs well now.
Thank you very much!