# Pynq custom overlay of multidimensional array calculation using vivado hls

**URL:** <https://discuss.pynq.io/t/pynq-custom-overlay-of-multidimensional-array-calculation-using-vivado-hls/1718>\
**Category:** Support\
**Created:** [September 7, 2020, 3:00am UTC](https://discuss.pynq.io/t/pynq-custom-overlay-of-multidimensional-array-calculation-using-vivado-hls/1718 "2020-09-07T03:00:28Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [September 23, 2020, 8:32am UTC](https://discuss.pynq.io/t/pynq-custom-overlay-of-multidimensional-array-calculation-using-vivado-hls/1718/7 "2020-09-23T08:32:51Z")

</div>

@TingShen_Kuo In your Python code, what are “A” and “B”?  
The error is that the data type must be int or bytes. You may not have assigned a value to A or B correctly.

Can you post more details about this problem you have?:

> [@TingShen\_Kuo](#):
>
> Hi bartoken, i just modify your code to the following.  
> I just add integer 10 to the array2o.
> 
> ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/7/7f20c89c755fd614082a9ab66fb603d55a264254.png)
> 
> But when i export to RTL, it occurs that there is no use ip.  
> Do you know what is going on?

@bartokon

> Also, I have find out that PYNQ has some errors with register map if your array is bigger than ?64? units.  
> Depending on the host CPU (32bit/64bit) registers are 32 bit or 64 bit. This is why you see an error if you try to use something larger than this.

> I can write one value by using base address and incrementing by 4bythes (size of int)  
> We could do probably whole array like this, but there must be another way! I will try to search for a solution.

See this post:

> [@MMIO write is too slow](https://discuss.pynq.io/t/mmio-write-is-too-slow/389/2):
>
> The quick fix is to use the underlying numpy array to write the data - instances the MMIO class as a .array which provides direct access to the registers. If I’m doing this I generally take a slice of the array containing the registers I want to update frequently and then I can just directly assign it. input\_registers = mmio.array[0x100:0x200] # address 0x400 to 0x800 input\_registers[:] = input\_data This will be substantially faster than calling write for each entry separately For even better…

Cathal

---

_[View the full topic](https://discuss.pynq.io/t/pynq-custom-overlay-of-multidimensional-array-calculation-using-vivado-hls/1718)._
