Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Accelerated Graphics Port
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Protocol== An AGP bus is a superset of a 66 MHz [[conventional PCI]] bus and, immediately after reset, follows the same protocol. The card must act as a PCI target, and optionally may act as a PCI master. (AGP 2.0 added a "fast writes" extension which allows PCI writes from the motherboard to the card to transfer data at higher speed.) After the card is initialized using PCI transactions, AGP transactions are permitted. For these, the card is always the AGP master and the motherboard is always the AGP target. The card queues multiple requests which correspond to the PCI address phase, and the motherboard schedules the corresponding data phases later. An important part of initialization is telling the card the maximum number of outstanding AGP requests which may be queued at a given time. AGP requests are similar to PCI memory read and write requests, but use a different encoding on command lines C/BE[3:0] and are always 8-byte [[Data structure alignment|aligned]]; their starting address and length are always multiples of 8 bytes (64 bits). The three low-order bits of the address are used instead to communicate the length of the request. Whenever the PCI GNT# signal is asserted, granting the bus to the card, three additional status bits ST[2:0] indicate the type of transfer to be performed next. If the bits are <code>0xx</code>, a previously queued AGP transaction's data is to be transferred; if the three bits are <code>111</code>, the card may begin a PCI transaction or (if sideband addressing is not in use) queue a request in-band using PIPE#. ===AGP command codes=== Like PCI, each AGP transaction begins with an address phase, communicating an address and 4-bit command code. The possible commands are different from PCI, however: ; 000p: Read : Read 8Γ(AD[2:0]+1) = 8, 16, 24, ..., 64 bytes. The least significant bit p is 0 for low-priority, 1 for high. ; 001x: (reserved): ; 010p: Write : Write 8Γ(AD[2:0]+1) = 8–64 bytes. ; 011x: (reserved): ; 100p: Long read : Read 32Γ(AD[2:0]+1) = 32, 64, 96, ..., 256 bytes. This is the same as a read request, but the length is multiplied by four. ; 1010: Flush : Force previously written data to memory, for synchronization. This acts as a low-priority read, taking a queue slot and returning 8 bytes of random data to indicate completion. The address and length supplied with this command are ignored. ; 1011: (reserved): ; 1100: Fence : This acts as a [[memory fence]], requiring that all earlier AGP requests complete before any following requests. Ordinarily, for increased performance, AGP uses a very weak [[consistency model]], and allows a later write to pass an earlier read. (E.g. after sending "write 1, write 2, read, write 3, write 4" requests, all to the same address, the read may return any value from 2 to 4. Only returning 1 is forbidden, as writes must complete before following reads.) This operation does not require any queue slots. ; 1101: Dual address cycle : When making a request to an address above 2<sup>32</sup>, this is used to indicate that a second address cycle will follow with additional address bits. This operates like a regular PCI dual address cycle; it is accompanied by the low-order 32 bits of the address (and the length), and the following cycle includes the high 32 address bits and the desired command. The two cycles make one request, and take only one slot in the request queue. This request code is not used with side-band addressing. ; 111x: (reserved): AGP 3.0 dropped high-priority requests and the long read commands, as they were little used. It also mandated side-band addressing, thus dropping the dual address cycle, leaving only four request types: low-priority read (0000), low-priority write (0100), flush (1010) and fence (1100). ===In-band AGP requests using PIPE#=== To queue a request in-band, the card must request the bus using the standard PCI REQ# signal, and receive GNT# plus bus status ST[2:0] equal to <code>111</code>. Then, instead of asserting FRAME# to begin a PCI transaction, the card asserts the PIPE# signal while driving the AGP command, address, and length on the C/BE[3:0], AD[31:3] and AD[2:0] lines, respectively. (If the address is 64 bits, a dual address cycle similar to PCI is used.) For every cycle that PIPE# is asserted, the card sends another request without waiting for acknowledgement from the motherboard, up to the configured maximum queue depth. The last cycle is marked by deasserting REQ#, and PIPE# is deasserted on the following idle cycle. ===Side-band AGP requests using SBA[7:0]=== If side-band addressing is supported and configured, the PIPE# signal is not used. (And the signal is re-used for another purpose in the AGP 3.0 protocol, which requires side-band addressing.) Instead, requests are broken into 16-bit pieces which are sent as two bytes across the SBA bus. There is no need for the card to ask permission from the motherboard; a new request may be sent at any time as long as the number of outstanding requests is within the configured maximum queue depth. The possible values are: ; <code>0aaa aaaa aaaa alll</code> : Queue a request with the given low-order address bits A[14:3] and length 8Γ(L[2:0]+1). The command and high-order bits are as previously specified. Any number of requests may be queued by sending only this pattern, as long as the command and higher address bits remain the same. ; <code>10cc ccra aaaa aaaa</code> : Use command C[3:0] and address bits A[23:15] for future requests. (Bit R is reserved.) This does not queue a request, but sets values that will be used in all future queued requests. ; <code>110r aaaa aaaa aaaa</code> : Use address bits A[35:24] for future requests. ; <code>1110 aaaa aaaa aaaa</code> : Use address bits A[47:36] for future requests. ; <code>1111 0xxx</code>, <code>1111 10xx</code>, <code>1111 110x</code> : ''Reserved, do not use.'' ; <code>1111 1110</code> : Synchronization pattern used when starting the SBA bus after an idle period.{{r|agp10|agp20|p1=68|p2=163}} ; <code>1111 1111</code> : [[No operation]]; no request. At AGP 1Γ speed, this may be sent as a single byte and a following 16-bit side-band request started one cycle later. At AGP 2Γ and higher speeds, all side-band requests, including this NOP, are 16 bits long. Sideband address bytes are sent at the same rate as data transfers, up to 8Γ the 66 MHz basic bus clock. Sideband addressing has the advantage that it mostly eliminates the need for turnaround cycles on the AD bus between transfers, in the usual case when read operations greatly outnumber writes. ===AGP responses=== While asserting GNT#, the motherboard may instead indicate via the ST bits that a data phase for a queued request will be performed next. There are four queues: two priorities (low- and high-priority) for each of reads and writes, and each is processed in order. Obviously, the motherboard will attempt to complete high-priority requests first, but there is no limit on the number of low-priority responses which may be delivered while the high-priority request is processed. For each cycle when the GNT# is asserted and the status bits have the value <code>00p</code>, a read response of the indicated priority is scheduled to be returned. At the next available opportunity (typically the next clock cycle), the motherboard will assert TRDY# (target ready) and begin transferring the response to the oldest request in the indicated read queue. (Other PCI bus signals like FRAME#, DEVSEL# and IRDY# remain deasserted.) Up to four clock cycles worth of data (16 bytes at AGP 1Γ or 128 bytes at AGP 8Γ) are transferred without waiting for acknowledgement from the card. If the response is longer than that, both the card and motherboard must indicate their ability to continue on the third cycle by asserting IRDY# (initiator ready) and TRDY#, respectively. If either one does not, [[wait state]]s will be inserted until two cycles after they both do. (The value of IRDY# and TRDY# at other times is irrelevant and they are usually deasserted.) The C/BE# byte enable lines may be ignored during read responses, but are held asserted (all bytes valid) by the motherboard. The card may also assert the RBF# (read buffer full) signal to indicate that it is temporarily unable to receive more low-priority read responses. The motherboard will refrain from scheduling any more low-priority read responses. The card must still be able to receive the end of the current response, and the first four-cycle block of the following one if scheduled, plus any high-priority responses it has requested. For each cycle when GNT# is asserted and the status bits have the value <code>01p</code>, write data is scheduled to be sent across the bus. At the next available opportunity (typically the next clock cycle), the card will assert IRDY# (initiator ready) and begin transferring the data portion of the oldest request in the indicated write queue. If the data is longer than four clock cycles, the motherboard will indicate its ability to continue by asserting TRDY# on the third cycle. Unlike reads, there is no provision for the card to delay the write; if it didn't have the data ready to send, it shouldn't have queued the request. The C/BE# lines ''are'' used with write data, and may be used by the card to select which bytes should be written to memory. The multiplier in AGP 2Γ, 4Γ and 8Γ indicates the number of data transfers across the bus during each 66 MHz clock cycle. Such transfers use [[source synchronous]] clocking with a "strobe" signal (AD_STB[0], AD_STB[1], and SB_STB) generated by the data source. AGP 4Γ adds complementary strobe signals. Because AGP transactions may be as short as two transfers, at AGP 4Γ and 8Γ speeds it is possible for a request to complete in the middle of a clock cycle. In such a case, the cycle is padded with dummy data transfers (with the C/BE# byte enable lines held deasserted).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)