Tuesday, 2020-08-11

*** tpb has joined #yosys00:00
*** Degi has quit IRC00:28
*** Degi_ has joined #yosys00:28
*** Degi_ is now known as Degi00:28
*** kristianpaul has quit IRC00:33
*** kristianpaul has joined #yosys00:34
*** cr1901_modern has joined #yosys01:04
*** emeb_mac has quit IRC01:23
*** emeb_mac has joined #yosys01:26
*** Forty-Bot has quit IRC02:20
*** tux3 has quit IRC03:03
*** nmz787 has quit IRC03:04
*** xtro has quit IRC03:04
*** FL4SHK has quit IRC03:04
*** FL4SHK has joined #yosys03:06
*** citypw has joined #yosys03:08
*** xtro has joined #yosys03:11
awyglei swear i've hit this error before, but can somebody suggest a cause for "Assertion failure: it != port_fanin.end()"03:46
awyglein nextpnr-ecp5?03:46
*** _whitelogger has quit IRC03:54
*** _whitelogger has joined #yosys03:56
awygleit seems to be related to the --out-of-context argument04:32
awygle(or alternately, something which is only not optimized out because of the --out-of-context argument, i suppose)04:32
*** emeb_mac has quit IRC06:28
*** kraiskil has joined #yosys06:31
*** xtro has quit IRC06:36
*** Cerpin has quit IRC07:18
*** Asu has joined #yosys07:41
*** Asu has left #yosys07:42
*** jakobwenzel1 has joined #yosys07:44
*** FireFox317 has joined #yosys08:02
*** proteusguy has quit IRC08:03
*** somlo has quit IRC08:04
*** kraiskil has quit IRC08:05
*** kraiskil has joined #yosys08:07
*** kraiskil has quit IRC08:39
*** kraiskil has joined #yosys08:43
*** kraiskil has quit IRC09:07
*** jakobwenzel1 has quit IRC09:42
*** jakobwenzel1 has joined #yosys10:19
*** kraiskil has joined #yosys10:31
*** FireFox317 has quit IRC10:33
*** FireFox317 has joined #yosys10:52
*** kraiskil has quit IRC11:10
*** kraiskil has joined #yosys11:23
whitequarkawygle: seems like a reportable bug if nothing else11:33
daveshahJust saw this in the backlog11:33
daveshahFeel free to report it, but the core problem is the current timing analysis code is terrible11:33
*** somlo has joined #yosys11:41
*** FireFox317 has quit IRC11:41
*** FireFox317 has joined #yosys11:49
*** kraiskil has quit IRC12:53
*** kristianpaul has quit IRC12:56
*** kristianpaul has joined #yosys12:57
*** Thorn has quit IRC13:40
*** Cerpin has joined #yosys13:53
*** emeb has joined #yosys13:58
*** jakobwenzel1 has quit IRC13:59
*** jakobwenzel1 has joined #yosys14:03
*** citypw has quit IRC14:10
*** citypw has joined #yosys14:21
*** ayazar1 has joined #yosys14:28
*** proteusguy has joined #yosys14:29
*** jakobwenzel1 has quit IRC14:33
*** ayazar1 has quit IRC14:37
*** Thorn has joined #yosys15:04
knielsenset_dont_touch [get_nets -of_objects [get_cells -hierarchical -filter {@ref_name =~ "xaui6g_pads_x1"}]]15:23
knielsenoops, sorry about that mis-paste :-/15:23
*** xtro has joined #yosys15:26
*** az0re has quit IRC15:36
*** FireFox317 has quit IRC15:39
*** citypw has quit IRC16:02
*** az0re has joined #yosys16:36
*** FireFox317 has joined #yosys16:39
whitequarkmwk: daveshah: so i finally completely reversed the very last macrocell bits of ATF15xx17:12
whitequarkand i discovered that it has a single bit that controls three things at once17:12
whitequark1) ff init value 2) inverter between xor.o and ff.d 3) part of a priority encoder routing two product terms17:13
mwkwhat17:16
mwklike.... why17:17
LoftyThat's um.17:17
LoftyGonna be fun to route17:17
whitequarki spent more than a week just reverse engineering this17:17
whitequarkin the end i had to generate 32 bitstreams, use BSCAN to apply test vectors, build truth tables, use an SMT solver to minimize those, and then hand-minimize the 32 controlling expressions into something resembling 117:18
mwkwtf17:18
whitequarktheir datasheet is not just completely wrong about that part of the macrocell but also incredibly misleading17:19
whitequarkit has basically nothing to do with reality17:19
whitequarki wish i never even looked at it17:19
daveshahThis is not the first time this thing happens17:20
daveshahThe iCE40 datasheet is very confusing about global buffer numbering17:21
emebAtmel datasheets have always been... "interesting". And being acquired by MCHP isn't going to make them less interesting.17:21
daveshahCost me a few days when I was doing the up5k re17:21
*** m4ssi has joined #yosys17:27
*** emeb_mac has joined #yosys17:31
awygletbf the internals of the ice40 are also very confusing about global buffer numbering17:36
awyglewhitequark: daveshah: ok i'll try to reduce it then, thanks17:48
daveshahDon't worry if you don't get round to it, hopefully that whole file will be significantly rewritten in a few months17:49
daveshahunless you need an interim fix17:49
awygleone would be helpful but it's not required17:51
awyglethis came up in the context that i have a module that needs to be able to run at 266.67 MHz, so i wanted to set up an nmigen unit test that made sure i didn't break that constraint17:52
awygleobviously i need to test it in the full system but if it doesn't run that fast out-of-context then it's already game over17:52
*** kraiskil has joined #yosys17:58
*** kraiskil has quit IRC18:15
*** m4ssi has quit IRC18:17
*** Asu has joined #yosys19:03
whitequarkdaveshah: mwk: any ideas for making a model / black box of a macrocell?19:54
whitequarkunlike something like an FF the macrocell i have has a *ton* of options19:54
*** Asu has quit IRC20:08
*** Asu has joined #yosys20:08
*** FireFox317 has quit IRC20:37
*** m4ssi has joined #yosys20:45
*** m4ssi has quit IRC20:53
*** Asu has quit IRC20:59
*** kristianpaul has quit IRC21:24
*** kristianpaul has joined #yosys21:29
Loftywhitequark: you could always try a very high-level model and then gradually lower it, I guess21:31
LoftyDo you have plans for the prjbureau stuff to make it into Yosys?21:32
whitequarkLofty: sure21:33
whitequarki mean, i already use yosys. it is an integral part of the fuzzer itself21:34
LoftyI haven't looked at the internals of it other than the published HTML docs, so I'm fairly naive in that area21:34
whitequarkbecause my other three options are: manually construct EDIF netlists, manually construct TT2 files, or pulling in the entirety of WinCUPL21:34
whitequarkwell, i had to do the second option for a few cases anyway, because there are CPLD features that can't be exploited from just EDIF (yes, really)21:35
whitequark(yes, it's exactly as insane as it sounds)21:35
whitequarkthere's a cells.v with behavioral models of all primitives accepted in EDIF21:36
whitequarkuh, except LATCH and JKFFEARS21:36
whitequarkformer because lazy, latter because i don't think you can actually model that in synthesizable verilog21:37
whitequark... or in this CPLD for that matter21:37
mwk... wtf is JKFFEARS21:37
LoftyThat's a terrifying primitive name21:37
mwkyes21:37
whitequarkmwk: JK flip-flop with enable, async reset and async set.21:38
whitequark(async preset?)21:38
mwkah21:38
whitequarkas far as i know (i never tried) it works like this21:39
whitequark...21:39
whitequarkokay i actually don't know how it works for sure21:39
LoftyIt'll be nice to have a documented CPLD in Yosys21:39
whitequarki'm pretty sure the vendor docs tell you to not touch the JK flops21:40
whitequarki'm not really sure why it exists in first place or how you'd fit it into the CPLD21:40
whitequarklike,21:40
whitequarkit would maybe configure the FF as a latch with the J&K inputs feeding an inverse of the Q into D?21:41
whitequarkand the J-only/K-only states would be OR'd with user-provided async reset/set?21:41
whitequarkok yeah i can see it working that way. but ... why would you do that21:41
mwkwouldn't J/K inputs be synchronous?21:42
whitequarkhence, configure it as a latch21:42
whitequarkhm21:42
whitequarkwait, you're right21:42
mwk... or is it literally a J/K latch, as... discussed earlier21:42
Lofty[22:41:54]  whitequark: ok yeah i can see it working that way. but ... why would you do that <-- I find myself asking this question a lot in FPGA architecture21:42
whitequarkmodule JKFFEARS(input CLK21:42
whitequarkit's synchronous21:42
LoftySo it's a JK *flop*?21:43
whitequarkapparently21:43
whitequarkmodule JKFFEARS(input CLK, /*!*/AR, /*!*/AS, CE, J, K, output reg Q);21:43
whitequarkhere's the full signature21:43
Loftymwk: dfflegalize, now with support for things that are not D flip-flops21:43
Lofty:P21:43
LoftyAre the !s for negative true?21:44
mwkLofty: it's never been limitted to D flip-flops21:44
whitequarkLofty: i don't remember21:44
mwk(it also does D latches and SR latches)21:44
Loftymwk: I am aware, but was joking about the name21:44
mwkyeah, it's misnamed as is customary for yosys stuff dealing with FFs21:45
Lofty[22:45:42]  mwk: yeah, it's misnamed as is customary for yosys stuff <--- FTFY21:46
whitequarkanyway, i'm still not sure what to do with the macrocell21:46
whitequarkit has 24 configuration bits21:47
mwkwell21:47
whitequarksome of those are trivially easy, just make a parameter that's 0/121:47
whitequarksome of the others are enumerations or have multiple functions21:47
LoftyI think it depends on what your goal is: reimplement it, or abstract over it21:47
whitequark"something that nextpnr can place" and "something i can expand the bitstream back into"21:48
whitequarkthese need not be the same representation21:48
daveshahI'm really not sure that nextpnr is the right tool here21:48
daveshahIt feels a bit like using gcc on a pic12f21:48
daveshah*for21:48
mwk... we have one (1) cpld target in yosys right now, and it's uhh a mess I don't quite understand21:48
daveshahMy gut feeling is that something custom and heavily SAT based would give much better results for not much more effort21:49
whitequarkdaveshah: the problem is that i'm not familiar with SAT solvers and i don't really know how to write a PNR tool from scratch21:49
whitequarki can more or less how the nextpnr models programmable logic internally so i thought i could probably hack something together21:50
whitequarkif that's a bad idea i might just leave pnr to someone else?21:50
whitequarki did work on gp4par but i did not enjoy working on gp4par21:50
daveshahI mean hacking something together would be fine21:50
daveshahwith nextpnr21:50
whitequarkone significant issue is that i think yosys' $sop cell is a bad fit for this cPLD21:51
whitequarkbecause it treats product terms quite fluidly21:51
whitequarkyosys should probably just synthesize an AIG and leave it to the PNR tool to turn it into SOP as appropriate21:52
whitequarkbecause that's the only way to support cascade, foldback, and variable PTs available depending on FF options21:52
whitequarkwell either that or group $sop with flops, like a LUTFF primitive, but that seems like too much effort in a wrong place21:53
daveshahYeah definitely seems like better placed in PnR21:53
whitequarktbh, even AIGs are not ideal21:53
mwkhuh, aig-to-sop(ish) in p&r21:53
mwkinteresting21:54
daveshahI have no real idea about CPLd details though21:54
whitequarkbecause there's the hard XOR gate stuck between the SOP and the FF/OB21:54
whitequarkso if you turn *all* user logic into AIG, you have to re-extract XOR21:54
whitequarkthe vendor fitter seems to do something (not sure if AIG, though strongly suspect it, but it does strongly normalize)21:54
whitequarkit works badly.21:55
Loftywhitequark: for your consideration: full adders are essentially majority-of-3 gates, so you can use them in a MIG flow21:57
whitequarkmwk: daveshah: so the idea is that you can borrow some PTs from the ST to use: custom OE rather than GOEn, custom CLK rather than GCLKn, custom AR/AS21:57
whitequarkyou can also forward the ST to the next macrocell's ST while (if you want) borrowing PT2 to drive FF or OB of this macrocell21:58
mwkright, sounds like a lot of cplds21:58
whitequarkand there's the foldback thin21:58
whitequarkthis, to me, means that you want to synthesize at PT granularity, not SOP granularity21:58
whitequarki'm actually not sure how to synthesize PTs, it's a 40-input-wide AND gate22:00
whitequarkwith optional inverters on each input22:00
LoftyIs that frangible, or do you have exactly one output?22:00
whitequark*up-to-40-input wide22:01
whitequarkLofty: exactly one22:01
whitequarkwell22:01
whitequark"frangible" doesn't make sense in a CPLD context22:01
whitequarkit works like this. each logic block (16 macrocells) chooses which 40 inputs it wants to have, picked out of the global bus where every pin and FF Q signal on chip goes22:02
whitequarkeach MC has 5 PTs, where each PT picks any of those 40 inputs22:02
whitequarkfrangibility is a way around a limitation of LUT arches, but CPLDs have different limitations in first place22:03
*** awordnot has quit IRC22:05
*** awordnot has joined #yosys22:05
LoftyHmm. That's useful to know22:08
awyglewhitequark: "i did work on gp4par but i did not enjoy working on gp4par" any particular reason? or just greenpaks are weird?22:09
whitequarkawygle: it's written in azonenberg's dialect of C++ and not only i do not like C++, we also prefer different subsets of C++ too22:11
awygleah22:11
whitequarki'm fine with contributing to it (and might do more of that in the future), but i don't wanna do my PAR on top of it22:11
whitequarkwell on top of the library22:11
awygle"xbpar" iirc yeah22:11
whitequarki'm not even sure if xbpar is the right fit for the task22:11
whitequarkwhat daveshah talked about sounds much more sensible22:12
whitequarkgp4 is a LUT arch, too22:12
awyglerqou did some tests on sat-based stuff for the coolrunner-ii i believe22:12
whitequarkwhere?22:12
awyglegood question. i'll try to dig it up22:12
awyglehm can't find it. rqou, did i remember this wrong?22:17
awygleoh, here https://github.com/rqou/openfpga/tree/ng-par/src/xbpar22:30
tpbTitle: openfpga/src/xbpar at ng-par · rqou/openfpga · GitHub (at github.com)22:30
awygledunno if that's everything tho :shrug: i'm done hunting in any case22:31
*** lf has quit IRC23:13
*** lf has joined #yosys23:14
*** dxld has quit IRC23:16
*** dxld has joined #yosys23:18

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