Date: Mon, 28 Sep 2015 14:39:45 +0300 From: Aleksey Cherepanov <lyosha@...nwall.com> To: john-dev@...ts.openwall.com Subject: Re: Re: ztex 1.15y boards, pre-development Katja, On Sun, Sep 27, 2015 at 10:41:21PM +0300, Aleksey Cherepanov wrote: > On Mon, Jul 27, 2015 at 03:03:34AM +0300, Aleksey Cherepanov wrote: > > I think, I got how to bypass it: read 5 times and skip results from > > first 4 times. Also there is a difference: with wrong data I got 32 > > bytes back, while good data come in 34 bytes "packet". > > I found why there is additional word that causes 34 bytes instead of > 32: you check cnt >= 16 while you need cnt >= 15 because you already > read 16 words at cnt == 15. I played a bit and made a slightly different bitstream: it reads only once and writes back only once too. The code is in attach. There are problems: - first time after power cycle it gives zeros, I use workaround: I upload bitstream twice, then it works correctly even for the first run of transfer_data - I tried to make reads to return without data after the first one, but it is not stable: sometimes I get "got 0 bytes back" (desired), but sometimes it sticks with error "Error reading data: No error". I removed cnt <= 0 on RESET. Otherwise the work is repeated on each write even in 1 execution of transfer_data. I think you messed up work with SLOE, SLRD, SLWR and PKTEND control signals. I found a document that describes them: http://www.cypress.com/file/4455144551 "SLRD pin should be asserted by the master to read data from the FIFO." "SLWR pin should be asserted by the master to write data to the FIFO." "SLOE: This is the enable signal for the FIFO's output driver." "FIFOADR[1:0] These signals select the active endpoint." I changed this a bit in your code. My code does not really match states described in the document. Also I modified meaning of cnt: 0-14: write into fifo 15: write into fifo and set PKTEND, bump cnt to 16 16: disable sending, do nothing I don't fully understand all signals yet: I've found some values for signals by trial and error while they differ from my expectations based on the documentation. Anyway I hope it gives ideas how to proceed. Thanks! -- Regards, Aleksey Cherepanov View attachment "intraffic.v" of type "text/plain" (3059 bytes) View attachment "transfer_data.c" of type "text/x-csrc" (5307 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.