Sunday, 2024-10-27

*** tpb <[email protected]> has joined #yosys00:00
*** dys <dys!~dys@user/dys> has quit IRC (Ping timeout: 252 seconds)01:46
*** madprops <madprops!~hj8oijo@user/madprops> has left #yosys (Leaving)03:06
mewthi, having an issue on an updated Arch system trying to build yosys from source. I'm on d1695ad9980466ca49d7931ffbc600517682785f, I run "git clone --recursive https://github.com/YosysHQ/yosys.git" "git submodule update --init", "make -j$(nproc)", "sudo make install" from the root of the repo. In response I get the message at the following paste: https://dpaste.org/S1DXp04:00
mewthave tried removing the entire thing and cloning again several times, etc.04:00
mewti could just dummy out check-git-abc but i would prefer to know if it matters04:20
mewtThe contents of abc/.gitcommit is $Format:%H$04:22
mewtthat seems like that should have been resolved by the commands above04:26
mewtalright, and I've got a second one I've talked about before -- clog2 of a localparam that is the product of 2 other localparams causes yosys to exit with ERROR: Non-constant function call in constant expression.05:24
mewtclearly this is resolvable because the two localparams in the product are constants, therefore the product is a constant, therefore log2 ceil of the product is a constant05:45
mewtmodule blah #(localparam PARAM1 = 1, localparam PARAM2 = 2, localparam PARAM3=PARAM1*PARAM2, localparam PARAM4 = $clog2(PARAM3)) ( ... works. Should this be different?06:07
*** kristianpaul <kristianpaul!~paul@user/kristianpaul> has quit IRC (Read error: Connection reset by peer)08:03
*** kristianpaul <kristianpaul!~paul@user/kristianpaul> has joined #yosys08:04
loftymewt: can you provide an example for the clog2 issue?09:32
mewtsure, tested and failing here (tiny artificial one): https://0x0.st/XU6r.v14:59
mewtcmd used: yosys -p "synth_ice40 -device u -top clog2_test -json clog2_test.json" clog2_test.v15:00
mewtthis one succeeds, which is what I meant above: https://0x0.st/XU6s.v15:01
mewtthe first issue still exists, I took the strategy in the issue on github for it and just replaced the content of check-git-abc with exit 015:06
mewtguess it's confirmation it's not debian-specific?15:06
mewtcan provide whatever info and try whatever for that as well, just let me know15:07
loftymewt: your failing test case seems to be very reliant on implementation behaviour 15:33
loftyI searched 1364:2005, and it pretty much always assumes that parameters are declared before use15:33
mewtRight, so I guess I should just use 2nd case all the time, and this isn't much of a bug?15:34
loftyOr the "1995 form" where you declare port sizes after parameters15:35
mewtIt's not...hard to convert things to that, so that's not the worst outcome as long as I know a consistent rule. I guess I need to read the standard15:35
mewtBut why does it fail for only *this*?15:36
mewtSurely it should then fail for every single parameter I am using to set a port size15:37
mewtI have about a billion different things using the pattern with parameter declaration after they are use in a port size, and only once $clog2 gets involved, it fails15:38
loftyUsing a parameter to set a port size is fine, because they're defaults, effectively15:40
mewtYes, I am aware -- I'm saying that if the problem is where the declaration is, this is harly my only instance of doing it15:41
mewtlet me get another test case15:41
mewthardly*15:41
loftyBut the standard is fairly specific that system tasks must have constant expression inputs 15:41
mewtbut...don't they?15:42
mewtwhat's non-constant about the product of 2 constants?15:42
loftyNothing, which is why your second example works fine 15:42
mewtwhat makes it non-constant in the first? the order the parameters appear in is certainly the same15:43
mewtdoes it somehow...not look at PARAM3 first if I do the first thing?15:43
mewtwhy does it become non-constant if the declaration of the parameters moves below the ports?15:49
mewti really would prefer some kind of conclusive answer -- why does PARAM4 become non-constant with case 1, and why doesn't every instance of a parameter declaration after its use to set a port size fail if it's not permissible? Using PARAM1 or PARAM2 to set a port size with case 1 is just fine16:26
loftyAnd I'm working on trying to find that conclusive answer16:28
mewtAlright, I'll leave you to it, sorry16:28
loftymewt: so, Yosys has a monster called simplify, which performs elaboration and constant folding at once16:41
loftyIt traverses the function AST roughly from top to bottom16:41
mewtThank you. I guess at this point if I want to understand better, I should try to debug build and have a look in the code. I think I have an intuitive sense of what won't work from this/how to avoid any similar problems at least. I think I recall starting to look at where in the code things went this way but didn't have the bg16:45
loftyIn case 2, it discovers PARAM3, and transforms it into the constant 16, and then PARAM4, which is $clog(16) = 416:45
loftyIn case 1, it discovers PARAM4 first, looks at the definition of it to find it is $clog2(PARAM3), but PARAM3 has not been constant folded, so it's just an identifier, thus you get an error16:46
mewtah ok, so my very intuitive sense that it looked at param3 before knowing what it was was...about right then16:47
mewtthat makes sense16:48
mewtis that something that's intended to stay this way? 16:48
loftyThis feels like a situation it *could* handle, but the open source Verilog front-end is a nightmare nobody wants to touch or maintain 16:48
loftyThere is a pretty good reason why the team intends to migrate to slang instead of using the existing frontend16:48
mewtaha ok16:49
mewtI guess that's a fair long term thing?16:50
loftyhttps://github.com/povik/yosys-slang16:50
loftyCloser than you think16:50
lofty(the author is on the Yosys team)16:51
mewtneat!16:51
mewtbeing able to use systemverilog straight-up like this would be nice, I need to improve my skills on that anyways16:51
loftyI mean, we also have something of a disincentive to improve SV support because we sell Verific as an SV frontend16:52
lofty(and VHDL frontend)16:53
loftyBut the fact that a permissively licensed external SV frontend exists is pretty motivating16:54
mewtwell, as a lowly grad student whose research will be shoved into the xilinx tools if it touches HDL stuff at all, I probably am not the target. But I'll have to follow progress on this16:55
mewttarget for verific, that is16:56
loftyOh yeah, no, I understand16:56
loftyThe open frontend is Good Enough for a lot of people,16:57
loftyand our main target market for Verific is people doing formal verification 16:58
loftyAnyway; sorry, I'm rambling16:59
loftyGood luck with your research :p16:59
mewt(this is just a hobby project/a way to improve my FPGA skill)17:00
mewtthanks17:00
*** ppisati <[email protected]> has quit IRC (Ping timeout: 265 seconds)17:46
*** ppisati <[email protected]> has joined #yosys17:48
mewtoh, any comment on the first one? behavior seems same as this issue but isn't on debian https://github.com/YosysHQ/yosys/issues/444918:01
loftyYou say you're using Arch, right?18:12
loftymewt: ^18:13
mewtyes I am18:13
loftySmall problem: I too am using Arch and I can't reproduce this18:13
mewtinteresting18:13
mewtwhat is the content of abc/.gitcommit for you?18:14
lofty$Format:%H$18:14
mewtok, same then... huh18:14
mewtwell i don't have a lot more time, so I'll come back to this I guess unless there are other ideas. can try anything you suggest later on to disambiguate why, but it seems like something about the if statement must be different18:16
loftyWhat if you hexdump .gitcommit?18:16
loftymewt: ^18:17
mewthttps://0x0.st/XUI4.txt18:17
lofty... That hexdump has a weird order18:18
mewtI just used hexdump with no options18:18
mewthm18:18
loftyxxd :p18:18
mewthttps://0x0.st/XUIJ.txt sorry about that18:19
loftyWhat shell are you using? Out of curiosity 18:20
mewtthis is bash18:20
loftyByte perfect, same shell...18:21
mewtinteresting18:21
mewtGNU bash, version 5.2.37(1)-release (x86_64-pc-linux-gnu)18:21
loftyLocale? :p18:21
loftySame shell version18:22
loftyGNU Make 4.4.118:22
mewtLANG=en_US.UTF-818:22
mewtand everything else is that too, except LC_ALL is unset18:23
loftyDifferent locale, but I don't think that should matter18:23
loftymewt: git -C "." submodule status abc # in the Yosys source directory18:34
mewt cac8f99eaa220a5e3db5caeb87cef0a975c953a2 abc (yosys-0.46)18:35
loftygit -C "." submodule status abc 2>/dev/null | grep -q '^ '; echo $?18:36
mewt018:36
lofty... So why the heck is that branch not being taken >.< (not directed at you)18:37
lethalbitgit's cursed18:37
mewtI'll get a vanilla clone of it and try one more time real quick18:37
mewtyeah nope, now I have a second one I didn't dummy the check out on if you want anything else18:45
loftyUnfortunately it's a Sunday so my colleagues are away, which means I'm kinda guessing what might be useful to them 18:46
mewtwell, ping for anything else tomorrow/whenever and I can try to get it18:51
mewtotherwise I'll remove the check for now as it seems to work properly and I can see it manually, at this point, i think18:51
loftymewt: grep -V?19:39
*** nonchip <[email protected]> has quit IRC (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)23:40
*** nonchip <[email protected]> has joined #yosys23:40

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