-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for simpler environmental variable creation #333
Conversation
…tion in the Makefile
Yes! Great idea to do this as a separate PR. I still think this is a can of worms for two reasons.
I'm also highly sceptical towards the usage of all these env vars in the first place. Having dabbled a bit with symbiflow it seemed very much like they were only used to define variables to have all configuration in one place and not really used as env vars at all. In that case there is no point in having them at all in the generated makefile where we can just put in the final value directly. At the same time, I do see that this functionality fills a gap and it will likely work for a majority of the cases, so I'm leaning towards pulling it in but without any guarantees that it will stay in the code base |
Can you tell me more about ninja and how it integrates with Edalize? I don't know anything about it at the moment |
The real reason why we don't want to drop the environmental variables altogether is that they are heavily used inside the F4PGA/Symbiflow python scripts. I know we already discussed working those scripts out of the flow, but from the perspective of my project that's a pretty big task that's set as a long-term goal. |
I don't really have much experience with csh but I see your point. Are there a substantial number of users that use Edalize through it? Are environmental variables the primary difference that Edalize would have in csh? |
Ok...passing all this stuff as env vars to the python scripts was slightly unexpected. It's kind of like only using global variables. But as you say, getting that cleaned up is probably best left as a separate project. With that said however, I would prefer if we could limit the scope of these env vars, so that in the makefiles we only pass the env vars that are actually used for each tool. A command-line in the makefile would then typically look like I do see a lot of them in the tcl files launched by yosys though (which is something I tried to clean up last year but gave up on because it was just too much spaghetti code), and in that case we would pass the relevant env vars when invoking yosys |
I think csh is the default on typical enterprise distributions like redhat but I'm not completely sure about that. I do know that many EDA tools supply both .sh and .csh scripts to handle both types of environments. But if both environments (I know sh-based ones like bash does) support launching programs with |
Ninja is a modern light-weight build system. Perhaps the main benefit of using that for Edalize is that it is much easier to get going on non-linux platforms. Longer term, we want to support a wider array of build orchestration tools. We could e.g. automatically generate CI pipeline scripts or distribute different steps of the build to different machines using LSF and SLURM instead of a single machine running a makefile. Right now there's only a makefile backend for the EdaCommand class, but I want to be a bit conservative so that we don't add a lot of features that make it harder to port to other backends in the future. |
You
You're right, I keep getting the python scripts confused with the TCL scripts. For yosys do we just pass in the variables like you show above? Maybe we should make an option for all tools at the edatool level that allows you to pass in variables, and then those variables are put in front of the command as shown which would then solve the problem for yosys and any other tools that may need variables. |
Yeah, based on your above comment I think this might be the right way to go forward, but maybe we should do it at the Edatool level? |
I see, so Ninja is more like an alternative to Makefiles. If Ninja has its own backend then will what we do here really affect it that much? |
…tal variables" This reverts commit 454deb6.
@olofk I'm going to send in a PR with Yosys modification and see if we can supplant this PR with that. |
I did some testing and it seems like |
Yes. Let's keep the Thank you for your contribution. Squashed and merged! |
This is a change that @schafernc and I developed further after your comment here: #322 (comment)
We would really like a feature like this to be implemented because it would greatly simplify the process of adding environmental variables to the Makefile for flows such as F4PGA which at the present rely very heavily on them.
Let us know what your thoughts are on this matter. I figured it would be nice to pull this discussion out into a separate PR.