From 6b68cf3ad9614afce6e86dda19896e1f3877e862 Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Tue, 26 Mar 2024 22:52:06 -0700 Subject: [PATCH 01/14] Added documentation to address removal of legacy GUI in Rogue 6 --- docs/src/migration/rogue_v6.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/src/migration/rogue_v6.rst b/docs/src/migration/rogue_v6.rst index 68a77b19b..f9dcd265a 100644 --- a/docs/src/migration/rogue_v6.rst +++ b/docs/src/migration/rogue_v6.rst @@ -126,3 +126,28 @@ The reasoning is that a lot happens behind the scences when changing a poll interval, and masking this with a setter decorator gives the user the impression that it is much simpler than it is. +Previously Deprecated Legacy GUI has Been Removed +================================================= + +The legacy GUI has been removed. You can no longer use the following +code to launch a generic tree GUI. + +.. code:: + import pyrogue.gui + + with Root(...) as root: + appTop = pyrogue.gui.application(sys.argv) + guiTop = pyrogue.gui.GuiTop() + guiTop.addTree(root) + guiTop.resize(800, 800) + appTop.exec_() + +Instead, use the new PyDM GUI + +.. code:: + import pyrogue.pydm + + with Root(...) as root: + pyrogue.pydm.runPyDM( + serverList=root.zmqServer.address, + title='GUI Window Title') From 059af0df51c7793fabb818bd2e74e0484d3aff9e Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Tue, 26 Mar 2024 22:53:34 -0700 Subject: [PATCH 02/14] Formatting --- docs/src/migration/rogue_v6.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/src/migration/rogue_v6.rst b/docs/src/migration/rogue_v6.rst index f9dcd265a..0f67083ea 100644 --- a/docs/src/migration/rogue_v6.rst +++ b/docs/src/migration/rogue_v6.rst @@ -133,6 +133,7 @@ The legacy GUI has been removed. You can no longer use the following code to launch a generic tree GUI. .. code:: + import pyrogue.gui with Root(...) as root: @@ -145,6 +146,7 @@ code to launch a generic tree GUI. Instead, use the new PyDM GUI .. code:: + import pyrogue.pydm with Root(...) as root: From 4824632d48f7923c4d31d676a31863fa12a194b4 Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Tue, 26 Mar 2024 22:58:43 -0700 Subject: [PATCH 03/14] Try for python highlighting --- docs/src/migration/rogue_v6.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/migration/rogue_v6.rst b/docs/src/migration/rogue_v6.rst index 0f67083ea..a38781da4 100644 --- a/docs/src/migration/rogue_v6.rst +++ b/docs/src/migration/rogue_v6.rst @@ -132,7 +132,7 @@ Previously Deprecated Legacy GUI has Been Removed The legacy GUI has been removed. You can no longer use the following code to launch a generic tree GUI. -.. code:: +.. code:: python import pyrogue.gui @@ -145,7 +145,7 @@ code to launch a generic tree GUI. Instead, use the new PyDM GUI -.. code:: +.. code:: python import pyrogue.pydm From 911feaa877d5800620a115e2f37e2ff11dbf9d9d Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Tue, 26 Mar 2024 23:01:07 -0700 Subject: [PATCH 04/14] code-block --- docs/src/migration/rogue_v6.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/migration/rogue_v6.rst b/docs/src/migration/rogue_v6.rst index a38781da4..0e4d40b08 100644 --- a/docs/src/migration/rogue_v6.rst +++ b/docs/src/migration/rogue_v6.rst @@ -132,7 +132,7 @@ Previously Deprecated Legacy GUI has Been Removed The legacy GUI has been removed. You can no longer use the following code to launch a generic tree GUI. -.. code:: python +.. code-block:: python import pyrogue.gui @@ -145,7 +145,7 @@ code to launch a generic tree GUI. Instead, use the new PyDM GUI -.. code:: python +.. code-block:: python import pyrogue.pydm From c7d3065cd3c91e17a621e8d33c5e7d939d52339e Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Tue, 26 Mar 2024 23:03:22 -0700 Subject: [PATCH 05/14] Simple code blocks --- docs/src/migration/rogue_v6.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/migration/rogue_v6.rst b/docs/src/migration/rogue_v6.rst index 0e4d40b08..0f67083ea 100644 --- a/docs/src/migration/rogue_v6.rst +++ b/docs/src/migration/rogue_v6.rst @@ -132,7 +132,7 @@ Previously Deprecated Legacy GUI has Been Removed The legacy GUI has been removed. You can no longer use the following code to launch a generic tree GUI. -.. code-block:: python +.. code:: import pyrogue.gui @@ -145,7 +145,7 @@ code to launch a generic tree GUI. Instead, use the new PyDM GUI -.. code-block:: python +.. code:: import pyrogue.pydm From 303f5352e0ad66afe33fd037c6e2068650a27f82 Mon Sep 17 00:00:00 2001 From: Larry Ruckman Date: Wed, 27 Mar 2024 11:41:32 -0700 Subject: [PATCH 06/14] updating typeStr for Fixed/UFixed to match AMD naming convention --- python/pyrogue/_Model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/pyrogue/_Model.py b/python/pyrogue/_Model.py index a90c6d234..73503fc9e 100644 --- a/python/pyrogue/_Model.py +++ b/python/pyrogue/_Model.py @@ -699,7 +699,7 @@ class Fixed(Model): def __init__(self, bitSize, binPoint): super().__init__(bitSize,binPoint) - self.name = f'Fixed_{self.bitSize-self.binPoint-1}_{self.binPoint}' + self.name = f'Fixed_{self.bitSize}_{self.binPoint}' self.ndType = np.dtype(np.float64) class UFixed(Model): @@ -721,5 +721,5 @@ class UFixed(Model): def __init__(self, bitSize, binPoint): super().__init__(bitSize,binPoint) - self.name = f'UFixed_{self.bitSize-self.binPoint-1}_{self.binPoint}' + self.name = f'UFixed_{self.bitSize}_{self.binPoint}' self.ndType = np.dtype(np.float64) From 79a797fa503f3cfee1f5ff08ceeb6c143738221e Mon Sep 17 00:00:00 2001 From: Larry Ruckman Date: Wed, 10 Apr 2024 17:44:00 -0700 Subject: [PATCH 07/14] Update petalinux.rst ### Description - migrating from distutils3(depreciated) to setuptools3 --- docs/src/installing/petalinux.rst | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/src/installing/petalinux.rst b/docs/src/installing/petalinux.rst index b28b012bb..c32f68df3 100644 --- a/docs/src/installing/petalinux.rst +++ b/docs/src/installing/petalinux.rst @@ -18,9 +18,9 @@ You will want to replace the file project-spec/meta-user/recipes-apps/rogue/rogu .. code:: - ROGUE_VERSION = "6.1.3" - ROGUE_MD5SUM = "1df912b8525c01930bb869c3a2b2e7e3" - + ROGUE_VERSION = "6.1.4" + ROGUE_MD5SUM = "659c7f5c894f6915e2bd15f922cdab3b" + SUMMARY = "Recipe to build Rogue" HOMEPAGE ="https://github.com/slaclab/rogue" LICENSE = "MIT" @@ -33,8 +33,7 @@ You will want to replace the file project-spec/meta-user/recipes-apps/rogue/rogu PROVIDES = "rogue" EXTRA_OECMAKE += "-DROGUE_INSTALL=system -DROGUE_VERSION=v${ROGUE_VERSION}" - # Note: distutils3 is depreciated (not removed) in petalinux 2023.2 and need to switch to setuptools3 in petalinux 2024 release - inherit cmake python3native distutils3 + inherit cmake python3native setuptools3 DEPENDS += " \ python3 \ @@ -78,6 +77,12 @@ You will want to replace the file project-spec/meta-user/recipes-apps/rogue/rogu cmake_do_install } + do_install:append() { + # Ensure the target directory exists + install -d ${D}${PYTHON_SITEPACKAGES_DIR} + # Install the rogue.so file into the Python site-packages directory + install -m 0755 ${S}/python/rogue.so ${D}${PYTHON_SITEPACKAGES_DIR} + } Update the ROGUE_VERSION line for an updated version when appropriate (min version is 6.1.3). You will need to first download the tar.gz file and compute the MD5SUM using the following commands if you update the ROGUE_VERSION line: From a0f44e34af49c8814b397e47b72f786fdc9d1317 Mon Sep 17 00:00:00 2001 From: Larry Ruckman Date: Sun, 21 Apr 2024 21:29:54 -0700 Subject: [PATCH 08/14] exposing all the TX/RX diagnostic ioctl() to python --- include/rogue/hardware/axi/AxiStreamDma.h | 25 ++++++++++++ src/rogue/hardware/axi/AxiStreamDma.cpp | 48 +++++++++++++++++++++++ 2 files changed, 73 insertions(+) diff --git a/include/rogue/hardware/axi/AxiStreamDma.h b/include/rogue/hardware/axi/AxiStreamDma.h index bd02ee5d4..b145d9909 100644 --- a/include/rogue/hardware/axi/AxiStreamDma.h +++ b/include/rogue/hardware/axi/AxiStreamDma.h @@ -199,6 +199,31 @@ class AxiStreamDma : public rogue::interfaces::stream::Master, public rogue::int // Process Buffer Return void retBuffer(uint8_t* data, uint32_t meta, uint32_t rawSize); + + //! Get the size of buffers (RX/TX) + uint32_t getBuffSize(); + + //! Get the number of RX buffers + uint32_t getRxBuffCount(); + + //! Get the number of TX buffers + uint32_t getTxBuffCount(); + + //! Get TX buffer in User count + uint32_t getTxBuffinUserCount(); + + //! Get TX buffer in HW count + uint32_t getTxBuffinHwCount(); + + //! Get TX buffer in Pre-HW Queue count + uint32_t getTxBuffinPreHwQCount(); + + //! Get TX buffer in SW Queue count + uint32_t getTxBuffinSwQCount(); + + //! Get TX buffer missing count + uint32_t getTxBuffMissCount(); + }; //! Alias for using shared pointer as AxiStreamDmaPtr diff --git a/src/rogue/hardware/axi/AxiStreamDma.cpp b/src/rogue/hardware/axi/AxiStreamDma.cpp index d7330925a..1d85f2d06 100644 --- a/src/rogue/hardware/axi/AxiStreamDma.cpp +++ b/src/rogue/hardware/axi/AxiStreamDma.cpp @@ -566,6 +566,46 @@ void rha::AxiStreamDma::runThread(std::weak_ptr lockPtr) { } } +//! Get the size of buffers (RX/TX) +uint32_t rha::AxiStreamDma::getBuffSize() { + return uint32_t(ioctl(fd_, DMA_Get_Buff_Size, 0)); +} + +//! Get the number of RX buffers +uint32_t rha::AxiStreamDma::getRxBuffCount() { + return uint32_t(ioctl(fd_, DMA_Get_RxBuff_Count, 0)); +} + +//! Get the number of TX buffers +uint32_t rha::AxiStreamDma::getTxBuffCount() { + return uint32_t(ioctl(fd_, DMA_Get_TxBuff_Count, 0)); +} + +//! Get TX buffer in User count +uint32_t rha::AxiStreamDma::getTxBuffinUserCount() { + return ioctl(fd_, DMA_Get_TxBuffinUser_Count, 0); +} + +//! Get TX buffer in HW count +uint32_t rha::AxiStreamDma::getTxBuffinHwCount() { + return ioctl(fd_, DMA_Get_TxBuffinHW_Count, 0); +} + +//! Get TX buffer in Pre-HW Queue count +uint32_t rha::AxiStreamDma::getTxBuffinPreHwQCount() { + return ioctl(fd_, DMA_Get_TxBuffinPreHWQ_Count, 0); +} + +//! Get TX buffer in SW Queue count +uint32_t rha::AxiStreamDma::getTxBuffinSwQCount() { + return ioctl(fd_, DMA_Get_TxBuffinSWQ_Count, 0); +} + +//! Get TX buffer missing count +uint32_t rha::AxiStreamDma::getTxBuffMissCount() { + return ioctl(fd_, DMA_Get_TxBuffMiss_Count, 0); +} + void rha::AxiStreamDma::setup_python() { #ifndef NO_PYTHON @@ -575,6 +615,14 @@ void rha::AxiStreamDma::setup_python() { .def("setDriverDebug", &rha::AxiStreamDma::setDriverDebug) .def("dmaAck", &rha::AxiStreamDma::dmaAck) .def("setTimeout", &rha::AxiStreamDma::setTimeout) + .def("getBuffSize", &rha::AxiStreamDma::getBuffSize) + .def("getRxBuffCount", &rha::AxiStreamDma::getRxBuffCount) + .def("getTxBuffCount", &rha::AxiStreamDma::getTxBuffCount) + .def("getTxBuffinUserCount", &rha::AxiStreamDma::getTxBuffinUserCount) + .def("getTxBuffinHwCount", &rha::AxiStreamDma::getTxBuffinHwCount) + .def("getTxBuffinPreHwQCount", &rha::AxiStreamDma::getTxBuffinPreHwQCount) + .def("getTxBuffinSwQCount", &rha::AxiStreamDma::getTxBuffinSwQCount) + .def("getTxBuffMissCount", &rha::AxiStreamDma::getTxBuffMissCount) .def("zeroCopyDisable", &rha::AxiStreamDma::zeroCopyDisable); bp::implicitly_convertible(); From d536379cd85443925dad58d90e260256fab2e94d Mon Sep 17 00:00:00 2001 From: Larry Ruckman Date: Sun, 21 Apr 2024 21:30:24 -0700 Subject: [PATCH 09/14] adding the AxiStreamDmaMon python class --- .../pyrogue/hardware/axi/_AxiStreamDmaMon.py | 103 ++++++++++++++++++ python/pyrogue/hardware/axi/__init__.py | 10 ++ 2 files changed, 113 insertions(+) create mode 100644 python/pyrogue/hardware/axi/_AxiStreamDmaMon.py create mode 100644 python/pyrogue/hardware/axi/__init__.py diff --git a/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py b/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py new file mode 100644 index 000000000..19eea3275 --- /dev/null +++ b/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py @@ -0,0 +1,103 @@ +#----------------------------------------------------------------------------- +# Company: SLAC National Accelerator Laboratory +#----------------------------------------------------------------------------- +# Description: Module for monitoring the DMA kernel driver +#----------------------------------------------------------------------------- +# This file is part of the rogue software platform. It is subject to +# the license terms in the LICENSE.txt file found in the top-level directory +# of this distribution and at: +# https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. +# No part of the rogue software platform, including this file, may be +# copied, modified, propagated, or distributed except according to the terms +# contained in the LICENSE.txt file. +#----------------------------------------------------------------------------- + +import pyrogue as pr +import rogue.hardware.axi + +class AxiStreamDmaMon(pr.Device): + def __init__(self, axiStreamDma, pollInterval=1, **kwargs): + super(self.__class__, self).__init__(**kwargs) + + # Create a pointer to the AXI Stream DMA object + self._dma = axiStreamDma + + # Add variables + self.add(pr.LocalVariable( + name = 'BuffSize', + description = 'size of buffers (RX/TX)', + mode = 'RO', + value = 0x0, + typeStr = 'UInt32', + units = 'Bytes', + disp = '{:#x}', + localGet = lambda: self._dma.getBuffSize(), + )) + + self.add(pr.LocalVariable( + name = 'RxBuffCount', + description = 'Get the number of RX buffers', + mode = 'RO', + value = 0, + typeStr = 'UInt32', + localGet = lambda: self._dma.getRxBuffCount(), + )) + + self.add(pr.LocalVariable( + name = 'TxBuffCount', + description = 'Get the number of TX buffers', + mode = 'RO', + value = 0, + typeStr = 'UInt32', + localGet = lambda: self._dma.getTxBuffCount(), + )) + + self.add(pr.LocalVariable( + name = 'TxBuffinUserCount', + description = 'TX buffer in User count', + mode = 'RO', + value = 0, + typeStr = 'UInt32', + localGet = lambda: self._dma.getTxBuffinUserCount(), + pollInterval= pollInterval, + )) + + self.add(pr.LocalVariable( + name = 'TxBuffinHwCount', + description = 'TX buffer in HW count', + mode = 'RO', + value = 0, + typeStr = 'UInt32', + localGet = lambda: self._dma.getTxBuffinHwCount(), + pollInterval= pollInterval, + )) + + self.add(pr.LocalVariable( + name = 'TxBuffinPreHwQCount', + description = 'TX buffer in Pre-HW Queue count', + mode = 'RO', + value = 0, + typeStr = 'UInt32', + localGet = lambda: self._dma.getTxBuffinPreHwQCount(), + pollInterval= pollInterval, + )) + + self.add(pr.LocalVariable( + name = 'TxBuffinSwQCount', + description = 'TX buffer in SW Queue count', + mode = 'RO', + value = 0, + typeStr = 'UInt32', + localGet = lambda: self._dma.getTxBuffinSwQCount(), + pollInterval= pollInterval, + )) + + self.add(pr.LocalVariable( + name = 'getTxBuffMissCount', + description = 'TX buffer missing count', + mode = 'RO', + value = 0, + typeStr = 'UInt32', + localGet = lambda: self._dma.getTxBuffMissCount(), + pollInterval= pollInterval, + )) diff --git a/python/pyrogue/hardware/axi/__init__.py b/python/pyrogue/hardware/axi/__init__.py new file mode 100644 index 000000000..82b1470de --- /dev/null +++ b/python/pyrogue/hardware/axi/__init__.py @@ -0,0 +1,10 @@ +#----------------------------------------------------------------------------- +# This file is part of the rogue software platform. It is subject to +# the license terms in the LICENSE.txt file found in the top-level directory +# of this distribution and at: +# https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. +# No part of the rogue software platform, including this file, may be +# copied, modified, propagated, or distributed except according to the terms +# contained in the LICENSE.txt file. +#----------------------------------------------------------------------------- +from pyrogue.hardware.axi._AxiStreamDmaMon import * From 1139038340b4ac2c7fc54dcae6bb569c917d3dfd Mon Sep 17 00:00:00 2001 From: Larry Ruckman Date: Sun, 21 Apr 2024 21:38:51 -0700 Subject: [PATCH 10/14] linter fix --- python/pyrogue/hardware/axi/_AxiStreamDmaMon.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py b/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py index 19eea3275..72183e588 100644 --- a/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py +++ b/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py @@ -13,7 +13,6 @@ #----------------------------------------------------------------------------- import pyrogue as pr -import rogue.hardware.axi class AxiStreamDmaMon(pr.Device): def __init__(self, axiStreamDma, pollInterval=1, **kwargs): From fe7c298eaed0220480ded9f9ff77a37adb73b076 Mon Sep 17 00:00:00 2001 From: Larry Ruckman Date: Tue, 23 Apr 2024 19:03:08 -0700 Subject: [PATCH 11/14] adding more IOCTL for RX buffer diagnostics --- include/rogue/hardware/axi/AxiStreamDma.h | 16 ++- include/rogue/hardware/drivers/DmaDriver.h | 5 + .../pyrogue/hardware/axi/_AxiStreamDmaMon.py | 110 +++++++++++++++--- src/rogue/hardware/axi/AxiStreamDma.cpp | 30 +++++ 4 files changed, 144 insertions(+), 17 deletions(-) diff --git a/include/rogue/hardware/axi/AxiStreamDma.h b/include/rogue/hardware/axi/AxiStreamDma.h index b145d9909..af50b7e82 100644 --- a/include/rogue/hardware/axi/AxiStreamDma.h +++ b/include/rogue/hardware/axi/AxiStreamDma.h @@ -206,6 +206,21 @@ class AxiStreamDma : public rogue::interfaces::stream::Master, public rogue::int //! Get the number of RX buffers uint32_t getRxBuffCount(); + //! Get RX buffer in User count + uint32_t getRxBuffinUserCount(); + + //! Get RX buffer in HW count + uint32_t getRxBuffinHwCount(); + + //! Get RX buffer in Pre-HW Queue count + uint32_t getRxBuffinPreHwQCount(); + + //! Get RX buffer in SW Queue count + uint32_t getRxBuffinSwQCount(); + + //! Get RX buffer missing count + uint32_t getRxBuffMissCount(); + //! Get the number of TX buffers uint32_t getTxBuffCount(); @@ -223,7 +238,6 @@ class AxiStreamDma : public rogue::interfaces::stream::Master, public rogue::int //! Get TX buffer missing count uint32_t getTxBuffMissCount(); - }; //! Alias for using shared pointer as AxiStreamDmaPtr diff --git a/include/rogue/hardware/drivers/DmaDriver.h b/include/rogue/hardware/drivers/DmaDriver.h index eddd022c6..d07214c92 100644 --- a/include/rogue/hardware/drivers/DmaDriver.h +++ b/include/rogue/hardware/drivers/DmaDriver.h @@ -56,6 +56,11 @@ #define DMA_Get_TxBuffinPreHWQ_Count 0x1011 #define DMA_Get_TxBuffinSWQ_Count 0x1012 #define DMA_Get_TxBuffMiss_Count 0x1013 +#define DMA_Get_RxBuffinUser_Count 0x1014 +#define DMA_Get_RxBuffinHW_Count 0x1015 +#define DMA_Get_RxBuffinPreHWQ_Count 0x1016 +#define DMA_Get_RxBuffinSWQ_Count 0x1017 +#define DMA_Get_RxBuffMiss_Count 0x1018 /* Mask size */ #define DMA_MASK_SIZE 512 diff --git a/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py b/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py index 72183e588..6d6a82866 100644 --- a/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py +++ b/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py @@ -14,7 +14,7 @@ import pyrogue as pr -class AxiStreamDmaMon(pr.Device): +class AxiStreamDmaMonRx(pr.Device): def __init__(self, axiStreamDma, pollInterval=1, **kwargs): super(self.__class__, self).__init__(**kwargs) @@ -23,27 +23,74 @@ def __init__(self, axiStreamDma, pollInterval=1, **kwargs): # Add variables self.add(pr.LocalVariable( - name = 'BuffSize', - description = 'size of buffers (RX/TX)', + name = 'BuffCount', + description = 'Get the number of RX buffers', mode = 'RO', - value = 0x0, + value = 0, typeStr = 'UInt32', - units = 'Bytes', - disp = '{:#x}', - localGet = lambda: self._dma.getBuffSize(), + localGet = lambda: self._dma.getRxBuffCount(), )) self.add(pr.LocalVariable( - name = 'RxBuffCount', - description = 'Get the number of RX buffers', + name = 'BuffinUserCount', + description = 'RX buffer in User count', mode = 'RO', value = 0, typeStr = 'UInt32', - localGet = lambda: self._dma.getRxBuffCount(), + localGet = lambda: self._dma.getRxBuffinUserCount(), + pollInterval= pollInterval, + )) + + self.add(pr.LocalVariable( + name = 'BuffinHwCount', + description = 'RX buffer in HW count', + mode = 'RO', + value = 0, + typeStr = 'UInt32', + localGet = lambda: self._dma.getRxBuffinHwCount(), + pollInterval= pollInterval, + )) + + self.add(pr.LocalVariable( + name = 'BuffinPreHwQCount', + description = 'RX buffer in Pre-HW Queue count', + mode = 'RO', + value = 0, + typeStr = 'UInt32', + localGet = lambda: self._dma.getRxBuffinPreHwQCount(), + pollInterval= pollInterval, )) self.add(pr.LocalVariable( - name = 'TxBuffCount', + name = 'BuffinSwQCount', + description = 'RX buffer in SW Queue count', + mode = 'RO', + value = 0, + typeStr = 'UInt32', + localGet = lambda: self._dma.getRxBuffinSwQCount(), + pollInterval= pollInterval, + )) + + self.add(pr.LocalVariable( + name = 'BuffMissCount', + description = 'RX buffer missing count', + mode = 'RO', + value = 0, + typeStr = 'UInt32', + localGet = lambda: self._dma.getRxBuffMissCount(), + pollInterval= pollInterval, + )) + +class AxiStreamDmaMonTx(pr.Device): + def __init__(self, axiStreamDma, pollInterval=1, **kwargs): + super(self.__class__, self).__init__(**kwargs) + + # Create a pointer to the AXI Stream DMA object + self._dma = axiStreamDma + + # Add variables + self.add(pr.LocalVariable( + name = 'BuffCount', description = 'Get the number of TX buffers', mode = 'RO', value = 0, @@ -52,7 +99,7 @@ def __init__(self, axiStreamDma, pollInterval=1, **kwargs): )) self.add(pr.LocalVariable( - name = 'TxBuffinUserCount', + name = 'BuffinUserCount', description = 'TX buffer in User count', mode = 'RO', value = 0, @@ -62,7 +109,7 @@ def __init__(self, axiStreamDma, pollInterval=1, **kwargs): )) self.add(pr.LocalVariable( - name = 'TxBuffinHwCount', + name = 'BuffinHwCount', description = 'TX buffer in HW count', mode = 'RO', value = 0, @@ -72,7 +119,7 @@ def __init__(self, axiStreamDma, pollInterval=1, **kwargs): )) self.add(pr.LocalVariable( - name = 'TxBuffinPreHwQCount', + name = 'BuffinPreHwQCount', description = 'TX buffer in Pre-HW Queue count', mode = 'RO', value = 0, @@ -82,7 +129,7 @@ def __init__(self, axiStreamDma, pollInterval=1, **kwargs): )) self.add(pr.LocalVariable( - name = 'TxBuffinSwQCount', + name = 'BuffinSwQCount', description = 'TX buffer in SW Queue count', mode = 'RO', value = 0, @@ -92,7 +139,7 @@ def __init__(self, axiStreamDma, pollInterval=1, **kwargs): )) self.add(pr.LocalVariable( - name = 'getTxBuffMissCount', + name = 'BuffMissCount', description = 'TX buffer missing count', mode = 'RO', value = 0, @@ -100,3 +147,34 @@ def __init__(self, axiStreamDma, pollInterval=1, **kwargs): localGet = lambda: self._dma.getTxBuffMissCount(), pollInterval= pollInterval, )) + +class AxiStreamDmaMon(pr.Device): + def __init__(self, axiStreamDma, pollInterval=1, **kwargs): + super(self.__class__, self).__init__(**kwargs) + + # Create a pointer to the AXI Stream DMA object + self._dma = axiStreamDma + + # Add variables + self.add(pr.LocalVariable( + name = 'BuffSize', + description = 'Size of buffers (RX/TX)', + mode = 'RO', + value = 0x0, + typeStr = 'UInt32', + units = 'Bytes', + disp = '{:#x}', + localGet = lambda: self._dma.getBuffSize(), + )) + + self.add(AxiStreamDmaMonRx( + name = 'Rx', + axiStreamDma = axiStreamDma, + pollInterval = pollInterval, + )) + + self.add(AxiStreamDmaMonTx( + name = 'Tx', + axiStreamDma = axiStreamDma, + pollInterval = pollInterval, + )) diff --git a/src/rogue/hardware/axi/AxiStreamDma.cpp b/src/rogue/hardware/axi/AxiStreamDma.cpp index 1d85f2d06..9f043264b 100644 --- a/src/rogue/hardware/axi/AxiStreamDma.cpp +++ b/src/rogue/hardware/axi/AxiStreamDma.cpp @@ -576,6 +576,31 @@ uint32_t rha::AxiStreamDma::getRxBuffCount() { return uint32_t(ioctl(fd_, DMA_Get_RxBuff_Count, 0)); } +//! Get RX buffer in User count +uint32_t rha::AxiStreamDma::getRxBuffinUserCount() { + return ioctl(fd_, DMA_Get_RxBuffinUser_Count, 0); +} + +//! Get RX buffer in HW count +uint32_t rha::AxiStreamDma::getRxBuffinHwCount() { + return ioctl(fd_, DMA_Get_RxBuffinHW_Count, 0); +} + +//! Get RX buffer in Pre-HW Queue count +uint32_t rha::AxiStreamDma::getRxBuffinPreHwQCount() { + return ioctl(fd_, DMA_Get_RxBuffinPreHWQ_Count, 0); +} + +//! Get RX buffer in SW Queue count +uint32_t rha::AxiStreamDma::getRxBuffinSwQCount() { + return ioctl(fd_, DMA_Get_RxBuffinSWQ_Count, 0); +} + +//! Get RX buffer missing count +uint32_t rha::AxiStreamDma::getRxBuffMissCount() { + return ioctl(fd_, DMA_Get_RxBuffMiss_Count, 0); +} + //! Get the number of TX buffers uint32_t rha::AxiStreamDma::getTxBuffCount() { return uint32_t(ioctl(fd_, DMA_Get_TxBuff_Count, 0)); @@ -617,6 +642,11 @@ void rha::AxiStreamDma::setup_python() { .def("setTimeout", &rha::AxiStreamDma::setTimeout) .def("getBuffSize", &rha::AxiStreamDma::getBuffSize) .def("getRxBuffCount", &rha::AxiStreamDma::getRxBuffCount) + .def("getRxBuffinUserCount", &rha::AxiStreamDma::getRxBuffinUserCount) + .def("getRxBuffinHwCount", &rha::AxiStreamDma::getRxBuffinHwCount) + .def("getRxBuffinPreHwQCount", &rha::AxiStreamDma::getRxBuffinPreHwQCount) + .def("getRxBuffinSwQCount", &rha::AxiStreamDma::getRxBuffinSwQCount) + .def("getRxBuffMissCount", &rha::AxiStreamDma::getRxBuffMissCount) .def("getTxBuffCount", &rha::AxiStreamDma::getTxBuffCount) .def("getTxBuffinUserCount", &rha::AxiStreamDma::getTxBuffinUserCount) .def("getTxBuffinHwCount", &rha::AxiStreamDma::getTxBuffinHwCount) From 35207ceeef8128a11dd25bb1315e3f3525cac45c Mon Sep 17 00:00:00 2001 From: Larry Ruckman Date: Tue, 23 Apr 2024 19:16:20 -0700 Subject: [PATCH 12/14] linter fix --- python/pyrogue/hardware/axi/_AxiStreamDmaMon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py b/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py index 6d6a82866..2e79aacd6 100644 --- a/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py +++ b/python/pyrogue/hardware/axi/_AxiStreamDmaMon.py @@ -172,9 +172,9 @@ def __init__(self, axiStreamDma, pollInterval=1, **kwargs): axiStreamDma = axiStreamDma, pollInterval = pollInterval, )) - + self.add(AxiStreamDmaMonTx( name = 'Tx', axiStreamDma = axiStreamDma, pollInterval = pollInterval, - )) + )) From 0206859f77c12ded5b28ecbe041aa11bdc4e0b5d Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Mon, 29 Apr 2024 11:14:45 -0700 Subject: [PATCH 13/14] Run clang-format --- include/rogue/hardware/drivers/AxisDriver.h | 30 +- include/rogue/hardware/drivers/DmaDriver.h | 563 +++++++++--------- src/rogue/interfaces/ZmqClient.cpp | 27 +- src/rogue/interfaces/memory/Variable.cpp | 109 ++-- src/rogue/interfaces/stream/Slave.cpp | 2 +- .../protocols/packetizer/ControllerV2.cpp | 5 +- tests/api_test/src/api_test.cpp | 59 +- 7 files changed, 404 insertions(+), 391 deletions(-) diff --git a/include/rogue/hardware/drivers/AxisDriver.h b/include/rogue/hardware/drivers/AxisDriver.h index 104b98289..21107b3d5 100644 --- a/include/rogue/hardware/drivers/AxisDriver.h +++ b/include/rogue/hardware/drivers/AxisDriver.h @@ -25,8 +25,8 @@ #include "DmaDriver.h" // Command definitions -#define AXIS_Read_Ack 0x2001 // Command to acknowledge read -#define AXIS_Write_ReqMissed 0x2002 // Command to indicate a missed write request +#define AXIS_Read_Ack 0x2001 // Command to acknowledge read +#define AXIS_Write_ReqMissed 0x2002 // Command to indicate a missed write request // Only define the following if not compiling for kernel space #ifndef DMA_IN_KERNEL @@ -41,14 +41,14 @@ * @return The combined flags value. */ static inline uint32_t axisSetFlags(uint32_t fuser, uint32_t luser, uint32_t cont) { - uint32_t flags; + uint32_t flags; - // Set flags based on input parameters, ensuring each is in its correct position - flags = fuser & 0xFF; // First user-defined flag - flags |= (luser << 8) & 0xFF00; // Last user-defined flag - flags |= (cont << 16) & 0x10000; // Continuation flag + // Set flags based on input parameters, ensuring each is in its correct position + flags = fuser & 0xFF; // First user-defined flag + flags |= (luser << 8) & 0xFF00; // Last user-defined flag + flags |= (cont << 16) & 0x10000; // Continuation flag - return flags; + return flags; } /** @@ -59,7 +59,7 @@ static inline uint32_t axisSetFlags(uint32_t fuser, uint32_t luser, uint32_t con * @return The first user-defined flag. */ static inline uint32_t axisGetFuser(uint32_t flags) { - return flags & 0xFF; + return flags & 0xFF; } /** @@ -70,7 +70,7 @@ static inline uint32_t axisGetFuser(uint32_t flags) { * @return The last user-defined flag. */ static inline uint32_t axisGetLuser(uint32_t flags) { - return (flags >> 8) & 0xFF; + return (flags >> 8) & 0xFF; } /** @@ -81,7 +81,7 @@ static inline uint32_t axisGetLuser(uint32_t flags) { * @return The continuation flag. */ static inline uint32_t axisGetCont(uint32_t flags) { - return (flags >> 16) & 0x1; + return (flags >> 16) & 0x1; } /** @@ -90,7 +90,7 @@ static inline uint32_t axisGetCont(uint32_t flags) { * @param fd File descriptor for the AXIS device. */ static inline void axisReadAck(int32_t fd) { - ioctl(fd, AXIS_Read_Ack, 0); + ioctl(fd, AXIS_Read_Ack, 0); } /** @@ -99,8 +99,8 @@ static inline void axisReadAck(int32_t fd) { * @param fd File descriptor for the AXIS device. */ static inline void axisWriteReqMissed(int32_t fd) { - ioctl(fd, AXIS_Write_ReqMissed, 0); + ioctl(fd, AXIS_Write_ReqMissed, 0); } -#endif // !DMA_IN_KERNEL -#endif // __ASIS_DRIVER_H__ +#endif // !DMA_IN_KERNEL +#endif // __ASIS_DRIVER_H__ diff --git a/include/rogue/hardware/drivers/DmaDriver.h b/include/rogue/hardware/drivers/DmaDriver.h index d07214c92..accc3bb94 100644 --- a/include/rogue/hardware/drivers/DmaDriver.h +++ b/include/rogue/hardware/drivers/DmaDriver.h @@ -17,19 +17,19 @@ * copied, modified, propagated, or distributed except according to the terms * contained in the LICENSE.txt file. * ---------------------------------------------------------------------------- -**/ + **/ #ifndef __DMA_DRIVER_H__ #define __DMA_DRIVER_H__ #ifdef DMA_IN_KERNEL - #include +#include #else - #include +#include #endif /* API Version */ -#define DMA_VERSION 0x06 +#define DMA_VERSION 0x06 /* Error values */ #define DMA_ERR_FIFO 0x01 @@ -38,29 +38,29 @@ #define DMA_ERR_BUS 0x08 /* Commands */ -#define DMA_Get_Buff_Count 0x1001 -#define DMA_Get_Buff_Size 0x1002 -#define DMA_Set_Debug 0x1003 -#define DMA_Set_Mask 0x1004 -#define DMA_Ret_Index 0x1005 -#define DMA_Get_Index 0x1006 -#define DMA_Read_Ready 0x1007 -#define DMA_Set_MaskBytes 0x1008 -#define DMA_Get_Version 0x1009 -#define DMA_Write_Register 0x100A -#define DMA_Read_Register 0x100B -#define DMA_Get_RxBuff_Count 0x100C -#define DMA_Get_TxBuff_Count 0x100D -#define DMA_Get_TxBuffinUser_Count 0x100F -#define DMA_Get_TxBuffinHW_Count 0x1010 +#define DMA_Get_Buff_Count 0x1001 +#define DMA_Get_Buff_Size 0x1002 +#define DMA_Set_Debug 0x1003 +#define DMA_Set_Mask 0x1004 +#define DMA_Ret_Index 0x1005 +#define DMA_Get_Index 0x1006 +#define DMA_Read_Ready 0x1007 +#define DMA_Set_MaskBytes 0x1008 +#define DMA_Get_Version 0x1009 +#define DMA_Write_Register 0x100A +#define DMA_Read_Register 0x100B +#define DMA_Get_RxBuff_Count 0x100C +#define DMA_Get_TxBuff_Count 0x100D +#define DMA_Get_TxBuffinUser_Count 0x100F +#define DMA_Get_TxBuffinHW_Count 0x1010 #define DMA_Get_TxBuffinPreHWQ_Count 0x1011 -#define DMA_Get_TxBuffinSWQ_Count 0x1012 -#define DMA_Get_TxBuffMiss_Count 0x1013 -#define DMA_Get_RxBuffinUser_Count 0x1014 -#define DMA_Get_RxBuffinHW_Count 0x1015 +#define DMA_Get_TxBuffinSWQ_Count 0x1012 +#define DMA_Get_TxBuffMiss_Count 0x1013 +#define DMA_Get_RxBuffinUser_Count 0x1014 +#define DMA_Get_RxBuffinHW_Count 0x1015 #define DMA_Get_RxBuffinPreHWQ_Count 0x1016 -#define DMA_Get_RxBuffinSWQ_Count 0x1017 -#define DMA_Get_RxBuffMiss_Count 0x1018 +#define DMA_Get_RxBuffinSWQ_Count 0x1017 +#define DMA_Get_RxBuffMiss_Count 0x1018 /* Mask size */ #define DMA_MASK_SIZE 512 @@ -80,13 +80,13 @@ * control flags. */ struct DmaWriteData { - uint64_t data; - uint32_t dest; - uint32_t flags; - uint32_t index; - uint32_t size; - uint32_t is32; - uint32_t pad; + uint64_t data; + uint32_t dest; + uint32_t flags; + uint32_t index; + uint32_t size; + uint32_t is32; + uint32_t pad; }; /** @@ -105,14 +105,14 @@ struct DmaWriteData { * and various control flags. */ struct DmaReadData { - uint64_t data; - uint32_t dest; - uint32_t flags; - uint32_t index; - uint32_t error; - uint32_t size; - uint32_t is32; - int32_t ret; + uint64_t data; + uint32_t dest; + uint32_t flags; + uint32_t index; + uint32_t error; + uint32_t size; + uint32_t is32; + int32_t ret; }; /** @@ -124,22 +124,22 @@ struct DmaReadData { * within a DMA context. */ struct DmaRegisterData { - uint64_t address; - uint32_t data; + uint64_t address; + uint32_t data; }; // Conditional inclusion for non-kernel environments #ifndef DMA_IN_KERNEL +#include +#include #include #include -#include -#include -#include -#include +#include #include +#include #include -#include #include +#include /** * dmaWrite - Writes data to a DMA channel. @@ -156,17 +156,17 @@ struct DmaRegisterData { * * Return: Number of bytes written, or a negative error code on failure. */ -static inline ssize_t dmaWrite(int32_t fd, const void *buf, size_t size, uint32_t flags, uint32_t dest) { - struct DmaWriteData w; +static inline ssize_t dmaWrite(int32_t fd, const void* buf, size_t size, uint32_t flags, uint32_t dest) { + struct DmaWriteData w; - memset(&w, 0, sizeof(struct DmaWriteData)); - w.dest = dest; - w.flags = flags; - w.size = size; - w.is32 = (sizeof(void *) == 4); - w.data = (uint64_t)buf; + memset(&w, 0, sizeof(struct DmaWriteData)); + w.dest = dest; + w.flags = flags; + w.size = size; + w.is32 = (sizeof(void*) == 4); + w.data = (uint64_t)buf; - return(write(fd, &w, sizeof(struct DmaWriteData))); + return (write(fd, &w, sizeof(struct DmaWriteData))); } /** @@ -184,16 +184,16 @@ static inline ssize_t dmaWrite(int32_t fd, const void *buf, size_t size, uint32_ * Return: Number of bytes written, or a negative error code on failure. */ static inline ssize_t dmaWriteIndex(int32_t fd, uint32_t index, size_t size, uint32_t flags, uint32_t dest) { - struct DmaWriteData w; + struct DmaWriteData w; - memset(&w, 0, sizeof(struct DmaWriteData)); - w.dest = dest; - w.flags = flags; - w.size = size; - w.is32 = (sizeof(void *) == 4); - w.index = index; + memset(&w, 0, sizeof(struct DmaWriteData)); + w.dest = dest; + w.flags = flags; + w.size = size; + w.is32 = (sizeof(void*) == 4); + w.index = index; - return(write(fd, &w, sizeof(struct DmaWriteData))); + return (write(fd, &w, sizeof(struct DmaWriteData))); } /** @@ -214,32 +214,40 @@ static inline ssize_t dmaWriteIndex(int32_t fd, uint32_t index, size_t size, uin * * Return: Total number of bytes written, or a negative error code on failure. */ -static inline ssize_t dmaWriteVector(int32_t fd, struct iovec *iov, size_t iovlen, - uint32_t begFlags, uint32_t midFlags, uint32_t endFlags, uint32_t dest) { - uint32_t x; - ssize_t ret; - ssize_t res; - struct DmaWriteData w; - - ret = 0; - - for (x=0; x < iovlen; x++) { - memset(&w,0,sizeof(struct DmaWriteData)); - w.dest = dest; - w.flags = (x==0)?begFlags:((x==(iovlen-1))?endFlags:midFlags); - w.size = iov[x].iov_len; - w.is32 = (sizeof(void *)==4); - w.data = (uint64_t)iov[x].iov_base; - - do { - res = write(fd,&w,sizeof(struct DmaWriteData)); - - if ( res < 0 ) return(res); - else if ( res == 0 ) usleep(10); - else ret += res; - } while (res == 0); - } - return(ret); +static inline ssize_t dmaWriteVector(int32_t fd, + struct iovec* iov, + size_t iovlen, + uint32_t begFlags, + uint32_t midFlags, + uint32_t endFlags, + uint32_t dest) { + uint32_t x; + ssize_t ret; + ssize_t res; + struct DmaWriteData w; + + ret = 0; + + for (x = 0; x < iovlen; x++) { + memset(&w, 0, sizeof(struct DmaWriteData)); + w.dest = dest; + w.flags = (x == 0) ? begFlags : ((x == (iovlen - 1)) ? endFlags : midFlags); + w.size = iov[x].iov_len; + w.is32 = (sizeof(void*) == 4); + w.data = (uint64_t)iov[x].iov_base; + + do { + res = write(fd, &w, sizeof(struct DmaWriteData)); + + if (res < 0) + return (res); + else if (res == 0) + usleep(10); + else + ret += res; + } while (res == 0); + } + return (ret); } /** @@ -257,32 +265,40 @@ static inline ssize_t dmaWriteVector(int32_t fd, struct iovec *iov, size_t iovle * * Return: Total number of bytes written, or negative on failure. */ -static inline ssize_t dmaWriteIndexVector(int32_t fd, struct iovec *iov, size_t iovlen, - uint32_t begFlags, uint32_t midFlags, uint32_t endFlags, uint32_t dest) { - uint32_t x; - ssize_t ret; - ssize_t res; - struct DmaWriteData w; - - ret = 0; - - for (x = 0; x < iovlen; x++) { - memset(&w, 0, sizeof(struct DmaWriteData)); - w.dest = dest; - w.flags = (x == 0) ? begFlags : ((x == (iovlen - 1)) ? endFlags : midFlags); - w.size = iov[x].iov_len; - w.is32 = (sizeof(void *) == 4); - w.index = (uint32_t)(((uint64_t)iov[x].iov_base) & 0xFFFFFFFF); - - do { - res = write(fd, &w, sizeof(struct DmaWriteData)); - - if (res < 0) return(res); - else if (res == 0) usleep(10); - else ret += res; - } while (res == 0); - } - return(ret); +static inline ssize_t dmaWriteIndexVector(int32_t fd, + struct iovec* iov, + size_t iovlen, + uint32_t begFlags, + uint32_t midFlags, + uint32_t endFlags, + uint32_t dest) { + uint32_t x; + ssize_t ret; + ssize_t res; + struct DmaWriteData w; + + ret = 0; + + for (x = 0; x < iovlen; x++) { + memset(&w, 0, sizeof(struct DmaWriteData)); + w.dest = dest; + w.flags = (x == 0) ? begFlags : ((x == (iovlen - 1)) ? endFlags : midFlags); + w.size = iov[x].iov_len; + w.is32 = (sizeof(void*) == 4); + w.index = (uint32_t)(((uint64_t)iov[x].iov_base) & 0xFFFFFFFF); + + do { + res = write(fd, &w, sizeof(struct DmaWriteData)); + + if (res < 0) + return (res); + else if (res == 0) + usleep(10); + else + ret += res; + } while (res == 0); + } + return (ret); } /** @@ -298,24 +314,24 @@ static inline ssize_t dmaWriteIndexVector(int32_t fd, struct iovec *iov, size_t * * Return: Size of the data received, or negative on failure. */ -static inline ssize_t dmaRead(int32_t fd, void *buf, size_t maxSize, uint32_t *flags, uint32_t *error, uint32_t *dest) { - struct DmaReadData r; - ssize_t ret; +static inline ssize_t dmaRead(int32_t fd, void* buf, size_t maxSize, uint32_t* flags, uint32_t* error, uint32_t* dest) { + struct DmaReadData r; + ssize_t ret; - memset(&r, 0, sizeof(struct DmaReadData)); - r.size = maxSize; - r.is32 = (sizeof(void *) == 4); - r.data = (uint64_t)buf; + memset(&r, 0, sizeof(struct DmaReadData)); + r.size = maxSize; + r.is32 = (sizeof(void*) == 4); + r.data = (uint64_t)buf; - ret = read(fd, &r, sizeof(struct DmaReadData)); + ret = read(fd, &r, sizeof(struct DmaReadData)); - if (ret <= 0) return(ret); + if (ret <= 0) return (ret); - if (dest != NULL) *dest = r.dest; - if (flags != NULL) *flags = r.flags; - if (error != NULL) *error = r.error; + if (dest != NULL) *dest = r.dest; + if (flags != NULL) *flags = r.flags; + if (error != NULL) *error = r.error; - return(r.ret); + return (r.ret); } /** @@ -331,22 +347,22 @@ static inline ssize_t dmaRead(int32_t fd, void *buf, size_t maxSize, uint32_t *f * * Return: Size of the data received, or negative on failure. */ -static inline ssize_t dmaReadIndex(int32_t fd, uint32_t *index, uint32_t *flags, uint32_t *error, uint32_t *dest) { - struct DmaReadData r; - size_t ret; +static inline ssize_t dmaReadIndex(int32_t fd, uint32_t* index, uint32_t* flags, uint32_t* error, uint32_t* dest) { + struct DmaReadData r; + size_t ret; - memset(&r, 0, sizeof(struct DmaReadData)); + memset(&r, 0, sizeof(struct DmaReadData)); - ret = read(fd, &r, sizeof(struct DmaReadData)); + ret = read(fd, &r, sizeof(struct DmaReadData)); - if (ret <= 0) return(ret); + if (ret <= 0) return (ret); - if (dest != NULL) *dest = r.dest; - if (flags != NULL) *flags = r.flags; - if (error != NULL) *error = r.error; + if (dest != NULL) *dest = r.dest; + if (flags != NULL) *flags = r.flags; + if (error != NULL) *error = r.error; - *index = r.index; - return(r.ret); + *index = r.index; + return (r.ret); } /** @@ -365,25 +381,30 @@ static inline ssize_t dmaReadIndex(int32_t fd, uint32_t *index, uint32_t *flags, * * Returns: The number of bytes read. */ -static inline ssize_t dmaReadBulkIndex(int32_t fd, uint32_t count, int32_t *ret, uint32_t *index, - uint32_t *flags, uint32_t *error, uint32_t *dest) { - struct DmaReadData r[count]; - size_t res; - size_t x; - - memset(r, 0, count * sizeof(struct DmaReadData)); - - res = read(fd, r, count * sizeof(struct DmaReadData)); - - for (x = 0; x < res; ++x) { - if (dest != NULL) dest[x] = r[x].dest; - if (flags != NULL) flags[x] = r[x].flags; - if (error != NULL) error[x] = r[x].error; - - index[x] = r[x].index; - ret[x] = r[x].ret; - } - return(res); +static inline ssize_t dmaReadBulkIndex(int32_t fd, + uint32_t count, + int32_t* ret, + uint32_t* index, + uint32_t* flags, + uint32_t* error, + uint32_t* dest) { + struct DmaReadData r[count]; + size_t res; + size_t x; + + memset(r, 0, count * sizeof(struct DmaReadData)); + + res = read(fd, r, count * sizeof(struct DmaReadData)); + + for (x = 0; x < res; ++x) { + if (dest != NULL) dest[x] = r[x].dest; + if (flags != NULL) flags[x] = r[x].flags; + if (error != NULL) error[x] = r[x].error; + + index[x] = r[x].index; + ret[x] = r[x].ret; + } + return (res); } /** @@ -397,9 +418,9 @@ static inline ssize_t dmaReadBulkIndex(int32_t fd, uint32_t count, int32_t *ret, * Returns: Result of the IOCTL operation. */ static inline ssize_t dmaRetIndex(int32_t fd, uint32_t index) { - uint32_t cmd = DMA_Ret_Index | 0x10000; + uint32_t cmd = DMA_Ret_Index | 0x10000; - return(ioctl(fd, cmd, &index)); + return (ioctl(fd, cmd, &index)); } /** @@ -413,10 +434,10 @@ static inline ssize_t dmaRetIndex(int32_t fd, uint32_t index) { * * Returns: Result of the IOCTL operation. */ -static inline ssize_t dmaRetIndexes(int32_t fd, uint32_t count, uint32_t *indexes) { - uint32_t cmd = DMA_Ret_Index | ((count << 16) & 0xFFFF0000); +static inline ssize_t dmaRetIndexes(int32_t fd, uint32_t count, uint32_t* indexes) { + uint32_t cmd = DMA_Ret_Index | ((count << 16) & 0xFFFF0000); - return(ioctl(fd, cmd, indexes)); + return (ioctl(fd, cmd, indexes)); } /** @@ -428,7 +449,7 @@ static inline ssize_t dmaRetIndexes(int32_t fd, uint32_t count, uint32_t *indexe * Returns: The current write buffer index. */ static inline uint32_t dmaGetIndex(int32_t fd) { - return(ioctl(fd, DMA_Get_Index, 0)); + return (ioctl(fd, DMA_Get_Index, 0)); } /** @@ -440,7 +461,7 @@ static inline uint32_t dmaGetIndex(int32_t fd) { * Returns: Result of the IOCTL operation, indicating read readiness. */ static inline ssize_t dmaReadReady(int32_t fd) { - return(ioctl(fd, DMA_Read_Ready, 0)); + return (ioctl(fd, DMA_Read_Ready, 0)); } /** @@ -452,7 +473,7 @@ static inline ssize_t dmaReadReady(int32_t fd) { * Returns: The count of receive buffers. */ static inline ssize_t dmaGetRxBuffCount(int32_t fd) { - return(ioctl(fd, DMA_Get_RxBuff_Count, 0)); + return (ioctl(fd, DMA_Get_RxBuff_Count, 0)); } /** @@ -464,7 +485,7 @@ static inline ssize_t dmaGetRxBuffCount(int32_t fd) { * Returns: The count of transmit buffers. */ static inline ssize_t dmaGetTxBuffCount(int32_t fd) { - return(ioctl(fd, DMA_Get_TxBuff_Count, 0)); + return (ioctl(fd, DMA_Get_TxBuff_Count, 0)); } /** @@ -476,7 +497,7 @@ static inline ssize_t dmaGetTxBuffCount(int32_t fd) { * Returns: The size of DMA buffers. */ static inline ssize_t dmaGetBuffSize(int32_t fd) { - return(ioctl(fd, DMA_Get_Buff_Size, 0)); + return (ioctl(fd, DMA_Get_Buff_Size, 0)); } /** @@ -489,38 +510,38 @@ static inline ssize_t dmaGetBuffSize(int32_t fd) { * * Returns: Pointer to an array of pointers to the mapped buffers, or NULL on failure. */ -static inline void **dmaMapDma(int32_t fd, uint32_t *count, uint32_t *size) { - void *temp; - void **ret; - uint32_t bCount; - uint32_t gCount; - uint32_t bSize; - off_t offset; - - bSize = ioctl(fd, DMA_Get_Buff_Size, 0); - bCount = ioctl(fd, DMA_Get_Buff_Count, 0); - - if (count != NULL) *count = bCount; - if (size != NULL) *size = bSize; - - if ( (ret = (void **)malloc(sizeof(void *) * bCount)) == 0 ) return(NULL); - - // Attempt to map - gCount = 0; - while (gCount < bCount) { - offset = (off_t)bSize * (off_t)gCount; - - if ((temp = mmap(0, bSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset)) == MAP_FAILED) break; - ret[gCount++] = temp; - } - - // Map failed - if (gCount != bCount) { - while (gCount != 0) munmap(ret[--gCount], bSize); - free(ret); - ret = NULL; - } - return(ret); +static inline void** dmaMapDma(int32_t fd, uint32_t* count, uint32_t* size) { + void* temp; + void** ret; + uint32_t bCount; + uint32_t gCount; + uint32_t bSize; + off_t offset; + + bSize = ioctl(fd, DMA_Get_Buff_Size, 0); + bCount = ioctl(fd, DMA_Get_Buff_Count, 0); + + if (count != NULL) *count = bCount; + if (size != NULL) *size = bSize; + + if ((ret = (void**)malloc(sizeof(void*) * bCount)) == 0) return (NULL); + + // Attempt to map + gCount = 0; + while (gCount < bCount) { + offset = (off_t)bSize * (off_t)gCount; + + if ((temp = mmap(0, bSize, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset)) == MAP_FAILED) break; + ret[gCount++] = temp; + } + + // Map failed + if (gCount != bCount) { + while (gCount != 0) munmap(ret[--gCount], bSize); + free(ret); + ret = NULL; + } + return (ret); } /** @@ -532,18 +553,18 @@ static inline void **dmaMapDma(int32_t fd, uint32_t *count, uint32_t *size) { * * Returns: 0 on success. */ -static inline ssize_t dmaUnMapDma(int32_t fd, void **buffer) { - uint32_t bCount; - uint32_t bSize; - uint32_t x; +static inline ssize_t dmaUnMapDma(int32_t fd, void** buffer) { + uint32_t bCount; + uint32_t bSize; + uint32_t x; - bCount = ioctl(fd, DMA_Get_Buff_Count, 0); - bSize = ioctl(fd, DMA_Get_Buff_Size, 0); + bCount = ioctl(fd, DMA_Get_Buff_Count, 0); + bSize = ioctl(fd, DMA_Get_Buff_Size, 0); - for (x = 0; x < bCount; x++) munmap(buffer[x], bSize); + for (x = 0; x < bCount; x++) munmap(buffer[x], bSize); - free(buffer); - return(0); + free(buffer); + return (0); } /** @@ -557,7 +578,7 @@ static inline ssize_t dmaUnMapDma(int32_t fd, void **buffer) { * Return: Result from the IOCTL call. */ static inline ssize_t dmaSetDebug(int32_t fd, uint32_t level) { - return(ioctl(fd, DMA_Set_Debug, level)); + return (ioctl(fd, DMA_Set_Debug, level)); } /** @@ -570,17 +591,17 @@ static inline ssize_t dmaSetDebug(int32_t fd, uint32_t level) { * receive signals for asynchronous I/O. */ static inline void dmaAssignHandler(int32_t fd, void (*handler)(int32_t)) { - struct sigaction act; - int32_t oflags; + struct sigaction act; + int32_t oflags; - act.sa_handler = handler; - sigemptyset(&act.sa_mask); - act.sa_flags = 0; + act.sa_handler = handler; + sigemptyset(&act.sa_mask); + act.sa_flags = 0; - sigaction(SIGIO, &act, NULL); - fcntl(fd, F_SETOWN, getpid()); - oflags = fcntl(fd, F_GETFL); - fcntl(fd, F_SETFL, oflags | FASYNC); + sigaction(SIGIO, &act, NULL); + fcntl(fd, F_SETOWN, getpid()); + oflags = fcntl(fd, F_GETFL); + fcntl(fd, F_SETFL, oflags | FASYNC); } /** @@ -593,7 +614,7 @@ static inline void dmaAssignHandler(int32_t fd, void (*handler)(int32_t)) { * Return: Result from the IOCTL call. */ static inline ssize_t dmaSetMask(int32_t fd, uint32_t mask) { - return(ioctl(fd, DMA_Set_Mask, mask)); + return (ioctl(fd, DMA_Set_Mask, mask)); } /** @@ -602,8 +623,8 @@ static inline ssize_t dmaSetMask(int32_t fd, uint32_t mask) { * * Initializes the DMA mask byte array to zeros. */ -static inline void dmaInitMaskBytes(uint8_t *mask) { - memset(mask, 0, DMA_MASK_SIZE); +static inline void dmaInitMaskBytes(uint8_t* mask) { + memset(mask, 0, DMA_MASK_SIZE); } /** @@ -614,15 +635,15 @@ static inline void dmaInitMaskBytes(uint8_t *mask) { * Adds a destination to the DMA mask byte array by setting the appropriate * bit based on the destination index. */ -static inline void dmaAddMaskBytes(uint8_t *mask, uint32_t dest) { - uint32_t byte; - uint32_t bit; - - if (dest < 8 * (DMA_MASK_SIZE)) { - byte = dest / 8; - bit = dest % 8; - mask[byte] += (1 << bit); - } +static inline void dmaAddMaskBytes(uint8_t* mask, uint32_t dest) { + uint32_t byte; + uint32_t bit; + + if (dest < 8 * (DMA_MASK_SIZE)) { + byte = dest / 8; + bit = dest % 8; + mask[byte] += (1 << bit); + } } /** @@ -634,8 +655,8 @@ static inline void dmaAddMaskBytes(uint8_t *mask, uint32_t dest) { * * Return: Result from the IOCTL call. */ -static inline ssize_t dmaSetMaskBytes(int32_t fd, uint8_t *mask) { - return(ioctl(fd, DMA_Set_MaskBytes, mask)); +static inline ssize_t dmaSetMaskBytes(int32_t fd, uint8_t* mask) { + return (ioctl(fd, DMA_Set_MaskBytes, mask)); } /** @@ -647,9 +668,9 @@ static inline ssize_t dmaSetMaskBytes(int32_t fd, uint8_t *mask) { * Return: 0 if the version matches, -1 otherwise. */ static inline ssize_t dmaCheckVersion(int32_t fd) { - int32_t version; - version = ioctl(fd, DMA_Get_Version); - return((version == DMA_VERSION) ? 0 : -1); + int32_t version; + version = ioctl(fd, DMA_Get_Version); + return ((version == DMA_VERSION) ? 0 : -1); } /** @@ -663,11 +684,11 @@ static inline ssize_t dmaCheckVersion(int32_t fd) { * Return: Result from the IOCTL call. */ static inline ssize_t dmaWriteRegister(int32_t fd, uint64_t address, uint32_t data) { - struct DmaRegisterData reg; + struct DmaRegisterData reg; - reg.address = address; - reg.data = data; - return(ioctl(fd, DMA_Write_Register, ®)); + reg.address = address; + reg.data = data; + return (ioctl(fd, DMA_Write_Register, ®)); } /** @@ -681,23 +702,21 @@ static inline ssize_t dmaWriteRegister(int32_t fd, uint64_t address, uint32_t da * * Return: The result of the ioctl operation, indicating success or failure. */ -static inline ssize_t dmaReadRegister(int32_t fd, uint64_t address, uint32_t *data) -{ - struct DmaRegisterData reg; - ssize_t res; +static inline ssize_t dmaReadRegister(int32_t fd, uint64_t address, uint32_t* data) { + struct DmaRegisterData reg; + ssize_t res; - // Initialize register data structure - reg.address = address; - reg.data = 0; + // Initialize register data structure + reg.address = address; + reg.data = 0; - // Perform ioctl to read the register - res = ioctl(fd, DMA_Read_Register, ®); + // Perform ioctl to read the register + res = ioctl(fd, DMA_Read_Register, ®); - // If data pointer is valid, update it with the read value - if (data != NULL) - *data = reg.data; + // If data pointer is valid, update it with the read value + if (data != NULL) *data = reg.data; - return res; + return res; } /** @@ -712,21 +731,20 @@ static inline ssize_t dmaReadRegister(int32_t fd, uint64_t address, uint32_t *da * * Return: A pointer to the mapped memory region in user space, or MAP_FAILED on failure. */ -static inline void *dmaMapRegister(int32_t fd, off_t offset, uint32_t size) -{ - uint32_t bSize; - uint32_t bCount; - off_t intOffset; +static inline void* dmaMapRegister(int32_t fd, off_t offset, uint32_t size) { + uint32_t bSize; + uint32_t bCount; + off_t intOffset; - // Obtain buffer size and count from the DMA device - bSize = ioctl(fd, DMA_Get_Buff_Size, 0); - bCount = ioctl(fd, DMA_Get_Buff_Count, 0); + // Obtain buffer size and count from the DMA device + bSize = ioctl(fd, DMA_Get_Buff_Size, 0); + bCount = ioctl(fd, DMA_Get_Buff_Count, 0); - // Calculate internal offset - intOffset = (bSize * bCount) + offset; + // Calculate internal offset + intOffset = (bSize * bCount) + offset; - // Attempt to map the memory region into user space - return mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, intOffset); + // Attempt to map the memory region into user space + return mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, intOffset); } /** @@ -740,12 +758,11 @@ static inline void *dmaMapRegister(int32_t fd, off_t offset, uint32_t size) * * Return: Always returns 0 indicating success. */ -static inline ssize_t dmaUnMapRegister(int32_t fd, void *ptr, uint32_t size) -{ - // Unmap the memory region - munmap(ptr, size); - return 0; +static inline ssize_t dmaUnMapRegister(int32_t fd, void* ptr, uint32_t size) { + // Unmap the memory region + munmap(ptr, size); + return 0; } -#endif // !DMA_IN_KERNEL -#endif // __DMA_DRIVER_H__ +#endif // !DMA_IN_KERNEL +#endif // __DMA_DRIVER_H__ diff --git a/src/rogue/interfaces/ZmqClient.cpp b/src/rogue/interfaces/ZmqClient.cpp index f496a760b..58e01fd65 100644 --- a/src/rogue/interfaces/ZmqClient.cpp +++ b/src/rogue/interfaces/ZmqClient.cpp @@ -183,19 +183,20 @@ std::string rogue::interfaces::ZmqClient::sendString(std::string path, std::stri rogue::GilRelease noGil; zmq_send(this->zmqReq_, snd.c_str(), snd.size(), 0); - while (1) { - zmq_msg_init(&msg); - if ( zmq_recvmsg(this->zmqReq_,&msg,0) <= 0 ) { - seconds += (float)timeout_ / 1000.0; - if ( waitRetry_ ) { - log_->error("Timeout waiting for response after %f Seconds, server may be busy! Waiting...", seconds); - zmq_msg_close(&msg); - } - else - throw rogue::GeneralError::create("ZmqClient::sendString","Timeout waiting for response after %f Seconds.",seconds); - } - else break; - } + while (1) { + zmq_msg_init(&msg); + if (zmq_recvmsg(this->zmqReq_, &msg, 0) <= 0) { + seconds += (float)timeout_ / 1000.0; + if (waitRetry_) { + log_->error("Timeout waiting for response after %f Seconds, server may be busy! Waiting...", seconds); + zmq_msg_close(&msg); + } else + throw rogue::GeneralError::create("ZmqClient::sendString", + "Timeout waiting for response after %f Seconds.", + seconds); + } else + break; + } if (seconds != 0) log_->error("Finally got response from server after %f seconds!", seconds); diff --git a/src/rogue/interfaces/memory/Variable.cpp b/src/rogue/interfaces/memory/Variable.cpp index 01934be9b..cfb92dc56 100644 --- a/src/rogue/interfaces/memory/Variable.cpp +++ b/src/rogue/interfaces/memory/Variable.cpp @@ -43,68 +43,65 @@ namespace bp = boost::python; #endif //! Class factory which returns a pointer to a Variable (VariablePtr) -rim::VariablePtr rim::Variable::create( - std::string name, - std::string mode, - double minimum, - double maximum, - uint64_t offset, - std::vector bitOffset, - std::vector bitSize, - bool overlapEn, - bool verify, - bool bulkOpEn, - bool updateNotify, - uint32_t modelId, - bool byteReverse, - bool bitReverse, - uint32_t binPoint, - uint32_t numValues, - uint32_t valueBits, - uint32_t valueStride, - uint32_t retryCount) { - rim::VariablePtr v = std::make_shared( - name, - mode, - minimum, - maximum, - offset, - bitOffset, - bitSize, - overlapEn, - verify, - bulkOpEn, - updateNotify, - modelId, - byteReverse, - bitReverse, - binPoint, - numValues, - valueBits, - valueStride, - retryCount); +rim::VariablePtr rim::Variable::create(std::string name, + std::string mode, + double minimum, + double maximum, + uint64_t offset, + std::vector bitOffset, + std::vector bitSize, + bool overlapEn, + bool verify, + bool bulkOpEn, + bool updateNotify, + uint32_t modelId, + bool byteReverse, + bool bitReverse, + uint32_t binPoint, + uint32_t numValues, + uint32_t valueBits, + uint32_t valueStride, + uint32_t retryCount) { + rim::VariablePtr v = std::make_shared(name, + mode, + minimum, + maximum, + offset, + bitOffset, + bitSize, + overlapEn, + verify, + bulkOpEn, + updateNotify, + modelId, + byteReverse, + bitReverse, + binPoint, + numValues, + valueBits, + valueStride, + retryCount); return (v); } // Setup class for use in python void rim::Variable::setup_python() { #ifndef NO_PYTHON - bp::class_( - "Variable", - bp::init()) + bp::class_("Variable", + bp::init()) .def("_varBytes", &rim::Variable::varBytes) .def("_offset", &rim::Variable::offset) .def("_shiftOffsetDown", &rim::Variable::shiftOffsetDown) diff --git a/src/rogue/interfaces/stream/Slave.cpp b/src/rogue/interfaces/stream/Slave.cpp index 3ba5107c7..1aee647b1 100644 --- a/src/rogue/interfaces/stream/Slave.cpp +++ b/src/rogue/interfaces/stream/Slave.cpp @@ -171,7 +171,7 @@ bool ris::Slave::ensureSingleBuffer(ris::FramePtr& frame, bool reqEn) { // Process a local frame request ris::FramePtr ris::Slave::reqLocalFrame(uint32_t size, bool zeroCopyEn) { - return ris::Pool::acceptReq(size,zeroCopyEn); + return ris::Pool::acceptReq(size, zeroCopyEn); } void ris::Slave::setup_python() { diff --git a/src/rogue/protocols/packetizer/ControllerV2.cpp b/src/rogue/protocols/packetizer/ControllerV2.cpp index 84b4019af..210f1882c 100644 --- a/src/rogue/protocols/packetizer/ControllerV2.cpp +++ b/src/rogue/protocols/packetizer/ControllerV2.cpp @@ -235,8 +235,7 @@ void rpp::ControllerV2::transportRx(ris::FramePtr frame) { tranFrame_[tmpDest]->setLastUser(tmpLuser); transSof_[tmpDest] = true; tranCount_[tmpDest] = 0; - if (app_[tmpDest]) { - app_[tmpDest]->pushFrame(tranFrame_[tmpDest]); } + if (app_[tmpDest]) { app_[tmpDest]->pushFrame(tranFrame_[tmpDest]); } tranFrame_[tmpDest].reset(); // Detect SSI error @@ -359,7 +358,7 @@ void rpp::ControllerV2::applicationRx(ris::FramePtr frame, uint8_t tDest) { fUser, tDest, segment, - data[7]>>7, + data[7] >> 7, lUser, data[size - 7], last); diff --git a/tests/api_test/src/api_test.cpp b/tests/api_test/src/api_test.cpp index 6cfbb78d6..0e1523c2a 100644 --- a/tests/api_test/src/api_test.cpp +++ b/tests/api_test/src/api_test.cpp @@ -9,7 +9,7 @@ * ---------------------------------------------------------------------------- **/ -#include +#include "rogue/interfaces/api/Bsp.h" void varListener(std::string path, std::string value) { printf("Var Listener: %s = %s\n", path.c_str(), value.c_str()); @@ -20,42 +20,41 @@ void varDone() { } int main(int argc, char** argv) { - try { + try { + rogue::interfaces::api::Bsp bsp("pyrogue.examples", "ExampleRoot"); + bsp.addVarListener(&varListener, &varDone); - rogue::interfaces::api::Bsp bsp("pyrogue.examples", "ExampleRoot"); - bsp.addVarListener(&varListener, &varDone); + // Get running uptime clock + printf("LocalTime = %s\n", bsp["LocalTime"].get().c_str()); - // Get running uptime clock - printf("LocalTime = %s\n", bsp["LocalTime"].get().c_str()); + // Set and get scratchpad + bsp["AxiVersion"]["ScratchPad"].setWrite("0x1111"); + printf("ScratchPad = %s\n", bsp["AxiVersion"]["ScratchPad"].readGet().c_str()); - // Set and get scratchpad - bsp["AxiVersion"]["ScratchPad"].setWrite("0x1111"); - printf("ScratchPad = %s\n", bsp["AxiVersion"]["ScratchPad"].readGet().c_str()); + // Get object as a pointer using full path, and get scratchpad + printf("ScratchPad = %s\n", bsp.getNode("ExampleRoot.AxiVersion.ScratchPad")->get().c_str()); - // Get object as a pointer using full path, and get scratchpad - printf("ScratchPad = %s\n", bsp.getNode("ExampleRoot.AxiVersion.ScratchPad")->get().c_str()); + // Get yaml config + std::string cfg = bsp["GetYamlConfig"]("True"); + printf("Config = %s\n", cfg.c_str()); - // Get yaml config - std::string cfg = bsp["GetYamlConfig"]("True"); - printf("Config = %s\n", cfg.c_str()); + // Set yaml config, example + // bsp["SetYamlConfig"]("Some Yaml String"); - // Set yaml config, example - // bsp["SetYamlConfig"]("Some Yaml String"); + // Write Entrire Tree + bsp["WriteAll"](); - // Write Entrire Tree - bsp["WriteAll"](); + // Read Entrire Tree + bsp["ReadAll"](); - // Read Entrire Tree - bsp["ReadAll"](); + Py_BEGIN_ALLOW_THREADS; + sleep(60); + Py_END_ALLOW_THREADS; - Py_BEGIN_ALLOW_THREADS; - sleep(60); - Py_END_ALLOW_THREADS; - - } catch (...) { - fprintf(stderr, "Found error running API example:\n"); - PyErr_Print(); - return -1; - } - return 0; + } catch (...) { + fprintf(stderr, "Found error running API example:\n"); + PyErr_Print(); + return -1; + } + return 0; } From 641820bdde1260cb7b6ea98055ee95714ca138b2 Mon Sep 17 00:00:00 2001 From: Benjamin Reese Date: Mon, 29 Apr 2024 11:15:48 -0700 Subject: [PATCH 14/14] Indent PP directives --- .clang-format | 1 + include/rogue/Directives.h | 2 +- include/rogue/GeneralError.h | 2 +- include/rogue/GilRelease.h | 2 +- include/rogue/ScopedGil.h | 2 +- include/rogue/hardware/drivers/DmaDriver.h | 24 ++--- include/rogue/interfaces/ZmqClient.h | 2 +- include/rogue/interfaces/ZmqServer.h | 2 +- include/rogue/interfaces/memory/Block.h | 2 +- include/rogue/interfaces/memory/Emulate.h | 2 +- include/rogue/interfaces/memory/Hub.h | 2 +- include/rogue/interfaces/memory/Master.h | 2 +- include/rogue/interfaces/memory/Slave.h | 2 +- include/rogue/interfaces/memory/Transaction.h | 2 +- include/rogue/interfaces/memory/Variable.h | 2 +- include/rogue/interfaces/stream/Frame.h | 2 +- include/rogue/interfaces/stream/Master.h | 2 +- include/rogue/interfaces/stream/Slave.h | 2 +- include/rogue/protocols/packetizer/CRC.h | 98 +++++++++---------- src/rogue/GeneralError.cpp | 2 +- src/rogue/GilRelease.cpp | 2 +- src/rogue/Logging.cpp | 6 +- src/rogue/Version.cpp | 2 +- src/rogue/hardware/MemMap.cpp | 2 +- src/rogue/hardware/axi/AxiMemMap.cpp | 2 +- src/rogue/hardware/axi/AxiStreamDma.cpp | 2 +- src/rogue/interfaces/ZmqClient.cpp | 2 +- src/rogue/interfaces/ZmqServer.cpp | 2 +- src/rogue/interfaces/memory/Block.cpp | 6 +- src/rogue/interfaces/memory/Emulate.cpp | 2 +- src/rogue/interfaces/memory/Hub.cpp | 2 +- src/rogue/interfaces/memory/Master.cpp | 2 +- src/rogue/interfaces/memory/Slave.cpp | 2 +- src/rogue/interfaces/memory/TcpClient.cpp | 2 +- src/rogue/interfaces/memory/TcpServer.cpp | 2 +- src/rogue/interfaces/memory/Transaction.cpp | 2 +- .../interfaces/memory/TransactionLock.cpp | 2 +- src/rogue/interfaces/memory/Variable.cpp | 2 +- src/rogue/interfaces/stream/Fifo.cpp | 2 +- src/rogue/interfaces/stream/Filter.cpp | 2 +- src/rogue/interfaces/stream/Frame.cpp | 6 +- src/rogue/interfaces/stream/FrameLock.cpp | 2 +- src/rogue/interfaces/stream/Master.cpp | 2 +- src/rogue/interfaces/stream/Pool.cpp | 2 +- src/rogue/interfaces/stream/RateDrop.cpp | 2 +- src/rogue/interfaces/stream/Slave.cpp | 2 +- src/rogue/interfaces/stream/TcpClient.cpp | 2 +- src/rogue/interfaces/stream/TcpCore.cpp | 2 +- src/rogue/interfaces/stream/TcpServer.cpp | 2 +- src/rogue/protocols/batcher/InverterV1.cpp | 2 +- src/rogue/protocols/batcher/SplitterV1.cpp | 2 +- .../protocols/packetizer/Application.cpp | 2 +- src/rogue/protocols/packetizer/Core.cpp | 2 +- src/rogue/protocols/packetizer/CoreV2.cpp | 2 +- src/rogue/protocols/packetizer/Transport.cpp | 2 +- src/rogue/protocols/rssi/Application.cpp | 2 +- src/rogue/protocols/rssi/Client.cpp | 2 +- src/rogue/protocols/rssi/Server.cpp | 2 +- src/rogue/protocols/rssi/Transport.cpp | 2 +- src/rogue/protocols/srp/Cmd.cpp | 2 +- src/rogue/protocols/srp/SrpV0.cpp | 2 +- src/rogue/protocols/srp/SrpV3.cpp | 2 +- src/rogue/protocols/udp/Client.cpp | 2 +- src/rogue/protocols/udp/Core.cpp | 2 +- src/rogue/protocols/udp/Server.cpp | 2 +- src/rogue/protocols/xilinx/JtagDriver.cpp | 2 +- src/rogue/protocols/xilinx/Xvc.cpp | 2 +- src/rogue/utilities/Prbs.cpp | 2 +- src/rogue/utilities/StreamUnZip.cpp | 2 +- src/rogue/utilities/StreamZip.cpp | 2 +- .../utilities/fileio/LegacyStreamReader.cpp | 2 +- .../utilities/fileio/LegacyStreamWriter.cpp | 2 +- src/rogue/utilities/fileio/StreamReader.cpp | 2 +- src/rogue/utilities/fileio/StreamWriter.cpp | 2 +- .../utilities/fileio/StreamWriterChannel.cpp | 2 +- 75 files changed, 140 insertions(+), 139 deletions(-) diff --git a/.clang-format b/.clang-format index 319be06cf..c7881cb4e 100644 --- a/.clang-format +++ b/.clang-format @@ -15,6 +15,7 @@ AlignConsecutiveAssignments: true AlignConsecutiveMacros: true AccessModifierOffset: -2 SortIncludes: true +IndentPPDirectives: BeforeHash IncludeBlocks: Regroup IncludeCategories: # Rogue Directives.h goes first diff --git a/include/rogue/Directives.h b/include/rogue/Directives.h index eba2e103f..f0c7218f8 100644 --- a/include/rogue/Directives.h +++ b/include/rogue/Directives.h @@ -27,7 +27,7 @@ #define CRCPP_USE_CPP11 #ifndef __STDC_FORMAT_MACROS -#define __STDC_FORMAT_MACROS + #define __STDC_FORMAT_MACROS #endif #endif diff --git a/include/rogue/GeneralError.h b/include/rogue/GeneralError.h index 1b05d3a5d..3a54dc259 100644 --- a/include/rogue/GeneralError.h +++ b/include/rogue/GeneralError.h @@ -28,7 +28,7 @@ #include #ifndef NO_PYTHON -#include + #include #endif namespace rogue { diff --git a/include/rogue/GilRelease.h b/include/rogue/GilRelease.h index 32148ada0..6892288dd 100644 --- a/include/rogue/GilRelease.h +++ b/include/rogue/GilRelease.h @@ -23,7 +23,7 @@ #include #ifndef NO_PYTHON -#include + #include #endif namespace rogue { diff --git a/include/rogue/ScopedGil.h b/include/rogue/ScopedGil.h index 373a659a1..bdc40525e 100644 --- a/include/rogue/ScopedGil.h +++ b/include/rogue/ScopedGil.h @@ -22,7 +22,7 @@ #include "rogue/Directives.h" #ifndef NO_PYTHON -#include + #include #endif namespace rogue { diff --git a/include/rogue/hardware/drivers/DmaDriver.h b/include/rogue/hardware/drivers/DmaDriver.h index accc3bb94..ebb560a38 100644 --- a/include/rogue/hardware/drivers/DmaDriver.h +++ b/include/rogue/hardware/drivers/DmaDriver.h @@ -23,9 +23,9 @@ #define __DMA_DRIVER_H__ #ifdef DMA_IN_KERNEL -#include + #include #else -#include + #include #endif /* API Version */ @@ -130,16 +130,16 @@ struct DmaRegisterData { // Conditional inclusion for non-kernel environments #ifndef DMA_IN_KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include /** * dmaWrite - Writes data to a DMA channel. diff --git a/include/rogue/interfaces/ZmqClient.h b/include/rogue/interfaces/ZmqClient.h index 45c7c6356..46af6ca2c 100644 --- a/include/rogue/interfaces/ZmqClient.h +++ b/include/rogue/interfaces/ZmqClient.h @@ -24,7 +24,7 @@ #include "rogue/Logging.h" #ifndef NO_PYTHON -#include + #include #endif namespace rogue { diff --git a/include/rogue/interfaces/ZmqServer.h b/include/rogue/interfaces/ZmqServer.h index 8a4ef7168..75e68dbed 100644 --- a/include/rogue/interfaces/ZmqServer.h +++ b/include/rogue/interfaces/ZmqServer.h @@ -24,7 +24,7 @@ #include "rogue/Logging.h" #ifndef NO_PYTHON -#include + #include #endif namespace rogue { diff --git a/include/rogue/interfaces/memory/Block.h b/include/rogue/interfaces/memory/Block.h index 41cef7ad8..37b6b2ad4 100644 --- a/include/rogue/interfaces/memory/Block.h +++ b/include/rogue/interfaces/memory/Block.h @@ -29,7 +29,7 @@ #include "rogue/interfaces/memory/Master.h" #ifndef NO_PYTHON -#include + #include #endif namespace rogue { diff --git a/include/rogue/interfaces/memory/Emulate.h b/include/rogue/interfaces/memory/Emulate.h index 9448ddc80..716eed097 100644 --- a/include/rogue/interfaces/memory/Emulate.h +++ b/include/rogue/interfaces/memory/Emulate.h @@ -30,7 +30,7 @@ #include "rogue/interfaces/memory/Slave.h" #ifndef NO_PYTHON -#include + #include #endif #define MAP_TYPE std::map diff --git a/include/rogue/interfaces/memory/Hub.h b/include/rogue/interfaces/memory/Hub.h index 9f09b18a9..41ea84e51 100644 --- a/include/rogue/interfaces/memory/Hub.h +++ b/include/rogue/interfaces/memory/Hub.h @@ -33,7 +33,7 @@ #include "rogue/interfaces/memory/Slave.h" #ifndef NO_PYTHON -#include + #include #endif namespace rogue { diff --git a/include/rogue/interfaces/memory/Master.h b/include/rogue/interfaces/memory/Master.h index d2c8f0b61..98c8cbdaf 100644 --- a/include/rogue/interfaces/memory/Master.h +++ b/include/rogue/interfaces/memory/Master.h @@ -32,7 +32,7 @@ #include "rogue/Logging.h" #ifndef NO_PYTHON -#include + #include #endif namespace rogue { diff --git a/include/rogue/interfaces/memory/Slave.h b/include/rogue/interfaces/memory/Slave.h index 3ea573fab..7444904b1 100644 --- a/include/rogue/interfaces/memory/Slave.h +++ b/include/rogue/interfaces/memory/Slave.h @@ -32,7 +32,7 @@ #include "rogue/interfaces/memory/Transaction.h" #ifndef NO_PYTHON -#include + #include #endif namespace rogue { diff --git a/include/rogue/interfaces/memory/Transaction.h b/include/rogue/interfaces/memory/Transaction.h index 2f6908d09..fc641f067 100644 --- a/include/rogue/interfaces/memory/Transaction.h +++ b/include/rogue/interfaces/memory/Transaction.h @@ -33,7 +33,7 @@ #include "rogue/Logging.h" #ifndef NO_PYTHON -#include + #include #endif namespace rogue { diff --git a/include/rogue/interfaces/memory/Variable.h b/include/rogue/interfaces/memory/Variable.h index 349e5329c..74cee1d6b 100644 --- a/include/rogue/interfaces/memory/Variable.h +++ b/include/rogue/interfaces/memory/Variable.h @@ -31,7 +31,7 @@ #include "rogue/EnableSharedFromThis.h" #ifndef NO_PYTHON -#include + #include #endif namespace rogue { diff --git a/include/rogue/interfaces/stream/Frame.h b/include/rogue/interfaces/stream/Frame.h index 138206663..2291cfb01 100644 --- a/include/rogue/interfaces/stream/Frame.h +++ b/include/rogue/interfaces/stream/Frame.h @@ -33,7 +33,7 @@ #include "rogue/EnableSharedFromThis.h" #ifndef NO_PYTHON -#include + #include #endif namespace rogue { diff --git a/include/rogue/interfaces/stream/Master.h b/include/rogue/interfaces/stream/Master.h index 10ceb5c35..04e8226b3 100644 --- a/include/rogue/interfaces/stream/Master.h +++ b/include/rogue/interfaces/stream/Master.h @@ -34,7 +34,7 @@ #include "rogue/EnableSharedFromThis.h" #ifndef NO_PYTHON -#include + #include #endif namespace rogue { diff --git a/include/rogue/interfaces/stream/Slave.h b/include/rogue/interfaces/stream/Slave.h index 029d44b1e..35955348b 100644 --- a/include/rogue/interfaces/stream/Slave.h +++ b/include/rogue/interfaces/stream/Slave.h @@ -32,7 +32,7 @@ #include "rogue/interfaces/stream/Pool.h" #ifndef NO_PYTHON -#include + #include #endif namespace rogue { diff --git a/include/rogue/protocols/packetizer/CRC.h b/include/rogue/protocols/packetizer/CRC.h index 4bec680b7..de4cb73e0 100644 --- a/include/rogue/protocols/packetizer/CRC.h +++ b/include/rogue/protocols/packetizer/CRC.h @@ -60,71 +60,71 @@ #include // Includes CHAR_BIT #ifdef CRCPP_USE_CPP11 -#include // Includes ::std::size_t -#include // Includes ::std::uint8_t, ::std::uint16_t, ::std::uint32_t, ::std::uint64_t + #include // Includes ::std::size_t + #include // Includes ::std::uint8_t, ::std::uint16_t, ::std::uint32_t, ::std::uint64_t #else -#include // Includes size_t -#include // Includes uint8_t, uint16_t, uint32_t, uint64_t + #include // Includes size_t + #include // Includes uint8_t, uint16_t, uint32_t, uint64_t #endif #include // Includes ::std::numeric_limits #include // Includes ::std::move #ifndef crcpp_uint8 -#ifdef CRCPP_USE_CPP11 -/// @brief Unsigned 8-bit integer definition, used primarily for parameter definitions. -#define crcpp_uint8 ::std::uint8_t -#else -/// @brief Unsigned 8-bit integer definition, used primarily for parameter definitions. -#define crcpp_uint8 uint8_t -#endif + #ifdef CRCPP_USE_CPP11 + /// @brief Unsigned 8-bit integer definition, used primarily for parameter definitions. + #define crcpp_uint8 ::std::uint8_t + #else + /// @brief Unsigned 8-bit integer definition, used primarily for parameter definitions. + #define crcpp_uint8 uint8_t + #endif #endif #ifndef crcpp_uint16 -#ifdef CRCPP_USE_CPP11 -/// @brief Unsigned 16-bit integer definition, used primarily for parameter definitions. -#define crcpp_uint16 ::std::uint16_t -#else -/// @brief Unsigned 16-bit integer definition, used primarily for parameter definitions. -#define crcpp_uint16 uint16_t -#endif + #ifdef CRCPP_USE_CPP11 + /// @brief Unsigned 16-bit integer definition, used primarily for parameter definitions. + #define crcpp_uint16 ::std::uint16_t + #else + /// @brief Unsigned 16-bit integer definition, used primarily for parameter definitions. + #define crcpp_uint16 uint16_t + #endif #endif #ifndef crcpp_uint32 -#ifdef CRCPP_USE_CPP11 -/// @brief Unsigned 32-bit integer definition, used primarily for parameter definitions. -#define crcpp_uint32 ::std::uint32_t -#else -/// @brief Unsigned 32-bit integer definition, used primarily for parameter definitions. -#define crcpp_uint32 uint32_t -#endif + #ifdef CRCPP_USE_CPP11 + /// @brief Unsigned 32-bit integer definition, used primarily for parameter definitions. + #define crcpp_uint32 ::std::uint32_t + #else + /// @brief Unsigned 32-bit integer definition, used primarily for parameter definitions. + #define crcpp_uint32 uint32_t + #endif #endif #ifndef crcpp_uint64 -#ifdef CRCPP_USE_CPP11 -/// @brief Unsigned 64-bit integer definition, used primarily for parameter definitions. -#define crcpp_uint64 ::std::uint64_t -#else -/// @brief Unsigned 64-bit integer definition, used primarily for parameter definitions. -#define crcpp_uint64 uint64_t -#endif + #ifdef CRCPP_USE_CPP11 + /// @brief Unsigned 64-bit integer definition, used primarily for parameter definitions. + #define crcpp_uint64 ::std::uint64_t + #else + /// @brief Unsigned 64-bit integer definition, used primarily for parameter definitions. + #define crcpp_uint64 uint64_t + #endif #endif #ifndef crcpp_size -#ifdef CRCPP_USE_CPP11 -/// @brief Unsigned size definition, used for specifying data sizes. -#define crcpp_size ::std::size_t -#else -/// @brief Unsigned size definition, used for specifying data sizes. -#define crcpp_size size_t -#endif + #ifdef CRCPP_USE_CPP11 + /// @brief Unsigned size definition, used for specifying data sizes. + #define crcpp_size ::std::size_t + #else + /// @brief Unsigned size definition, used for specifying data sizes. + #define crcpp_size size_t + #endif #endif #ifdef CRCPP_USE_CPP11 -/// @brief Compile-time expression definition. -#define crcpp_constexpr constexpr + /// @brief Compile-time expression definition. + #define crcpp_constexpr constexpr #else -/// @brief Compile-time expression definition. -#define crcpp_constexpr const + /// @brief Compile-time expression definition. + #define crcpp_constexpr const #endif #ifdef CRCPP_USE_NAMESPACE @@ -722,15 +722,15 @@ inline CRCType CRC::CalculateRemainder(const void* data, if (lookupTable.GetParameters().reflectInput) { while (size--) { #if defined(WIN32) || defined(_WIN32) || defined(WINCE) - // Disable warning about data loss when doing (remainder >> CHAR_BIT) when - // remainder is one byte long. The algorithm is still correct in this case, - // though it's possible that one additional machine instruction will be executed. -#pragma warning(push) -#pragma warning(disable : 4333) + // Disable warning about data loss when doing (remainder >> CHAR_BIT) when + // remainder is one byte long. The algorithm is still correct in this case, + // though it's possible that one additional machine instruction will be executed. + #pragma warning(push) + #pragma warning(disable : 4333) #endif remainder = (remainder >> CHAR_BIT) ^ lookupTable[static_cast(remainder ^ *current++)]; #if defined(WIN32) || defined(_WIN32) || defined(WINCE) -#pragma warning(pop) + #pragma warning(pop) #endif } } else if (CRCWidth >= CHAR_BIT) { diff --git a/src/rogue/GeneralError.cpp b/src/rogue/GeneralError.cpp index 8c5c21299..3bc634287 100644 --- a/src/rogue/GeneralError.cpp +++ b/src/rogue/GeneralError.cpp @@ -24,7 +24,7 @@ #include #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; PyObject* rogue::generalErrorObj = 0; diff --git a/src/rogue/GilRelease.cpp b/src/rogue/GilRelease.cpp index 36dcce827..1d558b74d 100644 --- a/src/rogue/GilRelease.cpp +++ b/src/rogue/GilRelease.cpp @@ -24,7 +24,7 @@ #include #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/Logging.cpp b/src/rogue/Logging.cpp index cf824be02..5feac4d73 100644 --- a/src/rogue/Logging.cpp +++ b/src/rogue/Logging.cpp @@ -31,13 +31,13 @@ #include #if defined(__linux__) -#include + #include #elif defined(__APPLE__) && defined(__MACH__) -#include + #include #endif #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/Version.cpp b/src/rogue/Version.cpp index 24128c661..1f6cc82bb 100644 --- a/src/rogue/Version.cpp +++ b/src/rogue/Version.cpp @@ -32,7 +32,7 @@ #include "rogue/GilRelease.h" #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/hardware/MemMap.cpp b/src/rogue/hardware/MemMap.cpp index b39168c6a..9279b1056 100644 --- a/src/rogue/hardware/MemMap.cpp +++ b/src/rogue/hardware/MemMap.cpp @@ -40,7 +40,7 @@ namespace rh = rogue::hardware; namespace rim = rogue::interfaces::memory; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/hardware/axi/AxiMemMap.cpp b/src/rogue/hardware/axi/AxiMemMap.cpp index 213d93d57..7898d960c 100644 --- a/src/rogue/hardware/axi/AxiMemMap.cpp +++ b/src/rogue/hardware/axi/AxiMemMap.cpp @@ -41,7 +41,7 @@ namespace rha = rogue::hardware::axi; namespace rim = rogue::interfaces::memory; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/hardware/axi/AxiStreamDma.cpp b/src/rogue/hardware/axi/AxiStreamDma.cpp index 9f043264b..f8929d9a2 100644 --- a/src/rogue/hardware/axi/AxiStreamDma.cpp +++ b/src/rogue/hardware/axi/AxiStreamDma.cpp @@ -38,7 +38,7 @@ namespace rha = rogue::hardware::axi; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/ZmqClient.cpp b/src/rogue/interfaces/ZmqClient.cpp index 58e01fd65..ba60f1a07 100644 --- a/src/rogue/interfaces/ZmqClient.cpp +++ b/src/rogue/interfaces/ZmqClient.cpp @@ -30,7 +30,7 @@ #include "rogue/ScopedGil.h" #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/ZmqServer.cpp b/src/rogue/interfaces/ZmqServer.cpp index eb5359189..9aa15d10c 100644 --- a/src/rogue/interfaces/ZmqServer.cpp +++ b/src/rogue/interfaces/ZmqServer.cpp @@ -30,7 +30,7 @@ #include "rogue/ScopedGil.h" #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/memory/Block.cpp b/src/rogue/interfaces/memory/Block.cpp index f717bf465..51a78c00d 100644 --- a/src/rogue/interfaces/memory/Block.cpp +++ b/src/rogue/interfaces/memory/Block.cpp @@ -42,10 +42,10 @@ namespace rim = rogue::interfaces::memory; #ifndef NO_PYTHON -#include -#include + #include + #include -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/memory/Emulate.cpp b/src/rogue/interfaces/memory/Emulate.cpp index e873d2304..181fbbd1e 100644 --- a/src/rogue/interfaces/memory/Emulate.cpp +++ b/src/rogue/interfaces/memory/Emulate.cpp @@ -35,7 +35,7 @@ namespace rim = rogue::interfaces::memory; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/memory/Hub.cpp b/src/rogue/interfaces/memory/Hub.cpp index 708d05ea8..ea4c51250 100644 --- a/src/rogue/interfaces/memory/Hub.cpp +++ b/src/rogue/interfaces/memory/Hub.cpp @@ -37,7 +37,7 @@ namespace rim = rogue::interfaces::memory; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/memory/Master.cpp b/src/rogue/interfaces/memory/Master.cpp index 33ef620f4..db1656152 100644 --- a/src/rogue/interfaces/memory/Master.cpp +++ b/src/rogue/interfaces/memory/Master.cpp @@ -38,7 +38,7 @@ namespace rim = rogue::interfaces::memory; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/memory/Slave.cpp b/src/rogue/interfaces/memory/Slave.cpp index 5754ae993..ca2e34327 100644 --- a/src/rogue/interfaces/memory/Slave.cpp +++ b/src/rogue/interfaces/memory/Slave.cpp @@ -31,7 +31,7 @@ #include "rogue/interfaces/memory/Transaction.h" #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/memory/TcpClient.cpp b/src/rogue/interfaces/memory/TcpClient.cpp index 682a3865d..64bdf4839 100644 --- a/src/rogue/interfaces/memory/TcpClient.cpp +++ b/src/rogue/interfaces/memory/TcpClient.cpp @@ -38,7 +38,7 @@ namespace rim = rogue::interfaces::memory; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/memory/TcpServer.cpp b/src/rogue/interfaces/memory/TcpServer.cpp index 8a96ed785..40547802d 100644 --- a/src/rogue/interfaces/memory/TcpServer.cpp +++ b/src/rogue/interfaces/memory/TcpServer.cpp @@ -36,7 +36,7 @@ namespace rim = rogue::interfaces::memory; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/memory/Transaction.cpp b/src/rogue/interfaces/memory/Transaction.cpp index 872964269..55218fdd2 100644 --- a/src/rogue/interfaces/memory/Transaction.cpp +++ b/src/rogue/interfaces/memory/Transaction.cpp @@ -39,7 +39,7 @@ namespace rim = rogue::interfaces::memory; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/memory/TransactionLock.cpp b/src/rogue/interfaces/memory/TransactionLock.cpp index 228ea2339..e7fd587d5 100644 --- a/src/rogue/interfaces/memory/TransactionLock.cpp +++ b/src/rogue/interfaces/memory/TransactionLock.cpp @@ -29,7 +29,7 @@ namespace rim = rogue::interfaces::memory; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/memory/Variable.cpp b/src/rogue/interfaces/memory/Variable.cpp index cfb92dc56..d6d8a0abf 100644 --- a/src/rogue/interfaces/memory/Variable.cpp +++ b/src/rogue/interfaces/memory/Variable.cpp @@ -38,7 +38,7 @@ namespace rim = rogue::interfaces::memory; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/stream/Fifo.cpp b/src/rogue/interfaces/stream/Fifo.cpp index 175163c01..b79502943 100644 --- a/src/rogue/interfaces/stream/Fifo.cpp +++ b/src/rogue/interfaces/stream/Fifo.cpp @@ -39,7 +39,7 @@ namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/stream/Filter.cpp b/src/rogue/interfaces/stream/Filter.cpp index e6b9dfebc..d40482989 100644 --- a/src/rogue/interfaces/stream/Filter.cpp +++ b/src/rogue/interfaces/stream/Filter.cpp @@ -35,7 +35,7 @@ namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/stream/Frame.cpp b/src/rogue/interfaces/stream/Frame.cpp index f0ca5e8a3..5770916a3 100644 --- a/src/rogue/interfaces/stream/Frame.cpp +++ b/src/rogue/interfaces/stream/Frame.cpp @@ -34,10 +34,10 @@ namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include -#include + #include + #include -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/stream/FrameLock.cpp b/src/rogue/interfaces/stream/FrameLock.cpp index 856bf790a..f103427c9 100644 --- a/src/rogue/interfaces/stream/FrameLock.cpp +++ b/src/rogue/interfaces/stream/FrameLock.cpp @@ -29,7 +29,7 @@ namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/stream/Master.cpp b/src/rogue/interfaces/stream/Master.cpp index 9d1482f25..554923750 100644 --- a/src/rogue/interfaces/stream/Master.cpp +++ b/src/rogue/interfaces/stream/Master.cpp @@ -34,7 +34,7 @@ namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/stream/Pool.cpp b/src/rogue/interfaces/stream/Pool.cpp index aaadae803..143f401d0 100644 --- a/src/rogue/interfaces/stream/Pool.cpp +++ b/src/rogue/interfaces/stream/Pool.cpp @@ -37,7 +37,7 @@ namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/stream/RateDrop.cpp b/src/rogue/interfaces/stream/RateDrop.cpp index 757047e96..d6f0dc7e8 100644 --- a/src/rogue/interfaces/stream/RateDrop.cpp +++ b/src/rogue/interfaces/stream/RateDrop.cpp @@ -35,7 +35,7 @@ namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/stream/Slave.cpp b/src/rogue/interfaces/stream/Slave.cpp index 1aee647b1..f484348a6 100644 --- a/src/rogue/interfaces/stream/Slave.cpp +++ b/src/rogue/interfaces/stream/Slave.cpp @@ -43,7 +43,7 @@ namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/stream/TcpClient.cpp b/src/rogue/interfaces/stream/TcpClient.cpp index d3459e6cc..0c8621f63 100644 --- a/src/rogue/interfaces/stream/TcpClient.cpp +++ b/src/rogue/interfaces/stream/TcpClient.cpp @@ -36,7 +36,7 @@ namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/stream/TcpCore.cpp b/src/rogue/interfaces/stream/TcpCore.cpp index 2a5d91b4a..181f5ca55 100644 --- a/src/rogue/interfaces/stream/TcpCore.cpp +++ b/src/rogue/interfaces/stream/TcpCore.cpp @@ -38,7 +38,7 @@ namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/interfaces/stream/TcpServer.cpp b/src/rogue/interfaces/stream/TcpServer.cpp index f2e86ee44..466cbe437 100644 --- a/src/rogue/interfaces/stream/TcpServer.cpp +++ b/src/rogue/interfaces/stream/TcpServer.cpp @@ -36,7 +36,7 @@ namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/batcher/InverterV1.cpp b/src/rogue/protocols/batcher/InverterV1.cpp index 6e53d8ea9..995a13908 100644 --- a/src/rogue/protocols/batcher/InverterV1.cpp +++ b/src/rogue/protocols/batcher/InverterV1.cpp @@ -39,7 +39,7 @@ namespace rpb = rogue::protocols::batcher; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/batcher/SplitterV1.cpp b/src/rogue/protocols/batcher/SplitterV1.cpp index 096f6f268..625289af7 100644 --- a/src/rogue/protocols/batcher/SplitterV1.cpp +++ b/src/rogue/protocols/batcher/SplitterV1.cpp @@ -39,7 +39,7 @@ namespace rpb = rogue::protocols::batcher; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/packetizer/Application.cpp b/src/rogue/protocols/packetizer/Application.cpp index 02cc49631..c76b7ae39 100644 --- a/src/rogue/protocols/packetizer/Application.cpp +++ b/src/rogue/protocols/packetizer/Application.cpp @@ -35,7 +35,7 @@ namespace rpp = rogue::protocols::packetizer; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/packetizer/Core.cpp b/src/rogue/protocols/packetizer/Core.cpp index c2c87b9e3..53a1d3fbf 100644 --- a/src/rogue/protocols/packetizer/Core.cpp +++ b/src/rogue/protocols/packetizer/Core.cpp @@ -34,7 +34,7 @@ namespace rpp = rogue::protocols::packetizer; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/packetizer/CoreV2.cpp b/src/rogue/protocols/packetizer/CoreV2.cpp index f44daf56f..7aab1fd89 100644 --- a/src/rogue/protocols/packetizer/CoreV2.cpp +++ b/src/rogue/protocols/packetizer/CoreV2.cpp @@ -33,7 +33,7 @@ namespace rpp = rogue::protocols::packetizer; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/packetizer/Transport.cpp b/src/rogue/protocols/packetizer/Transport.cpp index 311bf71cb..76fdcc2ff 100644 --- a/src/rogue/protocols/packetizer/Transport.cpp +++ b/src/rogue/protocols/packetizer/Transport.cpp @@ -35,7 +35,7 @@ namespace rpp = rogue::protocols::packetizer; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/rssi/Application.cpp b/src/rogue/protocols/rssi/Application.cpp index a2970f5a0..c9b798aca 100644 --- a/src/rogue/protocols/rssi/Application.cpp +++ b/src/rogue/protocols/rssi/Application.cpp @@ -35,7 +35,7 @@ namespace rpr = rogue::protocols::rssi; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/rssi/Client.cpp b/src/rogue/protocols/rssi/Client.cpp index 822baf670..65bfdfb70 100644 --- a/src/rogue/protocols/rssi/Client.cpp +++ b/src/rogue/protocols/rssi/Client.cpp @@ -34,7 +34,7 @@ namespace rpr = rogue::protocols::rssi; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/rssi/Server.cpp b/src/rogue/protocols/rssi/Server.cpp index 423006a1b..7f3dfa25a 100644 --- a/src/rogue/protocols/rssi/Server.cpp +++ b/src/rogue/protocols/rssi/Server.cpp @@ -30,7 +30,7 @@ namespace rpr = rogue::protocols::rssi; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/rssi/Transport.cpp b/src/rogue/protocols/rssi/Transport.cpp index bdf5d4c57..7fbc7083b 100644 --- a/src/rogue/protocols/rssi/Transport.cpp +++ b/src/rogue/protocols/rssi/Transport.cpp @@ -35,7 +35,7 @@ namespace rpr = rogue::protocols::rssi; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/srp/Cmd.cpp b/src/rogue/protocols/srp/Cmd.cpp index 08ca8ce2d..6eae0707e 100644 --- a/src/rogue/protocols/srp/Cmd.cpp +++ b/src/rogue/protocols/srp/Cmd.cpp @@ -36,7 +36,7 @@ namespace rps = rogue::protocols::srp; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/srp/SrpV0.cpp b/src/rogue/protocols/srp/SrpV0.cpp index 037d19d9a..ff13a27ae 100644 --- a/src/rogue/protocols/srp/SrpV0.cpp +++ b/src/rogue/protocols/srp/SrpV0.cpp @@ -47,7 +47,7 @@ namespace rim = rogue::interfaces::memory; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/srp/SrpV3.cpp b/src/rogue/protocols/srp/SrpV3.cpp index aba1cd15d..3496ad9f7 100644 --- a/src/rogue/protocols/srp/SrpV3.cpp +++ b/src/rogue/protocols/srp/SrpV3.cpp @@ -47,7 +47,7 @@ namespace rim = rogue::interfaces::memory; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/udp/Client.cpp b/src/rogue/protocols/udp/Client.cpp index 579079d8a..3fc436e1c 100644 --- a/src/rogue/protocols/udp/Client.cpp +++ b/src/rogue/protocols/udp/Client.cpp @@ -41,7 +41,7 @@ namespace rpu = rogue::protocols::udp; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/udp/Core.cpp b/src/rogue/protocols/udp/Core.cpp index fb2395382..260dd3e57 100644 --- a/src/rogue/protocols/udp/Core.cpp +++ b/src/rogue/protocols/udp/Core.cpp @@ -31,7 +31,7 @@ namespace rpu = rogue::protocols::udp; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/udp/Server.cpp b/src/rogue/protocols/udp/Server.cpp index 03fec128a..d27e38fce 100644 --- a/src/rogue/protocols/udp/Server.cpp +++ b/src/rogue/protocols/udp/Server.cpp @@ -41,7 +41,7 @@ namespace rpu = rogue::protocols::udp; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/xilinx/JtagDriver.cpp b/src/rogue/protocols/xilinx/JtagDriver.cpp index 5db8816e2..c44bec19e 100644 --- a/src/rogue/protocols/xilinx/JtagDriver.cpp +++ b/src/rogue/protocols/xilinx/JtagDriver.cpp @@ -30,7 +30,7 @@ namespace rpx = rogue::protocols::xilinx; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/protocols/xilinx/Xvc.cpp b/src/rogue/protocols/xilinx/Xvc.cpp index 35259cf5b..3dc08e2ae 100644 --- a/src/rogue/protocols/xilinx/Xvc.cpp +++ b/src/rogue/protocols/xilinx/Xvc.cpp @@ -41,7 +41,7 @@ namespace rpx = rogue::protocols::xilinx; namespace ris = rogue::interfaces::stream; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/utilities/Prbs.cpp b/src/rogue/utilities/Prbs.cpp index ed25b97e7..67acdd9da 100644 --- a/src/rogue/utilities/Prbs.cpp +++ b/src/rogue/utilities/Prbs.cpp @@ -45,7 +45,7 @@ namespace ris = rogue::interfaces::stream; namespace ru = rogue::utilities; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/utilities/StreamUnZip.cpp b/src/rogue/utilities/StreamUnZip.cpp index f8afb7715..ac7416b81 100644 --- a/src/rogue/utilities/StreamUnZip.cpp +++ b/src/rogue/utilities/StreamUnZip.cpp @@ -39,7 +39,7 @@ namespace ris = rogue::interfaces::stream; namespace ru = rogue::utilities; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/utilities/StreamZip.cpp b/src/rogue/utilities/StreamZip.cpp index f81509178..6d17a8df9 100644 --- a/src/rogue/utilities/StreamZip.cpp +++ b/src/rogue/utilities/StreamZip.cpp @@ -39,7 +39,7 @@ namespace ris = rogue::interfaces::stream; namespace ru = rogue::utilities; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/utilities/fileio/LegacyStreamReader.cpp b/src/rogue/utilities/fileio/LegacyStreamReader.cpp index 62c163105..891c9f9ae 100644 --- a/src/rogue/utilities/fileio/LegacyStreamReader.cpp +++ b/src/rogue/utilities/fileio/LegacyStreamReader.cpp @@ -41,7 +41,7 @@ namespace ris = rogue::interfaces::stream; namespace ruf = rogue::utilities::fileio; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/utilities/fileio/LegacyStreamWriter.cpp b/src/rogue/utilities/fileio/LegacyStreamWriter.cpp index 059043d92..144bb2a47 100644 --- a/src/rogue/utilities/fileio/LegacyStreamWriter.cpp +++ b/src/rogue/utilities/fileio/LegacyStreamWriter.cpp @@ -55,7 +55,7 @@ namespace ris = rogue::interfaces::stream; namespace ruf = rogue::utilities::fileio; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/utilities/fileio/StreamReader.cpp b/src/rogue/utilities/fileio/StreamReader.cpp index c612992e6..cf7eeef1a 100644 --- a/src/rogue/utilities/fileio/StreamReader.cpp +++ b/src/rogue/utilities/fileio/StreamReader.cpp @@ -42,7 +42,7 @@ namespace ris = rogue::interfaces::stream; namespace ruf = rogue::utilities::fileio; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/utilities/fileio/StreamWriter.cpp b/src/rogue/utilities/fileio/StreamWriter.cpp index 955a73596..b4394143f 100644 --- a/src/rogue/utilities/fileio/StreamWriter.cpp +++ b/src/rogue/utilities/fileio/StreamWriter.cpp @@ -58,7 +58,7 @@ namespace ris = rogue::interfaces::stream; namespace ruf = rogue::utilities::fileio; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif diff --git a/src/rogue/utilities/fileio/StreamWriterChannel.cpp b/src/rogue/utilities/fileio/StreamWriterChannel.cpp index dcc7e3019..a6235bad9 100644 --- a/src/rogue/utilities/fileio/StreamWriterChannel.cpp +++ b/src/rogue/utilities/fileio/StreamWriterChannel.cpp @@ -40,7 +40,7 @@ namespace ris = rogue::interfaces::stream; namespace ruf = rogue::utilities::fileio; #ifndef NO_PYTHON -#include + #include namespace bp = boost::python; #endif