EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  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  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Port of EPICS 3.14.9 to ETRAX CRIS architecture - Strange Data
From: "Jeff Hill" <[email protected]>
To: "'Peter Zumbruch'" <[email protected]>, <[email protected]>
Date: Wed, 22 Aug 2007 14:28:38 -0600
Hello Peter,

Here are some numbers from you output below.

DBR_LONG    50331648 == 0x3000000
DBR_SHORT   768      == 0x300
DBR_CHAR    3        == 0x3

Based on this output it looks like byte swapping isn?t working properly for
_all_ operand sizes.

>	#elif defined (_cris_)
>	#     define EPICS_LITTLE_ENDIAN

I would add this code temporarily to osdWireFormat.h in order to debug the
situation.

#if ! defined (_cris_)
#warning !!!! _cris_ wasn?t defined as expected !!!!
#endif

I hope that this might help to illuminate a build configuration issue. Watch
for the #warning message when building the c++ codes. If you want the
compilation to stop then change the #warning to #error.

Another possibility might be that you need to do a "make rebuild" in order
to force all code to recompile after making the elif defined (_cris_) then
define EPICS_LITTLE_ENDIAN change??

> The cross-compiler used is a gnu-compiler provided by axis:
> cris-gcc --version: cris-axis-elf-gcc (GCC) 3.2.1 Axis release R64/1.64

This version is certainly close to, and lower numbered, compared to gcc
3.2.3 which is known to have a problem with -O3

> The optimization -O3 had to be replaced by -Os or the 
> default -O0 to be able to compile.

Typically changing the optimization level has an impact only on the object
code and therefore on what is executed at runtime (we hope that -O3 will run
correctly and hopefully also more efficiently compared -O0), but does not
have an impact on whether the source code will successfully compile or not.
I am interpreting the above statement to imply that the source code wouldn?t
compile successfully into object code under -O3, but given my expectations
of compilers I suspect that maybe I am suffering from a misunderstanding. So
I am curious, which was the result with -O3?
A) failure to produce object code, or
B) production of object code with runtime behavior even worse than what is
described in your mail message, or
C) You set the optimization to -O0 based on recent discussions about EPICS
R3.14.9 being incompatible with gcc 3.2.3 -O3

> The cross-compiler used is a gnu-compiler provided by axis:
> cris-gcc --version: cris-axis-elf-gcc (GCC) 3.2.1 Axis release R64/1.64

This version is certainly close to (and lower numbered) compared to gcc
3.2.3 which is known to have a problem with -O3 and EPICS R3.14.9. However,
(A) you mentioned that -O3 is turned off, and (B) the troubles with gcc
3.2.3 and EPICS R3.14.9 are less severe compared to what you are reporting
(see ca_test output attached below) so I am initially expecting that this
isn't a compiler issue.

Jeff

~$ ca_test joh:bill
name:   joh:bill
native type:    DBR_DOUBLE
native count:   1
DBR_STRING      0
DBR_SHORT       0
DBR_FLOAT       0.0000
DBR_ENUM        0
DBR_CHAR        0
DBR_LONG        2027290624
DBR_DOUBLE      0.0000
DBR_STS_STRING   0  0   Value: 0
DBR_STS_SHORT    0  0   Value: 0
DBR_STS_FLOAT    0  0   Value: 0.0000
DBR_STS_ENUM     0  0   Value: 0
DBR_STS_CHAR     0  0   Value: 0
DBR_STS_LONG     0  0   Value: 0
DBR_STS_DOUBLE   0  0   Value: 0.0000
DBR_TIME_STRING  0  0   TimeStamp: 2007/08/22 13:49:32.055404   Value: 0
DBR_TIME_SHORT   0  0   TimeStamp: 2007/08/22 13:49:32.055404   Value: 0
DBR_TIME_FLOAT   0  0   TimeStamp: 2007/08/22 13:49:32.055404   Value:
0.0000
DBR_TIME_ENUM    0  0   TimeStamp: 2007/08/22 13:49:32.055404   Value: 0
DBR_TIME_CHAR    0  0   TimeStamp: 2007/08/22 13:49:32.055404   Value: 0
DBR_TIME_LONG    0  0   TimeStamp: 2007/08/22 13:49:32.055404   Value: 0
DBR_TIME_DOUBLE  0  0   TimeStamp: 2007/08/22 13:49:32.055404   Value:
0.0000
DBR_GR_STRING    0  0   Value: 0
DBR_GR_SHORT     0  0 furlong
              10      -10       10       10      -10      -10   Value: 0
DBR_GR_FLOAT     0  0 furlong   4
          10.000  -10.000   10.000   10.000  -10.000  -10.000   Value:
0.0000
DBR_GR_ENUM      0  0   Value: 0
DBR_GR_CHAR      0  0 furlong
              10      246       10       10      246      246   Value: 0
DBR_GR_LONG      0  0 furlong
              10      -10       10       10      -10      -10   Value: 0
DBR_GR_DOUBLE    0  0 furlong   4
          10.000  -10.000   10.000   10.000  -10.000  -10.000   Value:
0.0000
DBR_CTRL_STRING  0  0   Value: 0
DBR_CTRL_SHORT   0  0 furlong
              10      -10       10       10      -10      -10       10
-10Value: 0
DBR_CTRL_FLOAT   0  0 furlong   4
          10.000  -10.000   10.000   10.000  -10.000  -10.000   10.000
-10.000Value: 0.0000
DBR_CTRL_ENUM    0  0   Value: 0
DBR_CTRL_CHAR    0  0 furlong
              10      246       10       10      246      246       10
246Value:    0
DBR_CTRL_LONG    0  0 furlong
              10      -10       10       10      -10      -10       10
-10Value: 0
DBR_CTRL_DOUBLE  0  0 furlong   4
          10.000  -10.000   10.000   10.000  -10.000  -10.000   10.000
-10.000Value: 0.000000
DBR_STSACK_STRING       Channel read request failed
DBR_CLASS_NAME  Channel read request failed


-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Peter Zumbruch
Sent: Wednesday, August 22, 2007 12:36 PM
To: [email protected]
Subject: Port of EPICS 3.14.9 to ETRAX CRIS architecture - Strange Data 

Hello everybody,

I am working on the port of EPICS to ETRAX CRIS architecture running Linux.
We are using several boards which either have Axis's chips:
    ETRAX LX100 MCM (cris_v10)
        (http://www.axis.com/techsup/dev/etrax_100lx_mcm/index.htm)
        or 
    ETRAX FS (cris_v32)
        (http://www.axis.com/techsup/dev/etrax_100lx_mcm/index.htm)
as a control unit on-board.

I meanwhile have succeeded ( :-) ) in compiling EPICS 3.14.9 on a 
linux-x86 host-system for those two architectures:

    - The CONFIG files needed to be create are documented at:
        linux-cris_10:
            
http://wiki.gsi.de/Epics/ConfigurationEpicsCrossCompileLinuxCrisV10
        linux-cris_32:
            
http://wiki.gsi.de/Epics/ConfigurationEpicsCrossCompileLinuxCrisV32
    where exclusively linux-cris files have been modified/created.

    - Changes in CONFIG_SITE.linux-x86.Common:
        CROSS_COMPILER_TARGET_ARCHS = linux-cris_v10 linux-cris_v32

    - The cross-compiler used is a gnu-compiler provided by axis:
        cris-gcc --version: cris-axis-elf-gcc (GCC) 3.2.1 Axis release 
R64/1.64

    - The file "$EPICS-BASE/src/libCom/osi/default/osdWireFormat.h"
    has been extended by those two lines to comply for the 
little-endianness :

	#elif defined (_cris_)
	#     define EPICS_LITTLE_ENDIAN 


    - The optimization -O3 had to be replaced by -Os or the default -O0 
to be able to compile.

Also the example Application created via
    |$EPICS_BASE/bin/linux-x86/makeBaseApp.pl
|compiles ||meanwhile without problems.

Copied to the target system (cris_v10 Target) the IOC starts up thoroughly.
"dbl, dbpr, etc" applied to all given records seem to work.


But,
    pardon me for the long introduction,
(either locally or remotely) looking with a client application to the 
the values the data are corrupted:

using *camonitor* gives for aiExample2
    (normally having a counter running  from 0 to  9):

zumbruchHost:aiExample2        2007-08-22 20:08:32.843735 4.33197e-320 ?? ??
zumbruchHost:aiExample2        2007-08-22 20:08:34.853797 0 ?? ??
zumbruchHost:aiExample2        2007-08-22 20:08:36.864724 3.03865e-319 ?? ??
zumbruchHost:aiExample2        2007-08-22 20:08:38.873781 3.16202e-322 ?? ??
zumbruchHost:aiExample2        2007-08-22 20:08:40.883986 1.04347e-320 ?? ??
zumbruchHost:aiExample2        2007-08-22 20:08:42.894597 2.05531e-320 ?? ??
zumbruchHost:aiExample2        2007-08-22 20:08:44.903989 2.56124e-320
zumbruchHost:aiExample2        1904-10-15 19:11:38.551617 3.06716e-320 ?? ??
zumbruchHost:aiExample2        2007-08-22 20:08:48.924495 3.57308e-320 ?? ??
zumbruchHost:aiExample2        2007-08-22 20:08:50.933987 4.07901e-320 ?? ??
zumbruchHost:aiExample2        2007-08-22 20:08:52.944423 4.33197e-320 ?? ??
zumbruchHost:aiExample2        1909-01-16 05:53:46.278750 0 ?? ??
zumbruchHost:aiExample2        1910-02-08 14:34:18.543753 3.03865e-319 ?? ??
zumbruchHost:aiExample2        1911-03-03 23:14:50.955094 3.16202e-322 ?? ??
zumbruchHost:aiExample2        2007-08-22 20:09:00.984164 1.04347e-320 ?? ??
zumbruchHost:aiExample2        1913-04-18 16:35:54.407488 2.05531e-320 ?? ??
zumbruchHost:aiExample2        1914-05-12 01:16:26.675635 2.56124e-320
zumbruchHost:aiExample2        2007-08-22 20:09:07.014232 3.06716e-320 ?? ??
zumbruchHost:aiExample2        2007-08-22 20:09:09.024221 3.57308e-320 ?? ??
zumbruchHost:aiExample2        2007-08-22 20:09:11.034747 4.07901e-320 ?? ??
zumbruchHost:aiExample2        2007-08-22 20:09:13.044186 4.33197e-320 ?? ??
zumbruchHost:aiExample2        1919-09-04 20:39:06.413164 0 ?? ??

for comparison a similar well running application ("What it should look 
like")

zumbruch2Host:aiExample2       2007-08-22 20:08:32.613470 1 LOLO MAJOR
zumbruch2Host:aiExample2       2007-08-22 20:08:34.615208 2 LOLO MAJOR
zumbruch2Host:aiExample2       2007-08-22 20:08:36.617301 3 LOW MINOR
zumbruch2Host:aiExample2       2007-08-22 20:08:38.618697 4 LOW MINOR
zumbruch2Host:aiExample2       2007-08-22 20:08:40.620584 5
zumbruch2Host:aiExample2       2007-08-22 20:08:42.622103 6 HIGH MINOR
zumbruch2Host:aiExample2       2007-08-22 20:08:44.623496 7 HIGH MINOR
zumbruch2Host:aiExample2       2007-08-22 20:08:46.624957 8 HIHI MAJOR
zumbruch2Host:aiExample2       2007-08-22 20:08:48.627479 9 HIHI MAJOR
zumbruch2Host:aiExample2       2007-08-22 20:08:50.629924 0 LOLO MAJOR
zumbruch2Host:aiExample2       2007-08-22 20:08:52.631170 1 LOLO MAJOR

The same for *ca_test*:

name:   zumbruchHost:aiExample2
native type:    DBR_DOUBLE
native count:   1
DBR_STRING      3
DBR_SHORT       768
DBR_FLOAT       0.0000
DBR_ENUM        768
DBR_CHAR        3
DBR_LONG        50331648
DBR_DOUBLE      0.0000
DBR_STS_STRING  1536 256        Value: 3
DBR_STS_SHORT   1536 256        Value: 768
DBR_STS_FLOAT   1536 256        Value: 0.0000
DBR_STS_ENUM    1536 256        Value: 768
DBR_STS_CHAR    1536 256        Value: 3
DBR_STS_LONG    1536 256        Value: 50331648
DBR_STS_DOUBLE  1536 256        Value: 0.0000
DBR_TIME_STRING 1536 256        TimeStamp: 1901/12/13 21:45:52.547135   
Value: 3
DBR_TIME_SHORT  1536 256        TimeStamp: 1901/12/13 21:45:52.547135   
Value: 768
DBR_TIME_FLOAT  1536 256        TimeStamp: 1901/12/13 21:45:52.547135   
Value: 0.0000
DBR_TIME_ENUM   1536 256        TimeStamp: 1901/12/13 21:45:52.547135   
Value: 768
DBR_TIME_CHAR   1536 256        TimeStamp: 1901/12/13 21:45:52.547135   
Value: 3
DBR_TIME_LONG   1536 256        TimeStamp: 1901/12/13 21:45:52.547135   
Value: 50331648
DBR_TIME_DOUBLE 1536 256        TimeStamp: 1901/12/13 21:45:52.547135   
Value: 0.0000
DBR_GR_STRING   1536 256        Value: 3
DBR_GR_SHORT    1536 256 Counts
            2560        0     2048     1536     1024      512   Value: 768
DBR_GR_FLOAT    1536 256 Counts   0
           0.000    0.000    0.000    0.000    0.000    0.000   Value: 
0.0000
DBR_GR_ENUM     1536 256        Value: 768
DBR_GR_CHAR     1536 256 Counts
              10        0        8        6        4        2   Value: 3
DBR_GR_LONG     1536 256 Counts
        167772160        0 134217728 100663296 67108864 33554432        
Value: 50331648
DBR_GR_DOUBLE   1536 256 Counts   0
           0.000    0.000    0.000    0.000    0.000    0.000   Value: 
0.0000
DBR_CTRL_STRING 1536 256        Value: 3
DBR_CTRL_SHORT  1536 256 Counts
            2560        0     2048     1536     1024      512     
2560        0 Value: 768
DBR_CTRL_FLOAT  1536 256 Counts   0
           0.000    0.000    0.000    0.000    0.000    0.000    
0.000    0.000 Value: 0.0000
DBR_CTRL_ENUM   1536 256        Value: 768
DBR_CTRL_CHAR   1536 256 Counts
              10        0        8        6        4        2       
10        0 Value:    3
DBR_CTRL_LONG   1536 256 Counts
        167772160        0 134217728 100663296 67108864 33554432 
167772160        0     Value: 50331648
DBR_CTRL_DOUBLE 1536 256 Counts   0
           0.000    0.000    0.000    0.000    0.000    0.000    
0.000    0.000 Value: 0.000000
DBR_STSACK_STRING       1536 256 256 512 3
DBR_CLASS_NAME  ai

and what it should look like:

name:   zumbruch2Host:aiExample2
native type:    DBR_DOUBLE
native count:   1
DBR_STRING      3
DBR_SHORT       3
DBR_FLOAT       3.0000
DBR_ENUM        3
DBR_CHAR        3
DBR_LONG        3
DBR_DOUBLE      3.0000
DBR_STS_STRING   6  1   Value: 3
DBR_STS_SHORT    6  1   Value: 3
DBR_STS_FLOAT    6  1   Value: 3.0000
DBR_STS_ENUM     6  1   Value: 3
DBR_STS_CHAR     6  1   Value: 3
DBR_STS_LONG     6  1   Value: 3
DBR_STS_DOUBLE   6  1   Value: 3.0000
DBR_TIME_STRING  6  1   TimeStamp: 2007/08/22 20:15:16.962527   Value: 3
DBR_TIME_SHORT   6  1   TimeStamp: 2007/08/22 20:15:16.962527   Value: 3
DBR_TIME_FLOAT   6  1   TimeStamp: 2007/08/22 20:15:16.962527   Value: 
3.0000
DBR_TIME_ENUM    6  1   TimeStamp: 2007/08/22 20:15:16.962527   Value: 3
DBR_TIME_CHAR    6  1   TimeStamp: 2007/08/22 20:15:16.962527   Value: 3
DBR_TIME_LONG    6  1   TimeStamp: 2007/08/22 20:15:16.962527   Value: 3
DBR_TIME_DOUBLE  6  1   TimeStamp: 2007/08/22 20:15:16.962527   Value: 
3.0000
DBR_GR_STRING    6  1   Value: 3
DBR_GR_SHORT     6  1 Counts
              10        0        8        6        4        2   Value: 3
DBR_GR_FLOAT     6  1 Counts   0
          10.000    0.000    8.000    6.000    4.000    2.000   Value: 
3.0000
DBR_GR_ENUM      6  1   Value: 3
DBR_GR_CHAR      6  1 Counts
              10        0        8        6        4        2   Value: 3
DBR_GR_LONG      6  1 Counts
              10        0        8        6        4        2   Value: 3
DBR_GR_DOUBLE    6  1 Counts   0
          10.000    0.000    8.000    6.000    4.000    2.000   Value: 
3.0000
DBR_CTRL_STRING  6  1   Value: 3
DBR_CTRL_SHORT   6  1 Counts
              10        0        8        6        4        2       
10        0 Value: 3
DBR_CTRL_FLOAT   6  1 Counts   0
          10.000    0.000    8.000    6.000    4.000    2.000   
10.000    0.000 Value: 3.0000
DBR_CTRL_ENUM    6  1   Value: 3
DBR_CTRL_CHAR    6  1 Counts
              10        0        8        6        4        2       
10        0 Value:    3
DBR_CTRL_LONG    6  1 Counts
              10        0        8        6        4        2       
10        0 Value: 3
DBR_CTRL_DOUBLE  6  1 Counts   0
          10.000    0.000    8.000    6.000    4.000    2.000   
10.000    0.000 Value: 3.000000
DBR_STSACK_STRING        6  1  1  2 3
DBR_CLASS_NAME  ai

Could somebody give me an advice where else to look at?

Thanks in advance,
Peter

-- 
 Dr. Peter W. Zumbruch                                  
 EE - department / Controls group / GSI
 E-Mail: [email protected] 
 Tel: +49-(6159)-71-1435 / Fax: +49-(6159)-71-2986
      
 Gesellschaft für Schwerionenforschung mbH 
 Planckstraße 1 / D-64291 Darmstadt / www.gsi.de

 Gesellschaft mit beschränkter Haftung
 Sitz der Gesellschaft: Darmstadt
 Handelsregister: Amtsgericht Darmstadt, HRB 1528

 Geschäftsführer: Professor Dr. Horst Stöcker, Dr. Alexander Kurz
 Vorsitzende des Aufsichtsrates: Dr. Beatrix Vierkorn-Rudolph,
 Stellvertreter: Ministerialdirigent Dr. Rolf Bernhardt





Replies:
Re: Port of EPICS 3.14.9 to ETRAX CRIS architecture - Strange Data - Optimization issues Peter Zumbruch
References:
Port of EPICS 3.14.9 to ETRAX CRIS architecture - Strange Data Peter Zumbruch

Navigate by Date:
Prev: Re: Port of EPICS 3.14.9 to ETRAX CRIS architecture - Strange Data Andrew Johnson
Next: Eagle drivers anyone? Heinrich du Toit
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Port of EPICS 3.14.9 to ETRAX CRIS architecture - Strange Data Andrew Johnson
Next: Re: Port of EPICS 3.14.9 to ETRAX CRIS architecture - Strange Data - Optimization issues Peter Zumbruch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Nov 2011 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·