This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > Wiki encyclopedia > MMIO

MMIO

MMIO (Memory-mapped I/O) is memory-mapped I/O. It is part of the PCI specification. I/O devices are placed in memory space instead of I/O space. From the processor's point of view, after memory-mapped I/O, system devices access the same as memory. In this way, access to the frame buffer, BIOS, and PCI devices on the AGP/PCI-E graphics card can be done using assembly instructions like reading and writing memory, simplifying the difficulty of programming and the complexity of the interface.

MMIO

Detailed introduction

MMIO (Memory mapping I/O) is memory mapping I/O. It is part of the PCI specification. I/O devices are placed in memory space instead of I/O space. From the processor's point of view, after memory-mapped I/O, system devices access the same as memory. In this way, access to the frame buffer, BIOS, and PCI devices on the AGP/PCI-E graphics card can be done using assembly instructions like reading and writing memory, simplifying the difficulty of programming and the complexity of the interface. As a channel for communication between CPU and peripherals, I/O is mainly divided into two types, one is Port I/O and the other is MMIO (Memory mapping I/O).

The former is the I/O port that we often talk about. It should actually be called the I/O address space.

For the x86 architecture, it is accessed through the IN/OUT instruction. The PC architecture has a total of 65536 8-bit I/O ports, forming a 64KI/O address space, numbered from 0 to 0xFFFF. Two consecutive 8-bit ports can form a 16-bit port, and four consecutive ports form a 32-bit port. The I/O address space and the CPU's physical address space are two different concepts. For example, the I/O address space is 64K, and a 32-bit CPU physical address space is 4G.

MMIO occupies the physical address space of the CPU, and access to it can be performed using instructions of the CPU to access the memory. An image metaphor is that after using mmap() on a file, you can access the file as if you were accessing memory. Similarly, MMIO accesses I/O resources in the same way as accessing memory, such as memory on the device. MMIO cannot be cached (in special cases, such as VGA).

The main difference

1) The former does not occupy the physical address space of the CPU, the latter occupies (this is said for the x86 architecture, some architectures, such as IA64, port I/O occupy physical address space).

2) The former is sequential access. In other words, before the completion of an I/O instruction, the next instruction will not be executed. For example, the operation of the device is initiated through Port I/O, which causes the state of the device register to change. This change takes effect before the next instruction is executed. The uncached MMIO ensures the order through the characteristics of uncahce memory.

3) Different ways of use

Since port I/O has an independent 64K I/O address space, but the CPU's address line has only one set, it is necessary to distinguish whether the address belongs to the physical address space or the I/O address space.

ASSOCIATED PRODUCTS

  • XCS20XL-5PQ208C

    XCS20XL-5PQ208C

    FPGA Spartan-XL Family 20K Gates 950 Cells 250MHz 3.3V 208-Pin HSPQFP EP

  • XCS20XL-5VQ100C

    XCS20XL-5VQ100C

    FPGA Spartan-XL Family 20K Gates 950 Cells 250MHz 3.3V 100-Pin VTQFP

  • XC2V1500-4FG676I

    XC2V1500-4FG676I

    FPGA Virtex-II Family 1.5M Gates 17280 Cells 650MHz 0.15um Technology 1.5V 676-Pin FBGA

  • XC2V1500-5FFG896I

    XC2V1500-5FFG896I

    FPGA Virtex-II Family 1.5M Gates 17280 Cells 750MHz 0.15um Technology 1.5V 896-Pin FCBGA

  • XC2V1500-6BGG575C

    XC2V1500-6BGG575C

    FPGA Virtex-II Family 1.5M Gates 17280 Cells 820MHz 0.15um Technology 1.5V 575-Pin BGA

FPGA Tutorial Lattice FPGA
Need Help?

Support

If you have any questions about the product and related issues, Please contact us.