whitequark[m] changed the topic of #nmigen to: nMigen hardware description language · code https://github.com/nmigen · logs https://freenode.irclog.whitequark.org/nmigen
<_whitenotifier-5> [YoWASP/nextpnr] whitequark pushed 1 commit to develop [+0/-0/±1] https://git.io/JYhjC
<_whitenotifier-5> [YoWASP/nextpnr] whitequark 9f1e57b - Update dependencies.
thorns514 has joined #nmigen
Degi has quit [Ping timeout: 260 seconds]
Degi has joined #nmigen
FFY00_ has quit [Remote host closed the connection]
FFY00_ has joined #nmigen
thorns514 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<whitequark> I don't anticipate Values to gain any knowledge of the object from which they've been cast; that would change the current approach to compilation (lowering) into a completely different one, with end-to-end correspondence of effectively two PLs embedded in a third
<whitequark> however, there might be another way to do what you want
nelgau_ has quit [Remote host closed the connection]
nelgau has joined #nmigen
nelgau has quit [Read error: Connection reset by peer]
nelgau has joined #nmigen
nelgau has quit [Ping timeout: 240 seconds]
Bertl_oO is now known as Bertl_zZ
nelgau has joined #nmigen
nelgau has quit [Ping timeout: 268 seconds]
nelgau has joined #nmigen
revolve has quit [Ping timeout: 240 seconds]
revolve has joined #nmigen
nelgau has quit [Ping timeout: 265 seconds]
nelgau has joined #nmigen
nelgau has quit [Ping timeout: 268 seconds]
peeps[zen] has quit [*.net *.split]
Raito_Bezarius has quit [*.net *.split]
ianloic_ has quit [*.net *.split]
davidlattimore has quit [*.net *.split]
guan has quit [*.net *.split]
SpaceCoaster has quit [*.net *.split]
feldim2425 has quit [*.net *.split]
pattop has quit [*.net *.split]
Chips4Makers has quit [*.net *.split]
mwk has quit [*.net *.split]
samlittlewood has quit [*.net *.split]
Sarayan has quit [*.net *.split]
yuriks has quit [*.net *.split]
smkz has quit [*.net *.split]
pepijndevos has quit [*.net *.split]
ktemkin has quit [*.net *.split]
carlomaragno has quit [*.net *.split]
Lofty has quit [*.net *.split]
Ekho has quit [*.net *.split]
balrog has quit [*.net *.split]
gravejac has quit [*.net *.split]
cr1901_modern has quit [*.net *.split]
blazra has quit [*.net *.split]
cesar[m]1 has quit [*.net *.split]
_whitenotifier-5 has quit [*.net *.split]
vup has quit [*.net *.split]
Yatekii has quit [*.net *.split]
Niklas[m]1 has quit [*.net *.split]
fevv8[m] has quit [*.net *.split]
Evidlo has quit [*.net *.split]
MadHacker has quit [*.net *.split]
gekh has quit [*.net *.split]
_florent_ has quit [*.net *.split]
lf has quit [*.net *.split]
sorear has quit [*.net *.split]
tucanae47_ has quit [*.net *.split]
whitequark[m] has quit [*.net *.split]
esden has quit [*.net *.split]
phire has quit [*.net *.split]
JJJollyjim1 has quit [*.net *.split]
kmc has quit [*.net *.split]
Bertl_zZ has quit [*.net *.split]
awygle has quit [*.net *.split]
Ultrasauce has quit [*.net *.split]
Qyriad has quit [*.net *.split]
zignig has quit [*.net *.split]
agg has quit [*.net *.split]
GenTooMan has quit [*.net *.split]
nspaced has quit [*.net *.split]
lsneff has quit [*.net *.split]
tannewt has quit [*.net *.split]
XgF has quit [*.net *.split]
levi has quit [*.net *.split]
gatecat has quit [*.net *.split]
sensille has quit [*.net *.split]
Stary has quit [*.net *.split]
miek has quit [*.net *.split]
mithro has quit [*.net *.split]
alanvgreen has quit [*.net *.split]
DX-MON has quit [*.net *.split]
key2 has quit [*.net *.split]
rohitksingh has quit [*.net *.split]
whitequark has quit [*.net *.split]
ronyrus has quit [*.net *.split]
TD-Linux has quit [*.net *.split]
Degi has quit [*.net *.split]
aquijoule_ has quit [*.net *.split]
d1b2 has quit [*.net *.split]
FL4SHK has quit [*.net *.split]
bob_twinkles has quit [*.net *.split]
hell__ has quit [*.net *.split]
electronic_eel has quit [*.net *.split]
lethalbit has quit [*.net *.split]
proteusguy has quit [*.net *.split]
kbeckmann has quit [*.net *.split]
anuejn has quit [*.net *.split]
trabucayre has quit [*.net *.split]
roamingr1 has quit [*.net *.split]
asu has quit [*.net *.split]
vmedea[m] has quit [*.net *.split]
bubble_buster has quit [*.net *.split]
plaes has quit [*.net *.split]
revolve has quit [*.net *.split]
pftbest_ has quit [*.net *.split]
lkcl has quit [*.net *.split]
bgs has quit [*.net *.split]
moony has quit [*.net *.split]
Lord_Nightmare has quit [*.net *.split]
FFY00_ has quit [*.net *.split]
tpw_rules has quit [*.net *.split]
modwizcode has quit [*.net *.split]
jfng has quit [*.net *.split]
bsmt has quit [*.net *.split]
nickoe has quit [*.net *.split]
emily has quit [Ping timeout: 276 seconds]
phire has joined #nmigen
mithro has joined #nmigen
nelgau has joined #nmigen
mithro has joined #nmigen
mithro has quit [Changing host]
nelgau has quit [Ping timeout: 245 seconds]
nelgau has joined #nmigen
emily has joined #nmigen
nelgau has quit [Ping timeout: 245 seconds]
asu has joined #nmigen
roamingr1 has joined #nmigen
vmedea[m] has joined #nmigen
Evidlo has joined #nmigen
blazra has joined #nmigen
fevv8[m] has joined #nmigen
JJJollyjim has joined #nmigen
whitequark[m] has joined #nmigen
cesar[m]1 has joined #nmigen
Niklas[m]2 has joined #nmigen
jfng has joined #nmigen
nelgau has joined #nmigen
nelgau has quit [Ping timeout: 245 seconds]
nelgau has joined #nmigen
nelgau has quit [Ping timeout: 240 seconds]
<lkcl> whitequark: you saw the segfault in write_cxxsim "goes away" if a yosys "memory" pass is added?
<whitequark[m]> sure
<whitequark[m]> if you have a minimal test case, i'll be happy to fix the underlying bug
<lkcl> 1 sec let me track it on irc log from yesterda
<lkcl> the repro case is brain-dead simple, it's a module-in-a-module. just the module with the reg-write doesn't segfault.
<lkcl> very bizarre
<whitequark[m]> you're not using `default_nettype none
<whitequark[m]> wait, nevermind
<whitequark[m]> thing_w_addr is defined, just not assigned
<whitequark[m]> this code is clearly pathological, but you're right in that cxxrtl should not be segfaulting
<lkcl> i know!
<lkcl> it's bizarre
<lkcl> in the "original" it was assigned
<whitequark[m]> it's not really bizarre, the code that emits memory writes is likely mishandling the case of write to all undef
<whitequark[m]> note that once i fix the segfault, your original problem is unlikely to go away
<lkcl> however as i reduced the case more and more, even the assignment being removed still caused segfaults
<lkcl> here's the original: https://ftp.libre-soc.org/spr_orig.v
<lkcl> the assignment is definitely there.
<lkcl> ls180.cpp takes a stunning *12 minutes* to compile on a 4.8ghz i9 btw :)
<whitequark[m]> okay, this is not a bug in cxxrtl
<lkcl> but it turns out to be the only reliable way
<lkcl> interesting!
<whitequark[m]> this is a bug in the `flatten` pass
<whitequark[m]> ... which i introduced
<whitequark[m]> ... while working on cxxrtl earlier
<lkcl> ahh that makes sense (given 2 modules). it would explain why when there was only 1 module there's no segfault
<whitequark[m]> ah, actually, not quite
<whitequark[m]> it's an omission in the flatten pass
<whitequark[m]> i'll just fix it
<lkcl> nice
<lkcl> we're running temporarily with an older version of yosys (until the tape-out deadline), i can live with workarounds for now
<whitequark[m]> i'll send a PR within a few minutes
<lkcl> so no pressure on you
<whitequark[m]> it's a very easy fix
<lkcl> ah cool
<lkcl> test works perfectly btw.
<lkcl> simulated JTAG, using JTAG-to-wishbone, uploaded a short program into "memory", hit reset (JTAG-to-DMI) and it runs
<lkcl> extremely cool
<whitequark[m]> nice!
<whitequark[m]> here you go
<lkcl> that was easy. ahh and the "memory" pass i am guessing would have done that
<whitequark[m]> even just doing proc before flatten would do it
<whitequark[m]> it's a subtle pass sequencing issue
<whitequark[m]> well, the segfault was caused by a subtle pass sequencing issue. the bug was there regardless
<lkcl> the slightly scary bit now is that we have to do *gate-level* cxxsim
<lkcl> using the VHDL cell library definitions, and the VHDL-subset-output from coriolis2
<lkcl> is it possible to do individual modules with write_cxxsim?
<whitequark[m]> what do you mean?
<lkcl> coriolis2, after it's done its layout, can extract the entire netlist *back* out as subset VHDL files (!)
<lkcl> we want to simulate that using cxxsim
<lkcl> but, to give some idea of the size: compiling those (350) files with ghdl resulted in a whopping 160 mb simulation binary
<lkcl> if i try to do write_cxxsim on the entire design it's quite likely to result in a cpp file of several hundred thousand lines in length
<whitequark[m]> that's normal
<lkcl> (because it's gate-level)
<lkcl> compilation time could be several hours
<whitequark[m]> several million is more likely
<whitequark[m]> yes
<lkcl> yeah
<whitequark[m]> that's expected with gate level cxxrtl models
<lkcl> i'd like to be able to do that as a parallel build
<lkcl> by having multiple separate cpp files, one per module
<whitequark[m]> are you not flattening?
<lkcl> at the moment (before P&R) i'm just doing "write_cxxsim"
<whitequark[m]> that flattens everything into a single module
<lkcl> i'm wondering / exploring what the possibilities here
<lkcl> yes. which is fine for the pre- P&R one
<whitequark[m]> if you don't flatten, you get a severe performance penalty
<lkcl> takes 12 minutes, the output (ls180.cpp) is 60,000
<lkcl> okaaay
<whitequark[m]> try running your design with `write_cxxsim -noflatten`
<whitequark[m]> and check the return value of `p_top->eval()`
<whitequark[m]> not flattening slows down your simulation by a factor of at least that much, in reality probably an order of magnitude more
<lkcl> well, that might be ok. we'll only be running for a few thousand clock cycles
<whitequark[m]> this is still the case for non-flattened gate-level simulations
<lkcl> i can live with that: the program being "run" is only 6 instructions long
<whitequark[m]> it is likely that the gain from parallel compilation will be more than offset by the performance hit of `-noflatten`
<whitequark[m]> I recommend running a compilation (for several hours, yes) with `write_cxxrtl -noflatten` on the gate level netlist first, and considering whether the reduction in performance is worth the potential gain from parallelized build
* lkcl thinks
<lkcl> ok i'll experiment
<lkcl> but it's at least possible?
<whitequark[m]> no, because according to my measurements, it provides no benefit
<whitequark[m]> (that is, there is no option to use a file per module)
<lkcl> ahh
<whitequark[m]> i was never able to find any significant end-to-end performance improvement, no matter the scenario, from simulating non-flattened netlists
<lkcl> interesting
<whitequark[m]> and if you have a flattened netlist, it is just one module anyway
<whitequark[m]> it would be, essntially, trivial to add an option to split everything with a module per file
<whitequark[m]> i just don't see any point in it
<lkcl> ahh i remember an option that verilator has. the (flattened) netlist is still split out into multiple cpp files
<lkcl> that gives the best of both worlds
<whitequark[m]> verilator does things very differently
<whitequark[m]> that doesn't necessarily mean better. in some scenarios, cxxrtl is already faster than verilator
<lkcl> cool :)
<whitequark[m]> it would not be easily possible to adapt what verilator does to cxxrtl. in general, i consider cxxrtl a simulator in a class of its own, rather than "verilator for yosys"
<lkcl> yeyeh
<lkcl> i really must try not to get distracted by wishing to see these things for myself, you know what i mean :)
<lkcl> and trust the research you've done
<whitequark[m]> you can do what i suggested and evaluate whether there is a performance benefit
<whitequark[m]> if there is, i'll happily update cxxrtl to have the option you want
<lkcl> appreciated
<lkcl> it's an intriguing counter-intuitive thing
<whitequark[m]> the implementation can get rather annoying, e.g. people will also want build system integration that is required for compiling multiple files, and such
<whitequark[m]> the current implementation is much easier to integrate, since it is just two fixed files
<whitequark[m]> (one in some cases)
<lkcl> yeyeh
<kbeckmann> neat, fyi the above PR also solves the problem i had a few days ago with the same root issue (array access with a wire as an index).
<lkcl> anyway - thank you for this amazing work.
<lkcl> kbeckmann: cool.
<whitequark[m]> kbeckmann: glad to hear it!
nelgau has joined #nmigen
nelgau has quit [Ping timeout: 268 seconds]
vnksnkr has joined #nmigen
vnksnkr has quit [Quit: vnksnkr]
vnksnkr has joined #nmigen
<jfng> ... I hit this exact bug yesterday (by simulating litedram with cxxrtl), and this PR fixed it
<jfng> thank you !
Funca has joined #nmigen
<Funca> Hi! I've got a question regarding verification.
<Funca> When I try to verify a module I can see that the engine injects data through the ports, but I was wondering if it could also do it in uninitialized registers?
<Funca> I've tried it with reset_less=True but it doesn't work
vnksnkr has quit [Quit: vnksnkr]
revolve has joined #nmigen
nelgau has joined #nmigen
nelgau has quit [Ping timeout: 240 seconds]
nelgau has joined #nmigen
<FL4SHK> whitequark: I see
<FL4SHK> I'll have to think about how to do this once I set up my own HDL
<FL4SHK> I'm currently making a statically typed interpreted language intended for making DSLs
<FL4SHK> I plan on stealing some ideas from nMigen for it
<FL4SHK> using multiple HDLs is fun
<FL4SHK> not so much for the same project
<FL4SHK> but for multiple projects? Yes please
<FL4SHK> I also want to borrow ideas from VHDL and SV
<FL4SHK> spitting out human-readable Verilog and VHDL would be the goal
<FL4SHK> maybe just VHDL
<whitequark[m]> ambitious
<FL4SHK> since apparently you can do formal verification with GHDL synthesis
<FL4SHK> yes
<FL4SHK> I've started writing up the interpreted language's grammar
Funca has quit [Quit: Connection closed]
thorns514 has joined #nmigen
thorns51_ has joined #nmigen
thorns514 has quit [Ping timeout: 268 seconds]
thorns514 has joined #nmigen
thorns51_ has quit [Ping timeout: 258 seconds]
thorns51_ has joined #nmigen
thorns514 has quit [Ping timeout: 258 seconds]
thorns51_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Funca has joined #nmigen
<_whitenotifier-5> [nmigen] slan synchronize pull request #602: Add synth_design_options override for vivado - https://git.io/Jmbuk
<_whitenotifier-5> [nmigen] codecov[bot] edited a comment on pull request #602: Add synth_design_options override for vivado - https://git.io/Jmbuw
<_whitenotifier-5> [nmigen] codecov[bot] edited a comment on pull request #602: Add synth_design_options override for vivado - https://git.io/Jmbuw
<_whitenotifier-5> [nmigen] codecov[bot] edited a comment on pull request #602: Add synth_design_options override for vivado - https://git.io/Jmbuw
<_whitenotifier-5> [nmigen] codecov[bot] edited a comment on pull request #602: Add synth_design_options override for vivado - https://git.io/Jmbuw
<_whitenotifier-5> [nmigen] codecov[bot] edited a comment on pull request #602: Add synth_design_options override for vivado - https://git.io/Jmbuw
<_whitenotifier-5> [nmigen] slan synchronize pull request #602: Add synth_design_options override for vivado - https://git.io/Jmbuk
<_whitenotifier-5> [nmigen] codecov[bot] edited a comment on pull request #602: Add synth_design_options override for vivado - https://git.io/Jmbuw
<_whitenotifier-5> [nmigen] slan commented on pull request #602: Add synth_design_options override for vivado - https://git.io/JOvtD
<_whitenotifier-5> [nmigen] slan closed pull request #602: Add synth_design_options override for vivado - https://git.io/Jmbuk
<_whitenotifier-5> [nmigen] slan opened pull request #606: Feature/vivado synth opts - https://git.io/JOvqE
<_whitenotifier-5> [nmigen] slan opened pull request #607: lib.fifo: add custom domain to sync FIFOs - https://git.io/JOvqD
<_whitenotifier-5> [nmigen] codecov[bot] commented on pull request #606: Feature/vivado synth opts - https://git.io/JOvqF
<_whitenotifier-5> [nmigen] codecov[bot] edited a comment on pull request #606: Feature/vivado synth opts - https://git.io/JOvqF
<_whitenotifier-5> [nmigen] codecov[bot] commented on pull request #607: lib.fifo: add custom domain to sync FIFOs - https://git.io/JOvmn
<_whitenotifier-5> [nmigen] codecov[bot] edited a comment on pull request #607: lib.fifo: add custom domain to sync FIFOs - https://git.io/JOvmn
<_whitenotifier-5> [nmigen] codecov[bot] edited a comment on pull request #607: lib.fifo: add custom domain to sync FIFOs - https://git.io/JOvmn
<_whitenotifier-5> [nmigen] codecov[bot] edited a comment on pull request #606: Feature/vivado synth opts - https://git.io/JOvqF
<_whitenotifier-5> [nmigen] codecov[bot] edited a comment on pull request #607: lib.fifo: add custom domain to sync FIFOs - https://git.io/JOvmn
Funca has quit [Quit: Connection closed]
vnksnkr has joined #nmigen
bvernoux has joined #nmigen
thorns514 has joined #nmigen
<_whitenotifier-5> [nmigen] anuejn commented on pull request #607: lib.fifo: add custom domain to sync FIFOs - https://git.io/JOvr7
vnksnkr has quit [Read error: Connection reset by peer]
vnksnkr has joined #nmigen
<lkcl> whitequark: aaaargh, flatten - on a 64-bit multiplier - with 12,000 gates - aiyaaaa :)
* lkcl sinking feeling but in a hilarious way
* lkcl going to get some tea, to prevent myself from banging my head against the keyboard
revolve has quit [Read error: Connection reset by peer]
revolve has joined #nmigen
pftbest has joined #nmigen
<_whitenotifier-5> [nmigen] slan commented on pull request #607: lib.fifo: add custom domain to sync FIFOs - https://git.io/JOvMZ
thorns514 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<_whitenotifier-5> [nmigen] anuejn commented on pull request #607: lib.fifo: add custom domain to sync FIFOs - https://git.io/JOvya
vnksnkr has quit [Ping timeout: 258 seconds]
pftbest has quit [Remote host closed the connection]
pftbest has joined #nmigen
pftbest has quit [Ping timeout: 240 seconds]
pftbest has joined #nmigen
thorns514 has joined #nmigen
Lord_Nightmare has joined #nmigen
<lkcl> whitequark: another one for you - https://ftp.libre-soc.org/ls180bug.v
<lkcl> yosys repro commands are in the comment field at the top.
<lkcl> ERROR: Assert `!for_debug' failed in backends/cxxrtl/cxxrtl_backend.cc:1332.
<lkcl> which iiis... here
<lkcl> User cells.
<lkcl> that's interesting. if specifying from -g0 to -g3 there's no assert
<lkcl> -g4 (default) however throws the assert
<lkcl> got another one lol
* lkcl whew
<lkcl> ERROR: Assert `cell_module != nullptr && cell_module->wire(conn.first) && conn.second.is_wire()' failed in backends/cxxrtl/cxxrtl_backend.cc:1339.
<lkcl> will track that down as well
lf has joined #nmigen
<lkcl> haack-ptooi, dang that took forever
<lkcl> the original ls180_ghdl.v is a *million* lines *splutter*
<lkcl> ouaff ok 1am here. had enough. tracked them here. night all https://bugs.libre-soc.org/show_bug.cgi?id=622