You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
request a dma read from any address that is 4K aligned (say 0x1000), dma length is 4096 bytes.
Normally only one Mrd TLP will be sent, but dma_if_pcie_rd generates two TLPs, one is a Mrd from address 0x1000 and another is a Mrd from address 0x2000, both TLP's dword count is 1024 (4096 bytes). The later Mrd will corrupt the data.
I think the cause is in dma_if_pcie_rd.v, line 675:
In above situation,"(((req_pcie_addr_reg & 12'hfff) + (req_op_count_reg & 12'hfff)) & 12'hfff) == 0" is true, req_op_count_reg is 4096, hence “req_op_count_reg >> 12” equals 1,"req_op_count_reg >> 12 == 0" is false, req_last_tlp is not assigned to 1, an unexpected tlp will be generated.
Is it OK to delete "&& req_op_count_reg >> 12 == 0" in line 675?
req_op_count_reg must be not greater than max read request size to reach line 675 (see line 663) and the maximum value of max read request size is 4096. "req_op_count_reg >> 12 == 0" is false only when req_op_count_reg equals 4096.
In the case that req_op_count_reg equals 4096, there is a chance that it is the last TLP (above situation), and "(((req_pcie_addr_reg & 12'hfff) + (req_op_count_reg & 12'hfff)) & 12'hfff) == 0" will determine wheter it is the last TLP.
In other cases that req_op_count_reg is less than 4096, "req_op_count_reg >> 12 == 0" is always false, so there is no need to evaluate it.
Please tell me if I was wrong.
The text was updated successfully, but these errors were encountered:
Hi Alex,
please consider this situation:
Normally only one Mrd TLP will be sent, but dma_if_pcie_rd generates two TLPs, one is a Mrd from address 0x1000 and another is a Mrd from address 0x2000, both TLP's dword count is 1024 (4096 bytes). The later Mrd will corrupt the data.
I think the cause is in dma_if_pcie_rd.v, line 675:
In above situation,"(((req_pcie_addr_reg & 12'hfff) + (req_op_count_reg & 12'hfff)) & 12'hfff) == 0" is true, req_op_count_reg is 4096, hence “req_op_count_reg >> 12” equals 1,"req_op_count_reg >> 12 == 0" is false, req_last_tlp is not assigned to 1, an unexpected tlp will be generated.
Is it OK to delete "&& req_op_count_reg >> 12 == 0" in line 675?
req_op_count_reg must be not greater than max read request size to reach line 675 (see line 663) and the maximum value of max read request size is 4096. "req_op_count_reg >> 12 == 0" is false only when req_op_count_reg equals 4096.
In the case that req_op_count_reg equals 4096, there is a chance that it is the last TLP (above situation), and "(((req_pcie_addr_reg & 12'hfff) + (req_op_count_reg & 12'hfff)) & 12'hfff) == 0" will determine wheter it is the last TLP.
In other cases that req_op_count_reg is less than 4096, "req_op_count_reg >> 12 == 0" is always false, so there is no need to evaluate it.
Please tell me if I was wrong.
The text was updated successfully, but these errors were encountered: