I was in a rush for a report previously that I did not get to
reply to all of this. Please see below.
Till Straumann wrote:
Kate Feng wrote:
Szalata, Zenon M. wrote:
I need a device driver for the CAEN V965 module, which works with
vxWorks 6.x. Here at SLAC we have a device driver for this module
which works with rtems only.
Thanks,
Zen
Is the driver written for EPICS 3.14.x ? If so, it should be
easy to port it to vxWorks. It is a good idea to write a driver
for multiple platforms. The "Application Developer's Guide"
provides a good guideline.
1) For the src/Makefile :
Copy the existing Makefile to Makefile.RTEMS. For the vxworks
Makefile, change "PROD_IOC_RTEMS" to "PROD_IOC_vxWorks"
and take out all the RTEMS related include path.
2) For the source code under src/ :
vxworks access the I/O register via a pointer to the address.
For example : for the long data access, which is four bytes, it does:
volatile epicsUInt32 *reg;
epicsUInt32 value;
reg = (volatile epicsUInt32 *) io_address ;
My 2 cents:
I am not sure how much does 2 cents cost. :-)
Accessing device registers this way is bad practice.
a) it is not obvious where I/O is done. Makes porting this code e.g., to
a CPU of different endianness much more cumbersome.
It should not be cumbersome to be implemented for EPICS. The
endianne for CA is already implemented gracefully. It could be
even more cumbersome to port in different ASM languages
among various CPUs into EPICS.
b) may not synchronize I/O properly; modern CPUs may reorder
instruction execution and need special instructions to enforce
in-order execution of critical code sequences.
I am sure vxWorks has a smart path to handle this kind of issues.
Did any vxWorks users experience any reorder problem on
the modern CPUs ?
Both issues are addressed by the RTEMS inline routines in io.h and
byteorder.h
Again this depends on the ASM language of each CPU, which could
be really "cumbersome".
It certainly would be great to have equivalent functionality available
in EPICS/OSI.
For now, you'll have to find out what vxWorks provides in this area
or ultimately code it yourself.
Vxworks provided. It's up to one's choice. Of course, I like how it was
done in RTEMS, too. :-)
However, I suggest you *always* perform register access by means
of a macro or inline routine for sake of portability and ease of
maintenance.
Sometimes, the sake of portability and ease of maintenance is in the
beholder's eyes. There is no clear cut in each instance. :-)
Ciao,
Kate
-- Till
*reg = value;
while RTEMS accesses the I/O register via the command in_be32( ) or
in_le32().
You can reference "synAppsRTEMS" source code at the web site :
http://www.nsls.bnl.gov/facility/expsys/software/EPICS/
The software is meant to be ported for both RTEMS and vxWorks.
Cheers,
Kate
- References:
- CAEN V965 driver Szalata, Zenon M.
- Re: CAEN V965 driver Kate Feng
- Re: CAEN V965 driver Till Straumann
- Navigate by Date:
- Prev:
Re: RE: RE: A db question about aiExample Silver
- Next:
A bug of calc record? Silver
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
<2008>
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: CAEN V965 driver Kate Feng
- Next:
IOC Shell David Dudley
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
<2008>
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|