Tuesday, 2023-10-24

*** tpb <[email protected]> has joined #yosys00:00
*** Raito_Bezarius <Raito_Bezarius!~Raito@wireguard/tunneler/raito-bezarius> has joined #yosys00:05
*** Raito_Bezarius <Raito_Bezarius!~Raito@wireguard/tunneler/raito-bezarius> has quit IRC (Ping timeout: 255 seconds)00:14
*** Raito_Bezarius <Raito_Bezarius!~Raito@wireguard/tunneler/raito-bezarius> has joined #yosys00:20
*** nelgau <[email protected]> has joined #yosys00:45
*** oldtopman <[email protected]> has quit IRC (Quit: *poof*)01:35
*** nelgau <[email protected]> has quit IRC (Read error: Connection reset by peer)01:39
*** nelgau <[email protected]> has joined #yosys01:39
*** oldtopman <[email protected]> has joined #yosys01:43
cr1901TIL that yosys will turn large case statements into block RAM. This is a great idea and normally desirable. If I want to check resource usage where a block RAM is NOT used, is there an attribute or something I can use to suppress block RAM inference?02:24
cr1901nevermind I got it; case with Default for vast majority suppressed the transformation02:30
*** ec <ec!~ec@gateway/tor-sasl/ec> has quit IRC (Ping timeout: 256 seconds)02:36
*** ec <ec!~ec@gateway/tor-sasl/ec> has joined #yosys02:37
*** charlottia <charlottia!charlotteh@2a01:4f8:c012:5b7:0:1:0:1d> has joined #yosys03:12
charlottia<cr1901> "TIL that yosys will turn large..." <- yes. set e.g. `ram_style` to `logic`.03:12
charlottia(see memory_libmap.cc around lines 493-531)03:12
cr1901Noted for the future, thanks!03:15
*** nelgau_ <[email protected]> has joined #yosys03:46
*** nelgau <[email protected]> has quit IRC (Ping timeout: 258 seconds)03:47
*** indy <[email protected]> has joined #yosys04:40
*** FabM <FabM!~FabM@2a03:d604:103:600:2e60:8c7c:e8fb:7990> has joined #yosys06:36
*** smkz <smkz!~x@user/smkz> has quit IRC (Ping timeout: 240 seconds)07:16
*** smkz <smkz!~x@user/smkz> has joined #yosys07:22
*** nelgau_ <[email protected]> has quit IRC (Read error: Connection reset by peer)08:16
*** nelgau <[email protected]> has joined #yosys08:17
*** nelgau <[email protected]> has quit IRC (Read error: Connection reset by peer)08:18
*** nelgau_ <[email protected]> has joined #yosys08:24
*** nelgau_ <[email protected]> has quit IRC (Ping timeout: 255 seconds)08:30
*** nelgau <[email protected]> has joined #yosys08:35
jixIIRC the `-norom` option to `proc` should prevent it from creating memory cells in the first place which might be closer to what you're asking for than mapping the rom back to logic?08:36
*** kristianpaul <kristianpaul!~paul@user/kristianpaul> has joined #yosys14:50
*** nelgau <[email protected]> has quit IRC (Read error: Connection reset by peer)15:26
*** nelgau <[email protected]> has joined #yosys15:26
*** FabM <FabM!~FabM@armadeus/team/FabM> has quit IRC (Ping timeout: 240 seconds)15:56
cr1901jix: Cool, I will have to try that when I have a chance to change the script. I was looking for source-level suggestions b/c they were easy :P16:16
jixI wonder if it makes sense for proc_rom (which does the initial transformation from case statement to ROM) to check if `ram_style` is `logic` and omit it16:42
jixor alternatively a different attribute or a special `ram_style` option ... I can see use cases for both, not creating a ROM in the first place and mapping the ROM back to logic16:44
jixalthough the difference between those two ways to end up with logic probably doesn't matter much most of the time16:46
cr1901Yea, I can imagine they could end up w/ different results, but not significantly. In any case, I decided to eat the cost of an additional block RAM for now. But being able to check to see if a sparse case can be optimized well in logic with an attribute would be cool16:51
jixIf it's sufficiently sparse (less than a quarter of the values are non-default) it shouldn't end up being a rom in the first place16:56
jixand in the case where it's sparse in some other way I think it'd mostly be abc that might be able to optimize it and that runs after it would be mapped back to logic if you use ram_style logic, so that should work the same for both approaches16:57
cr1901I would say about 1/10 of the values are non-default, but the default is 2'b1, and the values don't follow a nice pattern for which is default or not. In this case, the block RAM approach is better. 1/216:58
cr1901Additionally, all 1024 cases are written out via a Python for-loop (Amaranth-generated Verilog). I don't have code to share right now.16:59
jixcr1901: with 1/10 cases being non-default you end up with a ROM?17:00
cr1901yes17:01
jixhmm maybe that's ambiguous ... with do you have cases for 1/10 of the input values and the rest is handled by a default case or do you have cases for all input values of which 9/10 have the same value?17:02
cr1901latter17:02
cr1901Why? I generated a memory init list in Python initially. I changed from an explicit ROM/Memory to a case/(Switch/Case) in Amaranth. This saved a few resources, _even when proc_rom inferred a BRAM_.17:04
jixok, in the former case you shouldn't get a ROM, the current heuristic only looks at the number of cases / number of possible values17:04
cr1901FWIW, When I convert to the former case, I don't get a ROM.17:04
cr1901Tbh, I'm a bit surprised that a BRAM is best (in logic, the switch/case takes like 60 SB_LUT4s for some reason I can't be arsed to debug right now). Maybe I'll try minimizing manually.17:07
jixI'm not too familiar with the part that generates logic for case statements, so I might be wrong, but I think it will always generate a comparison for each case and then build a mux tree using those comparisons as selects ... which can handle the general case but is not the best way to implement a rom 17:21
*** GenTooMan <[email protected]> has quit IRC (Ping timeout: 245 seconds)17:41
*** GenTooMan <GenTooMan!~cyberman@2601:547:437f:e5c6:21f:5bff:fefe:a883> has joined #yosys17:53
*** Lord_Nightmare <Lord_Nightmare!~Lord_Nigh@user/lord-nightmare/x-3657113> has quit IRC (Quit: ZNC - http://znc.in)19:41
*** Lord_Nightmare <Lord_Nightmare!Lord_Night@user/lord-nightmare/x-3657113> has joined #yosys19:44
*** nonchip <[email protected]> has quit IRC (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)22:19
*** nonchip <[email protected]> has joined #yosys22:19
*** notgull <notgull!~notgull@2600:1f14:8f4:3100:e2a2:c920:847d:d23> has quit IRC (Ping timeout: 240 seconds)23:24
*** notgull <notgull!~notgull@ec2-50-112-148-23.us-west-2.compute.amazonaws.com> has joined #yosys23:25

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