On Fri, Jan 15, 2010 at 9:00 AM, David Brownell <[email protected]> wrote:
> On Thursday 14 January 2010, Øyvind Harboe wrote:
>> > +struct tms_command {
>> > +       /** How many bits should be clocked out. */
>> > +       unsigned        num_bits;
>> > +       /** The bits to clock out; the LSB is bit 0 of bits[0].  */
>> > +       uint8_t         *bits;
>>
>> Tiny comment:
>>
>> Use uint32_t here, rather than 8 bits. Why 8 bits?
>
> Mostly because the relevant patterns for switching between SWD
> and JTAG modes are on the order of
>
>        50+ all-ones bits
>        16-bit pattern
>        50+ all-ones bits
>
> So while it's easy to express that in terms of bytes and be obviously
> correct, using 32-bit numbers is pretty unnatural.

How any more unnatural than bytes?

> Plus, notice the second patch ... that "cable helper" library thing
> has always worked with a single 8-bit byte, not 32-bit integers.

This I accept: better impedance match.

> Plus, I didn't want to couple this interface to needing a rewrite of
> the entire JTAG layer bit vector interface ... ;)

Totally with you on that one.


I'm wondering if a better approach to allow optimization might be
to require the uint8_t * bit arrays to be machine word aligned...  Which
I think you hinted at.

With a bit of enforcement asserts, and a few bugfixes we could probably
get that done easily in 0.5 timeframe.

Seems like *much* less work...

-- 
Øyvind Harboe
US toll free 1-866-980-3434 / International +47 51 63 25 00
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to