EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Epics driver using BLT or CBLT to read FIFO wanted
From: Mark Rivers <[email protected]>
To: Till Straumann <[email protected]>, "[email protected]" <[email protected]>
Cc: Kate Feng <[email protected]>
Date: Thu, 6 Sep 2012 19:57:00 +0000
Folks,

I would like to renew my plea for an update to the EPICS devLib to support VME operations in an OS-independent manner.  This includes not just the DMA operations that this thread originally referenced, but also basic register write and read operations.

For example, when Kate Feng converted my SIS320 driver from vxWorks to RTEMS she made changes like the following:

-        status = sysDmaFromVme(dmaId_, fifoBuffer_, (int)fifo_base_, VME_AM_EXT_SUP_D64BLT, (count)*sizeof(int), 8);
+#ifdef __rtems__
+        status= BSP_VMEDmaStart(dmaId_,fifoBuffer_PCIaddr, fifo_baseVMEaddr_, (count)*sizeof(int));
+#else
+        status = sysDmaFromVme(dmaId_, fifoBuffer_, fifo_baseVMEaddr_, VME_AM_EXT_SUP_D64BLT, (count)*sizeof(int), 8);
+#endif
 
According to Till's message this might not have been necessary, since he said he had an RTEMS implementation of Andrew's API, so perhaps the same API call could have been used?

But there were also changes like this:
-    registers_->irq_control_status_reg = SIS3820_IRQ_SOURCE4_DISABLE;
+    writeReg32(&registers_->irq_control_status_reg, SIS3820_IRQ_SOURCE4_DISABLE);
 
and this:
-  firmwareVersion_ = registers_->moduleID_reg & 0x0000FFFF;
+  firmwareVersion_ = readReg32( &registers_->moduleID_reg) & 0x0000FFFF;
  
So where I was doing register access directly, on RTEMs this is being wrapped in a function or macro.  I understand that this may be needed on some architectures to ensure that writes are done immediately, etc.  The problem is that Kate's code won't build on vxWorks because the readReg32 function is defined in a header file only included for RTEMS.  I don't know of a vxWorks equivalent.

We really need something standard in EPICS base that we can all use in our VME drivers to make them OS and architecture independent.

Mark


________________________________________
From: [email protected] [[email protected]] on behalf of Till Straumann [[email protected]]
Sent: Wednesday, February 15, 2012 9:21 AM
To: [email protected]
Subject: Re: Epics driver using BLT or CBLT to read FIFO wanted

FWIW. We also have a RTEMS implementation of Andrew's DMA API.
And yes, I'd think integrating this into devLib would be desirable.

Till

On 02/15/2012 08:24 AM, Mark Rivers wrote:
> Hi,
>
> My SIS3820 driver reads out a FIFO using BLT. Here is the code snippet:
>
>       if (useDma_ && (count >= MIN_DMA_TRANSFERS)) {
>         asynPrint(pasynUserSelf, ASYN_TRACE_FLOW,
>                   "%s:%s: doing DMA transfer, fifoBuffer=%p, fifo_base=%p, count=%d\n",
>                   driverName, functionName, fifoBuffer_, fifo_base_, count);
>         status = sysDmaFromVme(dmaId_, fifoBuffer_, (int)fifo_base_, VME_AM_EXT_SUP_D64BLT, (count)*sizeof(int), 8);
>         if (status) {
>           asynPrint(pasynUserSelf, ASYN_TRACE_ERROR,
>                     "%s:%s: doing DMA transfer, error calling sysDmaFromVme, status=%d, buff=%p, fifo_base=%p, count=%d\n",
>                     driverName, functionName, status, fifoBuffer_, fifo_base_, count);
>         }
>
> You can get the complete file containing this snippet here:
>
> https://subversion.xor.aps.anl.gov/synApps/mca/trunk/mcaApp/SISSrc/drvSIS3820.cpp
>
> This code uses the DMA functions that Andrew Johnson provides in the vxWorks BSPs at the APS.
>
> I would like to suggest (again) that these functions or something similar should be added to devLib in EPICS base, so that we can all write portable code that uses DMA!
>
> Cheers,
> Mark
> ________________________________________
> From: [email protected] [[email protected]] on behalf of Bai Jiaoni [[email protected]]
> Sent: Wednesday, February 15, 2012 7:17 AM
> To: [email protected]
> Subject: Epics driver using BLT or CBLT to read FIFO wanted
>
> I want to wirte a driver for the hardware, which needs to use record to read the
> data of FIFO(altera FPGA) by BLT or CBLT. Do you know some other dirvers finishing
> the same function?
> Version:Epics 3.13 or 3.14; vxWorks 5.4; VME bus
>
> I am looking forward to your reply.
>
>
>
>
>

Replies:
Re: Epics driver using BLT or CBLT to read FIFO wanted Benjamin Franksen
References:
Epics driver using BLT or CBLT to read FIFO wanted Bai Jiaoni
RE: Epics driver using BLT or CBLT to read FIFO wanted Mark Rivers
Re: Epics driver using BLT or CBLT to read FIFO wanted Till Straumann

Navigate by Date:
Prev: Re: asyn4-20 compiling error on Scientific Linux 6.1 Ron Sluiter
Next: mca R7-2 available Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Epics driver using BLT or CBLT to read FIFO wanted Till Straumann
Next: Re: Epics driver using BLT or CBLT to read FIFO wanted Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·