| Woah there, my dude. Let's try to understand a simple model first. A CPU can access memory. When a CPU performs loads & stores it initiates transactions containing the address of the memory. Therefore, it is a bus master--it initiates transactions. A slave accepts transactions and services them. The interconnect routes those transactions to the appropriate hardware, e.g. the DDR controller, based on the system address map. Let's add a CPU, interconnect, and 2GB of DRAM memory: +-------+
| CPU |
+---m---+
|
+---s--------------------+
| Interconnect |
+-------m----------------+
|
+----s-----------+
| DDR controller |
+----------------+
System Address Map:
0x8000_0000 - 0x0000_0000 DDR controller
So, a memory access to 0x0004_0000 is going to DRAM memory storage.Let's add a GPU. +-------+ +-------+
| CPU | | GPU |
+---m---+ +---s---+
| |
+---s------------m-------+
| Interconnect |
+-------m----------------+
|
+----s-----------+
| DDR controller |
+----------------+
System Address Map:
0x9000_0000 - 0x8000_0000 GPU
0x8000_0000 - 0x0000_0000 DDR controller
Now the CPU can perform loads & stores from/to the GPU. The CPU can read/write registers in the GPU. But that's only one-way communication. Let's make the GPU a bus master as well: +-------+ +-------+
| CPU | | GPU |
+---m---+ +--s-m--+
| | |
+---s-----------m-s-----+
| Interconnect |
+-------m----------------+
|
+----s-----------+
| DDR controller |
+----------------+
System Address Map:
0x9000_0000 - 0x8000_0000 GPU
0x8000_0000 - 0x0000_0000 DDR controller
Now, the GPU can not only receive transactions, but it can also initiate transactions. Which also means it has access to DRAM memory too.But this is still only one-way communication (CPU->GPU). How can the GPU communicate to the CPU? Well, both have access to DRAM memory. The CPU can store information in DRAM memory (0x8000_0000 - 0x0000_0000) and then write to a register in the GPU (0x9000_0000 - 0x8000_0000) to inform the GPU that the information is ready. The GPU then reads that information from DRAM memory. In the other direction, the GPU can store information in DRAM memory, and then send an interrupt to the CPU to inform the CPU that the information is ready. The CPU then reads that information from DRAM memory. An alternative to using interrupts is to have the CPU poll. The GPU stores information in DRAM memory and then sets some bit in DRAM memory. The CPU polls on this bit in DRAM memory, and when it changes, the CPU knows that it can read the information in DRAM memory that was previously written by the GPU. Hope this helps. It's very fun stuff! |
I do wonder, why aren't interconnects more emphasized in the courses I took? All I've seen was just oversimplified pictures of the process. Your explanation goes just enough into the lower-level aspects of the process to allow me to piece it.