Skip to content
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

Fix tests #390

Merged
merged 3 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 21 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ fw-build:
fw-clean:
make -C $(FIRM_DIR) clean-all


#
# EMULATE ON PC
#
Expand All @@ -29,7 +28,6 @@ pc-emul-clean: fw-clean
pc-emul-test: pc-emul-clean
make -C $(PC_DIR) test


#
# SIMULATE RTL
#
Expand Down Expand Up @@ -64,7 +62,6 @@ fpga-clean: fw-clean
fpga-test:
make -C $(BOARD_DIR) test


#
# SYNTHESIZE AND SIMULATE ASIC
#
Expand All @@ -85,6 +82,7 @@ asic-test:
#
# COMPILE DOCUMENTS
#

doc-build:
make -C $(DOC_DIR) $(DOC).pdf

Expand All @@ -94,10 +92,11 @@ doc-clean:
doc-test:
make -C $(DOC_DIR) test

doc-test-clean:
make -C $(DOC_DIR) test-clean

#
# CLEAN
#

clean: pc-emul-clean sim-clean fpga-clean doc-clean

#
# TEST ALL PLATFORMS
Expand Down Expand Up @@ -132,8 +131,10 @@ test-asic-clean:
make asic-clean ASIC_NODE=skywater

test-doc:
make fpga-clean-all
make fpga-build-all
make fpga-clean BOARD=CYCLONEV-GT-DK
make fpga-clean BOARD=AES-KU040-DB-G
make fpga-build BOARD=CYCLONEV-GT-DK
make fpga-build BOARD=AES-KU040-DB-G
make doc-test DOC=pb
make doc-test DOC=presentation

Expand All @@ -145,25 +146,22 @@ test: test-clean test-pc-emul test-sim test-fpga test-doc

test-clean: test-pc-emul-clean test-sim-clean test-fpga-clean test-doc-clean


debug:
@echo $(UART_DIR)
@echo $(CACHE_DIR)


.PHONY: fw-build fw-clean \
pc-emul-build pc-emul-run pc-emul-clean \
pc-emul-test pc-emul-test-clean\
sim-build sim-run sim-clean sim-test sim-test-clean\
fpga-build fpga-run fpga-clean fpga-test fpga-test-clean\
asic-synth asic-synth-clean \
asic-sim-post-synth asic-sim-post-synth-clean \
asic-test asic-test-clean\
doc-build doc-clean doc-test doc-test-clean\
test-pc-emul test-pc-emul-clean\
test-sim test-sim-clean\
test-fpga test-fpga-clean\
test-asic test-asic-clean\
test-doc test-doc-clean\
test test-clean
pc-emul-build pc-emul-run pc-emul-clean pc-emul-test \
sim-build sim-run sim-clean sim-test \
fpga-build fpga-run fpga-clean fpga-test \
asic-synth asic-sim-post-synth asic-test \
doc-build doc-clean doc-test \
clean \
test-pc-emul test-pc-emul-clean \
test-sim test-sim-clean \
test-fpga test-fpga-clean \
test-asic test-asic-clean \
test-doc test-doc-clean \
test test-clean \
debug
15 changes: 1 addition & 14 deletions document/document.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,10 @@ SWREGS=0

include $(LIB_DIR)/document/document.mk


test: clean-all
ifeq ($(DOC),pb)
make -C $(ROOT_DIR) fpga-test
endif
make $(DOC).pdf

$(DOC).pdf:
make doc-build
test: clean-all $(DOC).pdf
diff -q $(DOC).aux test.expected

clean-all: clean
rm -f $(DOC).pdf

test-clean:
make doc-clean DOC=presentation
make doc-clean DOC=pb

.PHONY: test clean-all

2 changes: 1 addition & 1 deletion hardware/fpga/fpga.mk
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ endif

FORCE ?= 1

run:
run: firmware.bin
ifeq ($(NORUN),0)
ifeq ($(BOARD_SERVER),)
if [ ! -f $(LOAD_FILE) ]; then touch $(LOAD_FILE); chown $(USER):dialout $(LOAD_FILE); chmod 664 $(LOAD_FILE); fi;\
Expand Down
10 changes: 6 additions & 4 deletions hardware/hardware.mk
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,17 @@ system.v: $(SRC_DIR)/system_core.v
PYTHON_DIR=$(MEM_DIR)/software/python

boot.hex: $(BOOT_DIR)/boot.bin
$(PYTHON_DIR)/makehex.py $(BOOT_DIR)/boot.bin $(BOOTROM_ADDR_W) > boot.hex
$(PYTHON_DIR)/makehex.py $< $(BOOTROM_ADDR_W) > $@

firmware.hex: $(FIRM_DIR)/firmware.bin
$(PYTHON_DIR)/makehex.py $(FIRM_DIR)/firmware.bin $(FIRM_ADDR_W) > firmware.hex
$(PYTHON_DIR)/makehex.py $< $(FIRM_ADDR_W) > $@
$(PYTHON_DIR)/hex_split.py firmware .
cp $(FIRM_DIR)/firmware.bin .

firmware.bin: $(FIRM_DIR)/firmware.bin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this target

cp $< .

#clean general hardware files
hw-clean: gen-clean
@rm -f *.v *.hex *.bin $(SRC_DIR)/system.v $(TB_DIR)/system_tb.v *.vh
@rm -f *.v *.vh *.hex *.bin $(SRC_DIR)/system.v $(TB_DIR)/system_tb.v

.PHONY: hw-clean
6 changes: 3 additions & 3 deletions hardware/simulation/simulation.mk
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ endif
#RULES
build: $(VSRC) $(VHDR) $(HEXPROGS)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy bin here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

ifeq ($(SIM_SERVER),)
bash -c "trap 'make kill-sim' INT TERM KILL EXIT; make comp"
make comp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why delete this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because here is running a build, not a simulation. So there is no simulation stuck to kill.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

else
ssh $(SIM_SSH_FLAGS) $(SIM_USER)@$(SIM_SERVER) "if [ ! -d $(REMOTE_ROOT_DIR) ]; then mkdir -p $(REMOTE_ROOT_DIR); fi"
rsync -avz --delete --force --exclude .git $(SIM_SYNC_FLAGS) $(ROOT_DIR) $(SIM_USER)@$(SIM_SERVER):$(REMOTE_ROOT_DIR)
bash -c "trap 'make kill-remote-sim' INT TERM KILL; ssh $(SIM_SSH_FLAGS) $(SIM_USER)@$(SIM_SERVER) 'make -C $(REMOTE_ROOT_DIR) sim-build SIMULATOR=$(SIMULATOR) INIT_MEM=$(INIT_MEM) USE_DDR=$(USE_DDR) RUN_EXTMEM=$(RUN_EXTMEM) VCD=$(VCD) TEST_LOG=\"$(TEST_LOG)\"'"
ssh $(SIM_SSH_FLAGS) $(SIM_USER)@$(SIM_SERVER) 'make -C $(REMOTE_ROOT_DIR) sim-build SIMULATOR=$(SIMULATOR) INIT_MEM=$(INIT_MEM) USE_DDR=$(USE_DDR) RUN_EXTMEM=$(RUN_EXTMEM) VCD=$(VCD) TEST_LOG=\"$(TEST_LOG)\"'
endif

run:
run: firmware.bin
ifeq ($(SIM_SERVER),)
@rm -f soc2cnsl cnsl2soc
$(CONSOLE_CMD) $(TEST_LOG) &
Expand Down