Saturday, 2020-05-30

*** tpb has joined #litex00:00
*** CarlFK has quit IRC00:28
somlo_florent_: good morning! (I think :) )02:06
somlojust dumped a whole bunch of stuff into github, getting readyo to go to sleep over here...02:07
somlo*ready02:07
somlobut long story short, I got sdcard to properly pass testing on rocket (with either 8 or 32bit simple CSRs)02:08
benhsomlo: hey02:22
benhI very much disagree with your "fix" for the CSRs, this brings back a breakage I fixed  actually :)02:23
benh_florent_ somlo: see my comment on the github issue. I can try to investigate why it broke on Mor1kx but making the access size match the actual CSR size was done on purpose, otherwise we end up generating multi-beat transfers on every CSR access02:24
benhwhen the unsigned long is wider than the CSR size02:24
benhmy patch  *should* have taken the alignment into account via CSR_OFFSET_BYTES and it works on microwatt which has a 64-bit bus and 32-bit CSRs02:24
benhso I don't know why Mor1kx broke at this point, if you have info, please share, otherwise I'll try to investigate this week-end02:25
benhbut I very very much disagree with your "fix"02:25
*** Degi has quit IRC02:54
*** Degi has joined #litex02:56
*** Skip has quit IRC03:38
*** kgugala_ has quit IRC04:20
*** kgugala has joined #litex04:32
*** scanakci has joined #litex05:11
*** _whitelogger has quit IRC05:20
*** _whitelogger has joined #litex05:30
*** CarlFK has joined #litex05:35
*** CarlFK has quit IRC06:28
*** kgugala_ has joined #litex07:05
*** kgugala__ has joined #litex07:08
*** kgugala has quit IRC07:09
*** kgugala_ has quit IRC07:10
*** proteusguy has quit IRC07:50
*** proteusguy has joined #litex08:04
*** wizzy has joined #litex08:17
_florent_somlo: good for the sdcard, i will look at your changes09:50
_florent_somlo, benh: we could discuss the right solution for the CSR fix in the issue and should also probably limit the supported CSR configurations to simplify things09:52
*** _whitelogger has quit IRC10:03
*** _whitelogger has joined #litex10:05
benh_florent_: I agree, there is no point in supporting every combination under the sun, it's just a pain to maintain & test long run10:15
benh_florent_: and if we support them today & people use them it gets harder to get rid of10:15
benh_florent_: so yes, I wholeheartedly agree :) 32-bit and 8-bit CSR both on a 32-bit wishbone makes sense10:16
benhnot sure if there's real advantage to the 8-bit case but we can keep it around if it really saves resources (it does add muxes and uses less registers, I tend to find that we run out of muxes/timing faster than we run out of registers but that's my use cases)10:16
benhif 64-bit systems always have a proper down-converter to 32-bit then alignment can be removed10:17
benhand such systems can just use normal 32-bit with 32-bit alignment10:17
benhwe still need to decide on endian :) but that's less urgent10:18
_florent_yes this seems fine and easier to support in the long term10:18
benhsomlo: opinions ? :)10:19
benh_florent_: if we go down that path, we could simplify hw/common.h a lot too10:19
benhwe can make csr_*simple just open-code the 4 read/write for the 8-bit case and make everything else operate on 32-bit quantities10:21
somlo_florent_, benh: I honestly wish the CSR bus had some concept of strobes :)10:29
somlobecause that's the main reason we have to have 64bit CSR alignment right now10:29
somloi.e., the 64bit CPU makes 64-bit accesses for *everything* (even an 8bit read/write), which then gets translated into two 32-bit accesses by the wishbone down-shifter, which then touches two adjacent 32-bit CSRs (if they're not 64-bit aligned), regardless of whether one half of the original 64-bit request is completely strobed out10:30
_florent_somlo: we could handle the strobes in the Wishbone2CSR converter10:30
_florent_somlo: ie, if the strobes are not set for the the 32 LSB or MSB, we could just avoid the access on the CSR bus for this10:31
somloright, and then we could get rid of 64-bit alignment. I'm just saying, with the way things are right now, the MMIO (simple) accessors are what they need to be. They're wrong on some "ideal" hardware we don't (yet) have :D10:31
_florent_somlo: ok, so we could work on this together10:33
somloand I'll take a pass at fixing the "buffer" accessors for non-multiple cases, unless whatever we're about to do changes *that*, in which case I'd wait until the dust settles :D10:33
*** _whitelogger has quit IRC10:39
*** _whitelogger has joined #litex10:41
benhwait...11:13
benhwhy would it do that ?11:13
benhI mean, why would the 64->32 downconverter generate cycles for the lanes that have no byte enable ?11:13
benhmine doesn't :-)11:13
benh(the one I have in microwatt)11:13
benhand yes, the Wishbone2CSR converter should definitely check the enables11:14
benhfor 32-bit and 8-bit11:14
benh_florent_: ok so I see two issues indeed with the approach I want for the accessors11:23
benh_florent_: indeed it looks like the wishbone downconverter will turn any access from a 64-bit master into 2x32-bit access downstream even if sel's are all 011:23
benhthat should/could probably be optimized :)11:24
benh(unless I'm misreading the migen)11:24
benh_florent_: and yes Wishbone2CSR should probably check that relevant sel bits are set for the CSR size11:24
*** _whitelogger has quit IRC12:15
*** _whitelogger has joined #litex12:17
*** scanakci has quit IRC13:06
_florent_somlo: could you do some tests with Rocket, 32-bit CSR alignment and https://github.com/enjoy-digital/litex/commit/759367752caf21475b57d468a442635a87ac273b?13:23
tpbTitle: wishbone/wishbone2csr: use wishbone.sel on CSR write. · enjoy-digital/litex@7593677 · GitHub (at github.com)13:23
_florent_to use 32-bit CSR alignment, you can just comment: https://github.com/enjoy-digital/litex/blob/master/litex/soc/integration/soc.py#L79413:24
tpbTitle: litex/soc.py at master · enjoy-digital/litex · GitHub (at github.com)13:24
benh_florent_: if we start making the main wishbone 64-bit, we'll have more 64->32 downconverters for random IO parts (not a bad idea for utilization anyway)13:24
benh_florent_: might be worth looking at avoiding the downstream phases for unused sels13:24
benh_florent_: in microwatt it's easy bcs the downconverter is hard wired for 64-32 :)13:24
benh_florent_: the general case is harder but we could special case the "half size" case in the generator13:25
benh_florent_: I basically have two signals "have_top" and "have_bottom" and define the next state based on them with a state for each half13:25
somlo_florent_: seems to work in sim with rocket and 32-bit csr data width; I'll run some more tests, and try on the nexys4ddr after that14:28
somlothen I'll pretty much have to overhaul the 64-bit linux drivers in litex-hub/linux :)14:29
somlobut writing to the scratch register no longer causes the SoC to reset (because of the preceding reset register contained within the same 64-bit aligned pair :)14:29
*** kgugala__ has quit IRC15:07
*** kgugala has joined #litex15:07
somlo32-bit alignment appears to work on nexys4ddr with rocket and the updated sdcard code from PR 54715:12
somlo_florent_: are you planning to officially comment out https://github.com/enjoy-digital/litex/blob/master/litex/soc/integration/soc.py#L794 upstream?15:13
tpbTitle: litex/soc.py at master · enjoy-digital/litex · GitHub (at github.com)15:13
*** darren099 has quit IRC15:39
*** darren099 has joined #litex15:40
*** CarlFK has joined #litex16:21
*** Skip has joined #litex16:56
*** CarlFK has quit IRC17:56
*** CarlFK has joined #litex19:22
*** _whitelogger has quit IRC19:36
*** _whitelogger has joined #litex19:38
_florent_somlo: thanks for the test, yes i was planning to remove the CSR re-alignment on the CPU data width if it was working without for you19:59
_florent_somlo: maybe we should also remove 64-bit CSR alignment at the same time20:01
_florent_benh: i agree we should avoid downstream access if sel is not set, i will look at implementing it. Here i just wanted to see if we could avoid the 64-bit CSR alignment support20:03
somlo_florent_: I think I'm ok with removing 64bit alignment altogether21:57
somloI assume the linux drivers will be more or less the same in that case for both vexriscv and rocket21:58
somlobut I can check (and clean things up if needed)21:58
somloI have 15 days of time off and nowhere to go (my flight to Budapest just got canceled, so no vacation this summer for the Somlos :(21:59
somloon the bright side, I can spend some fun time with LiteX now that $DAYJOB won't pay for it anymore :D21:59

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!