Hi, Heystek, I tried to use the Sine Wave module in the xilinx blockset to generate a positive or cosine signal, and then use the casper snapshot module to read the generated signal value and verify the result. I think you can start with a simple example like this. the bram details are as David said.
Hope this helps, Duan ======================================== 段雪峰(Duan Xuefeng) 中国科学院新疆天文台 Xinjiang Astronomical Observatory (XAO), CAS 乌鲁木齐市新市区科学一街150号,830011 150 Science 1-Street, Urumqi, 830011, China 电话(Tel):0991-3689068 15719983612 From: David Harold Edward MacMahon Date: 2021-10-19 19:37 To: casper CC: fvdheever Subject: Re: [casper] Help to program BRAM blocks. Hi, Heystek, The CPU/KATCP/CasperFpga data path to the "Shared BRAM" is 32 bits wide, so in the end you will be writing/sending an array of 32 bit integers. The data path on the FPGA side of the "shared BRAM" may be wider (e.g. 64 bits) or narrower (e.g 8 or 16 bits) or the same (i.e. 32 bits). Thing are most straightforward when the FPGA data path is 32 bits since location 0 is the same for either side, but one important detail is that the values in the Shared BRAM are stored in "big endian" format (aka "network byte order"), which is opposite from the x86_64 convention. When the widths differ between the two sides, some care is required to ensure that the data is ordered properly to get the desired output order. The "Block RAM Address Mapping" section of UG363 (https://www.xilinx.com/content/dam/xilinx/support/documentation/user_guides/ug363.pdf) describes this mapping. The one detail that is not covered there is when the FPGA data port is 64 bits wide. In that case, you need to convert the 64-bit value to big endian, but then swap the low 32-bits and high-32 bits, though sometimes the gateware designer will be "clever" and do this swap for you (which is convenient if you know about it). Hope this helps, Dave On Oct 19, 2021, at 12:55, Heystek Grobler <[email protected]> wrote: Good day everyone. I was hoping that someone can perhaps help me or can point me in the right direction. I want to write sine and cosine waves to BRAM blocks in order to implement a local oscillator. I have a basic idea of how to do this by making use of a struct that needs to be packed, but in practice I have not done this before and can't seem to find a good example to follow. Thank you for the help! Heystek -- 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/CALWRf%3DQOnhWbZdRXntDDcnySHu1oZcd7c%2BEi7jd1zpVrm-k5MQ%40mail.gmail.com. -- 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/27B96FF5-A8A4-49C4-B6DF-A55480FF6D98%40berkeley.edu. -- 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/2021101920172100228164%40xao.ac.cn.

