Monday, 2023-11-20

*** tpb <[email protected]> has joined #yosys00:00
*** ec <ec!~ec@gateway/tor-sasl/ec> has quit IRC (Remote host closed the connection)02:06
*** ec <ec!~ec@gateway/tor-sasl/ec> has joined #yosys02:06
*** peeps[zen] <peeps[zen]!~peepsalot@openscad/peepsalot> has quit IRC (Remote host closed the connection)03:08
*** peeps[zen] <peeps[zen]!~peepsalot@openscad/peepsalot> has joined #yosys03:08
*** peeps <peeps!~peepsalot@openscad/peepsalot> has joined #yosys04:27
*** DX-MON <[email protected]> has quit IRC (Quit: I'm not disconnecting, you're disconnecting!)04:27
*** DX-MON <[email protected]> has joined #yosys04:28
*** peeps[zen] <peeps[zen]!~peepsalot@openscad/peepsalot> has quit IRC (Read error: Connection reset by peer)04:29
*** FL4SHK <[email protected]> has quit IRC (Ping timeout: 252 seconds)04:30
*** FL4SHK <[email protected]> has joined #yosys04:31
*** peeps is now known as peeps[zen]04:44
*** bpye <bpye!~bpye@user/bpye> has quit IRC (Ping timeout: 256 seconds)06:12
*** bpye <bpye!~bpye@user/bpye> has joined #yosys06:15
*** FabM <FabM!~FabM@2a03:d604:103:600:2e60:8c7c:e8fb:7990> has joined #yosys07:47
*** lexano <[email protected]> has quit IRC (Ping timeout: 255 seconds)08:17
*** lexano <[email protected]> has joined #yosys08:30
*** lexano <[email protected]> has quit IRC (Remote host closed the connection)12:23
*** lexano <[email protected]> has joined #yosys12:39
cr1901I abc9 supposed to be strictly better (number of LUTs) than abc? I have a design where it's strictly worse (to be released soon). Is that worth a bug report? Idk how to minimize it tho.13:15
cr1901I don't feel like adding "-noabc9" because I don't want to pin to "the yosys 3 commits ago or newer as of this writing" as a dep, but...13:16
cr1901s/better/smaller/ s/worse/larger/ (better/worse is subjective. Smaller is what I want)13:29
tntcr1901: It's definitely not strictly better for me either.13:30
tntWhat's the target btw ?13:31
cr1901ICE40HX1K13:31
tntOk, so default type is good. Because a downside of abc9 is needing to specify `-device xxx` (default is hx) for it to select the right timing.13:32
cr1901This may just be something I need to live with. I made a refactor, and abc got larger after the refactor, and abc9 got smaller with the refactor13:41
cr1901(both "after refactors" are larger than "abc before refactor" tho)13:42
loftyYeah, please file it15:27
loftycr1901: ^15:28
loftytnt: I'm not sure it's a downside when the alternative is ABC's "what's a timing"15:29
cr1901Will do once the project's public (should be soon...). I may choose a non-HEAD commit b/c refactors change the degree that abc9 is larger than abc (but it's pretty consistent)15:30
loftyIf nothing else, YosysHQ are looking for benchmark designs to compare things on15:31
loftyBut having an "ABC9 performs worse here" benchmark means I can experiment with things15:32
cr1901Well try this: http://gopher.wdj-consulting.com:70/paste/d50ff075-d091-4bb9-b677-8cfa2bfbbb09.txt 1082 LUTs w/ synth_ice40, 1041 LUTs w/ -noabc915:41
cr1901~4% increase in size15:42
cr19011227 ICESTORM_LCs w/ -noabc9, 1252 LCs w/ just plain 'synth_ice40'15:44
loftycr1901: I'm going to need a .pcf file too; nextpnr won't pack the SB_GB_IO otherwise16:06
cr1901lofty: http://gopher.wdj-consulting.com:70/paste/2fb4e3a5-97b7-4c58-a069-b16dfd36bc0e.txt16:14
loftycr1901: I get different numbers, but ABC9 is indeed bigger16:15
loftyIt does seem to have a higher Fmax though16:16
loftylet's do some runs and compare.16:16
loftycr1901: just to confirm, it's cd_sync_clk12_0__i which is the clock to check, right?16:18
cr1901no, you want to check cpu_clk16:19
loftythere is no `cpu_clk`.16:19
cr1901Ooo you mean in the PCF. then yes16:20
loftyI mean in the nextpnr output :p16:20
loftybecause to me this looks like a classical case of "ABC9 found a higher Fmax solution with less timing slack available"16:20
cr1901Yes, there's only one clock in the design (aside from a reset_less POR domain which uses the same clock)16:21
cr1901And okay, but I don't want a higher Fmax if it means that I lose room for expansion16:21
loftydo you want the good news or the bad news?16:25
loftycr1901: ^16:27
cr1901bad mews16:27
cr1901typo intended I guess16:27
loftythe invocation to get ABC9 to do better than ABC is a little unwieldy involving some dark arts16:28
loftyyosys -p "scratchpad -set abc9.D 83333; scratchpad -copy abc9.script.flow3 abc9.script; synth_ice40 -abc9 -dff -json abc9-delaytarget.ice40.json" -f verilog testcase.v16:29
loftyresults in a netlist using 11 fewer ICESTORM_LCs than ABC16:29
cr1901I don't want this design to fit into hx1k on a technicality either. So if it involves poking abc9 internals or a horrific command line invocation, I will live w/ the size diff16:29
cr1901hmmmm16:30
loftyin english this is: "target a network delay of 83333 ps AKA 12 MHz; optimise as much as possible; pass DFFs to ABC9 so it can optimise through them"16:30
loftysort of the -O3 of ABC916:31
cr1901Well, I guess it's worth adding that for the sake of a demo/proof of concept16:33
cr1901I'd rather see something like ISE's optimize "SPEED", "BALANCED", "AREA" options16:34
cr1901I'm not sure I've ever used scratchpad16:35
loftycr1901: that'd be nice, but Yosys itself is not timing-driven, only ABC9 is16:36
loftyso I think it'd be a bit misleading16:36
cr1901What is the scratchpad, and why does it "magically" affect how the synthesis/abc9 script runs?16:43
cr1901Lemme guess... passes are allowed to set their own internal vars16:43
cr1901and scratchpad is the escape-hatch to mess w/ those vars16:43
loftycr1901: pretty much; normally the only way to fiddle with a pass' behaviour is via its command line, which gets set in stone inside the `synth_xxx` command16:52
loftyso to let a user override behaviour without editing the source and recompiling, some passes - like `abc9` - accept configuration through the scratchpad16:52
cr1901Well abc9.D and abc9.script are documented as part of the command-line params. But I can't find docs on abc9.script.flow3 (other than "it exists and is set by default")16:57
cr1901(presumably -D and -script command-line params would override the scratchpad? But since synth_ice40 doesn't set those, abc9 defers to the scratchpad to get default values instead?)16:59
loftycr1901: But I can't find docs on abc9.script.flow3 <-- map the design directly, remember it, do light synthesis, map the design, remember it, do heavy synthesis, map the design, remember it, pick out the best parts of all the mappings17:09
loftybut basically, it's just a copy of what the ABC `&flow3` command does, more or less17:09
loftycr1901: But since synth_ice40 doesn't set those <-- yeah, it looks in the scratchpad for a fallback value17:11
cr1901I'd like to note that neither abc9.D nor abc.script have a default values (yosys -p 'scratchpad get ...")17:12
cr1901So it must fallback to a default default (sic) value :P17:12
loftyabc9.D does not have a default value; if you don't specify it it does not get passed to ABC917:13
lofty...so ABC9 pretends you set it to 1.17:13
lofty(with the difference that ABC9 will not issue a warning if it cannot meet the target set by abc9.D)17:13
cr1901I guess my question is "what is the priority of the abc9 command for looking to fill the "script" and "D" vars, given that you can pass them either as command-line params to "abc9" pass or set them as part of the scratchpad (or do neither!)17:15
cr1901?*17:15
loftyas for abc9.script, if it's not set, it gets copied from abc9.script.default17:15
cr1901>abc9.script.default <-- okay that _is_ set17:16
loftythere is even17:16
loftyabc9.script.default.area and abc9.script.default.fast17:16
lofty:p17:16
loftycr1901: judging by the following comment in the `abc9` pass source code17:17
lofty\// get arguments from scratchpad first, then override by command arguments17:17
*** ZipCPU <[email protected]> has quit IRC (Ping timeout: 260 seconds)17:19
cr1901In other words, unless you clear abc9.script.default, you can't have abc9.script unset. But abc9.D can be unset without problems.17:19
cr1901unless you clear abc9.script.default <-- probably shouldn't do that17:19
loftyYosys seems surprisingly resilient to having abc9.script.default cleared17:21
lofty> ERROR: scratchpad entry "abc9.script.default" is a global constant17:21
cr1901I feel like a lot of this should be documented, but not sure where17:22
cr1901(_outside of the source code_)17:22
*** ZipCPU <[email protected]> has joined #yosys17:57
*** ZipCPU <[email protected]> has quit IRC (Ping timeout: 255 seconds)18:21
*** ZipCPU <[email protected]> has joined #yosys18:29
*** nelgau <[email protected]> has quit IRC (Ping timeout: 260 seconds)18:36
*** FabM <FabM!~FabM@armadeus/team/FabM> has quit IRC (Ping timeout: 256 seconds)20:03
*** nelgau <[email protected]> has joined #yosys21:14
*** kristianpaul <kristianpaul!~paul@user/kristianpaul> has quit IRC (Quit: WeeChat 3.5)21:26
cr1901lofty: Honestly, even the -dff option alone is doing wonders without destroying timing21:55
loftycr1901: I usually find that -dff makes timing slightly worse, but does help with area. when I don't get a complaint about it exposing an existing bug in the design, anyway22:05
cr1901Yea, it also took out a worrying number of FFs as well. But the design still works on my board, so... it's probably nothing22:10
cr1901(like 30 FFs were removed by adding -dff)22:11
loftyHave a little bit of faith in Alan to write correct code :p22:14
cr1901Fiiiine :D22:23
*** nonchip <[email protected]> has quit IRC (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)23:20
*** nonchip <[email protected]> has joined #yosys23:20
*** ec <ec!~ec@gateway/tor-sasl/ec> has quit IRC (Ping timeout: 240 seconds)23:30
*** ec <ec!~ec@gateway/tor-sasl/ec> has joined #yosys23:32

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