This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gdb/220: ocd - wiggler baud rate problem



>Number:         220
>Category:       gdb
>Synopsis:       ocd - wiggler baud rate problem
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 01 13:08:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     ac131313@cygnus.com
>Release:        unknown-1.0
>Organization:
>Environment:

>Description:
Jonathan Riches writes:

Thanks Juro for the info.  It appears that in GDB 5.0 (ocd.c) that all ocd
writes / reads are as bytes, this would account for the problem I also had
in writing an init file, where the SYPCR was only getting 1 byte written,
then it was set for good.

I have found the download speed using wiggler has risen from 10,000 bits/sec
to 25,000,
Regards
Jonathan Riches

Juro wrote >
#######################################################################
Hi Jonathan

There's a bug in OCD.C, I reported it to macraigor:

the file load was SIGNIFICANTLY
slower. Using Raven I achieved the equivalent of about 9600 baud rate.
So I started comparing the old code with the new one and found a serious
bug:

in the file OCD.C you try to determine if to read/write words, halfwords or
bytes.

Your code:
=======================================================
if      ( ((memaddr & 4) == 4) || ((len & 4) == 4) )
   buf[5] = 4;  /* Word align and word length */
else if ( ((memaddr & 2) == 2) || ((len & 2) == 2) )
   buf[5] = 2; /* TWO BYTE WRITE */
else
   buf[5] = 1;  /* default to byte write */
=====================================================

is clearly wrong. You probably meant something like:

=====================================================
  if ( ((memaddr & 3) == 0) && ((len & 3) == 0) )
    buf[5] = 4;  /* Word align and word length */
  else if ( ((memaddr & 1) == 0) && ((len & 1) == 0) )
    buf[5] = 2; /* TWO BYTE WRITE */
  else
    buf[5] = 1;  /* default to byte write */

=====================================================

The same code occurs in two different places.
Indeed, after replacing the code we were back up to the speed
#####################################################################






>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]