diff --git a/.gitignore b/.gitignore index e8c8dad..d8eddca 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,8 @@ __pycache__/ # Cadence/Xcelium simulation output sim/behav/WORKSPACE/ + +# Submission packaging +*-dd-fall26.zip +regress.log +submission.stamp diff --git a/Makefile b/Makefile index 84937a8..052ffbb 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,12 @@ +# Fill these in before running make submit, for example: +# MEMBER_NAME = George Burdell +# GT_USERNAME = gburdell3 +# DISCORD_NAME = gburdell67discord +MEMBER_NAME = +GT_USERNAME = +DISCORD_NAME = +export MEMBER_NAME + PYTHON ?= python3 TEST ?= ebreak TEST_DIR := tests/$(TEST) @@ -6,13 +15,14 @@ CROSSBAR_TIMEOUT ?= 20 TEST_NAMES := $(sort $(notdir $(patsubst %/,%,$(dir $(wildcard tests/*/program.asm))))) -.PHONY: help generate smoke test regress clean clean-generated +.PHONY: help generate smoke test regress submit clean clean-generated help: @echo "make generate TEST= Assemble a test and generate golden files" @echo "make smoke Test build/TB wiring with a mock DUT" @echo "make test TEST= Generate and run one RTL test" @echo "make regress Run every test, print PASS/FAIL summary (logs in tests//sim.log)" + @echo "make submit Run regress and zip your sources, tests and log for checkoff" @echo "make clean Remove generated test and simulator files" @echo "Available tests: $(TEST_NAMES)" @@ -54,6 +64,22 @@ regress: exit 1; \ fi +submit: + @if [ -z "$(strip $(MEMBER_NAME))" ] || [ -z "$(strip $(GT_USERNAME))" ] || [ -z "$(strip $(DISCORD_NAME))" ]; then \ + echo "Fill in MEMBER_NAME, GT_USERNAME and DISCORD_NAME at the top of the Makefile first."; \ + exit 2; \ + fi + @submission="$$(printf '%s' "$$MEMBER_NAME" | tr -d "[:space:]'.,-")-$(strip $(GT_USERNAME))-$(strip $(DISCORD_NAME))-dd-fall26.zip"; \ + rm -f "$$submission" regress.log submission.stamp; \ + scripts/sjstamp submission.stamp regress.log src sim/behav/Include tests -- $(MAKE) --no-print-directory regress; \ + status=$$?; \ + if [ $$status -eq 125 ]; then echo "Could not stamp the submission, nothing was zipped."; exit 1; fi; \ + zip -qr "$$submission" src sim/behav/Include tests regress.log submission.stamp \ + -x '*.DS_Store' 'tests/*/program.o' 'tests/*/program.hex' 'tests/*/sim.log'; \ + echo "----------------------------------------"; \ + if [ $$status -ne 0 ]; then echo "WARNING: not all tests pass, see regress.log"; fi; \ + echo "Wrote $$submission" + clean: $(MAKE) -C sim/behav clean $(MAKE) --no-print-directory clean-generated diff --git a/README.md b/README.md index 1ad9a46..c13ba1b 100644 --- a/README.md +++ b/README.md @@ -276,6 +276,7 @@ In Person Submissions: Additional Instructions For Online Submissions: - Include a screenshot of all your tests passing with your gt username somewhere in the terminal in the screenshot +- fill in your name, GT username and Discord username at the top of the `Makefile`, then run `make submit` to run every test and build the zip - **submit a zip of the src folder to the sjcheckoffs Discord Account​** image - Include any supporting documentation you may have used (diagrams, drawings, state machines) diff --git a/scripts/sjstamp b/scripts/sjstamp new file mode 100755 index 0000000..1cfa2d0 Binary files /dev/null and b/scripts/sjstamp differ