Previous - Up - Next

20.3   Memory and I/O Spaces

The PCI memory and I/O spaces are implemented as generic Simics memory-spaces where the spaces controlled by the base address registers of the PCI devices will be mapped.

Let us imitate the transactions that the simulated software would issue to map the space controlled by the base address register 1 of the dec0 object above:

# Issue a write to BAR1 register (offset 0x14)
simics> pciconf0.set address = 0x1814 value = 0xFF000000 size = 4 -l

# Enable memory mappings in Command register (offset 0x4)
simics> pciconf0.set address = 0x1804 value = 0x0002 size = 2 -l

# Print the PCI memory mappings
simics> pcimem0.map
base               object               fn offs               length
0x00000000ff000000 dec0                  0 0x0                0x80              
- default -        pci0                  5 0x0                -                 
            target -> plb

The address space controlled by the BAR1 register is now mapped at address in 0xFF000000 in the PCI memory.

PCI bridges in Simics typically create space-to-space mappings when adding a PCI memory space to the global memory-space in a system. This way memory transactions go directly between memory-spaces without having to pass the bridge object. There are, however, cases when the bridge is needed, for example for accesses where nothing is mapped. In these cases, the bridge is associated with the mapping (see section on memory mapping types), and the bridge will be called for non-mapped accesses.

The bridge mapping is also used to prevent memory mappings loops. A bridge typically doesn't forward upstream a transaction that it sent downstream previously. But in Simics the memory-spaces are connected directly to each other, and there is no bridge doing the forwarding. Since the bridge creates the mappings as "bridge mappings", Simics will make sure that the transaction isn't forwarded using the same bridge twice in a row. Circular mappings are not a problem in a correctly configured system, but can occur for memory accesses to a non-existing device.

In the same way as with the configuration space, a PCI-to-PCI bridge will create mappings in the memory and I/O spaces for upstream and downstream accesses. These mappings are created at run-time, since they are dynamic and set up by the simulated software.

Previous - Up - Next