<commit_before>CPU ?= lm32
export CLANG=0

IPRANGE ?= 192.168.100

opsis_base:
	rm -rf build/opsis_base
	./opsis_base.py --cpu-type $(CPU)

opsis_minisoc:
	rm -rf build/opsis_minisoc
	./opsis_base.py --with-ethernet --cpu-type $(CPU) --iprange=$(IPRANGE)

# TFTP server for minisoc to load firmware from
tftpd_stop:
	sudo killall atftpd || true	# FIXME: This is dangerous...

tftpd_start:
	sudo atftpd --bind-address $(IPRANGE).100 --daemon --logfile /dev/stdout --no-fork --user $(shell whoami) build/$(TARGET)/software/ &

opsis_video:
	rm -rf build/opsis_video
	./opsis_video.py --cpu-type $(CPU) --iprange=$(IPRANGE)

opsis_hdmi2usb:
	rm -rf build/opsis_hdmi2usb
	./opsis_hdmi2usb.py --cpu-type $(CPU) --iprange=$(IPRANGE)

opsis_sim_setup:
	sudo openvpn --mktun --dev tap0
	sudo ifconfig tap0 $(IPRANGE).100 up
	sudo mknod /dev/net/tap0 c 10 200
	sudo chown $(shell whoami) /dev/net/tap0
	make TARGET=opsis_sim tftpd_start

opsis_sim_teardown:
	make tftpd_stop
	sudo rm -f /dev/net/tap0
	sudo ifconfig tap0 down
	sudo openvpn --rmtun --dev tap0

opsis_sim:
	rm -rf build/opsis_sim
	./opsis_sim.py --with-ethernet --cpu-type $(CPU)

reset:
	opsis-mode-switch --verbose --mode=serial
	opsis-mode-switch --verbose --mode=jtag
	opsis-mode-switch --verbose --mode=serial

load:
	opsis-mode-switch --verbose --load-gateware build/$(TARGET)/gateware/top.bit
	make TARGET=$(TARGET) load-firmware

load-firmware:
	opsis-mode-switch --verbose --mode=serial
	flterm --port=/dev/hdmi2usb/by-num/opsis0/tty --kernel=build/$(TARGET)/software/boot.bin

clean:
	rm -rf build

.PHONY: load firmware load-firmware
<commit_msg>Split load gateware/firmware<commit_after>CPU ?= lm32
export CLANG=0

IPRANGE ?= 192.168.100

opsis_base:
	rm -rf build/opsis_base
	./opsis_base.py --cpu-type $(CPU)

opsis_minisoc:
	rm -rf build/opsis_minisoc
	./opsis_base.py --with-ethernet --cpu-type $(CPU) --iprange=$(IPRANGE)

# TFTP server for minisoc to load firmware from
tftpd_stop:
	sudo killall atftpd || true	# FIXME: This is dangerous...

tftpd_start:
	sudo atftpd --bind-address $(IPRANGE).100 --daemon --logfile /dev/stdout --no-fork --user $(shell whoami) build/$(TARGET)/software/ &

opsis_video:
	rm -rf build/opsis_video
	./opsis_video.py --cpu-type $(CPU) --iprange=$(IPRANGE)

opsis_hdmi2usb:
	rm -rf build/opsis_hdmi2usb
	./opsis_hdmi2usb.py --cpu-type $(CPU) --iprange=$(IPRANGE)

opsis_sim_setup:
	sudo openvpn --mktun --dev tap0
	sudo ifconfig tap0 $(IPRANGE).100 up
	sudo mknod /dev/net/tap0 c 10 200
	sudo chown $(shell whoami) /dev/net/tap0
	make TARGET=opsis_sim tftpd_start

opsis_sim_teardown:
	make tftpd_stop
	sudo rm -f /dev/net/tap0
	sudo ifconfig tap0 down
	sudo openvpn --rmtun --dev tap0

opsis_sim:
	rm -rf build/opsis_sim
	./opsis_sim.py --with-ethernet --cpu-type $(CPU)

reset:
	opsis-mode-switch --verbose --mode=serial
	opsis-mode-switch --verbose --mode=jtag
	opsis-mode-switch --verbose --mode=serial

load-gateware:
	opsis-mode-switch --verbose --load-gateware build/$(TARGET)/gateware/top.bit
	make TARGET=$(TARGET) load-firmware

load-firmware:
	opsis-mode-switch --verbose --mode=serial
	flterm --port=/dev/hdmi2usb/by-num/opsis0/tty --kernel=build/$(TARGET)/software/boot.bin

clean:
	rm -rf build

.PHONY: load firmware load-firmware

{'fraction_non_alphanumeric': 0.14523076923076922, 'fraction_numerical': 0.021538461538461538, 'mean_word_length': 3.637660485021398, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '268890', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1263, 'n_words': 302}