_florent_ changed the topic of #litex to: LiteX FPGA SoC builder and Cores / Github : https://github.com/enjoy-digital, https://github.com/litex-hub / Logs: https://freenode.irclog.whitequark.org/litex
tpb has quit [Remote host closed the connection]
tpb has joined #litex
Degi has quit [Ping timeout: 256 seconds]
Degi has joined #litex
_whitelogger has joined #litex
CarlFK has quit [Read error: Connection reset by peer]
levi has quit [Ping timeout: 246 seconds]
mithro has quit [Ping timeout: 244 seconds]
guan has quit [Ping timeout: 272 seconds]
jaseg has quit [Ping timeout: 246 seconds]
jaseg has joined #litex
rohitksingh has quit [Ping timeout: 244 seconds]
bubble_buster has quit [Ping timeout: 256 seconds]
rohitksingh has joined #litex
bubble_buster has joined #litex
rohitksingh has quit [Ping timeout: 244 seconds]
bubble_buster has quit [Ping timeout: 244 seconds]
rohitksingh has joined #litex
bubble_buster has joined #litex
guan has joined #litex
mithro has joined #litex
levi has joined #litex
HoloIRCUser1 has joined #litex
HoloIRCUser has quit [Ping timeout: 260 seconds]
davidcorrigan714 has joined #litex
_whitelogger has joined #litex
kgugala_ has joined #litex
kgugala has quit [Ping timeout: 240 seconds]
kgugala has joined #litex
kgugala_ has quit [Ping timeout: 240 seconds]
CarlFK has joined #litex
kgugala has quit [Quit: -a- Connection Timed Out]
kgugala has joined #litex
tcal has quit [Quit: Connection closed for inactivity]
kgugala_ has joined #litex
kgugala has quit [Ping timeout: 256 seconds]
<lkcl> that's interesting. nextpnr-ecp5 compiling microwatt didn't complete (overnight!) and has locked up solid after 15 hours, with 4,000 / 140,000 routes left.
<daveshah> the routeability of large ecp5 designs isn't great
<lkcl> annoying as i need it in order to test DDR3 memtest with 64-bit
<daveshah> you can try Rocket, it isn't POWER but in the default, non-Linux-ready config, I think it should fit slightly better
<lkcl> ah that's rocket-chip (written in chisel3). yeah
<lkcl> arg probably need an updated rv cross compiler... hm there should be debian packages
<lkcl> ah interesting, upgrading to gcc-9 didn't help
<lkcl> litex/litex/soc/software/bios/isr.c:56: Error: Instruction csrr requires absolute expression
<lkcl> bizarre-ness. picorv32 csrr() and microwatt csrr() macros in their respective system.h are identical
kgugala has joined #litex
<lkcl> but it's on mtval (in software/bios/isr.c) which i've commented out
<lkcl> i *think* this is because mtval was retired (or is optional)
kgugala_ has quit [Ping timeout: 240 seconds]
<lkcl> ahh interesting. i'm getting data corruption on the UART terminal (minicom)
<lkcl> this is on libresoc 64-bit 55mhz with latest git master
<lkcl> daveshah: urrr.... rocketchip build - Info: 9.8 ns logic, 33.0 ns routing
<lkcl> Warning: Max frequency for clock '$glbnet$sys_clk': 23.36 MHz (FAIL at 55.01 MHz)
<lkcl> aaa i just want something to work! :)
<lkcl> the axi4 to tilelink converter creates a morass of critical path dependencies
* lkcl is trying 50mhz nextpnr-ecp5 builds and that seems to work (picorv32)
<lkcl> i suspect that the libresoc build, at 55mhz, is just too close to the limit estimated by nextpnr... nope. arse. a 50mhz libresoc build gets the same UART corruption.
<lkcl> ahh interesting
<lkcl> _florent_: when i re-added kwargs["integrated_main_ram_size"] = 0x1000 the UART corruption (black square "?" being the predominant char) went away
proteusguy has quit [Ping timeout: 240 seconds]
proteusguy has joined #litex
kgugala_ has joined #litex
kgugala has quit [Ping timeout: 265 seconds]
HoloIRCUser has joined #litex
HoloIRCUser1 has quit [Read error: Connection reset by peer]
<somlo> lkcl: I'm probably late to this party, but I managed to get 30 "official" MHz timing for my 5g-versa board with this command line:
<somlo> litex-boards/litex_boards/targets/versa_ecp5.py --sys-clk-freq 60e6 --csr-data-width 32 --cpu-type rocket --integrated-rom-size 0x10000 --build
<somlo> I can't test it right now, but the "advertised" fmax is usually *way* lower than what one can get away with (nextpnr is typically overly conservative w.r.t. timing)
<somlo> I also had to remove "-abc9" here: https://github.com/enjoy-digital/litex/blob/master/litex/build/lattice/trellis.py#L57 (latest abc crashes about 50% of the time when called from yosys' abc9 stage)
<tpb> Title: litex/trellis.py at master · enjoy-digital/litex · GitHub (at github.com)
<somlo> I think I'm going to revert litex commit 6c298cb7 and make abc9 optional via a command line flag
<somlo> and if you have a non-5g versa board, you'll probably need to make additional tweaks to the litex build environment (but if you've already been building stuff for your versa board, you've likely already figured that part out)
<somlo> once I free up my (currently busy) usb port, I can actually test the bitstream I built and see if it actually works, and if it manages to pass memtest, but that'll have to wait for a couple of hours :)
<lkcl> somlo: ah thank you
<lkcl> ahh interesting. csr data width normally defaults to 8 bit
<lkcl> i wonder if that has any impact, here.
<somlo> lkcl: historically, I don't think csr-data-width has had a major impact on timing, placement, or utilization
<lkcl> ok appreciated
<lkcl> aw poop, forgot the --device=LFE5UM :)
<somlo> oh, so you do have a non-5g versa, then :)
<lkcl> somlo: for lack of being able to purchase a 5g version via mouser 3 months ago... yes
<somlo> I'm still ripping a multi-cd audiobook to mp3 for my daughter, and the one usb port I could use to hook up my dev board is currently occupied by the cd drive -- so I can't test myself for a while :)
<somlo> lkcl: I initially ordered a 5g versa, they shipped me a non-5g one, daveshah helped me figure out why it wasn't working the way I thought it should have -- long story short, it took another month or so to sort out the mess :)
<lkcl> doh
<somlo> eventually they sent me the right one (this was via the lattice web store from the US)
<lkcl> oh cool
<lkcl> built - and fails.
<lkcl> ./versa_ecp5.py --sys-clk-freq 50e6 --device=LFE5UM --csr-data-width 32 --cpu-type rocket --integrated-rom-size 0x10000 --build
<lkcl> Warning: Max frequency for clock '$glbnet$sys_clk': 20.58 MHz (FAIL at 50.00 MHz)
<somlo> aaah, that
<somlo> try pushing the bitstream to the board anyway, see what happens
<lkcl> because of the massive combinatorial chain between tilelink and axi-lite
<lkcl> nope, fail
<somlo> I consistently get "fails at 30 (or 40) MHz" on a trellisboard (after requesting 60MHz) and it works fine :)
<lkcl> i mean: it loads successfully, it just doesn't report anything on the USB console
<lkcl> :)
<daveshah> somlo: I remember Rocket giving 50MHz+ once upon a time
<somlo> right, so then it *really* fails
<daveshah> did we ever figure out why that changed?
<somlo> daveshah: not sure if it was rocket, or yosys/trellis/nextpnr, or some interaction between the changes made to each of them
<somlo> I remember a point in time when bumping the rocket chip git version caused utilization to go up by 6-7 %
<daveshah> yeah, seems likely
<daveshah> that was probably almost a year ago that I remember that number from
<somlo> but I didn't pay as much attention to timing. I think at some point (before that) I had been complaining about no longer meeting timing, and litex switched to "--timing-allow-fail" based on the "looseness" of that calculation in nextpnr...
<somlo> these days I can get 60MHz working on the trellisboard most of the time, and the "linux" version of rocket will no longer fit on the versa no matter what (105+ % utilization), so I haven't tried with that board in the last several months
<lkcl> somlo: do you happen to have _anything_ that has a 64 bit bus, that you know (last time you tried it) "works"?
<lkcl> nextpnr-ecp5 on microwatt took 16 hours to fail to complete routing (locked up with 5% nets left)
<tpb> Title: A Trustworthy, Free (Libre), Linux Capable, Self-Hosting 64bit RISC-V Computer (at www.contrib.andrew.cmu.edu)
<somlo> some git versions of things I used back a while ago. sadly, I don't remember which litex commit that was at the time
<lkcl> cpu-variant "linuxd"? what's that one?
<somlo> lkcl: there's several versions of rocket with different mem-axi port widths, matching the native width of litedram on various dev boards
<somlo> so we can hook rocket's memory port directly to litedram, point-to-point, and bypass the wishbone bus used for MMIO
<somlo> but if we're looking for something we know used to work, I'd check out litex cca. 1 year ago, e.g. commit 4cc40aad
<somlo> also check out one of the earlier (earliest) versions of pythondata-cpu-rocket to match
<somlo> lkcl: there's another trick I remember from a while back: using `--nextpnr-timingstrict` with `versa_ecp5.py`, so that it *properly* fails when not meeting timing
<somlo> then running that in a `for` loop in the shell, until you get lucky and it succeeds :)
<somlo> but that might take a while (days)
<somlo> and it's not guaranteed to work
<lkcl> yyeah
<lkcl> and i'd have to then try to get libresoc working against that version of litex, to be able to make a fair comparison
<lkcl> i think... i am tempted to track down a nmigen 64-to-32-bit converter and throw that in front, before the data requests reach litex
<lkcl> hey i got the LUT4s down from 20,000 to around 16,000 by adding in sync delays into the regfile reads, that gave nextpnr a chance to to "hey i can use BRAMS now"
<lkcl> yaay
<daveshah> it's yosys that does that not nextpnr, jfyi
<lkcl> daveshah: oh, ta :)
<daveshah> and yeah, that will definitely help :)
<lkcl> i'm very happy. it was... a small but hair-raising change
<daveshah> this is the kind of interesting difference between what is efficient on ASIC vs FPGA
<lkcl> i'm doing an out-of-order design, which (for now) has a FSM, however all the infrastructure is there to add the dependency matrices in
<lkcl> which means that there are *combinatorial* "Pipeline Managers" that expect operands to come in with a "operand is ok" plus "actual operand" in the *same* cycle
<lkcl> not, as things are done in regfiles, on the *next* cycle (after the read-enable)
<lkcl> so, of course, to make life easier, i made the regfile combinatorial as well...
<lkcl> baad move
<lkcl> daveshah: well, it's more that i've never done this before.
<lkcl> i had:
<lkcl> * an instruction decoder that was combinatorial and
<lkcl> * a regfile read likewise and
<lkcl> * a pipeline manager likewise...
<lkcl> no wonder i was only getting 20 mhz, a couple days ago :)
<lkcl> nuts to it, i'm going to try libresoc @ 75mhz
<lkcl> what's a DPR16X4?
<somlo> lkcl: just tried that bitstream on the 5g versa, and it works (requested 50MHz, "passed" at 24-and-change, works fine, including passing memtest, at 50 when programmed)
<daveshah> lkcl: 16x4 bit distributed RAM
<daveshah> ie a cluser of 4 LUTs can be used as RAM instead of ROM
<lkcl> daveshah: thx
<lkcl> somlo: hmm interesting.
<lkcl> what versions of... "stuff" are you using?
<lkcl> because if you use latest rocket-chip, they're removed mtval
<lkcl> so it's guaranteed that the litex bios won't compile
<tpb> Title: Imgur: The magic of the Internet (at imgur.com)
<lkcl> litex git a0c8bb55
<somlo> litex 35929c0f yosys c39ebe6 trellis f93243b nextpnr b39a2a5
<somlo> "latest" to within the last week, or thereabouts
<lkcl> ok got it
<lkcl> i've got a version of trellis and nextpnr from about a month ago
<somlo> lkcl: I would bet against that making a relevant difference, but one never knows for sure :)
<lkcl> wait... is there anything that's determined by software read-levelling that is passed over to hardware?
<lkcl> i get this:
<lkcl> Read leveling:
<lkcl> m0, b00: |0| delays: -
<somlo> I think `read_delay_inc()` is used to modify `dq` based on calibration tests
<lkcl> argh ok
<lkcl> so, the core i'm doing is currently a FSM, not a pipelined design
<somlo> but I'm dangerously approaching the limits of my understanding of litedram :)
<lkcl> because the dependency matrices are massive and particularly complex, i've left them out for now (to add later)
<lkcl> problem is: the CPU therefore runs at a 0.1 to 0.2 IPC
<lkcl> somlo: i kiiinda get it. i'll take a look
<daveshah> Given that SERV runs litedram calibration just fine and that is IPC <0
<daveshah> <0.1
<daveshah> there shouldn't be an IPC dependency
* sorear thinks about the implications of ipc<0
<daveshah> Even PicoRV32 is an IPC of only 0.2 ish, less depending on the memory bus
<lkcl> daveshah: ok. even stranger, then
<daveshah> Is there any cache involved?
<lkcl> daveshah: no, no caches
<lkcl> (yet)
<daveshah> Good, that eliminates one cause of ddr3 calibration issues
<daveshah> My guess is that something somewhere is going wrong in the bus interface
<lkcl> daveshah: i did have an issue with the load/store interface, dropping the wishbone "ack" far too early
<lkcl> i did fix that (so that sim.py works)
<lkcl> tck-tck... i need to run some of microwatt's unit tests under the litex sim.py
<lkcl> how do you specify an alternative binary to be loaded in litex (at address 0x000000)?
<daveshah> Not sure, I haven't used sim.py much
<daveshah> https://github.com/litex-hub/linux-on-litex-vexriscv/issues/84 might be interesting though. Simulating part of the DRAM interface.
<lkcl> my guess is, specify a different "BIOS"
<tpb> Title: sim: use SDRAM DFI model for simulation · Issue #84 · litex-hub/linux-on-litex-vexriscv · GitHub (at github.com)
<daveshah> Yeah
<lkcl> that's an interesting one, i think i'll try that
<lkcl> of course, disable --integrated_ram_size (doh)
lf has quit [Ping timeout: 260 seconds]
lf has joined #litex
<lkcl> ahhh :)
<lkcl> daveshah: good call.
<lkcl> managed very quickly to put something together
<lkcl> microwatt: passed
<lkcl> libresoc: fail
<lkcl> *now* i have something i can test/compare against
<lkcl> and, as an added bonus, get a vcd trace
<lkcl> excellent call
<daveshah> Great!
<lkcl> thank you for that. vcd file's going to be massive... one for investigating tomorrow.
<lkcl> btw do you have some trellisboards available?
<daveshah> No, unfortunately not
<lkcl> daveshah: ok. i noticed the UXLS3 has an 85k version _and_ SDRAM.
<daveshah> Yep
<daveshah> Should be a bit simpler to debug than DDR3, too
<daveshah> From memory it was running reliably for me even at 16MHz
<lkcl> yeah that sounds not unreasonable for SDRAM. i'd really like to test opencores sdram before putting it into an actual ASIC
<lkcl> ok enough. 00:31 here :)
<daveshah> Ditto :)