Hey Morag The BRAM has an address width 10 and a data width of 32.
Should I increase it? Heystek > On 25 Nov 2021, at 19:52, Morag Brown <[email protected]> wrote: > > Hi Heystek, > > How big is the BRAM in your design? Does it have enough space to accommodate > the amount of data you're trying to write to it? > > Morag > > On Thu, Nov 25, 2021 at 6:59 PM Heystek Grobler <[email protected] > <mailto:[email protected]>> wrote: > Hey Morag and Jack > > Thank you for the suggestions. > > I played around a little bit. if I create the sine wave the same as you > Morag, then it works. I am able to write it to the bram, read it back from > the bram, unpack it and get the same signal back. As soon as I use the sine > wave that I require for my application, then it breaks again. > > Here is what I achieved using your sine wave Morag (ps iI changed my design > to 32 bit): > > <Screenshot 2021-11-25 at 18.49.04.png> > > > <Screenshot 2021-11-25 at 18.49.34.png> > > <Screenshot 2021-11-25 at 18.49.58.png> > > When I use my sign wave, then it does not work: > > <Screenshot 2021-11-25 at 18.55.45.png> > > <Screenshot 2021-11-25 at 18.56.02.png> > > <Screenshot 2021-11-25 at 18.56.14.png> > > <Screenshot 2021-11-25 at 18.56.43.png> > > The only thing that changed is the sine wave. is there something that I am > missing? > > Thanks for the help! I really appreciate it! > > Heystek > > >> On 25 Nov 2021, at 14:57, Morag Brown <[email protected] >> <mailto:[email protected]>> wrote: >> >> I think that's because the functions used in both In[15] and In[16] do the >> same thing. See the screenshots below to see what I mean. So you construct >> the raw bytes data in In[15] and then try to pack that as an integer in >> In]16}, which won't work because struct.pack('>i',A_y) expects data of type >> int while you're actually giving it data of type bytes. To pack the data >> using struct.pack() you would need to pass it an int (or array of ints and >> tell it how many points you're packing). I think (someone please correct me >> if I'm wrong) that you only need to do one or the other to get the correct >> raw data to be written to BRAM. >> >> <Screenshot from 2021-11-25 14-55-29.png> >> <Screenshot from 2021-11-25 14-55-39.png> >> >> I also see you're scaling up by 2^31, but I think your BRAM is data width is >> 16 bits, so you'd likely want to scale by 2^15? >> >> Morag >> >> On Thu, Nov 25, 2021 at 12:46 PM Heystek Grobler <[email protected] >> <mailto:[email protected]>> wrote: >> Hey Jack and Morag >> >> thank you for the advice and help! i am still getting errors and is stuck. >> Below is the new errors: >> >> <Screenshot 2021-11-25 at 12.41.43.png> >> >> <Screenshot 2021-11-25 at 12.42.53.png> >> >> I have also attached the new script I am working on. >> >> Could it be that I am generating the sine wave incorrectly? I have about 600 >> 000 000 points that I am working with. >> >> I keep getting “cannot convert argument to integer when running struct.pack. >> >> Thanks for the help! >> >> Heystek >> >> >>> On 23 Nov 2021, at 14:31, Jack Hickish <[email protected] >>> <mailto:[email protected]>> wrote: >>> >>> Hi Heystek, >>> >>> Assuming your BRAM is set for 32-bit wide, you probably want to be writing >>> the values with 31 bits below the binary point -- i.e. normalized to the >>> range [-1, 1) (aka simulink FIx32_31). In this case the packed values >>> would be: >>> >>> struct.pack('>i', int(floating_point_sine_value * 2**31)) >>> >>> Though, be careful, because +1.0 isn't included in this number >>> representation (the maximum is 1 - 2**-31) , so you might want to include >>> some saturation logic (or scale up by a value less than 2**31). >>> >>> For what it's worth, you can pack an entire numpy array with: >>> floating_point_numpy_array.astype('>i').tobytes() ,which saves looping and >>> appending to a binary string. >>> >>> Does that help? >>> >>> Cheers >>> Jack >>> >>> On Mon, 22 Nov 2021 at 18:10, Heystek Grobler <[email protected] >>> <mailto:[email protected]>> wrote: >>> Hey Jack >>> >>> I am also well thank you. We are starting to go back to the observatory >>> (HartRAO) again. >>> >>> Here is a snippets of the python code that I am using as well as my >>> simulink design: >>> >>> The first nipped is where I create the sine wave: >>> >>> The second snipped is where I plot the sine wave: >>> >>> >>> The third snipped is where I pack the sine wave array: >>> >>> >>> The fourth snipped is where I write the packed data to the BRAM: >>> >>> >>> Snipped 5 is where I want to use the sine wave and cosine wave: >>> >>> >>> But to check that it is working, I have created the simple design in >>> snipped 6: >>> >>> >>> I have also attached my simulink design and python script. >>> >>> Thank you for the help! >>> >>> Heystek >>> >>> >>>> On 22 Nov 2021, at 18:55, Jack Hickish <[email protected] >>>> <mailto:[email protected]>> wrote: >>>> >>>> Hi Heystek, >>>> >>>> All good here (in London), Thanks. Hope things are going ok with you too! >>>> >>>> I've taken this back on list for the benefit of others. Do you have: >>>> >>>> a) a snippet of some python code which you're using at the moment >>>> b) A Simulink snippet of the BRAM you're trying to write to, indicating >>>> how the bram is configured and how its data are being used? >>>> >>>> Cheers >>>> Jack >>>> >>>> On Mon, 22 Nov 2021 at 16:52, Heystek Grobler <[email protected] >>>> <mailto:[email protected]>> wrote: >>>> Hey Jack >>>> >>>> How are you? It has been a while since we last spoke. >>>> >>>> I am really struggling to pack data into binary format for my design. I >>>> was wondering if you have time if you can please help me with it. I have >>>> no clue if what i am doing is correct and there is no one around me with >>>> the knowledge to help me. >>>> >>>> All that I want to do is too pack a sine wave that I already generated, >>>> and write it to a BRAM. >>>> >>>> I hope to hear from you soon! >>>> >>>> Heystek >>> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "[email protected] <mailto:[email protected]>" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] >> <mailto:[email protected]>. >> To view this discussion on the web visit >> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/8791F6EA-204B-4BCC-B0DC-3CAD3D928A05%40gmail.com >> >> <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/8791F6EA-204B-4BCC-B0DC-3CAD3D928A05%40gmail.com?utm_medium=email&utm_source=footer>. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "[email protected] <mailto:[email protected]>" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] >> <mailto:[email protected]>. >> To view this discussion on the web visit >> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAGH-0TdWxe-sOF31vMDZxPbO37UwQFLTVHhJwbuZqXpwE6Gbsw%40mail.gmail.com >> >> <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAGH-0TdWxe-sOF31vMDZxPbO37UwQFLTVHhJwbuZqXpwE6Gbsw%40mail.gmail.com?utm_medium=email&utm_source=footer>. > > > -- > You received this message because you are subscribed to the Google Groups > "[email protected] <mailto:[email protected]>" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/5B9A4F5B-4F61-4CF6-AC06-6BD3432B11AB%40gmail.com > > <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/5B9A4F5B-4F61-4CF6-AC06-6BD3432B11AB%40gmail.com?utm_medium=email&utm_source=footer>. > > -- > You received this message because you are subscribed to the Google Groups > "[email protected]" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAGH-0TfPZw9xvQbrTbB0Vyq%2BnQwpeFaeBLy9zG0D2Hi%2BqtHd_w%40mail.gmail.com > > <https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAGH-0TfPZw9xvQbrTbB0Vyq%2BnQwpeFaeBLy9zG0D2Hi%2BqtHd_w%40mail.gmail.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "[email protected]" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/7268EAFF-680E-4659-AF96-727243B0E5F4%40gmail.com.
smime.p7s
Description: S/MIME cryptographic signature

