[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [usb] dma



On Wednesday 24 July 2002 03:40 pm, meizhangxiong wrote:
> hi,all
> I have there questions about Mr. Rudolf Usselmann's usb device core.
> 1,In the document,USB Function IP Core 3.1.1,the usb core surports a
> double buffering feature,and data is being retrieved/filled from/to the
> buffers in a round robin fation. In this document 3.2,however,in DMA
> mode,only one buffer(buffer 0)is used,buffer 1 is never used in DMA
> mode.I want to know if there is any conflition between these two
> representations and why. 2,In the interupt servcie routine,how do the

If the CPU/micro-controller does the filling of buffers,  both buffers may 
be used. For DMA only one buffer is used. This are two different modes
of operation. Two reasons for that:

1) CPU will be slower when filling buffers, therefore double buffering
is provided.

2) To manage double buffering for DMA in hardware would have
increased the size of the core and is most likely not needed as
DMA will  have no problems keeping up ...

> buffer0/buffer1 exchange data with usb funtion controller?By DMA mode?

Not sure what you mean here. Interrupt service of the USB core, would
be first through CPU intervention to set up the DMA, then second through
DMA.

> 3,In usbf_pe.v,the following sentence,
> // New Size (to be written to register file)
> always @(posedge clk)
> 	new_sizeb <= #1 (out_op & dma_en) ? max_pl_sz : (in_op ? size_next :
> sizu_c); Does it mean that usb core use max_pl_sz space for each output
> transaction?

Basically yes, but it depends on many other parameters. During an
OUT transfer the host is sending a data packet to the USB function.
I can not control what the host does, but, I can control what the core
does in response. Some endpoint types have pre-defined packet
sizes. See USB 2.0 specification for more details.

rudi

> Regards
>
>               meizhangxiong
>               meizx@ict.ac.cn
>                  2002-07-24



--
To unsubscribe from usb mailing list please visit http://www.opencores.org/mailinglists.shtml