<cr1901>
The easy way I know how to do cartridge emulation is to use two separate DRAMs and refresh them out of phase with each other. Which nobody actually does in practice, so I'm clearly being lazy :P
<cr1901>
_florent_: This may be a stupid question, but... how does litedram handle the edge case that "the refresh timer for row 'n' on a specific rank has triggered, but the CPU is currently in the process of doing a r/w to a separate row on that same rank."
<cr1901>
how does litedram ensure that even if the CPU is in the middle of an xfer, the refresh happens while ensuring each row is refreshed every 64ms or whatever
timkpaine has quit [Remote host closed the connection]
<_florent_>
cr1901: The 64ms is an average, it's common to postpone a few refresh command to avoid interrupting transfers and then do multiple consecusive refreshs.
<_florent_>
cr1901: In LiteDRAM, the Refresher module advertises the core that a refresh should occur and let the core finish the current transfer before doing the refresh.
<_florent_>
cr1901: But it's common to postpone up to 8 refreshs.
indy has quit [Ping timeout: 250 seconds]
so-offishul has joined #litex
so-offish has quit [Ping timeout: 246 seconds]
so-offishul has quit [Ping timeout: 246 seconds]
<somlo>
got the schematics (a pdf file) from the seller of the sitlinv-stlv7325-v2 board I just bought. He asked if I could "upload it to github" so others can see it too
<somlo>
this is all via aliexpress auto-translation, mind you :) He said github is difficult for him due to language barrier, as far as I was able to follow
<somlo>
so I promised I'd ask around: where would be a *good* place for that schematic to live (worst case, I can dump it into my personal github repo and share the link, but figured I'd try for a better place first)
<somlo>
any ideas ?
<cr1901>
_florent_: Thank you for the hint/source code links, they are very helpful
<cr1901>
I knew that 64ms is an average. I designed an old DRAM chip tester on FPGA, and I opted to do refresh of all rows in a single burst. But I thought that each row _also_ had to be refreshed exactly 64ms (or less) after it was previously refreshed
<cr1901>
I didn't know that there was enough slack to postpone refresh for a given row up to 15us * 7 + "time the currently executing command takes"
<cr1901>
(up to 7 because, if postpone = 1, then refresh happens after current command, if postpone == 2, refresh happens after current command + next refresh interval, etc)
<cr1901>
_florent_: Also, thanks for the "it's common to postpone up to 8 refreshs" remark. According to this paper, that's explicitly in the JEDEC spec (I didn't know this) https://memlab.ece.gatech.edu/papers/TACO_2014_1.pdf
<_florent_>
somlo: An easy way to share the .pdf: Copy it to a github issue (in litex-boards) and share the link with us :)
<_florent_>
cr1901: The is really an average and relaxed. You'll also see that at high temperature, it's recommended to shorten it, ex on DDR4, 32ms is recommended for T > 85C.
<_florent_>
cr1901: BTW, a nice way to just visualize it: Use a Video Framebuffer with a static image (or just black) and disable refresh on your controller, you'll see some pixel degradation but that it's also relatively slow.
<cr1901>
_florent_: Yea, against my better judgment, I'm thinking of making a crappy SDRAM and maybe hyperram core, just so I can say I did it. (Obviously use litedram when possible)
<cr1901>
The framebuffer debugger is good advice
<somlo>
_florent_: oh yeah, it could even be the PR I submit to add the platform and target files for the board :)