Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Unaligned access to AXI read slave yields incorrect data

Aperta
#1,019 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Ambito
backend

Direzione di ricerca

Start with the loop at line 116 in axi_read_slave.vhd and trace how address, burst.size, and self.data_size determine byte indices across beats. Reproduce the reported 32-bit, address-1, two-beat case and inspect the related tests. Done when later beats return bytes from the expected addresses and the first beat's bytes below the start address follow the configured drive_invalid behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When doing multi-beat accesses to AXI read slave with an unaligned start address, every beat except the first one will yield wrong data due to the address offsetting

Line 116 in axi_read_slave.vhd:

for j in 0 to burst.size-1 loop
  idx := (address + j) mod self.data_size;
  rdata(8*idx+7 downto 8*idx) <= std_logic_vector(to_unsigned(read_byte(axi_slave.p_memory, address+j), 8));
end loop;

Example:
Bus width: 32 bits
Address: 1
Burst length: 2 beats, 7 bytes

For the first beat, due to the modulo operation, the byte with index 1, 2 and 3 will be correctly, set. However the byte with index with index 0 will be fetched from memory index 4. For the first beat, this does not matter, since that address is "invalid" anyway.

But for the second beat and onwards, the same will occur, byte with address 4 (and index 0) will be fetched from address 8.
In the case of unallocated data this will fail the allocation check, but otherwise this will return the wrong data.

This should be relatively easily fixed by looping over address the address to the next aligned address and also aligning all subsequent addresses. This fix will also yield undefined data (if this is configured via generic) on the bytes of the first beat which are "below" the starting address, which is probably a good thing since those bytes are not of interest, should the user decide to configure the drive_invalid generic.

I will post a patch later.

Lingua principale
VHDL
Stelle
850
Fork
305
Merge medio
2g 10h
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di VUnit/vunit

Tutte le issue di VUnit/vunit

Issue simili

Altre issue su Backend & API Design

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.