Skip to content

Commit

Permalink
Update loading_an_overlay.ipynb to Pynq 2.7 (#1400)
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuajack committed May 1, 2024
1 parent aaf31b3 commit b0926b9
Showing 1 changed file with 110 additions and 26 deletions.
136 changes: 110 additions & 26 deletions docs/source/pynq_overlays/loading_an_overlay.ipynb
Expand Up @@ -6,11 +6,8 @@
"source": [
"# Loading an Overlay\n",
"\n",
"By default, an overlay (bitstream) called *base* is downloaded into ",
"the PL at boot time. The *base* overlay can be considered like ",
"a reference design for a board.\n",
"New overlays can be installed or copied to ",
"the board and can be loaded into the PL as the system is running. \n",
"By default, an overlay (bitstream) called *base* is downloaded into the PL at boot time. The *base* overlay can be considered like a reference design for a board.\n",
"New overlays can be installed or copied to the board and can be loaded into the PL as the system is running. \n",
"\n",
"An overlay usually includes:\n",
"\n",
Expand Down Expand Up @@ -38,14 +35,35 @@
"data": {
"application/javascript": [
"\n",
"try {\n",
"require(['notebook/js/codecell'], function(codecell) {\n",
" codecell.CodeCell.options_default.highlight_modes[\n",
" 'magic_text/x-csrc'] = {'reg':[/^%%microblaze/]};\n",
" Jupyter.notebook.events.one('kernel_ready.Kernel', function(){\n",
" Jupyter.notebook.get_cells().map(function(cell){\n",
" if (cell.cell_type == 'code'){ cell.auto_highlight(); } }) ;\n",
" });\n",
"});\n"
"});\n",
"} catch (e) {};\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/javascript": [
"\n",
"try {\n",
"require(['notebook/js/codecell'], function(codecell) {\n",
" codecell.CodeCell.options_default.highlight_modes[\n",
" 'magic_text/x-csrc'] = {'reg':[/^%%pybind11/]};\n",
" Jupyter.notebook.events.one('kernel_ready.Kernel', function(){\n",
" Jupyter.notebook.get_cells().map(function(cell){\n",
" if (cell.cell_type == 'code'){ cell.auto_highlight(); } }) ;\n",
" });\n",
"});\n",
"} catch (e) {};\n"
]
},
"metadata": {},
Expand Down Expand Up @@ -76,6 +94,8 @@
"Help on BaseOverlay in module pynq.overlays.base.base object:\n",
"\n",
"class BaseOverlay(pynq.overlay.Overlay)\n",
" | BaseOverlay(bitfile, **kwargs)\n",
" | \n",
" | The Base overlay for the Pynq-Z1\n",
" | \n",
" | This overlay is designed to interact with all of the on board peripherals\n",
Expand Down Expand Up @@ -110,7 +130,7 @@
" | Method resolution order:\n",
" | BaseOverlay\n",
" | pynq.overlay.Overlay\n",
" | pynq.pl.Bitstream\n",
" | pynq.bitstream.Bitstream\n",
" | builtins.object\n",
" | \n",
" | Methods defined here:\n",
Expand All @@ -124,38 +144,51 @@
" | ----------\n",
" | bitfile_name : str\n",
" | The bitstream name or absolute path as a string.\n",
" | download : boolean or None\n",
" | Whether the overlay should be downloaded. If None then the\n",
" | overlay will be downloaded if it isn't already loaded.\n",
" | dtbo : str\n",
" | The dtbo file name or absolute path as a string.\n",
" | download : bool\n",
" | Whether the overlay should be downloaded.\n",
" | ignore_version : bool\n",
" | Indicate whether or not to ignore the driver versions.\n",
" | device : pynq.Device\n",
" | Device on which to load the Overlay. Defaults to\n",
" | pynq.Device.active_device\n",
" | \n",
" | Note\n",
" | ----\n",
" | This class requires a Vivado '.hwh' file to be next to bitstream file\n",
" | with same name (e.g. base.bit and base.hwh).\n",
" | This class requires a HWH file to be next to bitstream file\n",
" | with same name (e.g. `base.bit` and `base.hwh`).\n",
" | \n",
" | ----------------------------------------------------------------------\n",
" | Methods inherited from pynq.overlay.Overlay:\n",
" | \n",
" | __dir__(self)\n",
" | __dir__() -> list\n",
" | default dir() implementation\n",
" | Default dir() implementation.\n",
" | \n",
" | __getattr__(self, key)\n",
" | Overload of __getattr__ to return a driver for an IP or\n",
" | hierarchy. Throws an `RuntimeError` if the overlay is not loaded.\n",
" | \n",
" | download(self)\n",
" | The method to download a bitstream onto PL.\n",
" | download(self, dtbo=None)\n",
" | The method to download a full bitstream onto PL.\n",
" | \n",
" | Note\n",
" | ----\n",
" | After the bitstream has been downloaded, the \"timestamp\" in PL will be\n",
" | updated. In addition, all the dictionaries on PL will\n",
" | be reset automatically.\n",
" | \n",
" | Returns\n",
" | -------\n",
" | None\n",
" | This method will use parameter `dtbo` or `self.dtbo` to configure the\n",
" | device tree.\n",
" | \n",
" | The download method will also configure some of the PS registers\n",
" | based on the metadata file provided, e.g. PL clocks,\n",
" | AXI master port width.\n",
" | \n",
" | Parameters\n",
" | ----------\n",
" | dtbo : str\n",
" | The path of the dtbo file.\n",
" | \n",
" | free(self)\n",
" | \n",
" | is_loaded(self)\n",
" | This method checks whether a bitstream is loaded.\n",
Expand Down Expand Up @@ -191,17 +224,66 @@
" | -------\n",
" | None\n",
" | \n",
" | pr_download(self, partial_region, partial_bit, dtbo=None)\n",
" | The method to download a partial bitstream onto PL.\n",
" | \n",
" | In this method, the corresponding parser will only be\n",
" | added once the `download()` method of the hierarchical block is called.\n",
" | \n",
" | This method always uses the parameter `dtbo` to configure the device\n",
" | tree.\n",
" | \n",
" | Note\n",
" | ----\n",
" | There is no check on whether the partial region specified by users\n",
" | is really partial-reconfigurable. So users have to make sure the\n",
" | `partial_region` provided is correct.\n",
" | \n",
" | Parameters\n",
" | ----------\n",
" | partial_region : str\n",
" | The name of the hierarchical block corresponding to the PR region.\n",
" | partial_bit : str\n",
" | The name of the partial bitstream.\n",
" | dtbo : str\n",
" | The path of the dtbo file.\n",
" | \n",
" | reset(self)\n",
" | This function resets all the dictionaries kept in the overlay.\n",
" | \n",
" | This function should be used with caution.\n",
" | This function should be used with caution. In most cases, only those\n",
" | dictionaries keeping track of states need to be updated.\n",
" | \n",
" | Returns\n",
" | -------\n",
" | None\n",
" | \n",
" | ----------------------------------------------------------------------\n",
" | Data descriptors inherited from pynq.pl.Bitstream:\n",
" | Methods inherited from pynq.bitstream.Bitstream:\n",
" | \n",
" | insert_dtbo(self, dtbo=None)\n",
" | Insert dtbo file into the system.\n",
" | \n",
" | A simple wrapper of the corresponding method in the PL class. If\n",
" | `dtbo` is None, `self.dtbo` will be used to insert the dtbo\n",
" | file. In most cases, users should just ignore the parameter\n",
" | `dtbo`.\n",
" | \n",
" | Parameters\n",
" | ----------\n",
" | dtbo : str\n",
" | The relative or absolute path to the device tree segment.\n",
" | \n",
" | remove_dtbo(self)\n",
" | Remove dtbo file from the system.\n",
" | \n",
" | A simple wrapper of the corresponding method in the PL class. This is\n",
" | very useful for partial bitstream downloading, where loading the\n",
" | new device tree blob will overwrites the existing device tree blob\n",
" | in the same partial region.\n",
" | \n",
" | ----------------------------------------------------------------------\n",
" | Data descriptors inherited from pynq.bitstream.Bitstream:\n",
" | \n",
" | __dict__\n",
" | dictionary for instance variables (if defined)\n",
Expand Down Expand Up @@ -249,6 +331,8 @@
"Help on Channel in module pynq.lib.axigpio object:\n",
"\n",
"class Channel(builtins.object)\n",
" | Channel(parent, channel)\n",
" | \n",
" | Class representing a single channel of the GPIO controller.\n",
" | \n",
" | Wires are and bundles of wires can be accessed using array notation\n",
Expand Down Expand Up @@ -283,7 +367,7 @@
" | setlength(self, length)\n",
" | Set the number of wires connected to the channel\n",
" | \n",
" | wait_for_interrupt_async(self)\n",
" | async wait_for_interrupt_async(self)\n",
" | Wait for the interrupt on the channel to be signalled\n",
" | \n",
" | This is intended to be used by slices waiting for a particular\n",
Expand All @@ -303,7 +387,7 @@
" | list of weak references to the object (if defined)\n",
" | \n",
" | trimask\n",
" | Gets or sets the tri-state mask for an inout channel\n",
" | Gets or sets the tristate mask for an inout channel\n",
"\n"
]
}
Expand Down Expand Up @@ -428,7 +512,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.0"
"version": "3.8.2"
}
},
"nbformat": 4,
Expand Down

0 comments on commit b0926b9

Please sign in to comment.