Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12455 Discussions

how to use single byte offset in function IORW?

Altera_Forum
Honored Contributor II
830 Views

I found the offset is 4 bytes in IOWR, I want to know how to set the offset single byte? 

 

thanks.
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
109 Views

you can use the IOWR_xxDIRECT() macros instead of IOWR for byte addressing (xx being 8,16 or 32 depending on the access size). 

Using an odd address will only work with IOWR_8DIRECT() though, if I remember correctly.
Altera_Forum
Honored Contributor II
109 Views

That's correct. This is the alignment you need to use for each: 

 

IOxx_8DIRECT --> any alignment 

IOxx_16DIRECT --> 2 byte alignment 

IOxx_32DIRECT --> 4 byte alignment
Altera_Forum
Honored Contributor II
109 Views

Hi, 

 

Anyone knows about the IOWR function declaration/definition? 

 

I need to know how the IDE drivers the data to pins of my component in SoPC. 

For example, if I have a LED_PIO with widht 8 bits, I just write IOWR (LED_PIO_BASE, 0, DATA) and I think the DATA will be sent to pins. But, if I have a component as DM9000A Ethernet controller, with 38 pins, where some are data and some are control, how I can set the correct pins to write a word? 

 

And how can I see the information about the order of component pins in IDE?
Altera_Forum
Honored Contributor II
109 Views

With components other than PIOs, you don't directly control the pins through the IOWR macro. You access registers. All the components have a driver with at least an include file that lists the registers and macros to read/write them. 

I don't have any design with a DM9000A but you should check all the include files that are added in your BSP. There must be one of them with a definition of the chip registers.
Reply