PYNQ: PYTHON PRODUCTIVITY

Issues for dma.recvchannel for custom IP

I’m trying to implement a SHA-256 IP in Vivado, referred to this work (GitHub - secworks/sha256: Hardware implementation of the SHA-256 cryptographic hash function) and used their stream interface in Verilog to create the IP. My block diagram looks like this so far:

As I export the bitstream and use it as an overlay on PYNQ-Z1 board, the code cell runs and stalls, when stopping the kernel I see that this is the issue!

KeyboardInterrupt Traceback (most recent call last)
in ()
dma.recvchannel.transfer(out_buffer)
dma.sendchannel.wait()
----> dma.recvchannel.wait()
/usr/local/lib/python3.6/dist-packages/pynq/lib/dma.py in wait(self)
raise RuntimeError(‘DMA channel not started’)
while True:
→ error = self._mmio.read(self._offset + 4)
if self.error:
if error & 0x10:
KeyboardInterrupt:

Would anyone be able to advise on this problem, it would be much appreciated! Btw, I’ve also considered and tried using HLS to create the SHA256 IP but I got stuck on that as well :’^)

Hi @broken_pynqy,

The mst interface of your IP does not implement the signal ready which is key for handshaking.
That maybe the cause of the issue

Mario

Hi @marioruiz,

thanks for the suggestion! I’ve added ready port, m_tready_i, for the mst interface but I am still facing the same issue. Is there something I have missed out or overlooked?

Once again, thanks for the help!

I think Tlast is not correctly setup. I already went through so many problems because of this. You have to properly set up the Tlast signal at the end of your data completion to be sent to the DMA. Even the name is matter in this case for some reason, which shouldn’t be. I have checked that. Until DMA doesn’t get Tlast the transaction won’t over.