lib/HDLRuby/std/memory.rb in HDLRuby-2.4.11 vs lib/HDLRuby/std/memory.rb in HDLRuby-2.4.12

- old
+ new

@@ -956,11 +956,11 @@ reader_input rst_name end # Declares the address counter. awidth = (size-1).width awidth = 1 if awidth == 0 - [size.width-1].inner :abus_r + [awidth].inner :abus_r reader_inout :abus_r # Defines the read procedure at address +addr+ # using +target+ as target of access result. reader do |blk,target| @@ -1000,11 +1000,13 @@ else rst_name = rst.name writer_input rst_name end # Declares the address counter. - [size.width-1].inner :abus_w + awidth = (size-1).width + awidth = 1 if awidth == 0 + [awidth].inner :abus_w writer_inout :abus_w # Defines the write procedure at address +addr+ # using +target+ as target of access result. writer do |blk,target| @@ -1048,11 +1050,11 @@ reader_input rst_name end # Declares the address counter. awidth = (size-1).width awidth = 1 if awidth == 0 - [size.width-1].inner :abus_r + [awidth].inner :abus_r reader_inout :abus_r # Defines the read procedure at address +addr+ # using +target+ as target of access result. reader do |blk,target| @@ -1092,10 +1094,12 @@ else rst_name = rst.name reader_input rst_name end # Declares the address counter. - [size.width-1].inner :abus_w + awidth = (size-1).width + awidth = 1 if awidth == 0 + [awidth].inner :abus_w reader_inout :abus_w # Defines the write procedure at address +addr+ # using +target+ as target of access result. writer do |blk,target|