ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: pointer weirdness

To:
Subject: Re: [ts-7000] Re: pointer weirdness
From: David Hawkins <>
Date: Wed, 12 Sep 2007 16:54:20 -0700
> Your most important comment:
> 
>  > I am trying to read/write registers in the FPGA.
> 
> The FPGA interface uses a 16-bit interface, and
> since the TS example code uses PEEK and POKE
> routines to implement accesses to ensure that
> *specific assembly instructions* are used to
> access the FPGA interface locations, then I'd
> be wary of letting the compiler just select
> any old memory instruction it likes.

Note that writing driver code such that it uses
specific assembly instructions is not uncommon.

In Linux drivers for PCI interfaces you're supposed
to use readl(), writel(), readb(), writeb() etc.
These routines perform little-endian accesses no
matter what the processor, since the PCI bus is
defined as little-endian.

On PowerPC processor, out_be32(), in_be32() are
used to generate 32-bit processor calls.

I haven't looked at the implementations, but I suspect
some of these commands probably have flush routines
to maintain instruction ordering, or you have to
include those commands to make sure your write
gets to your hardware, before you go and read from
it, eg. write-to-enable, followed by a polling routine,
or ISR, etc.

They key thing is that; using pointers to access
hardware registers is generally *not* recommended.

Cheers,
Dave



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU