From bee07d1578811f702052b618bb1b128b3db48d90 Mon Sep 17 00:00:00 2001 From: rhong Date: Mon, 24 Jun 2024 15:47:16 -0500 Subject: [PATCH] Fixing the CPU word order for CML of EVR-VME-300 card, mtca is not affected --- evrMrmApp/src/drvemCML.cpp | 45 ++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/evrMrmApp/src/drvemCML.cpp b/evrMrmApp/src/drvemCML.cpp index d1f1ebff..b3ea331d 100644 --- a/evrMrmApp/src/drvemCML.cpp +++ b/evrMrmApp/src/drvemCML.cpp @@ -26,10 +26,10 @@ MRMCML::MRMCML(const std::string& n, unsigned char i,EVRMRM& o, outkind k, formFactor f) :CML(n) // CML word length - ,mult(f==formFactor_CPCIFULL || f==formFactor_mTCA ? 40 : 20) + ,mult(f==formFactor_CPCIFULL || f==formFactor_mTCA || f==formFactor_VME64 ? 40 : 20) // # of 32-bit dwords used to store 1 CML word // 40 bits fit in 2 dwords, 20 bits fit in 1 - ,wordlen(f==formFactor_CPCIFULL || f==formFactor_mTCA ? 2 : 1) + ,wordlen(f==formFactor_CPCIFULL || f==formFactor_mTCA || f==formFactor_VME64 ? 2 : 1) ,base(o.base) ,N(i) ,owner(o) @@ -37,6 +37,12 @@ MRMCML::MRMCML(const std::string& n, unsigned char i,EVRMRM& o, outkind k, formF ,shadowWaveformlength(0) ,kind(k) { + //For EVR-VME230, CML world length is 20, Need to add this exception for VME + if (f==formFactor_VME64 && strcmp(o.conf->model,"VME-EVRRF-230")==0){ + mult=20; + wordlen=1; + } + epicsUInt32 val=READ32(base, OutputCMLEna(N)); val&=~OutputCMLEna_type_mask; @@ -357,31 +363,38 @@ MRMCML::getPattern(pattern p, unsigned char *buf, epicsUInt32 blen) const blen = std::min(plen, blen); epicsUInt32 val=0; + for(epicsUInt32 i=0; i>cpubit; buf[i]&=0x1; - } + return blen; } @@ -400,6 +413,7 @@ MRMCML::setPattern(pattern p, const unsigned char *buf, epicsUInt32 blen) epicsUInt32 val=0; + for(epicsUInt32 i=0; i