← RTL Design Interviews · SoC Architecture Interviews

Interview Question · Explain the SoC

Design a Four-Byte Receive Channel

L1 JuniorL2 Mid-LevelL3 Seniorexplain the soc

The Question

The interviewer asks

Firmware wants four bytes from UART0 copied into SRAM. What state lets a DMA channel finish after firmware leaves the bus?

Reveal the Model Answer

Firmware writes source, destination and length, then starts the job. The channel becomes a second bus manager and waits its turn against the core. Keep the current addresses, remaining count and one held byte between a successful read and its matching write.

Self-Check

Tick each key point you covered in your answer.

What Interviewers Want to Hear (Junior)

Identify who issues the eight transfers.

Choose Your Follow-up

I’ve answered the opening question

Choose the route closest to your reasoning. Answer the follow-up aloud, then open the closing question.

I followed the addresses.

Edges 18 and 23 read 1000000c and return hex 73 and 65. How does the channel avoid skipping or duplicating a byte?

Reveal the Model Answer

Wait for a receive byte before each read. A successful device read consumes one byte. Hold it through the write, then advance the SRAM address by one. Four bytes need four reads plus four writes.

Self-Check

Tick each key point you covered in your answer.

Specify What Done Promises

What lets the driver publish all four bytes? What changes with a write-back data cache and no coherent port?

Reveal the Model Answer

The successful final write accounts for the fourth byte and permits done. Keep the buffer under DMA ownership until completion. In the S9.9 model invalidate the destination lines after done and before reading. The ap_soc core has no data cache. Its S11.6 firmware polls DMA completion before reading the destination.

Self-Check

Tick each key point you covered in your answer.

I defined an error flag.

On the third read the summary becomes “rx_ack=2 ram=73650000 done=0 error=1”. What can the driver recover?

Reveal the Model Answer

Only two bytes reached SRAM, leaving 4 − 2 = 2 bytes outstanding. The failed read left the third byte in UART0. Stop without writing its error data and report a fault. Resume only if software can establish the committed length and remaining source contents.

Self-Check

Tick each key point you covered in your answer.

Specify What Done Promises

What lets the driver publish all four bytes? What changes with a write-back data cache and no coherent port?

Reveal the Model Answer

The successful final write accounts for the fourth byte and permits done. Keep the buffer under DMA ownership until completion. In the S9.9 model invalidate the destination lines after done and before reading. The ap_soc core has no data cache. Its S11.6 firmware polls DMA completion before reading the destination.

Self-Check

Tick each key point you covered in your answer.

I counted source acknowledgments.

The last read completes at e33 and the last write normally completes at e35. Suppose SRAM stalls that write. What stays live?

Reveal the Model Answer

Keep hex 64, destination 80000003 and the outstanding write until its response. Three bytes are committed while the fourth is held. Delay done until successful completion and signal fault on a write error. UART0 already removed the byte. Losing the held copy loses the data.

Self-Check

Tick each key point you covered in your answer.

Specify What Done Promises

What lets the driver publish all four bytes? What changes with a write-back data cache and no coherent port?

Reveal the Model Answer

The successful final write accounts for the fourth byte and permits done. Keep the buffer under DMA ownership until completion. In the S9.9 model invalidate the destination lines after done and before reading. The ap_soc core has no data cache. Its S11.6 firmware polls DMA completion before reading the destination.

Self-Check

Tick each key point you covered in your answer.

What People Get Wrong

Common wrong answers and why they fail.

Half-Truth

Increment both addresses after every byte.

The next UART byte arrives at the same data register.

Half-Truth

Restart a failed receive job from its original addresses.

Earlier reads may already have removed bytes from the queue.

Learn It, Then Prove It