-
Notifications
You must be signed in to change notification settings - Fork 240
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 argument to makefile to simplify Continuous Integration flow #173
Conversation
While I understand the motivation and I agree that it can be improved, I am unsure about the specific solution/implementation in this PR. The fact that building/compiling the software and updating it implies modification of VHDL sources is undesirable. That is modificating the state of the repo unnecessarily. That is a problem for CI, but also for local usage. When testing multiple boards with different software, the software changes need to be handled in temporary commits, in order to avoid conflicts. That requires good knowledge of git and it can be cumbersome for less experienced users. I think a reasonable solution would be not to check Alternatively, The third option would be to modify the software makefiles as done in this PR. Currently, image: $(APP_ASM) $(APP_IMG)
install: image install-$(APP_IMG)
# Generate NEORV32 executable VHDL boot image
$(APP_IMG): main.bin $(IMAGE_GEN)
@set -e
@$(IMAGE_GEN) -app_img $< $@ $(shell basename $(CURDIR))
install-$(APP_IMG): $(APP_IMG)
@set -e
@echo "Installing application image to $(NEORV32_RTL_PATH)/$(APP_IMG)"
@cp $(APP_IMG) $(NEORV32_RTL_PATH)/. |
The 3rd solution from @umarcor seems like a better solution then mine, and would work nicely in my CI setup. |
@torerams feel free to update this PR with that snippet! |
@torerams
I know this is not pretty, but I like the concept that everything is already there so a synthesis will work out of the box.
😅 👍
I like this, too!
The default |
I have modified the makefile to support some new targets:
I have also updated the default targets accordingly. If the modifications work as expected I can update this PR if you like. -> common.mk.txt (changed file ending due to upload constraints) |
I like the new split into image and install but I am not that exited about the install target only copying old files. I see a lot of down-side of this approach as this will break the current flow for all/most users and scripts. I also expect there will be some people spending hours debugging before realizing that the install target copies old files, and are not using the source files they have just updated. I don't see much (if any) up-side with this approach. I really like @umarcor solution where:
With this solution everything is working as before when using the install target, but users can (not must) use the image target to build a local VHDL image file only. |
I guess what @torerams is suggesting comes down to adding the dependencies to the install target. I believe it was just an oversight by @stnolting since he was probably more focused on the app/bootloader stuff (which I missed in the snippet). |
Yes and no 😄 So yeah, maybe the easiest way would be to have a new Same with the bootloader: I think this would be more straightforward while also being backwards compatible. |
756ff3c
to
959c905
Compare
I have updated the PR with the solution we have discussed. |
@torerams I think this can be merged, if I did not broke anything, right? |
Thank @stnolting for fixing up the PR. Everything seem to be working fine with my testing, and the PR is ready for merging. |
I am using the neorv32 as a git submodule in a project where I compile both bootloader and application into VHDL modules in a CI flow (using a Jenkins server).
I have the source code if my application in my own repository and use the "make install" and "make bootloader" to compile and make local VHDL files in my repository.
But the 2 VHDL files (neorv32_bootloader_image.vhd and neorv32_application_image.vhd) are copied to the /rtl/core folder in the neorv32 repository messing up source control (and the CI flow) for this repository.
There are several workarounds for this (and I am using several), but a clean way to deal with this is to have an optional makefile argument to support CI flow better.
This PR adds a FLOW argument to the sw/common makefile (common.mk). Making it easy to use CI flow for your own projects.
To compile as before just use the same commands as before:
To make bootloader and application in a CI flow:
These commands will not change any source files in the neorv32 repository.