cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
1,341 Views
Registered: ‎09-17-2018

Import overlay outside Jupyter notebook

Jump to solution

Hi all,

 

I can successfully run code on the PYNQ from Jupyter notebooks, but I would like to import my overlays into my own project files, not the notebooks. Can this be done? I have creating a test.py file in the same directory as the pynq directory with the following code

 

import pynq

If I run this with python3, then I get the following error message:

 

ssh://xilinx@10.0.0.83:22/home/xilinx/.virtualenvs/cv/bin/python3.5 -u /home/xilinx/test.py
Traceback (most recent call last):
  File "/home/xilinx/test.py", line 1, in <module>
    import pynq
  File "/home/xilinx/pynq/__init__.py", line 32, in <module>
    from .ps import Register
  File "/home/xilinx/pynq/ps.py", line 280, in <module>
    class ClocksMeta(type):
  File "/home/xilinx/pynq/ps.py", line 293, in ClocksMeta
    arm_pll_reg = Register(SCLR_BASE_ADDRESS + ARM_PLL_DIV_OFFSET)
  File "/home/xilinx/pynq/ps.py", line 158, in __init__
    self._buffer = MMIO(address).array.astype(np.uint32, copy=False)
  File "/home/xilinx/pynq/mmio.py", line 81, in __init__
    raise EnvironmentError('Root permissions required.')
OSError: Root permissions required.
Exception ignored in: <bound method MMIO.__del__ of <pynq.mmio.MMIO object at 0x357776d0>>
Traceback (most recent call last):
  File "/home/xilinx/pynq/mmio.py", line 112, in __del__
    os.close(self.mmap_file)
AttributeError: 'MMIO' object has no attribute 'mmap_file'

It's complaining about permissions, so if I run the same command with sudo, then I get:

 

xilinx@pynq:~$ sudo python3 test.py
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    import pynq
  File "/home/xilinx/pynq/__init__.py", line 34, in <module>
    from .pl import PL
  File "/home/xilinx/pynq/pl.py", line 459, in <module>
    class PLMeta(type):
  File "/home/xilinx/pynq/pl.py", line 475, in PLMeta
    _tcl = _TCL(TCL_BOOT)
  File "/home/xilinx/pynq/pl.py", line 372, in __init__
    self._build_hierarchy_dict()
  File "/home/xilinx/pynq/pl.py", line 456, in _build_hierarchy_dict
    self.hierarchy_dict[hier]['hierarchies'][subhier] = val
KeyError: 'video/hdmi_in'

This just seems like a big mess and I'm not sure I'm doing the correct thing here. Any clues?

 

Edit: I guess I can just push all my Python code inside the Jupyter notebook, from which I can include my overlays, but that seems like a hassle. So I would really like to import the overlays in my own files.

 

Best regards,

Eirik

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
1,298 Views
Registered: ‎11-09-2015

Re: Import overlay outside Jupyter notebook

Jump to solution

Hi @eirikvaa,

 

For Pynq related question, you might want to ask here: http://www.pynq.io/support.html. You might get more help


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**

View solution in original post

2 Replies
Highlighted
Moderator
Moderator
1,299 Views
Registered: ‎11-09-2015

Re: Import overlay outside Jupyter notebook

Jump to solution

Hi @eirikvaa,

 

For Pynq related question, you might want to ask here: http://www.pynq.io/support.html. You might get more help


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**

View solution in original post

Highlighted
Visitor
Visitor
1,294 Views
Registered: ‎09-17-2018

Re: Import overlay outside Jupyter notebook

Jump to solution

All right, I'll ask over there. Thanks!