Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/15/06 13:00
Read: times


 
#112222 - a readable version of the above
Responding to: ???'s previous message
Jan, I just could not stand trying to read your post as it was formatted.

First, while I think you know that I know that you know that "JTAG" is not equivalent to "debugging"; if you say "debugging via JTAG", to somebody who might not be experienced in the field implies JTAG MUST be present to be able to debug. If we are really going to play with words, I'd suggest "on-chip debugging facility with serial interface, e.g. JTAG".
I'd call it "serial ISD" in the following text (please suggest a better term or acronym).

Second, let's investigate in depth, what can be gained and lost by using either one of the two techniques.

Both serial ISD and monitors feature program start/stop, internal resources (SFR/memories) inspection and manipulation, single-stepping (and "tracing").

The serial ISD is superior in having a possibility to include breakpoints, of code ("stop here") and "stop if memory area is accessed" type. Number of breakpoints is limited (as is the number of registers holding the breakpoint address). Conditional breakpoints are practically impossible; n-th pass breakpoints are possible but would be quite expensive - but if full-speed is not essential, complex breakpoints can be simulated in a similar way than in the monitors.
Monitors can have breakpoints, too, but not of the "memory area access" type and conditional/n-th_pass code breakpoints can be only simulated (hence no full speed). Moreover, also the implementation of code breakpoints in '51 (replacing the original instruction by a jump or call, 3 bytes minimum) requires the said von-Neumann-style RAM/Flash and involves a potential risk of mis-running program due to overwriting the following instructions (it happens when the breakpoint is set at the end of the routine, e.g. replacing a single-byte ret).

None of the two is able to produce full trace of various resources as a hardware ICE would, although there are some limited possibilities (e.g. in "trace" mode). Principially a trace memory could be implemented and interfaced to the serial ISD, but it would certainly be prohibitively expensive.

Serial ISD requires to have the "vehicle" (the "serial port"), and physical "connections" to all the resources inside the chip. This means some chip area increase, and also some speed penalty, as the "key points" have to be tapped at various points of the core and brought out usually to the chip's edge where the "extra" circuitry would sit. Jez might give exact figures for his '51 core. Outside of the chip, there has to be some physical interface (but that's the same for monitor as well), but more importantly, some software is needed on PC, serving as the user interface and providing some of the "automatic" functions.

Monitors are infamous for requiring/occupying resources which one needs for the application - they need some "hooks" (usually occupy one or more interrupt vectors), the "vehicle" (usually the UART) and of course, memories (RAM, stack, code memory). On the other hand, they are cheap, derivative-independent (save the requirement for von Neumann code memory), and easily expandable, upgradeable, correctable (it's only software, anyway). They come in two fashion - self-contained, requiring only a serial terminal program on PC; and the "core" type, performing very similarly to the serial-ISD, requiring extensive support from a PC application. It seems that the latter is more useful, but the former has the advantage of being "OS-independent", enabling "debugging everywhere".


Summary of pros (+) and contras (-):
                             serial ISD     monitor
extra chip area needed            -            +              
speed penalty                     -            +
interrupt occupied                +            -
RAM/stack/code space occupied     +            -
vonNeumann code space needed      +            -
single stepping, stop&run         +            +
resources inspection              +            +
breakpoints                       +            -
traces                            -            -
PC application needed             -            +-
correctable                       -            +
pins occupied                     +-           -
various interface possible        -            +


In ASICs and freshly cooked '51 chips, there is a cross-over/compromise possible - the core might contain support for the breakpoints and some extra resources (a few bytes of RAM and a special code memory) normally invisible to the user, accessible not via a dedicated hardware, but via SFRs from the monitor program. I think this is a very good concept and in the '51 world it has been used in the TI's(BB's) MSC12xx chips.


I'd like to discuss this topic further with the intention of creating some FAQ-ish document on debugging tools, so please run down on what has been said here, tear it into pieces and comment on each of it. Thanks.


Jan Waclawek

PS.: history of ISD on AVRs: JTAG was first, but single-pin debugging is the bleeding edge now, both coexisting on the high-end Megas
PS2: in the '51 world, ADuC have single-pin insitu debugging, but with zero public documentation.



List of 49 messages in thread
TopicAuthorDate
MONITOR for ASIC with 8051 IP core            01/01/70 00:00      
   replacing serial by xxx            01/01/70 00:00      
   JTAG?            01/01/70 00:00      
      should have come to me            01/01/70 00:00      
      JTAG money talks...            01/01/70 00:00      
         shome mishtake sureley            01/01/70 00:00      
         External UART            01/01/70 00:00      
      JTAG != debug port            01/01/70 00:00      
         Debug via JTAG            01/01/70 00:00      
            Does it make sense?            01/01/70 00:00      
            debugging            01/01/70 00:00      
               a readable version of the above            01/01/70 00:00      
                  coments            01/01/70 00:00      
                     won't we make it a separate thread?            01/01/70 00:00      
                        screw the wiki, who but you have been th            01/01/70 00:00      
   ASIC as in ASIC or FPGA?            01/01/70 00:00      
      How can I forward to other interface?            01/01/70 00:00      
         stick an IIC port on            01/01/70 00:00      
         what is not clear?            01/01/70 00:00      
            re: replacing setial by xxx            01/01/70 00:00      
               von Neumann RAM            01/01/70 00:00      
                  I get it...I'll have to play with FlashM            01/01/70 00:00      
                     IAP, ISP, von Neumann and others            01/01/70 00:00      
                        STOP, ! it is NOT            01/01/70 00:00      
                           NOR?            01/01/70 00:00      
                              oh well, wrong again            01/01/70 00:00      
                                 a multiple-post Re to Erik            01/01/70 00:00      
                                    replies            01/01/70 00:00      
               von Neumann RAM            01/01/70 00:00      
         Sure about the volume?            01/01/70 00:00      
            There is something VERY strange here: T            01/01/70 00:00      
               indeed VERY strange            01/01/70 00:00      
                  could it be            01/01/70 00:00      
                     maybe            01/01/70 00:00      
                  Mea culpa ! WRONG EXAMPLE!            01/01/70 00:00      
                     Then use DEDICATED ASICS            01/01/70 00:00      
                        One more detail just to get it right            01/01/70 00:00      
                           You haven't done the homework yet            01/01/70 00:00      
                     For that qty modify a standard chip            01/01/70 00:00      
                  Orders of Magnitude            01/01/70 00:00      
                     Re: Orders of Magnitude            01/01/70 00:00      
                        That may be a good per-piece cost            01/01/70 00:00      
   missing details            01/01/70 00:00      
      this is just a joke            01/01/70 00:00      
         ASIC size            01/01/70 00:00      
      Still price consideration problems            01/01/70 00:00      
   now paralell posted            01/01/70 00:00      
      End result and solution!            01/01/70 00:00      
         wrong sorry            01/01/70 00:00      

Back to Subject List