Address alignment and Nios programming for Avalon Bus

Source: Internet
Author: User

First of all, the concept of address alignment I do not detail, you can refer to this article: Avalon Bus Address alignment: Dynamic addressing and native addressing.

Suppose we customize a peripheral with a data width of 32 bits and an address of 2 bits. If we want the address line to do something else rather than address it, for example:

1 if (cs&WR) 2 begin 3  Case (addr) 4     2 ' b00:  //Custom 5     2 ' B01:  //Custom 6endcase7End

In Nios eds, how to Determine addr? In other words, when we use Iowr_32direct (BASE, offset, DATA), how do we determine OFFSET?

I believe you have already thought the answer, the answer is actually very simple: offset for 0x00 addr for 2 ' B00,offset for 0x04 addr for 2 ' B01,offset for 0x08 corresponding addr for 2 ' B10, Offset for 0x0c corresponds to addr of 2 ' B11.

Other data widths are the same, assuming that the data width is 8 bits, the address is 2 bits, Iowr_32direct (base, 0x00, data) is the corresponding addr 2 ' B00,iowr_32direct (base, 0x01, data) is the corresponding addr 2 ' B01, the rest of the analogy.

There is also an article you can refer to: Understanding the Avalon Bus Static address alignment and dynamic address alignment.

Address alignment and Nios programming for Avalon Bus

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.