Altera_Forum
Honored Contributor
20 years agoNIOS2 with 8Bit devices on tristate bridge
Outside the fpga is a multiplexed 8 bit device bus with shared
8-bit data 20-bit adr nRD nWR and a couple of not shared nCS and a nINT to each device like LAN chip, Profibuschip, NVRAM, RTC .... In sum there are 8 ( from nCS0 to nCS7 and nINT0 to nINT7) devices on that multiplexed bus. Inside the FPGA is a NiosII V5.01 Within the SOPC builder i did the following setup : i added an avalon tristate bridge and for each external device a custom sopc module that does only a translation of the external to the internal signals. I just added the external signals to the avalon tristate slave signals without any hdl coding and modified the class.ptf to have nRD and nWR with isshared=1 Now setting up signaltap to watch how different access cycles are handled give me the following conditions. 32Bit write access is performed as four 8 bit transfers. first is the lowest adr +0 ... accessing up to adr +3 This is OK as expected 16Bit write access is performed as two 8 bit transfers. This is also OK and 8 single 8 bit write access is just one 8 bit transfer. So far so good. A 32 Bit Read access is as expected performed by four 8 bit transfers. BUT A 16 bit read and a 8 bit read is always a four bit read transfer. WHY ? yes Nios 2 is a 32bit core. but assume external devices where you just want to access one 8 bit register and not all the registers folling the addresspace. imagie a read of a 8bit data register at adress 0 and a status register that is located at the next 8bit adress. a single read would read the 8bit adress 0 to 3. there are chips out there that will monitor the read of a register and clear bits within that adress range. for such an external device it doesn't matter that nios forgets the not used bits from such a 32 bit read access when the software only needs 8 or 16 bit of them as coded (IORD_8DIRECT) So how can i setup the sopc builder that an external 8bit device bus is accessed with only these operations that the software has selected. an 8 bit access regardless of read or write must perform only one 8bit access to the external device. any help about that is welcome and urgently needed. this feature is a must have for us. we expected that this is possible. i have also send this to mysupoort as this is a very importand feature for us. Regards. Michael Schmitt