For an FPGA project using the PYNQ-Z1, I would like to use the allocate module which allow us to allocate memory used by the PL. I am currently using the image_v3.0.1 of PYNQ that I found on GitHub.
from pynq import allocate ← I got : " cannot import name ‘allocate’ "
First of all, I tried to solve this problem by my own. I noticed that there is not any folder or .py file which is called allocate. So I deducted that I should import buffer instead of allocate.
from pynq import buffer ← Succeed
a = buffer.allocate(222) ← I got : " No module named ‘pl_server’ "
To try to understand why it does not work, I try to import pl_server in a cell:
Could you clarify how you’re running your code, what’s your setup? Are you running these commands from a jupyter lab notebook or as a script? This could happen if for whatever reason you’re not in the pynq-venv, for reference: OSError: Root permissions required - #2 by skalade
I decided to restart from the begining. So what I do :
→ Formate SD CARD
→ Put PYNQ-Z1 image PYNQ - Python productivity for Zynq - Board v3.0.1 on it
→ Use Win32 disk imager to put the image in the empty SD Card (32gb)
→ Started the board and open Jupyter Notebook on my browser (chrome)
So now when I try to import allocate it works. I think the problem came from the original image that I put in the SD card wich wasn’t the latest one, but also the differents things that I tried to solve directly in the PYNQ folder.
Also, I don’t understand why if I try to read the value of input_buffer in an other cell like this, even if I run the other one before, I have this error :
I noticed that if I put input_buffer in an other variable like this :
→ a = input_buffer, then print in an other cell :
→ print(a) ; It works , but I would like to understand why (If you can shed any light on this problem)
just curious…
what is the output when you ask it to ‘print(a)’?:
and
i guess, you are assigning input_buffer to ‘a’ before the ‘input_buffer.freebuffer()’ command…
I think, that is why you are able to see the buffer copies again…
Hello @sharan !
One more time, thanks for your explications it help me a lot ! I clearly understand better how the allocate works.
Also I understand that because of the print of the empty buffer, all of my notebook stopped to work properly and that’s why when I try to run this follow lines :
It works. So unfortunately I didn’t made a big discovery.