Monday, 2022-02-07

*** tpb <[email protected]> has joined #symbiflow00:00
bl0x_Hi, I've just got hit by the fact that I forgot to assign a suitable clock to an instantiated module's clock input (in this case xc7 MMCME2_ADV). Symbiflow was happy with it, Vivado complained about it during DRC. Is that a symbiflow/yosys issue? How is DRC done in symbiflow/yosys?01:28
*** bl0x_ <bl0x_!~bastii@p200300d7a7164100bd29fa0eacbbcdc9.dip0.t-ipconnect.de> has quit IRC (Ping timeout: 256 seconds)02:49
*** bl0x_ <bl0x_!~bastii@p200300d7a7144400b248e6f0686addee.dip0.t-ipconnect.de> has joined #symbiflow02:51
lkclbl0x_, hi - there's a lot of things missing from the FOSS HDL tools at the moment, which if you're used to proprietary ones will seem strange that they're lacking. over time this will get better, if there's proper funding and/or resources, you know how that works with FOSS :)05:21
lkcli've been working with VLSI ASIC/FPGA for about 3-4 years now, and DRC and error-checking in general i've found is quite sparse. personally i've substituted huge quantities of unit tests for that lack, and that's worked well for me05:24
lkclsomeone else on here may have had different experiences and know of some Libre DRC tools? i'd be interested to know if they exist, as well05:26
sf-slack<acomodi> lkcl: I believe that you bumped in a current limitation of VPR regarding the direct connections between macro blocks such as carry chains which COUT - CIN connections do not enter the general interconnect and require definition of direct inter-block connections (https://docs.verilogtorouting.org/en/latest/arch/reference/#direct-inter-block-connections)08:14
tpbTitle: Architecture Reference — Verilog-to-Routing 8.1.0-dev documentation (at docs.verilogtorouting.org)08:14
sf-slack<acomodi> these connections are currently present for the carry chains, but due to some slight variation in the xc7 fabric, the offset between the carry-chains "y" location might be of two units rather than one, I believe when the carry-chain has to "jump" over the clock spine in the middle of a clock region08:16
sf-slack<acomodi> I think that VPR should be enhanced to have multiple ways of building up a macro cluster (where macro cluster is a cluster of blocks that have direct connections, such a set of carry-chains connected one to the other). Currently IIRC there is one possible inter-block direct definition that can be defined for two block pins (COUT - CIN)08:19
sf-slack<acomodi> For the time being, having a carry chain longer than 25 (which should be the maximum length of carry chain blocks that have a one-length "jump" between one another instead of the less common two-length one), should result in the error you reported08:22
sf-slack<acomodi> @fahrenkrog: IIRC latches primitives such as LDCE are not currently supported (and in general they should be avoided). There was a PR opened a while ago to add support for those: https://github.com/SymbiFlow/symbiflow-arch-defs/pull/141708:24
bl0x_lkcl: Sure, I am not complaining about symbiflow/yosys! On the contrary =) But this reminded me to always cross-check with a Vivado run if things are really OK. Also, if I know where to look, then I can check how to contribute whenever something seems "strange" or "lacking".09:20
lkclbl0x_, no, me neither, i mean we wouldn't be able to do anything without the work done by everyone on these tools. if you were developing an ASIC, i could refer you to klayout, apparently someone put together some DRC checking for ASIC development.11:47
bl0x_lkcl: oh, but no. I'm doing FPGA for the time being.12:05
bl0x_I've seen that some basic checks are done in techmap. Perhaps that can be enhanced. 12:08
sf-slack<fahrenkrog> @acomodi Thanks, I will have a read through that and see how to improve the design. Cheers!12:08
lkclacomodi: thanks for responding. i'm not yet familiar enough with the internals of vtr to understand fully there, but intuitively i get it (and that you have a handle on the problem).12:48
lkclso, to help me understand: is this because the (large) design i am doing has an above-average number of large add/sub/cmp operations? or is carry-chains a general-purpose block for propagating large inter-connected combinatorial circuits?12:50
lkclfor example, if we have a global pipeline "stall" signal that connects to 10 separate (rather large) pipelines, or an MMU with a TLB that ended up being a (massive) combinatorial circuit?12:52
sf-slack<acomodi> I believe is the former, probably your design uses quite large add/sub/cmp operations that lead synthesis to generate a very long carry-chain (>25 carry blocks) that VPR cannot handle at this point. A possible workaround might be to cut the carry-chain in sub-carry-chains during the synthesis step12:58
lkclahh yeah we have a divide unit which can do square-root and reciprocal-square-root. for 64-bit outputs that needs 3x 64-bit for the divisor so 192-bit add/sub13:14
lkclas that's currently not needed (Power ISA integer ops don't have sqrt and certainly not rsqrt) i think we can get away with cutting that out13:14
lkclthank you!13:14
lkclif however we wanted to cut the carry-chain, how would i go about identifying it? what am i looking for?13:17
lkclah that's interesting13:20
sf-slack<acomodi> So, first thought would be to add a step that identifies too-long-carry-chains and splits them to this script https://github.com/SymbiFlow/symbiflow-arch-defs/blob/master/utils/fix_xc7_carry.py13:21
lkclhttps://github.com/SymbiFlow/symbiflow-arch-defs/blob/master/utils/fix_xc7_carry.py13:23
lkclyes lol i was just trying to find the source for that :)13:23
* lkcl just having a look at clean_carry_out.v to get a handle on this13:26
lkclacomodi: okaaay i've got a mini repro design (in nmigen) which creates a 192-bit adder14:44
lkcland can see that fix_xc7_carry.py is being run a bit too early14:44
lkclas in: it's run on the design *before* any CARRY4_VPR blocks are present14:46
lkclthe files go through a processing stream, original top.v to json, then that's in to fix_xc7_carry.py, then the output from that goes into abc914:48
lkclbut i think it should have been run _after_ the abc9 processing14:49
lkcli'll try it manually, see what happens14:49
lkclok i've a mini-script which repros the techmap fixups, which allows the port_direction attributes to be inserted into the post-abc9 .v file...15:14
lkclgetting this error:15:14
lkcl  File "fix_xc7_carry.py", line 317, in find_carry4_chains15:14
lkcl    assert direct_cell["type"] == "CARRY_CO_DIRECT", direct_cellname15:14
lkclAssertionError: _296_15:14
lkclactual type is 'CARRY4_VPR',15:15
lkclermermermermerm... i think i know what this is15:20
lkclhttps://github.com/SymbiFlow/symbiflow-arch-defs/blob/8a7fc2ff272222641fc5c887ca7d81a949c62bae/utils/fix_xc7_carry.py#L31315:20
lkclsuspect that should be [1] not [0]15:20
lkclngggh nope. getting a little lost here.15:31
lkclok got it - back to the pre-fixup json, there it is.15:37
sf-slack<acomodi> So, for context, the techmapping forces the creation of the `CARRY_CO_DIRECT` and `CARRY_COUT_PLUG` additional cells which are required to force the VPR packer to correctly use the `CIN - COUT` pins for the direct connection15:38
lkclyes, am up to speed, just putting in some debug prints in15:40
lkcla 192-bit adder creates a chain of length 4815:40
sf-slack<acomodi> The idea here would be to iterate over a carry-chain starting from its head and, upon reaching the limit, remove the following `CARRY_CO_DIRECT` and `CARRY_COUT_PLUG` and restore the original connection coming out of the original `synth_xilinx` pass, so that, at VPR eyes, the carry-chain can be packed as a 25 and 23 length chains15:41
lkclwhat type of cell would need to be put in, here?15:41
lkclmmmm ahh ok15:41
lkclmrhm i should be able to find that file (original synth pass)15:42
lkcl"symbiflow-arch-defs/xc/xc7/yosys/synth.tcl"15:42
lkclin there somewhere15:42
lkclah, you mean the {name}.premap.v file?15:43
sf-slack<acomodi> I think you have all the information in that script, and basically you might just connect the `carry_co_direct` input to the `carry_cout_plug` output15:43
lkclbeen doing python for 20 years now, but the data format's new to me. let me do some more debug prints - i can see what fixup_cin is doing so that establishes a baseline/principle15:46
lkclso just to check: does the {top}.carry_fixup.json file already have CARRY_CO_DIRECT connected directly to CARRY_COUT_PLUG?15:58
lkcl(graphviz - yosys show top - is taking several *minutes*, otherwise i'd be able to see it myself)15:58
lkcli need to start from a smaller example - 192 bits is too large, taking far too long16:00
sf-slack<acomodi> tbh I'd need to navigate through the carry chain handling, as I am not too familiar myself with it, I might have mistaken and there are actually only the additional carry_cout_plug. I suggest starting from an 8 bit counter which is enough to understand what is going on there16:01
lkclyes, i reduced down to 16-bit and it's still 100% CPU... oh hooray! graphviz completed after 2 minutes :)16:04
* lkcl restarting with 8-bit16:05
lkclthat's better.  only about 15 seconds. whew16:06
lkclrrright.  ran the xc7_fixup.py on an 8-bit add and it doesn't actually look like any change was made, hm.16:09
lkcltop_synth.v.premap.v contains just CARRY4 blocks.16:12
sf-slack<acomodi> Yeah, the `CARRY4_VPR` are generated after mapping, so the script should run on the already-mapped netlist16:14
* lkcl wondering if dropping in an IBUF would do the trick16:14
lkclnope those are for pads, it looks like16:15
lkcla pair of INVs back-to-back?16:15
lkcl(yuk!)16:16
lkclis there a non-inverting cell?16:17
*** balrog <balrog!znc@user/balrog> has quit IRC (Ping timeout: 256 seconds)16:19
lkclBUFG with an "EN" set to 1 would do it16:21
* lkcl thinking of changing random CARRY_OUT_PLUGs to BUFGs16:23
* lkcl afk16:23
lkclThe clock net '$auto$alumacc.cc:485:replace_alu$1437.CO[3]' driving 'BUFGCTRL_VPR' sources at logic which is not allowed!17:28
lkclgrr no, not allowed17:28
lkclMUXCY is a virtual cell (mapped)17:48
lkcllet's try a MUXF6...17:54
lkclwith a hard-coded S=017:55
lkclblif file was accepted into vtr...18:04
*** ec <ec!~ec@gateway/tor-sasl/ec> has joined #symbiflow18:14
lkcldamnit that didn't work either18:32
lkclCannot route from BLK-TL-CLBLM_R[0].CLBLM_M_AMUX[0] (RR node: 5365158 class: 82 capacity: 1 fan-in: 0 fan-out: 1 SOURCE:5365158 (134,72)) to BLK-TL-CLBLM_R[0].CLBLM_L_CIN[0] (RR node: 5365097 class: 21 capacity: 1 fan-in: 1 fan-out: 0 SINK:5365097 (134,72)) -- no possible path18:32
lkcli think something more sophisticated (earlier) might be needed here18:33
lkclto rework adds of an excessive length to ones that are explicitly say 128-bit (max) but multiple of them, chained together with a single bit-carry18:34
lkcldone at the verilog level (or more like yosys ilang)18:35
*** balrog <balrog!znc@user/balrog> has joined #symbiflow19:20
*** xiretza[m] <xiretza[m]!~xiretzaxi@2001:470:69fc:105::9b1> has quit IRC (*.net *.split)19:37
*** duck2 <[email protected]> has quit IRC (*.net *.split)19:37
*** tucanae47_ <[email protected]> has quit IRC (*.net *.split)19:37
*** jn <jn!~quassel@user/jn/x-3390946> has quit IRC (*.net *.split)19:37
*** xiretza[m] <xiretza[m]!~xiretzaxi@2001:470:69fc:105::9b1> has joined #symbiflow19:42
*** duck2 <[email protected]> has joined #symbiflow19:42
*** tucanae47_ <[email protected]> has joined #symbiflow19:42
*** jn <jn!~quassel@user/jn/x-3390946> has joined #symbiflow19:42
*** Niklas[m]1 <Niklas[m]1!~nsmlzlmat@2001:470:69fc:105::c93a> has quit IRC (Ping timeout: 245 seconds)19:46
*** cesar <cesar!~cesar@2001:470:69fc:105::76c> has quit IRC (Ping timeout: 256 seconds)19:46
*** CarlosEDP <CarlosEDP!~carlosedp@2001:470:69fc:105::218e> has quit IRC (Ping timeout: 252 seconds)19:46
*** CarlFK <CarlFK!~carlfk@2001:470:69fc:105::5d8> has quit IRC (Ping timeout: 252 seconds)19:46
*** xiretza[m] <xiretza[m]!~xiretzaxi@2001:470:69fc:105::9b1> has quit IRC (Ping timeout: 260 seconds)19:46
*** Niklas[m]1 <Niklas[m]1!~nsmlzlmat@2001:470:69fc:105::c93a> has joined #symbiflow20:07
*** ec <ec!~ec@gateway/tor-sasl/ec> has quit IRC (Quit: ec)20:23
*** cesar <cesar!~cesar@2001:470:69fc:105::76c> has joined #symbiflow20:49
*** CarlFK <CarlFK!~carlfk@2001:470:69fc:105::5d8> has joined #symbiflow20:51
*** Raito_Bezarius <Raito_Bezarius!~Raito@wireguard/tunneler/raito-bezarius> has quit IRC (Ping timeout: 250 seconds)21:03
*** Raito_Bezarius <Raito_Bezarius!~Raito@wireguard/tunneler/raito-bezarius> has joined #symbiflow21:16
*** xiretza[m] <xiretza[m]!~xiretzaxi@2001:470:69fc:105::9b1> has joined #symbiflow21:27
*** xiretza[m] <xiretza[m]!~xiretzaxi@2001:470:69fc:105::9b1> has quit IRC (Read error: Connection reset by peer)21:35
*** CarlFK <CarlFK!~carlfk@2001:470:69fc:105::5d8> has quit IRC (Read error: Connection reset by peer)21:35
*** cesar <cesar!~cesar@2001:470:69fc:105::76c> has quit IRC (Read error: Connection reset by peer)21:35
*** Niklas[m]1 <Niklas[m]1!~nsmlzlmat@2001:470:69fc:105::c93a> has quit IRC (Read error: Connection reset by peer)21:35
*** cesar <cesar!~cesar@2001:470:69fc:105::76c> has joined #symbiflow21:36
*** CarlosEDP <CarlosEDP!~carlosedp@2001:470:69fc:105::218e> has joined #symbiflow21:46
*** Niklas[m] <Niklas[m]!~nsmlzlmat@2001:470:69fc:105::c93a> has joined #symbiflow21:46
*** CarlFK <CarlFK!~carlfk@2001:470:69fc:105::5d8> has joined #symbiflow21:46
*** xiretza[m] <xiretza[m]!~xiretzaxi@2001:470:69fc:105::9b1> has joined #symbiflow21:46
*** TMM_ <[email protected]> has quit IRC (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)22:26
*** TMM_ <[email protected]> has joined #symbiflow22:26
lkclacomodi: ah ha! a potential temporary workaround23:40
lkcl        log("    -nocarry\n");23:41
lkcl        log("        do not use XORCY/MUXCY/CARRY4 cells in output netlist\n");23:41
lkclin yosys techlibs/xilinx/synth_xilinx.c23:42
*** ec <ec!~ec@gateway/tor-sasl/ec> has joined #symbiflow23:49
lkcli'm tempted to suggest the idea of a new techmap, either replacing yosys/share/xilinx/arith_map.v $alu map23:49
lkclwhich spots if the length of the $alu is greater than 90 or so bits23:50
lkcland does the split there, with a manual carry of one extra bit and some intermediary signals23:51
lkclok that successfully maps to a batch of LUT4/5/6s (using synth_xilinx -nocarry)23:54

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