Friday, 2019-11-08

*** tpb has joined #yosys00:00
*** dys has quit IRC01:30
*** kraiskil has joined #yosys02:07
*** citypw has joined #yosys02:41
*** _whitelogger has quit IRC03:15
*** _whitelogger has joined #yosys03:17
*** craigo has quit IRC03:56
*** PyroPeter has quit IRC04:00
*** PyroPeter has joined #yosys04:13
*** _whitelogger has quit IRC05:12
*** _whitelogger has joined #yosys05:14
*** _whitelogger has quit IRC05:36
*** _whitelogger has joined #yosys05:38
*** _whitelogger has quit IRC06:06
*** _whitelogger has joined #yosys06:08
*** Jybz has joined #yosys06:26
*** Jybz has quit IRC06:35
*** _whitelogger has quit IRC06:54
*** _whitelogger has joined #yosys06:56
*** emeb_mac has quit IRC07:08
*** _whitelogger has quit IRC07:30
*** _whitelogger has joined #yosys07:32
*** m4ssi has joined #yosys09:06
pepijndevosZirconiumX, my script has an assert, so I don't think I need grep. What I ended up doing is specifying everything except -modules09:08
pepijndevosZirconiumX, What exactly are you doing with test/arch/common? I made them work for gowin recently, so maybe I know _something_09:09
ZirconiumXpepijndevos: you'll still need grep :P09:11
pepijndevosHmmm, question of my own: how do I implement a Nextpnr constraint for the generic target in Python? Some of my slices in a tile don't have a DFF.09:11
pepijndevosZirconiumX, to do what? That only limits what is considered a crash, any my assert perfectly describes the crash I want.09:12
ZirconiumXGreat, and what if you find a Yosys bug in the process?09:14
ZirconiumXThat's a crash09:14
pepijndevossure...09:14
ZirconiumXAnd now bugpoint is going off to minimise something entirely different to your target09:14
ZirconiumXIn fact, I bet that's why you needed to ignore modules; because pruning the top-level module produced a different error, no?09:15
*** kraiskil has quit IRC09:15
ZirconiumXAnyway.09:17
pepijndevosOh... you're saying it deleted *everything* and decided that was the most minimal case... yea ok...09:17
ZirconiumXHonestly I think -grep should be required09:19
daveshahpepijndevos: in a real arch it would be a simple validity check problem09:20
daveshahBut that isn't exposed to Python, and Python code in the placer hot path wouldn't be great in any case09:21
daveshahimo, just ignore those cells for now09:21
pepijndevosRight haha09:21
pepijndevosI'll just have 6 slices09:21
ZirconiumXpepijndevos: I just pushed the broken test to the better-flow branch of prjmistral09:22
pepijndevoslink?09:22
ZirconiumXMake sure to clone it in your home directory, because I don't yet have the luxury of the + path, so put it in ~ instead :P09:22
ZirconiumXhttps://github.com/ZirconiumX/mistral09:23
tpbTitle: GitHub - ZirconiumX/mistral: Cyclone V bitstream reverse-engineering project (at github.com)09:23
ZirconiumXIt's mistral/flow/test/intel/shifter.ys09:28
*** flaviusb has joined #yosys09:48
pepijndevosZirconiumX, the problem is in @(posedge CLK or negedge ACn)09:59
ZirconiumXUgh.10:00
ZirconiumXThat's awkward.10:00
pepijndevosNot sure how you'd solve that or why I didn't have this problem (yet)10:00
daveshahYeah, that `if` pattern doesn't correspond to any of the allowed 1364.1 patterns10:00
daveshahThe `en` needs to be inside the `if(!ACn)` and/or `else` not outside of it10:00
daveshahThe rule is that the async set/reset(s) must always be top level if branches inside the `always`10:01
pepijndevosHuh, interesting...10:02
daveshahSee page 9/10 of http://www.iuma.ulpgc.es/~nunez/clases-FdC/verilog/Verilog-IEEE-1364.pdf10:03
ZirconiumXThis is me trying to interpret the vendor FF model10:03
daveshahIt's one of the few parts of Verilog that's actually well defined10:03
daveshahrather than being left up to the synthesis tool to decide what patterns it does/doesn't infer10:03
daveshahAlthough many tools allow more than 1364.1 but Yosys follows it exactly10:03
daveshahI guess that model is intended for simulation; so they didn't pay attention to synthesis rules10:04
ZirconiumXERROR: Async reset \ACn yields non-constant value 1'm for signal \Q.10:04
daveshahYeah, actually the enable is still dodgy10:04
ZirconiumXPresumably it has to be unconditionally reset then?10:04
daveshahTry gating ACn with enable outside of the always10:05
ZirconiumXhttps://github.com/AmeerAbdelhadi/Verilog-Quartus-Mapping-VQM-Netlist-Parser/blob/master/sim/cyclonev_atoms.v#L39410:06
tpbTitle: Verilog-Quartus-Mapping-VQM-Netlist-Parser/cyclonev_atoms.v at master · AmeerAbdelhadi/Verilog-Quartus-Mapping-VQM-Netlist-Parser · GitHub (at github.com)10:06
ZirconiumXHere's the vendor model I'm trying to replicate10:06
daveshahI don't think the async clear is gated by the enable at all?10:07
daveshahSo just have the enable as an if statement in the clocked 'else' part10:07
ZirconiumXI must have gotten it confused with synchronous clear then10:07
ZirconiumXOkay, so now proc_arst doesn't complain10:08
ZirconiumXIt fails to prove equivalence though10:08
ZirconiumXWhich is annoying.10:09
ZirconiumXOn the other hand10:09
ZirconiumXWarning: No SAT model available for cell $techmap$auto$simplemap.cc:420:simplemap_dff$56.$procdff$167_gate ($adff)10:09
ZirconiumXI should probably find/fix this10:09
daveshahYou probably need a techmap and clk2fflogic or sync2async in there10:09
ZirconiumXI'm basing this off the iCE40 script10:11
ZirconiumX5.45. Executing EQUIV_STATUS pass.10:15
ZirconiumXFound 8 $equiv cells in equiv:10:15
ZirconiumX  Of those cells 8 are proven and 0 are unproven.10:15
ZirconiumX  Equivalence successfully proven!10:15
ZirconiumXWoo!10:16
*** craigo has joined #yosys10:53
pepijndevosNiiice10:55
pepijndevosZirconiumX, Micko recommended I based mine of the Efinix tests because they don't have any arch-specific tests in them yet10:56
pepijndevosCurious if fsm.ys works for you... I'm stuck on that one with a weird equivalence bug.10:56
ZirconiumXFirst I've got to get my LUTs in order10:57
pepijndevos(which seems unrelated to my techmap, rather wreduce just deletes a few too many bits)10:57
*** wifasoi has joined #yosys10:57
ZirconiumXI mean, that's indicative of a bug if anything10:58
*** rohitksingh has quit IRC11:18
*** rohitksingh has joined #yosys11:24
pepijndevosProbably, maybe.11:26
pepijndevosHmmmmmmmmm, do cell port names have to map to bel port names? I'm currently just using Gowin bel port names, but it's not happy about that.11:33
pepijndevosAnd the generic packer does a weird thing where the Q is either the LUT F or the DFF Q, while on Gowin they are different things. So maybe I just need to bit the bullet and make my own Python packer.11:36
ZirconiumXdaveshah: I have a really stupid idea. Quartus accepts a Routing Constraints File that lets you map signal paths, and the Quartus Settings File lets you place cells in exact positions. So nextpnr would produce a solution that constrains Quartus to the point where nextpnr's solution is the only valid solution for PnR, and then it can produce a bitstream from there.11:46
*** rohitksingh has quit IRC11:51
mwktbh that seems to be the obvious correct way to use quartus as bitgen-only11:56
mwknot pretty, but Should Work™11:56
*** vidbina_ has joined #yosys11:57
ZirconiumXmwk: it's a stupid idea, you're not meant to *agree* with me :P12:01
mwkZirconiumX: it's what I would actually do :p12:02
mwkwe work with the tools we're given12:02
mwkor well12:02
ZirconiumXThe main question is how long it will take Quartus to realise I've given it the solution12:02
mwkwhat I'd really do is use the same path, but to build a lot of fuzzers12:03
ZirconiumXIndeed, but I'm not as smart as you, mwk :P12:03
mwkyou're severely overestimating the complexity of a routing fuzzer, given device map and control over routing :p12:10
*** kraiskil has joined #yosys12:12
ZirconiumXNo, I'm not :P12:17
pepijndevosIf you know all the wires that exist, and have control over them, you can just fuzz them like any other feature, no? Turn wire off, collect bits, turn wire on, collect bits, compare.12:19
ZirconiumX*If* you know all the wires that exist12:20
mwkpepijndevos: correct12:21
pepijndevosUh, you have control over them, but you can't observe them?12:21
ZirconiumXI have little knowledge of the internal routing12:21
daveshahI'm also not sure if Quartus can just turn arbitrary wires on and off12:21
mwkZirconiumX: this is also a requirement for getting P&R working, though12:21
daveshahI think it still needs a full routed path12:21
mwkso if you can do a nextpnr backend, you can also do a fuzzer12:22
daveshahAnd I presume will create one around constraints if an rcf isn't complete12:22
ZirconiumXYep12:22
ZirconiumXSo I can observe them, but control is questionable12:22
daveshahThe simple correlation approach that xray does would probably suffice12:22
ZirconiumXmwk has automated fuzzers for these bits and I calculated them all by hand12:23
ZirconiumXWell, by manual binary diffing12:23
*** vidbina_ has quit IRC12:37
*** kraiskil has quit IRC12:43
*** wifasoi has quit IRC12:46
pepijndevosdaveshah, IIRC you mentioned yesterday you could do basic packing with a techmap, could you elaborate a bit?13:01
pepijndevosIt seems actually more like extract13:01
daveshahThat was mwk I think13:01
daveshahNot so much the combining cells together side of packing, but more the converting cell types13:02
pepijndevosBut I'm struggling to make it work due to the init parameter... or at all13:02
daveshahWhich is a lot of what nextpnr packing is about as validity checks often mean not so much combining is needed13:02
daveshaheg converting various lut primitives to a single common LUT, same for FF and IO13:02
daveshahFor packing involving merging cells probably a custom pass would be best13:03
tntdaveshah: btw, thanks for ecp5 compressed bitstream, that's really nice \o/13:04
daveshahOh glad it's useful, lmk if you hit an issues13:04
*** vidbina_ has joined #yosys13:07
pepijndevosHmm13:07
mwkpepijndevos: I said yosys passes in general, not just techmap13:18
mwkpmgen might be useful as well, for one13:19
mwk(though I have to admit I haven't fully figured out how pmgen works yet, so take it with a grain of salt)13:19
*** wifasoi has joined #yosys13:22
pepijndevosmwk, ERROR: No such command: pmgen (type 'help' for a command overview)13:25
mwkit's not a command, it's a... framework/code generator to build commands13:31
mwkhave a look at passes/pmgen13:31
pepijndevosCurrently trying to use extract, but seems a dead end due to parameters.13:33
mwkyeah, extract sucks13:33
mwkit's a very one-trick pony13:33
pepijndevosThis is the second time I'm trying to use it and run into the parameter thing.13:33
mwkwhat you need is a more general pattern-matching engine13:34
mwkwhich pmgen tries to be13:34
pepijndevosSometimes I wonder how normal people use Yosys... maybe they just run synth_ice40 and live happily.13:34
mwk(pattern matcher generator)13:34
mwkwell yes13:34
mwkthat's exactly how most people use yosys :p13:35
mwksome days they even use *shudder* options to the synth_whatever pass13:35
mwkI'm not sure I can recommend pmgen though13:39
mwkit feels quite ugh to me13:39
pepijndevosI mean... what am I even doing... the generic packer is like a dozen lines of C, surely it can't be too hard to just hand-roll my own python packer using a slightly different primitive.13:42
mwkc++13:43
mwkalso, the amount of stuff you need to do in the packer heavily depends on your device and how well the incoming primitives match with the P&R sites13:44
pepijndevoscpedanticpedantic13:44
pepijndevosRight. Disregarding everything complicated, I would say pretty well hehe13:45
mwkit might not be so simple13:45
mwkthere are a lot of decisions to make here13:45
daveshahIn general, I am leaning towards minimal packing and more validity checking13:46
mwkare LUT and FF separate cells, or do you want to place a combined LUT+FF cell?13:46
mwkyour FPGA has wide multiplexers — how do you represent that?13:46
mwksame for distributed RAMs13:46
mwkwhich also take up several LUTs13:47
pepijndevosmwk, I'm doing a silly PoC, I'm not considering anything like wide muxes.13:47
mwkfair enough13:47
mwkwhat about LUT+FF though?13:47
daveshahFWIW, both DRAM and wide LUTs can be represented in nextpnr using relative constraints13:47
daveshah(I know mwk knows that, for the benefit of pepijn)13:47
pepijndevosSo right now I'm just trying to make the generic target pack a LUT+DFF in a slice.13:48
daveshahimo, LUT+FF should be separate cells/bels if they are separately useable (like Xilinx); combined if not (like iCE40)13:48
mwkagreed13:48
mwkFWIW, they're not separately usable13:48
daveshahA combined primitive makes sense as the placer can't really chose to place them separately in any case then13:48
pepijndevosI can *almost* use the generic packer, except Gowin has a seperate LUT and DFF output, so the cell doesn't match the bel13:49
mwkright13:49
mwkso you need to make a LUTFF cell13:49
mwk4 inputs, two outputs13:49
daveshahI am actually tempted to change the generic cell to meet that spec13:49
daveshahSeveral FPGAs seem to follow the pattern13:49
pepijndevosI'll *hapily* make a PR for that, seems more useful and easy than some whacky yosys pass or Python mess13:50
daveshahSure, would make a good first nextpnr PR.13:50
pepijndevosomg, on my way, brb13:50
pepijndevoshehe13:50
mwkof course eventually you'll need to extend your simple cell with more stuff to support muxes, ALUs, RAMs :p13:51
mwkbut sure, it's a good way to begin\13:51
pepijndevosWhat would you think about command-line parameters to make the cell names configurable?13:51
daveshahWell they wouldn't be command line parameters they'd be a Python function like how LUT K is set13:52
pepijndevosmwk, I'm not going to do any of those things in Python. So it's more like... do PoC in Python, then do the real thing properly in C++13:52
daveshahPersonally, I'd rather the generic flow core primitives stayed generic13:53
pepijndevosOkay, I'll do the other thing first... the parameters is more work and less important13:54
daveshahYou could probably just translate them in the fasm export script13:56
pepijndevosalso true13:56
mwkyou'd need to convert them on input as well though13:56
mwkat least if you want to keep the yosys output netlist compatible with vendor13:57
pepijndevosRight, with renaming a few things, you could *maybe* (not super likely) use the actual synth_gowin pass with all the extras disabled, rather than the special synth_generic script.13:58
pepijndevosBut yea, might as well just use the synth_generic script and rename the output to match13:58
pepijndevosdaveshah, I think I got it working. I added a --write command to visualize it with Yosys, do you want that in the PR, or should I leave it the way it was? https://imgur.com/q3Ao1Dl14:30
tpbTitle: Imgur: The magic of the Internet (at imgur.com)14:30
daveshahYeah, add the --write too14:31
daveshahMake sure to update the example too14:31
pepijndevosYes, I did, that's why I added the write, to verify the example actually looks more or less sane and doesn't have any disconnected Q or F outputs14:32
daveshahGreat14:33
*** vidbina_ has quit IRC14:39
pepijndevosdaveshah, https://github.com/YosysHQ/nextpnr/pull/35014:58
tpbTitle: Dedicated output for LUT in GENERIC_SLICE by pepijndevos · Pull Request #350 · YosysHQ/nextpnr · GitHub (at github.com)14:58
*** alexhw has quit IRC14:59
*** alexhw has joined #yosys15:01
*** kraiskil has joined #yosys15:11
pepijndevosdaveshah, uhm, where does this int constructor live? I found this one https://github.com/YosysHQ/nextpnr/blob/master/common/nextpnr.h#L30515:23
tpbTitle: nextpnr/nextpnr.h at master · YosysHQ/nextpnr · GitHub (at github.com)15:23
daveshahhttps://github.com/YosysHQ/nextpnr/blob/master/common/nextpnr.cc#L13715:24
tpbTitle: nextpnr/nextpnr.cc at master · YosysHQ/nextpnr · GitHub (at github.com)15:25
daveshahpepijndevos: ^15:25
pepijndevoshuh, but does C++ just allows you to assign an into to that (ignoring the width) and it'll do the right thing?15:26
daveshahYes, it calls the constructor because the constructor isn't marked as explicit15:26
pepijndevosI was looking for some operator= magic because I assign an int15:26
daveshahIn this case, you want to fill the str with a string of [01] and then call update_intval#15:27
daveshah*update_intval()15:27
pepijndevosAh, the width has a default value, is that why it works?15:27
*** alexhw has quit IRC15:27
daveshahYes15:27
pepijndevosSometimes I think I know C++...15:28
pepijndevosSometimes I'm an idiot haha15:28
pepijndevosI had a job writing C++... don't tell anyone I was really just writing C15:30
*** alexhw has joined #yosys15:30
daveshahI mean nextpnr's codebase isn't that C++y15:30
daveshahThere's not a large amount of templating or polymorphism15:30
pepijndevosTrue15:31
pepijndevosLet's see what's the most C++y way I can find to make a string of 1015:33
*** wifasoi has quit IRC15:34
pepijndevosnvm, writing C hehe15:49
*** dys has joined #yosys15:49
pepijndevosI think I fixed it but uuuhhh testing testing... how is this supposed to work..15:56
daveshahThe generic architecture isn't really tested at all (the infrastructure wasn't there at the time I wrote most of it)15:56
daveshahFeel free to write something that uses the back annotated JSON in a simple test15:57
pepijndevosCurrently crashing because !is_string15:57
daveshahwhere?15:58
daveshahis_string should be false15:58
pepijndevosProperty::Property(const std::string &strval) : is_string(true), str(strval), intval(0xDEADBEEF) {}15:59
pepijndevosIf you make it from a string it sets is_string15:59
daveshahThat is where the property is storing an ASCII string rather than a string representation of a bitvector15:59
daveshahi.e. the former is isomorphic to "ABCD" in Verilog, the later to something like 8'b1010101016:00
daveshahif that example makes any sense16:00
daveshahYou want to use from_string rather than the string constructor here16:01
*** Jybz has joined #yosys16:02
pepijndevosok16:02
pepijndevosHuh... it's the K parameter that's a string, wtf?16:04
*** Thorn has quit IRC16:04
daveshahThat's broken16:05
daveshahIt's probably a legacy from before Property existed16:05
daveshahwhere everything was a string (don't blame me on that one...)16:05
daveshahprobably just a stray std::to_string that needs to be removed16:05
daveshahyeah, just remove the to_string here https://github.com/YosysHQ/nextpnr/blob/master/generic/cells.cc#L4516:07
tpbTitle: nextpnr/cells.cc at master · YosysHQ/nextpnr · GitHub (at github.com)16:07
pepijndevosYes, that was it... now it's back to bein broken in my own code16:08
*** Jybz has quit IRC16:11
*** Jybz has joined #yosys16:12
*** citypw has quit IRC16:13
pepijndevoswoookring16:13
pepijndevosokay, even formatting took only two tries this time -.-16:19
daveshahLGTM!16:29
pepijndevosOMG yay16:29
pepijndevosty16:29
*** X-Scale` has joined #yosys16:30
*** X-Scale has quit IRC16:31
*** X-Scale` is now known as X-Scale16:32
*** FabM has quit IRC16:34
*** kraiskil has quit IRC16:46
*** gkh has quit IRC16:52
*** m4ssi has quit IRC16:59
*** rohitksingh has joined #yosys17:04
*** rohitksingh has quit IRC17:51
*** rohitksingh has joined #yosys17:56
*** emeb has joined #yosys18:13
*** pie_ has quit IRC18:16
*** kraiskil has joined #yosys18:31
*** dys has quit IRC18:47
*** attie has joined #yosys19:18
*** kraiskil has quit IRC19:30
*** pie_ has joined #yosys19:30
*** attie has quit IRC20:34
*** emeb_mac has joined #yosys20:36
*** rohitksingh has quit IRC21:02
*** Thorn has joined #yosys21:05
*** rohitksingh has joined #yosys21:10
*** Jybz has quit IRC21:30
*** Jybz has joined #yosys21:31
*** Jybz has quit IRC22:04
*** rohitksingh has quit IRC22:15
*** adjtm has quit IRC22:16
*** adjtm_ has joined #yosys22:17
*** emeb has left #yosys22:54
*** somlo has quit IRC23:44

Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!