From a2d30f56efef91bd23bc06be99335e119fb0e896 Mon Sep 17 00:00:00 2001 From: Dawood Alnajjar Date: Thu, 21 Mar 2024 22:33:54 -0700 Subject: [PATCH] Fixed bug with writer cfg stream. Now set to channel 5. Fixed code in fileReader --- firmware/python/ePix320kM/_Root.py | 14 ++++++++------ software/notebook/fileReader.ipynb | 16 ++++++++-------- software/script/devGui.py | 8 -------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/firmware/python/ePix320kM/_Root.py b/firmware/python/ePix320kM/_Root.py index 60e8490..5b324b0 100644 --- a/firmware/python/ePix320kM/_Root.py +++ b/firmware/python/ePix320kM/_Root.py @@ -83,12 +83,7 @@ def __init__( self, self.zmqServer = pyrogue.interfaces.ZmqServer(root=self, addr='127.0.0.1', port=0) self.addInterface(self.zmqServer) - # Create configuration stream - stream = pyrogue.interfaces.stream.Variable(root=self) - # Create StreamWriter with the configuration stream included as channel 1 - self.dataWriter = pyrogue.utilities.fileio.StreamWriter(configStream={1: stream}) - self.add(self.dataWriter) ################################################################# # Create an empty list to be filled @@ -101,7 +96,14 @@ def __init__( self, self.unbatchers = [rogue.protocols.batcher.SplitterV1() for lane in range(self.numOfAsics)] self.streamUnbatchers = [rogue.protocols.batcher.SplitterV1() for lane in range(self.numOfAsics)] self._dbg = [dataDebug(name='DataDebug[{}]'.format(lane), size = DDebugSize) for lane in range(self.numOfAsics)] - + + # Create configuration stream + stream = pyrogue.interfaces.stream.Variable(root=self) + + # Create StreamWriter with the configuration stream included as channel 1 + self.dataWriter = pyrogue.utilities.fileio.StreamWriter(configStream={5: stream}) + self.add(self.dataWriter) + # Check if not VCS simulation if (not self.sim): diff --git a/software/notebook/fileReader.ipynb b/software/notebook/fileReader.ipynb index e85e931..28517a7 100755 --- a/software/notebook/fileReader.ipynb +++ b/software/notebook/fileReader.ipynb @@ -27,7 +27,6 @@ "pr.addLibraryPath( rootTopLevel )\n", "import setupLibPaths\n", "\n", - "import ePix320kM as fpgaBoard\n", "\n", "from dataDebug import dataDebug\n", "\n", @@ -73,12 +72,13 @@ "numOfAsics = 4\n", "readerReceiver = [dataDebug(name = \"readerReceiver[{}]\".format(lane), size = 70000) for lane in range(numOfAsics)]\n", "filter = [rogue.interfaces.stream.Filter(False, lane) for lane in range(numOfAsics)]\n", - "dataReceiverFilter = [rogue.interfaces.stream.Filter(False, 2) for lane in range(numOfAsics)]\n", + "# not sure what to do this yet\n", + "cfgFilter = rogue.interfaces.stream.Filter(False, 5)\n", "fread = rogue.utilities.fileio.StreamReader()\n", "readUnbatcher = [rogue.protocols.batcher.SplitterV1() for lane in range(numOfAsics)]\n", "\n", "for i in range(numOfAsics):\n", - " readerReceiver[i] << readUnbatcher[i] << filter[i] << fread\n", + " readerReceiver[i] << readUnbatcher[i] << filter[i]<< fread\n", " readerReceiver[i].enableDataDebug(True)\n", " readerReceiver[i].enableDebugPrint(True)\n", " \n", @@ -108,22 +108,22 @@ "name": "stdout", "output_type": "stream", "text": [ - "Extracted and descrambled 10000 frames\r" + "Extracted and descrambled 4 frames\r" ] } ], "source": [ "# Has good performance\n", "\n", - "ssdPath = \"/u1/ePixHRM320k/measurements/20240306_source/\"\n", - "filename = f\"{ssdPath}/03062024_Fe55_50V_RX000_0.dat\"\n", + "ssdPath = \"/u1/ePixHRM320k/acquisition/\"\n", + "filename = f\"{ssdPath}/data_20240321_222413.dat\"\n", "\n", "readFromFile(filename)" ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 5, "id": "9f45fa83", "metadata": {}, "outputs": [ @@ -132,7 +132,7 @@ "output_type": "stream", "text": [ "Read ASIC0 (192, 384, 0) Frames\n", - "Read ASIC1 (192, 384, 10000) Frames\n", + "Read ASIC1 (192, 384, 4) Frames\n", "Read ASIC2 (192, 384, 0) Frames\n", "Read ASIC3 (192, 384, 0) Frames\n" ] diff --git a/software/script/devGui.py b/software/script/devGui.py index e869f52..868a736 100644 --- a/software/script/devGui.py +++ b/software/script/devGui.py @@ -76,14 +76,6 @@ help = "Sets the GUI type (PyDM or None)", ) - parser.add_argument( - "--serverPort", - type = int, - required = False, - default = 9099, - help = "Zeromq server port", - ) - parser.add_argument( "--justCtrl", type = argBool,