*** tpb <[email protected]> has joined #yosys | 00: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 | |
mewt | hi, 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/S1DXp | 04:00 |
---|---|---|
mewt | have tried removing the entire thing and cloning again several times, etc. | 04:00 |
mewt | i could just dummy out check-git-abc but i would prefer to know if it matters | 04:20 |
mewt | The contents of abc/.gitcommit is $Format:%H$ | 04:22 |
mewt | that seems like that should have been resolved by the commands above | 04:26 |
mewt | alright, 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 |
mewt | clearly 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 constant | 05:45 |
mewt | module 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 #yosys | 08:04 | |
lofty | mewt: can you provide an example for the clog2 issue? | 09:32 |
mewt | sure, tested and failing here (tiny artificial one): https://0x0.st/XU6r.v | 14:59 |
mewt | cmd used: yosys -p "synth_ice40 -device u -top clog2_test -json clog2_test.json" clog2_test.v | 15:00 |
mewt | this one succeeds, which is what I meant above: https://0x0.st/XU6s.v | 15:01 |
mewt | the 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 0 | 15:06 |
mewt | guess it's confirmation it's not debian-specific? | 15:06 |
mewt | can provide whatever info and try whatever for that as well, just let me know | 15:07 |
lofty | mewt: your failing test case seems to be very reliant on implementation behaviour | 15:33 |
lofty | I searched 1364:2005, and it pretty much always assumes that parameters are declared before use | 15:33 |
mewt | Right, so I guess I should just use 2nd case all the time, and this isn't much of a bug? | 15:34 |
lofty | Or the "1995 form" where you declare port sizes after parameters | 15:35 |
mewt | It'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 standard | 15:35 |
mewt | But why does it fail for only *this*? | 15:36 |
mewt | Surely it should then fail for every single parameter I am using to set a port size | 15:37 |
mewt | I 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 fails | 15:38 |
lofty | Using a parameter to set a port size is fine, because they're defaults, effectively | 15:40 |
mewt | Yes, I am aware -- I'm saying that if the problem is where the declaration is, this is harly my only instance of doing it | 15:41 |
mewt | let me get another test case | 15:41 |
mewt | hardly* | 15:41 |
lofty | But the standard is fairly specific that system tasks must have constant expression inputs | 15:41 |
mewt | but...don't they? | 15:42 |
mewt | what's non-constant about the product of 2 constants? | 15:42 |
lofty | Nothing, which is why your second example works fine | 15:42 |
mewt | what makes it non-constant in the first? the order the parameters appear in is certainly the same | 15:43 |
mewt | does it somehow...not look at PARAM3 first if I do the first thing? | 15:43 |
mewt | why does it become non-constant if the declaration of the parameters moves below the ports? | 15:49 |
mewt | i 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 fine | 16:26 |
lofty | And I'm working on trying to find that conclusive answer | 16:28 |
mewt | Alright, I'll leave you to it, sorry | 16:28 |
lofty | mewt: so, Yosys has a monster called simplify, which performs elaboration and constant folding at once | 16:41 |
lofty | It traverses the function AST roughly from top to bottom | 16:41 |
mewt | Thank 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 bg | 16:45 |
lofty | In case 2, it discovers PARAM3, and transforms it into the constant 16, and then PARAM4, which is $clog(16) = 4 | 16:45 |
lofty | In 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 error | 16:46 |
mewt | ah ok, so my very intuitive sense that it looked at param3 before knowing what it was was...about right then | 16:47 |
mewt | that makes sense | 16:48 |
mewt | is that something that's intended to stay this way? | 16:48 |
lofty | This 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 |
lofty | There is a pretty good reason why the team intends to migrate to slang instead of using the existing frontend | 16:48 |
mewt | aha ok | 16:49 |
mewt | I guess that's a fair long term thing? | 16:50 |
lofty | https://github.com/povik/yosys-slang | 16:50 |
lofty | Closer than you think | 16:50 |
lofty | (the author is on the Yosys team) | 16:51 |
mewt | neat! | 16:51 |
mewt | being able to use systemverilog straight-up like this would be nice, I need to improve my skills on that anyways | 16:51 |
lofty | I mean, we also have something of a disincentive to improve SV support because we sell Verific as an SV frontend | 16:52 |
lofty | (and VHDL frontend) | 16:53 |
lofty | But the fact that a permissively licensed external SV frontend exists is pretty motivating | 16:54 |
mewt | well, 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 this | 16:55 |
mewt | target for verific, that is | 16:56 |
lofty | Oh yeah, no, I understand | 16:56 |
lofty | The open frontend is Good Enough for a lot of people, | 16:57 |
lofty | and our main target market for Verific is people doing formal verification | 16:58 |
lofty | Anyway; sorry, I'm rambling | 16:59 |
lofty | Good luck with your research :p | 16:59 |
mewt | (this is just a hobby project/a way to improve my FPGA skill) | 17:00 |
mewt | thanks | 17:00 |
*** ppisati <[email protected]> has quit IRC (Ping timeout: 265 seconds) | 17:46 | |
*** ppisati <[email protected]> has joined #yosys | 17:48 | |
mewt | oh, any comment on the first one? behavior seems same as this issue but isn't on debian https://github.com/YosysHQ/yosys/issues/4449 | 18:01 |
lofty | You say you're using Arch, right? | 18:12 |
lofty | mewt: ^ | 18:13 |
mewt | yes I am | 18:13 |
lofty | Small problem: I too am using Arch and I can't reproduce this | 18:13 |
mewt | interesting | 18:13 |
mewt | what is the content of abc/.gitcommit for you? | 18:14 |
lofty | $Format:%H$ | 18:14 |
mewt | ok, same then... huh | 18:14 |
mewt | well 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 different | 18:16 |
lofty | What if you hexdump .gitcommit? | 18:16 |
lofty | mewt: ^ | 18:17 |
mewt | https://0x0.st/XUI4.txt | 18:17 |
lofty | ... That hexdump has a weird order | 18:18 |
mewt | I just used hexdump with no options | 18:18 |
mewt | hm | 18:18 |
lofty | xxd :p | 18:18 |
mewt | https://0x0.st/XUIJ.txt sorry about that | 18:19 |
lofty | What shell are you using? Out of curiosity | 18:20 |
mewt | this is bash | 18:20 |
lofty | Byte perfect, same shell... | 18:21 |
mewt | interesting | 18:21 |
mewt | GNU bash, version 5.2.37(1)-release (x86_64-pc-linux-gnu) | 18:21 |
lofty | Locale? :p | 18:21 |
lofty | Same shell version | 18:22 |
lofty | GNU Make 4.4.1 | 18:22 |
mewt | LANG=en_US.UTF-8 | 18:22 |
mewt | and everything else is that too, except LC_ALL is unset | 18:23 |
lofty | Different locale, but I don't think that should matter | 18:23 |
lofty | mewt: git -C "." submodule status abc # in the Yosys source directory | 18:34 |
mewt | cac8f99eaa220a5e3db5caeb87cef0a975c953a2 abc (yosys-0.46) | 18:35 |
lofty | git -C "." submodule status abc 2>/dev/null | grep -q '^ '; echo $? | 18:36 |
mewt | 0 | 18:36 |
lofty | ... So why the heck is that branch not being taken >.< (not directed at you) | 18:37 |
lethalbit | git's cursed | 18:37 |
mewt | I'll get a vanilla clone of it and try one more time real quick | 18:37 |
mewt | yeah nope, now I have a second one I didn't dummy the check out on if you want anything else | 18:45 |
lofty | Unfortunately it's a Sunday so my colleagues are away, which means I'm kinda guessing what might be useful to them | 18:46 |
mewt | well, ping for anything else tomorrow/whenever and I can try to get it | 18:51 |
mewt | otherwise I'll remove the check for now as it seems to work properly and I can see it manually, at this point, i think | 18:51 |
lofty | mewt: 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 #yosys | 23:40 |
Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!