0

If a PCI device can work with both 64-bit PCI bus and 32-bit bus. Suppose the PCI device is a memory card. When the device works with 64-bit PCI bus, it can transfer 64 bits. On 32-bit PCI bus, the device can transfer 32 bits.

My question is mostly about when this 64-bit device is working on 32-bit PCI bus. Does this mean that the device internally uses two different addressing mechanisms? Does it use two different hardware decoders to activate either the lower 4 bytes or upper 4 bytes in case of 32-bit PCI? In the tables below, only first few rows of memory device are shown. I'd appreciate if you could keep your answer simple since I'm trying to understand it conceptually at basic level.

enter image description here

I tried online but couldn't find the answer. I have tried to detail what is confusing me.

PG1995
  • 109
  • 2
  • 1
    I'd assume a typical design would internally still fetch 8 bytes (from `address & -8`, i.e. the containing 8-byte chunk), but then use bit#2 of the address to mux either the high or low 4 bytes into the bus. Or something equivalent to that. You don't need a whole separate address decoder; every byte still has the same byte address so you can still use the upper address bits the same way. – Peter Cordes Dec 01 '22 at 07:53
  • @PeterCordes Thank you but I'm still struggling. What do you mean by "address & -8"? **Q1** Suppose 64-bit PCI bus sends address of "24", the PCI device needs to align this address with Row #3. I think one way is divide the address by 8 to alighn it with memory row number; 24/8=3. Do I have it correct? **Q2** In case of 32-bit PCI, if bit #2=1, then it's upper 4 bytes. Suppose 32-bit PCI issues address 28 which bit #2 asserted. The PCI device can subtract 4 from the address to find the row number; i.e. 28-4=24. Then, it can divide 24 by 8 to get row number; 24/8=3. Could you please guide me? – PG1995 Dec 01 '22 at 10:01
  • 1
    `-8` is `0xFF...FFF8`, so it clears the low 3 bits of a number, i.e. rounding down to a multiple of 8. The address of the containing 8-byte chunk. Or yes, you can look at it as those low bits not existing at all for the purposes of addressing an 8-byte chunk, just `address >> 3` to get a row number. – Peter Cordes Dec 01 '22 at 10:16
  • @PeterCordes Thank you! You said, "*Or yes, you can look at it as those low bits not existing at all for the purposes of addressing an 8-byte chunk, just address >> 3 to get a row number.*" You're saying that one can shift the address by 3 bits to the right to get the memory row number. That's a nice approach! Anyway, I don't understand this, "*-8 is 0xFF...FFF8, so it clears the low 3 bits of a number, i.e. rounding down to a multiple of 8.*" I see that hex signed 2's complement of decimal -8 is "FFF8" but you also wrote "0xFF". Could you plz guide how one can get row # using this approach? – PG1995 Dec 01 '22 at 11:35
  • 1
    `...` was a placeholder for any number of `F` digits, out to 32 or 64 bits. I'm talking about ignoring / clearing the low 3 bits of the address, and was trying to express that in simple pseudocode. – Peter Cordes Dec 01 '22 at 11:54

0 Answers0