-
Notifications
You must be signed in to change notification settings - Fork 168
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
Add Bender support #216
Add Bender support #216
Conversation
Need to freeze version and point to stable branches
setup/vsim.sh
Outdated
ROOT=$(cd "$(dirname "${(%):-%N}")/.." && pwd) | ||
else | ||
ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) | ||
fi | ||
export VSIM_PATH="$ROOT"/sim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to change this file. The ${BASH_SOURCE[0]:-$0}
with the :
makes it so that it works under zsh
already.
@bluewww @meggiman Thanks for merging pulp_soc! This PR should implement bender within pulpissimo, adding overrides for
Let me know if you would like me to modify anything, I also updated the readme slightly to inform a bit about bender integration. |
I made a new As for the FPGA + bender thing, we can address this in another PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one small issue.
CI passes so I can merge it right afterwards.
@[ "$$(ls -A ips/)" ] || { echo "ERROR: ips/ is an empty directory. Did you run ./update-ips?"; exit 1; } | ||
cd sim && $(MAKE) lib build opt | ||
cd sim && $(MAKE) all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change this to all
, then you should also remove clean
from the all
target it sim/
. Anyway, it is a mistake from me to put clean
into the all
target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a couple of comments in my review. On a side-note: I already have the necessary changes for the benderization of the FPGA port. I will add them in a separate PR once this one is merged. All in all the PR looks very nice. Thanks a lot @micprog, there are only a couple of consideration about make target interdependencies I want to raise:
I think having the bender download target as a dependency of all other bender using targets is a must. What could be considered on top of that is to add dependencies to the build and scripts target as well to force a bender update
or bender scripts
when necessary. For these two cases I would be interested in you opinion if there are corner cases where such a behavior is nuisance during usual workflow.
@@ -2,3 +2,6 @@ modelsim.ini | |||
xcelium.d/ | |||
xrun.history | |||
xrun.log | |||
.bender | |||
bender | |||
Bender.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it maybe make sense to add the default deps
checkout folder used by the bender clone
command here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can of course add this, here are some considerations why I haven't yet.
First, the ips
directory used for IPApproX is not added, so it would be conflicting behavior (this could be added of course).
Second, one use-case for bender clone
would be to temporarily check in edits to one IP, along with the corresponding Bender.local
edits, to share with a collaborator. Although, for this use-case, I think trickier behavior could be considered OK, as this is non-standard, so adding working_dir
to the .gitignore
would be acceptable.
Finally, I would consider keeping this directory outside of the .gitignore
as a check before merging, to see if all changes to dependencies have been added before committing the parent repo, in an effort to avoid conflicts when sharing.
Please let me know your thoughts on this, I will gladly update as needed.
Makefile
Outdated
BENDER_BUILD_DIR = sim | ||
|
||
.PHONY: bender-script bender-build bender-rm | ||
bender-script: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would make sense to have the bender
target as a dependency of the script target. Like this, bender would be automatically downloaded upon first use of the bender-script. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense. I didn't add it, as the checkout
command would call it, with bender-script
serving as a support target, and for the logical flow I decided to separate dependency download and script generation, but bender will fetch the dependencies if they're not there, so ensuring bender is present for this command is reasonable, will add.
``` | ||
This will download all the required IPs, solve dependencies and generate the | ||
scripts by calling `./generate-scripts`. | ||
scripts. The default dependency management tool is IPApproX, where `./update-ips` and `./generate-scripts` are called. If the environment variable `BENDER` is set, bender is used as the dependency management tool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should ideally have a single set of commands, that only discriminates between the usage of the BENDER env variable. I.e. we should have a checkout
scripts
build
target that does the job for both tools. Right now, generate scripts is done with a make target for bender but with a Python script for IPApprox. That's a bit inconsistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense, I have updated it, although this is likely to cause confusion for IPApproX users, as the behavior of ./update-ips
is now different from before, requiring an additional step.
I agree on the bender download as a target for the other bender commands. Regarding the calling of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm from my side
When @meggiman approves we can merge this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! Thanks for the changes.
Add
Bender.yml
for bender support, addBender.local
for overrides, add Makefile compatibility with bender (set envvarBENDER
to usecheckout
,build
,clean
)