--- Quote Start ---
originally posted by warine@Aug 4 2004, 03:07 AM
and nios ii processor reference handbook says "when using instruction ldw/ldwio, the effective byte address must be word aligned. if the byte address is not a multiple of 4, the operation is undefined." but the definition of macros iord and iowr in altera_avalon_uart_regs.h of nios ii ide cann't guarantee the byte address is a multiple of 4. how to explain? --- Quote End ---
The Nios I processor had a choice of 16-bit or 32-bit bus width. The Nios II processor is 32-bit only. The UART registers only use 16 data bits each, at most, is backwards compatible with the Nios I (thus the need to support 16-bit buses), and it uses "native" addressing, so each register gets its own 32-bit address; the registers aren't packed in pairs into 32-bit words.
The physical analog is if you hooked the A4-A2 pins of a regular MCU to the address pins of the UART, and hooked the 16 data pins of the UART to the low-order 16 bits of the MCU's data bus, and had pulldowns on the other 16 bits of the MCU's data bus. You would see a set of 32-bit registers, but only the bottom 16 bits would work on any of them.
--- Quote Start ---
originally posted by warine@Aug 4 2004, 03:07 AM
and the slave read & write transfer on avalon bus has multiple timing, then how the macros iord & iowr to use the read & write timing? --- Quote End ---
Timing is determined by the slave; the master (CPU) has no say in that matter. It's not like, say, the EMIF bus of a TI DSP, where you have to set a bunch of timing registers in order to talk to someone.
The reason this is so is that the Avalon bus isn't a multidrop bus. It's more of a switched fabric. There's a lot of auto-generated logic in that bus module that handles getting the master and slave to talk properly. All the information (such as timing) it is using to generate the bus logic is in the system's PTF file.
So, to answer your original question (way back), the driver has no control over timing for a custom component, rather, all that information is in the custom component's class.ptf file. The various PTF settings for the different slave and master bus modes are shown in the Avalon Bus manual, and much more info about what's in PTF files is in the PTF File handbook.