<gregdavill>
Are there any examples of adding a second CSRBank to a SoC?
skip has quit [Remote host closed the connection]
<gregdavill>
I think I've got it working correctly, but now I'm wanting to tidy up the implementation.
<gregdavill>
I'm essentially creating a new CSR bus, and passing the address/data signals through a clock domain via an AsyncFIFO.
<gregdavill>
This is specifically for operating valentyusb.eptri 12MHz, from a CPU that's running at 48-72MHz.
FFY00 has quit [Remote host closed the connection]
FFY00 has joined #litex
rohitksingh has joined #litex
CarlFK has quit [Quit: Leaving.]
<_florent_>
gregdavill: for second CSRBank, you have to do it manually for now, probably as you just did. The potential issue with CSR and CDC is that the CSR is expecting reads to be returned on the next clock cycle which is not possible if the origin clock is faster than the target clock. Doing CDC on Wishbone would be possible (due to the stb/ack) but not currently implemented in LiteX.
<_florent_>
gregdavill: happy to have a look at your implementation to see if we could ease this in LiteX
<gregdavill>
I've created a custom WB2CSR. Which exposes an Ack signal that is fed externally if a read is performed.
<gregdavill>
Essentially I send Addr/Dat/we signals through an Async FIFO, and then if we is low, addr/dat is sent back though another AsyncFIFO. Ack is esserted when the address back matches the pending request.
<gregdavill>
I'm trying to just have all the cdc stuff happening at the CSR bus, because it's nice and simple. But I've had to tie in a wishbone level to hold the CPU to handle reads.
<gregdavill>
This way isn't super fast for reads, but uses the least amount of resources.
<zyp>
does the link part of valentyusb really have to be operated at 12MHz?
<zyp>
I'm currently working on a usb core of my own, and while the phy needs to operate at 48 MHz, the link should be able to operate at whatever as long as it's able to keep up
<_florent_>
gregdavill: ok i see, it's indeed complicated to do CDC on CSR due to the assumption data should be ready on the next cycle
<_florent_>
In the future, we should probably allow creating different groups of CSRs running in different clock domains and let the tools connect it to the main bus and insert the CDC modules. But not sure this is going to be very soon, so your solution is probably fine for now.
<_florent_>
zyp: i'm not well aware of valentyusb, but the link is probably working at 12MHz to simplify CDC between 12MHz and 48MHz and reduce resource usage.
<zyp>
ah, looks like the tx pipeline is running the serializer from the 12MHz clock
<gregdavill>
I actually haven't looked into it too deeply, I just assumed that the 12/48MHz domains were quite tightly coupled.
HoloIRCUser1 has joined #litex
HoloIRCUser has quit [Read error: Connection reset by peer]
futarisIRCcloud has quit [Quit: Connection closed for inactivity]
skip has joined #litex
gregdavill has quit [Quit: Leaving]
ambro718 has joined #litex
ambro718 has quit [Quit: Konversation terminated!]
ambro718 has joined #litex
CarlFK has joined #litex
btashton has joined #litex
<btashton>
I'm trying top build the kernel module for the litepcie core, but I am a little unclear as to how I should be integrating this with the generated sources from my litex build
<btashton>
I see I was not generating the correct headers.
gojimmypi has joined #litex
btashton has quit [Remote host closed the connection]
btashton has joined #litex
btashton has quit [Remote host closed the connection]