Sunday, 2023-03-19

*** tpb <[email protected]> has joined #yosys00:00
*** adjtm <[email protected]> has quit IRC (Read error: Connection reset by peer)00:50
*** adjtm_ <[email protected]> has joined #yosys00:50
*** peepsalot <peepsalot!~peepsalot@openscad/peepsalot> has quit IRC (Ping timeout: 255 seconds)01:17
*** peepsalot <peepsalot!~peepsalot@openscad/peepsalot> has joined #yosys01:17
*** bl0x_ <bl0x_!~bl0x@p200300d7a7290b006973a192364d5612.dip0.t-ipconnect.de> has joined #yosys02:44
*** bl0x <[email protected]> has quit IRC (Ping timeout: 256 seconds)02:46
*** adjtm_ <[email protected]> has quit IRC (Ping timeout: 265 seconds)03:12
*** krispaul <[email protected]> has quit IRC (Remote host closed the connection)05:13
*** krispaul <[email protected]> has joined #yosys05:14
*** krispaul <[email protected]> has quit IRC (Read error: Connection reset by peer)07:01
*** krispaul <[email protected]> has joined #yosys07:05
*** indy <[email protected]> has quit IRC (Ping timeout: 276 seconds)09:16
*** chaoticryptidz_ <[email protected]> has quit IRC (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)10:15
*** chaoticryptidz <[email protected]> has joined #yosys10:16
*** adjtm <[email protected]> has joined #yosys10:25
*** adjtm <[email protected]> has quit IRC (Remote host closed the connection)13:14
*** adjtm <[email protected]> has joined #yosys13:15
Forty-Botdoes anyone have suggestions on how to parametrize the number of states in a state machine?17:00
Forty-BotI am writing a module where some data is read in byte-by-byte, and I'd like to make the number of bytes parametric https://paste.debian.net/1274608/17:01
tpbTitle: debian Pastezone (at paste.debian.net)17:01
Forty-Botthis is a stripped-down version for experimentation, in the real module there are a lot more states17:01
Forty-Bothowever, there is a difference in module size between the parametrized and non-parametrized versions17:02
Forty-BotI also tried using a counter, however this ended up taking even more resources https://paste.debian.net/1274609/17:02
tpbTitle: debian Pastezone (at paste.debian.net)17:02
Forty-BotI am using synth_ice40 for testing17:03
*** adjtm <[email protected]> has quit IRC (Read error: Connection reset by peer)17:09
bl0x_Forty-Bot: best to use a counter for the current byte and have the destination range depend on the value of the counter. The counter start value would be the parameters you pass in to the module.17:19
Forty-BotI tried that in the second link17:19
bl0x_Ah, oops didn't read that far .. haha17:20
Forty-BotI would love to use that approach, but it takes more resources...17:20
bl0x_Hm, what about a one hot counter?17:20
Forty-BotI think it's because yosys doesn't allow arithmetic to be part of state machines17:21
Forty-Botso any time you have something like `state_next = state - 1` or whatever, it disables the FSM optimization17:21
Forty-BotI'll try a 1-hot...17:21
bl0x_What about generating code? Or does it need to be dynamic at run time?17:23
Forty-Botthe rest of the project doesn't use code generation, so ideally I'd like to use parameters17:24
bl0x_I meant to use a generate block. Not some external code generator17:25
Forty-Bot1-hot is better, but still not as good17:26
Forty-Bota generate block would be pretty awful because there are ~7-8 other (unparametrized) states17:27
bl0x_Could you put in all states and then skip the unnecessary ones based on the parameter?17:32
Forty-Botyes, that's what happens in the first example when PARAM is set17:33
bl0x_Ok. 17:35
bl0x_About the generate blocks: can't you generate only the additional states inside the fsm surrounded with 'generate if ... ' ?17:36
Forty-Botno17:36
Forty-Botgenerates are not allowed in always blocks17:36
Forty-Botdefinitely what I would have done given the choice17:37
bl0x_Pretty sure that works in vhdl, no?17:37
Forty-Botno clue; I've only really used verilog17:37
tntI mean, this looks like this should be a shift register really ...17:48
Forty-Bottnt: for size 16 shift registers are larger17:50
Forty-Botbut not by too much17:50
Forty-Bothowever, the parametrized version is still larger17:50
tntForty-Bot: https://pastebin.com/1pW1ktQQ17:52
tpbTitle: module test #( parameter integer WIDTH = 32)( input clk, rst, - Pastebin.com (at pastebin.com)17:52
Forty-Botit's part of a larger state machine17:53
tntWell, we can't optimize something you doesn't give us ...17:53
Forty-Botso something like that isn't really what I had in mind... although that's a different way of approaching things17:54
tntbut this should be implementable as a single state in it, just waiting for the last 'ena' to get out of that state.17:54
Forty-Bottnt: well, I wanted to start with something small which didn't have a lot of extra stuff in it17:54
Forty-Bottnt: https://github.com/Forty-Bot/ethernet/blob/WIP_axis/rtl/axis_wb_bridge.v17:56
Forty-Botright now the counter is constant 1, but I would like to also support different values based on DATA _WIDTH17:57
*** notafile[m] <notafile[m]!~notafilem@2001:470:69fc:105::181f> has joined #yosys19:11
notafile[m]nya!20:13
gatecatmrow?20:13
*** Guest25 <[email protected]> has joined #yosys21:52
*** Guest25 <[email protected]> has quit IRC (Client Quit)21:52
*** nonchip <[email protected]> has quit IRC (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)23:10
*** nonchip <[email protected]> has joined #yosys23:10

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