Friday, 2020-06-26

*** tpb has joined #yosys00:00
cr1901_modernBtw, I got this warning when compiling nextpnr-generic (for example) about strict aliasing for the pybindings: http://ix.io/2qc9 Is this bad? Or is it unavoidable in the context of whatever horrifying thing Boost does to generate Python bindings?00:02
*** maartenBE has quit IRC00:11
*** futarisIRCcloud has joined #yosys00:17
*** maartenBE has joined #yosys00:47
az0remithro: Noice01:03
mithrocr1901_modern: Guess so :-P -- First step is to make them run in iverilog / verilator now01:08
*** Degi has quit IRC01:59
*** Degi has joined #yosys02:00
*** citypw has joined #yosys02:26
*** FFY00 has quit IRC02:54
*** FFY00 has joined #yosys02:54
*** az0re has quit IRC03:49
*** az0re has joined #yosys04:06
*** AdamHorden has quit IRC04:47
*** AdamHorden has joined #yosys04:55
*** AdamHorden has left #yosys05:54
*** emeb_mac has quit IRC06:02
*** jakobwenzel has joined #yosys06:36
*** FabM has joined #yosys07:06
*** m4ssi has joined #yosys07:33
*** dys has quit IRC07:50
*** Asu has joined #yosys08:13
*** az0re has quit IRC09:16
*** citypw has quit IRC09:30
*** dys has joined #yosys09:53
whitequarkdaveshah: PTAL at https://github.com/YosysHQ/prjtrellis/pull/14510:05
tpbTitle: Add WASI platform support by whitequark · Pull Request #145 · YosysHQ/prjtrellis · GitHub (at github.com)10:05
whitequarkcr1901_modern: seems like a bug, but not sure10:06
daveshahwhitequark: looks good, I'll take a proper look later. The multithreading stuff was just for fuzzing, so won't cause any loss with wasm10:10
whitequarkyeah I assumed so10:12
*** dys has quit IRC12:35
*** dys has joined #yosys13:56
whitequarkdaveshah: i think #145 works well now14:05
whitequarkbtw it looks like nextpnr-ecp5 fails --test too14:08
whitequarksame bel z check issue14:08
whitequarkwell, similar14:09
*** X-Scale has quit IRC14:43
*** emeb has joined #yosys14:50
daveshahwhitequark: looks good, merged, thanks15:02
daveshahI will look into the test issue and set up CI to actually run them, at least for a few device variants15:02
*** jfcaron_ has joined #yosys15:06
*** X-Scale has joined #yosys15:07
*** jakobwenzel has quit IRC15:09
*** jfcaron_ has left #yosys15:12
*** FabM has quit IRC15:19
*** laudecay1 has joined #yosys15:27
laudecay1hiya so i am writing verilog and i want to write a thing like systemverilog's count_bits or count_ones, but in as few gates as possible15:28
laudecay1it gets mad when i say something like assign a = $countbits b; though15:28
laudecay1is there some kind of shorthand for this in verilog? or do i need to write a module myself?15:29
LoftyYou would have to write a module yourself15:30
laudecay1ah ok15:30
laudecay1thanks!15:31
LoftyIt more or less boils down to add-reducing your input, except I don't think Verilog lets you do that directly15:31
laudecay1what do you mean by add-reduce?15:32
LoftyDo you know how things like or-reduce work?15:33
Lofty(unary | on a signal)15:33
laudecay1i'm currently writing code that produces verilog, and i need to be able to write it to support a variety of input and output sizes- so my plan was to make $INPUT_SIZE bitmasks, or them with the input, check equality of each, then add those15:33
laudecay1i come from a math background with a bit of C, i know what bitwise | does if that's what you're asking15:34
laudecay1oh like a map-reduce thing on the bits of the input15:34
Loftyx | y is binary |15:34
Lofty|x is like x[0] | x[1] | ...15:35
laudecay1yeahhhhhh ok i haven't seen that notation but that's like a haskell fold15:35
LoftyHere you want x[0] + x[1] + x[2] ...15:35
laudecay1yeah15:35
LoftyThough, have fun with expression widths there15:35
laudecay1does verilog get mad about expression widths?15:35
LoftyNo, Verilog *is* mad about expression widths15:35
laudecay1:(15:36
laudecay1big sad15:36
laudecay1ok hm.15:36
laudecay1i can handle breaking up expression widths, but15:36
laudecay1how would you recommend doing this with fewest gates possible?15:36
LoftyBy "gate" do you mean ASIC gates, or FPGA LUTs?15:37
laudecay1like, would the "and it with a bunch of bitmasks" approach be reasonable?15:37
LoftyI don't think so, really.15:37
laudecay1fewest 2-input and + not gates is ideal if possible15:38
laudecay1i mean like boolean algebra gates15:38
LoftyI wouldn't recommend optimising for AIG15:39
laudecay1i found this paper: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.534.7271&rep=rep1&type=pdf15:39
laudecay1oh i have to optimize for boolean algebra gates- that's like the main constraint of the problem15:39
* Lofty 's XY problem detector goes haywire15:40
laudecay1yeah...... i know it sounds wild15:40
laudecay1we're turning x86 into boolean circuits15:40
LoftyThe most optimal thing to use here is the, uh, `+` operator15:40
laudecay1is a big part of the research15:40
laudecay1in terms of boolean gates that it'll turn into under the hood? won't `+` overflow on each wire?15:41
laudecay1like `b 1 + `b 1 = `b 0 right?15:41
laudecay1`b 01 + `b 01 = `b 1015:42
laudecay1or am i misunderstanding15:42
LoftyThe proposed circuit adds 1-bit results together, then 2-bit results together, then 4-bit results...15:42
laudecay1ohhhhhh15:42
LoftyThe `+` would produce half-adders for single input bits15:43
Loftylaudecay1: https://puu.sh/G0MmO/58e2239336.png <-- from Verilog-2001 standard; 2005 has an equivalent15:46
LoftySo to get a 2-bit result from addition, you need to zero-extend i and j to 2-bit, or assign it to a 2-bit wire15:47
*** laudecay1 has quit IRC15:48
*** laudecay1 has joined #yosys15:50
laudecay1sorry my internet went out15:50
laudecay1back15:50
Lofty<Lofty> laudecay1: https://puu.sh/G0MmO/58e2239336.png <-- from Verilog-2001 standard; 2005 has an equivalent15:50
Lofty<Lofty> So to get a 2-bit result from addition, you need to zero-extend i and j to 2-bit, or assign it to a 2-bit wire15:50
laudecay1oh wow that's really helpful15:51
laudecay1thank you so much!!15:51
*** laudecay1 has quit IRC16:24
*** emeb_mac has joined #yosys16:53
*** emeb_mac has quit IRC16:58
*** dys has quit IRC17:39
*** kraiskil has joined #yosys17:46
*** laudecay1 has joined #yosys17:50
laudecay1hey im back- how do i test a circuit? i have the module signature here: module Population_count_32_to_32(input wire [0:31] a, output wire [0:31] b);17:51
laudecay1i'd read -sv the file, then i run `eval -table a $abstract\Population_count_32_to_32`17:51
laudecay1and i get an error it's failing to parse the table expression a17:52
*** dys has joined #yosys18:07
*** laudecay1 has quit IRC18:12
*** AdamHorden has joined #yosys19:11
*** cr1901_modern has quit IRC19:20
*** cr1901_modern has joined #yosys19:24
*** kraiskil has quit IRC20:06
*** az0re has joined #yosys20:26
az0reHey so I was just perusing the README and I noticed that Yosys already depends on libboost-system-dev, libboost-python-dev, and libboost-filesystem-dev20:27
az0reWhere exactly do these dependencies come from?20:27
daveshahlibboost-python-dev will be from the python bindings20:28
daveshahseems like filesystem is python related too20:28
az0reSo I guess the Boost situation is a bit more complicated than I thought...20:28
daveshahhttps://github.com/YosysHQ/yosys/blob/master/passes/cmds/plugin.cc#L2920:28
tpbTitle: yosys/plugin.cc at master · YosysHQ/yosys · GitHub (at github.com)20:28
*** emeb_mac has joined #yosys20:29
az0reI'm sure whitequark would vigorously oppose any further dependencies, but it's not a blanket ban20:29
daveshahIt's only because the Python support is optional and disabled-by-default20:29
az0redaveshah: Yup, I see, thanks20:30
az0reIs that the only requirement in order to introduce a Boost dependency? That it be disabled by default?20:30
daveshahThat kind of decision would be beyond my pay grade20:57
*** Asu has quit IRC21:31
*** Asuu has joined #yosys21:31
*** m4ssi has quit IRC21:39
whitequarkaz0re: i am vigorously opposed to anything from boost that is not absolutely necessary21:39
whitequarkwhich is to say anything new from boost at all21:40
whitequarkand i'd rather get rid of boost-python; there are better solutions available now, though i think they weren't there when this code was added21:40
daveshahYeah the Yosys Python bindings are actually fairly old now21:41
daveshahThey were held back for ages because of some academic dispute21:41
whitequarkthere's https://github.com/pybind/pybind11 now21:41
tpbTitle: GitHub - pybind/pybind11: Seamless operability between C++11 and Python (at github.com)21:41
whitequarkthat's just 3 years old though, so it didn't exist when the bindings were added, i think21:42
daveshahI guess it would have just about done, but certainly not as well known21:42
whitequarkperhaps not working as well as now either?21:43
whitequarkthe point being, i think boost-python was an appropriate choice *at the time it was added*21:43
whitequarkbut not anymore21:43
daveshahI should look at pybind11 for nextpnr at some point21:43
whitequarkaz0re: if you want to use something like std::filesystem we should find a polyfill that isn't boost-related21:43
whitequarkremember how you (correctly) judged against using some hypergraph partitioner because it used scons? i would rather have to use scons when cross-compiling yosys than b221:44
whitequarkyosys also has this annoying situation where it doesn't use cmake. with nextpnr it's generally easy to add any dependency that uses cmake because it can usually be vendored without much trouble, or just built in the same way as nextpnr itself21:45
whitequarkyosys is special21:45
whitequarkbecause of its baroque makefiles i think that any utility dependency should be just vendored into it, like i did with json1121:46
daveshahEven with nextpnr I am preferring vendoring in these days, for stuff that isn't too big or fast-changing21:47
whitequarkeigen? :)21:48
whitequarki currently actually install it into a temporary prefix in yowasp so that find_package() works21:49
daveshahPossibly a bit tricky with the blas dependency too21:50
daveshahBut I can look into that for sure21:50
whitequarkI... think the cross-builds don't use blas?21:50
whitequarkhm21:50
whitequarkI wonder if they run slower because of that21:51
whitequarkcertainly I can't compile asm-laden fortran into wasm21:51
daveshahThe performance difference is tiny anyway21:51
daveshahI don't think it materially affects any ice40 or ecp5 design, it would be a small part of a small part of runtime21:51
daveshahFor some reason I thought it requires blas, but if it works without then that sounds fine21:52
daveshahI rejected one sparse matrix solver because it was full of non-thread-safe f2c...21:53
whitequarkworks perfectly fine as just a single header21:53
whitequarki'm not actually sure how to make it use blas21:53
whitequarkwell not single header, headers alone21:54
daveshahThat's easy enough then21:54
*** Asuu has quit IRC22:10
emebOK - I've got a super sketchy design ganked from the web that uses a combinatorial loop to do some I2C stuff. It simulates fine and mostly synthesizes OK w/ yosys + nextpnr BUT I get this --- Warning: The network is combinational (run "fraig" or "fraig_sweep")23:13
emebAnd that particular part of the design doesn't work right.23:14
emebso the question is how to stick fraig_sweep in there?23:14
emeb(FWIW - this design apparently works in Xilinx tools, but requires some synthesis pragmas to preserve the structure - ie "keep" on the two nets of the loop)23:15
Loftyemeb: Don't23:32
LoftyThe warning is harmless23:32
LoftyThis is because the network is presented to ABC as a combinational cloud23:33
emebLofty: thx23:35
Loftyemeb: It actually seems the warning is out of date23:36
LoftyYosys runs `ifraig`, and if you use what little help there is within ABC, `fraig -h` suggests `ifraig` as a replacement23:36
emebLofty: haha23:36
emebwell, this logic is nasty so I'm not surprised that it misbehaves in the real world.23:37
LoftyYosys does support `(* keep *)`23:38
LoftySo23:38
emebLofty: heh - that fixed it. Thanks!23:43

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