Monday, 2021-08-23

*** tpb <[email protected]> has joined #yosys00:00
*** mikolajw <mikolajw!~mwielgus@user/mwielgus> has quit IRC (Quit: WeeChat 3.2)00:01
*** GenTooMan <GenTooMan!~cyberman@2601:547:437f:e5c6:21f:5bff:fefe:a883> has quit IRC (Ping timeout: 250 seconds)00:14
*** GenTooMan <GenTooMan!~cyberman@2601:547:437f:e5c6:21f:5bff:fefe:a883> has joined #yosys00:16
*** chipb <chipb!~chipb@user/chipb> has quit IRC (*.net *.split)04:45
*** chipb_ <chipb_!~chipb@user/chipb> has joined #yosys04:45
*** agg <[email protected]> has quit IRC (*.net *.split)04:48
*** kbeckmann <[email protected]> has quit IRC (*.net *.split)04:48
*** sauce <[email protected]> has quit IRC (*.net *.split)04:48
*** TD-Linux <TD-Linux!~Thomas@user/td-linux> has quit IRC (*.net *.split)04:48
*** anuejn <[email protected]> has quit IRC (*.net *.split)04:48
*** sauce <[email protected]> has joined #yosys04:49
*** anuejn <[email protected]> has joined #yosys04:49
*** TD--Linux <TD--Linux!~Thomas@user/td-linux> has joined #yosys04:49
*** agg <[email protected]> has joined #yosys04:49
*** agg is now known as Guest605604:50
*** kbeckmann <[email protected]> has joined #yosys04:58
*** peepsalot <peepsalot!~peepsalot@openscad/peepsalot> has quit IRC (Read error: Connection reset by peer)05:48
*** peepsalot <peepsalot!~peepsalot@openscad/peepsalot> has joined #yosys05:49
*** FabM <[email protected]> has joined #yosys06:34
*** emeb_mac <[email protected]> has quit IRC (Quit: Leaving.)07:04
*** Guest6056 <[email protected]> has quit IRC (Quit: WeeChat 1.8)09:10
*** adamgreig <[email protected]> has joined #yosys09:10
*** adamgreig is now known as agg10:11
*** vidbina <[email protected]> has joined #yosys10:55
*** vidbina <[email protected]> has quit IRC (Ping timeout: 240 seconds)12:34
*** GenTooMan <GenTooMan!~cyberman@2601:547:437f:e5c6:21f:5bff:fefe:a883> has quit IRC (Quit: Leaving)12:34
*** GenTooMan <GenTooMan!~cyberman@2601:547:437f:e5c6:21f:5bff:fefe:a883> has joined #yosys12:36
*** vidbina <[email protected]> has joined #yosys13:04
*** FabM <FabM!~FabM@armadeus/team/FabM> has quit IRC (Quit: Leaving)14:56
*** gsmecher <[email protected]> has joined #yosys16:10
*** emeb <[email protected]> has joined #yosys16:44
*** emeb_mac <[email protected]> has joined #yosys16:59
*** vidbina <[email protected]> has quit IRC (Ping timeout: 248 seconds)17:22
*** vidbina <[email protected]> has joined #yosys17:50
*** gsmecher <[email protected]> has quit IRC (Ping timeout: 250 seconds)18:47
*** GenTooMan <GenTooMan!~cyberman@2601:547:437f:e5c6:21f:5bff:fefe:a883> has quit IRC (Ping timeout: 240 seconds)19:20
*** GenTooMan <GenTooMan!~cyberman@2601:547:437f:e5c6:21f:5bff:fefe:a883> has joined #yosys19:24
*** emeb_mac <[email protected]> has quit IRC (Ping timeout: 240 seconds)19:27
*** emeb <[email protected]> has quit IRC (Ping timeout: 240 seconds)19:27
*** emeb <[email protected]> has joined #yosys19:30
*** emeb_mac <[email protected]> has joined #yosys19:30
*** GenTooMan <GenTooMan!~cyberman@2601:547:437f:e5c6:21f:5bff:fefe:a883> has quit IRC (Ping timeout: 250 seconds)20:03
*** gsmecher <[email protected]> has joined #yosys20:05
*** GenTooMan <GenTooMan!~cyberman@2601:547:437f:e5c6:21f:5bff:fefe:a883> has joined #yosys20:16
tntIs there an attribute I can set on a signal to tell yosys to actually generate and _use_ that signal as-is in logic whenever I use it and not try to optimize by looking at where that signal come frome etc ... ?21:16
tntLike I have   wire x = ~y;    and then I use `x` in some expressions later, and I want it to not try to fold the inverter in there.21:17
tntI tried 'keep' but that's not enough apparently :/21:18
*** vidbina <[email protected]> has quit IRC (Quit: vidbina)21:20
corecodetnt: what would be the use case for this?21:26
tntGuide yosys into doing "the right thing".21:27
tntI want to do this:   val_cur <= do_load ? val_load : (val_cur - 1);21:27
killjoyYeah I don't understand why you would want to do that in this case. The synthesizer could very well fold your inverter downstream, or upstream, and what do you care as long as it's equivalent?21:27
tntBut for it to pack correctly, I have to write:  val_cur <= do_load ? val_load : (val_cur + {N{do_load}});21:27
tntErr, wait, when simplifying my example, I inverted thing.21:29
tnt        val_cur <= do_dec ? (val_cur - 1) : val_load;21:29
tnt        val_cur <= do_dec ? (val_cur + {N{do_dec}}) : val_load;21:29
corecodeoh otherwise it packs less compactly?21:30
tntThat only packs properly (1 LUT per bit) if do_dec is `1` when doing the decrement and `0` when doing the load due to the hardcoded carry chain.21:30
tntAnd so if instead of using `do_dec` _exactly_ as I wrote it as a logic expression, yosys tries to optimize or unfold an inverter or something ... packing is screwed up.21:32
killjoyHow wide is val_cur? and do_load is your 1 bit wire, right?21:38
tntdo_load is 1 bit.  val_cur is 16 bit.21:38
tntBut that submodule ends up instanciated 32 times in a UP5k ... so wasting like 10% of the whole FPGA if packing for this is not done as it should.21:39
corecodegood that you found a workaround21:39
tntI didn't ...21:41
killjoySo, are you making an assignment or comparison with "val_cur <= do_dec"?21:42
tnthuh ? No.21:42
killjoyAre you wanting "if val_cur is less than or equal to do_dec?"21:42
tntno.21:42
tntit either loads a value or decrement by 1.21:43
killjoyI would be a lot more explicit in my code than this.21:44
killjoyYou don't get points for being terse.21:44
killjoyYou're trying to say "if do_dec is 1 decrement val_cur and assign it back, else give it val_load?"21:44
tntThat's the only way to write it so it packs properly ....21:44
*** emeb <[email protected]> has quit IRC (Ping timeout: 240 seconds)21:45
*** emeb_mac <[email protected]> has quit IRC (Ping timeout: 240 seconds)21:45
tntFeel free to try and find another way : https://pastebin.com/Rbedy7J721:49
tpbTitle: // yosys -p 'synth_ice40' t.vmodule top( input wire [31:0] ld_value, - Pastebin.com (at pastebin.com)21:49
corecodeso you did find a workaround?21:49
tntNo.21:49
corecodeok i'm confused :)  you said it packs correctly if you do this21:49
corecodewhat about instantiating the LUT manually?21:50
tntAs a separate module it works, but when the 'do_dec' signal doesn't come from outside, but from some internal logic, yosys tries to optimize it and merge it with the adder and screws things up.21:50
corecodeah!21:50
*** emeb_mac <[email protected]> has joined #yosys21:50
corecodeis the LUT the issue or the carry chain?21:50
tntWhich is why I want a way to 'fence' it. Tell yosys : "Ok, use 'do_dec' as is, don't touch it"21:50
corecodei don't think i can help at all, but I can learn :)21:50
killjoyThis doesn't make sense to me.21:50
killjoyIt shouldn't need to pack anything, you're just decrementing a 32 bit integer.21:51
killjoyBased on some signal.21:51
*** emeb <[email protected]> has joined #yosys21:51
killjoyI thought maybe your use of the ternary operator was confusing the synthesizer.21:52
killjoyBut you're saying the lower code doesn't work right?21:52
corecodei'm assuming it prepares the LSB in one LUT and then does the carry chain separately21:52
killjoyOh wait.21:52
tntIt "works" as in the logic is "correct" but it uses twices as many LCs at the top one.21:52
killjoy*sigh* let me attempt to dig into brain cells from 10 years ago.21:52
killjoyI think it's because you're implying latches, but let me try to remember.21:53
tntI can assure you it's not.21:53
corecodeso what do the two LUTs do?21:54
corecodeone for the mux, the other for ~do_dec being inverted again?21:54
tnttwo LUTs ?21:54
corecodeyou said it allocates two LC21:54
tntper bit.21:54
corecodeis that LUT + carry element?21:54
tntNo, it will use 1 LC per bit to implement the decrement and then another LC to do the mux.21:55
killjoyYeah ok it's not that.21:55
corecodehuh ok21:55
tntwhile in reality you can do both theses functions in the same LC.21:55
*** emeb_mac <[email protected]> has quit IRC (Ping timeout: 240 seconds)21:55
corecodedoes it use the carry chain of the LC?21:55
tntyes21:55
corecodeor does it do a plain LUT ripple21:55
*** emeb <[email protected]> has quit IRC (Ping timeout: 240 seconds)21:56
corecodeaha, so it fails to merge carry chain and mux LUT21:56
corecodesurprising21:56
tntwell the ice40 has a very rigid carry structure.21:56
tntand it's only mergeable when the 'control' signal has value '1' when doing the decrement and value '0' when doing the load.21:57
tnt(you'd have to go dig up the ice40 internal structure to understand why ... a bit late here for me to explain all the details ... )21:58
corecodeok21:58
corecodei'll have a look out of curiosity21:58
corecodeso even if you'd instantiate a SB_CARRY and a SB_LUT4, it might not get merged22:00
corecodei mean, co-located22:00
tntwell ... yeah, if I instanciate primitives manually I'm sure it'd work ...22:01
tntbut that's a major pain.22:01
corecodeor not...22:01
corecodeor does nextpnr do the co-locating?22:02
corecodethe tech library docs are not very good in this regard22:02
tntnextpnr does the colocating.22:03
tntif the SB_CARRY in/out connect to the righ tports of the SB_LUT4 for it to go there.22:03
*** emeb_mac <[email protected]> has joined #yosys22:03
*** emeb <[email protected]> has joined #yosys22:04
killjoyEh, it's been too long for me, and I never did an FPGA project, just ASICs.22:04
*** shoragan <shoragan!~shoragan@user/shoragan> has quit IRC (Ping timeout: 255 seconds)22:55
*** shoragan <shoragan!~shoragan@user/shoragan> has joined #yosys22:55
*** emeb <[email protected]> has left #yosys23:31
*** peepsalot <peepsalot!~peepsalot@openscad/peepsalot> has quit IRC (Read error: Connection reset by peer)23:54
*** peepsalot <peepsalot!~peepsalot@openscad/peepsalot> has joined #yosys23:54

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