From 110fc0058b6a11a36c1783fe483e5e0fa33291d5 Mon Sep 17 00:00:00 2001 From: cjsha <36574350+cjsha@users.noreply.github.com> Date: Mon, 22 Apr 2024 15:40:50 -0400 Subject: [PATCH] Add workflow and page for MemoryUsageDevice (#51) - Added three new files: workflow, workflow svg, and page for workflow - Block read size set low in workflow to allow buffer to accumulate data - Labels added to reference parts of memory monitor datasheet and OniContext node - "Read Block Size" -> "Block Read Size" & "Write Block Size" -> "Block Write Size" to reflect the OniContext node's configuration table --- .../Datasheets/memory-usage.rst | 2 + .../Bonsai.ONIX/Nodes/MemoryUsageDevice.rst | 52 ++++++++ .../Bonsai.ONIX/Nodes/ONIContext.rst | 6 +- .../Bonsai.ONIX/Nodes/index.rst | 1 + .../bonsai/workflows/MemoryMonitor.bonsai | 116 ++++++++++++++++++ .../bonsai/workflows/MemoryMonitor.svg | 3 + 6 files changed, 178 insertions(+), 2 deletions(-) create mode 100644 source/Software Guide/Bonsai.ONIX/Nodes/MemoryUsageDevice.rst create mode 100644 source/_static/bonsai/workflows/MemoryMonitor.bonsai create mode 100644 source/_static/bonsai/workflows/MemoryMonitor.svg diff --git a/source/Hardware Guide/Datasheets/memory-usage.rst b/source/Hardware Guide/Datasheets/memory-usage.rst index c5415087..cbaf3b2b 100644 --- a/source/Hardware Guide/Datasheets/memory-usage.rst +++ b/source/Hardware Guide/Datasheets/memory-usage.rst @@ -74,6 +74,8 @@ Register Programming - None - Number of 32-bit words stored in memory, same value as what the frames generate +.. _onidatasheet_memory-usage_d2h: + Device To Host Data Frames ****************************************** Each frame transmitted to the host is structured as follows: diff --git a/source/Software Guide/Bonsai.ONIX/Nodes/MemoryUsageDevice.rst b/source/Software Guide/Bonsai.ONIX/Nodes/MemoryUsageDevice.rst new file mode 100644 index 00000000..e0add608 --- /dev/null +++ b/source/Software Guide/Bonsai.ONIX/Nodes/MemoryUsageDevice.rst @@ -0,0 +1,52 @@ + + +################# +MemoryUsageDevice +################# + + +A `Bonsai source `__ that wraps a +:ref:`onidatasheet_memory-usage` device. + +:Inputs: None +:Outputs: A single ``MemoryUsageDataFrame`` that is produced periodically by + hardware containing information about data buffer memory status. + This type is a wrapper around the :ref:`Device To Host Data Frame ` specified + on the :ref:`onidatasheet_memory-usage` datasheet. To calculate the percentage of memory that is occupied, + divide the number of 32-bit memory words used by the hardware's total memory and multiply that quotient by 100. + +.. attention:: + The :ref:`Block Read Size ` property in the :ref:`bonsai_onicontext` node is set intentionally low so that the buffer accumulates data for demonstration purposes. + +.. raw:: html + + {% with static_path = '../../../_static', name = 'MemoryMonitor' %} + {% include 'workflow.html' %} + {% endwith %} + +************* +Configuration +************* + +Configuration is performed using its property pane which contains the following +options. + +.. list-table:: + :widths: auto + :header-rows: 1 + + * - Name + - Type + - Description + + * - EnableStream + - boolean + - Enable the device data stream + + * - UpdateHz + - uint + - Rate at which the hardware memory usage is polled in Hz. + + * - MemorySize + - uint + - Hardware buffer size in 32-bit words. diff --git a/source/Software Guide/Bonsai.ONIX/Nodes/ONIContext.rst b/source/Software Guide/Bonsai.ONIX/Nodes/ONIContext.rst index 407e5151..17c09457 100644 --- a/source/Software Guide/Bonsai.ONIX/Nodes/ONIContext.rst +++ b/source/Software Guide/Bonsai.ONIX/Nodes/ONIContext.rst @@ -64,6 +64,8 @@ to use it. present in a single computer, then each will need its own :ref:`bonsai_onicontext` to manage it. +.. _bonsai_onicontext_configuration: + Configuration GUI -------------------------- :ref:`bonsai_onicontext` configuration is performed using a GUI provided in the @@ -80,10 +82,10 @@ using the **Properties Pane** on the right side of the form. #. **Settings**: Drop down menu that provides several hardware configuration options #. **Driver**: The device driver used to control the host hardware. #. **Slot**: The physical slot of the Host hardware in the computer. -#. **Read Block Size**: The number of bytes read per call to the kernel driver. +#. **Block Read Size**: The number of bytes read per call to the kernel driver. Larger numbers *will generally* increase overall bandwidth and decrease response latency. -#. **Write Block Size**: The number of bytes pre-allocated to make output for output +#. **Block Write Size**: The number of bytes pre-allocated to make output for output data frames. Larger numbers *may* increase overall bandwidth and decrease response latency. #. |refresh_icon| ****: Shows the current host hardware connection status. diff --git a/source/Software Guide/Bonsai.ONIX/Nodes/index.rst b/source/Software Guide/Bonsai.ONIX/Nodes/index.rst index db3df63d..063b0860 100644 --- a/source/Software Guide/Bonsai.ONIX/Nodes/index.rst +++ b/source/Software Guide/Bonsai.ONIX/Nodes/index.rst @@ -17,6 +17,7 @@ Nodes ONIContext HeartbeatDevice + MemoryUsageDevice AnalogIODevice DigitalIODevice ClockOutputDevice diff --git a/source/_static/bonsai/workflows/MemoryMonitor.bonsai b/source/_static/bonsai/workflows/MemoryMonitor.bonsai new file mode 100644 index 00000000..37956f06 --- /dev/null +++ b/source/_static/bonsai/workflows/MemoryMonitor.bonsai @@ -0,0 +1,116 @@ + + + + + + + + + riffa + 0 + + 48 + 8192 + + + + + + + + riffa + 0 + + 6 + + 100 + Volts + true + TenVolts + TenVolts + TenVolts + TenVolts + TenVolts + TenVolts + TenVolts + TenVolts + TenVolts + TenVolts + TenVolts + TenVolts + Input + Input + Input + Input + Input + Input + Input + Input + Input + Input + Input + Input + + + + Data + + + + analog-data_.raw + Timestamp + false + ColumnMajor + + + + Clock + + + + analog-clock_.raw + Timestamp + false + ColumnMajor + + + + + + + riffa + 0 + + 10 + + true + 100 + + + + memory-use_.csv + false + false + Timestamp + false + Clock,MemoryUsageBytes,MemoryUsagePercentage + + + MemoryUsagePercentage + + + + + + + + + + + + \ No newline at end of file diff --git a/source/_static/bonsai/workflows/MemoryMonitor.svg b/source/_static/bonsai/workflows/MemoryMonitor.svg new file mode 100644 index 00000000..ef5b9d90 --- /dev/null +++ b/source/_static/bonsai/workflows/MemoryMonitor.svg @@ -0,0 +1,3 @@ + +]>ONI Context(riffa/0)MatrixWriterMatrixWriterMemoryUsagePercentageDataClockCsvWriterAnalogIODeviceMemoryUsageDevice \ No newline at end of file