<commit_before>export CLANG=0

CPU ?= lm32
PLATFORM ?= opsis
TARGET ?= HDMI2USB

IPRANGE ?= 192.168.100
TFTP_DIR := build/tftpd/

gateware:
	rm -rf build/$(PLATFORM)_$(TARGET)_$(CPU)
	./make.py --platform=$(PLATFORM) --target=$(TARGET) --cpu-type=$(CPU) --iprange=$(IPRANGE)

firmware:
	./make.py --platform=$(PLATFORM) --target=$(TARGET) --cpu-type=$(CPU) --iprange=$(IPRANGE) --no-compile-gateware


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

# Sim targets
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

sim-teardown:
	sudo killall atftpd || true	# FIXME: This is dangerous...

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

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

# Opsis specific targets
opsis-reset:
	opsis-mode-switch --verbose --mode=serial
	opsis-mode-switch --verbose --mode=jtag
	opsis-mode-switch --verbose --mode=serial
<commit_msg>Adding tftp directory.<commit_after>export CLANG=0

CPU ?= lm32
PLATFORM ?= opsis
TARGET ?= HDMI2USB

IPRANGE ?= 192.168.100
TFTPD_DIR ?= build/tftpd/

gateware:
	rm -rf build/$(PLATFORM)_$(TARGET)_$(CPU)
	./make.py --platform=$(PLATFORM) --target=$(TARGET) --cpu-type=$(CPU) --iprange=$(IPRANGE)

firmware:
	./make.py --platform=$(PLATFORM) --target=$(TARGET) --cpu-type=$(CPU) --iprange=$(IPRANGE) --no-compile-gateware

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

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

# Sim targets
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

sim-teardown:
	sudo killall atftpd || true	# FIXME: This is dangerous...

# TFTP server for minisoc to load firmware from
tftp: firmware
	mkdir -p $(TFTPD_DIR)
	cp build/$(PLATFORM)_$(TARGET)/software/boot.bin $(TFTPD_DIR)/boot.bin

tftpd_stop:
	sudo killall atftpd || true	# FIXME: This is dangerous...

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

# Opsis specific targets
opsis-reset:
	opsis-mode-switch --verbose --mode=serial
	opsis-mode-switch --verbose --mode=jtag
	opsis-mode-switch --verbose --mode=serial

{'fraction_non_alphanumeric': 0.16391787277011108, 'fraction_numerical': 0.02019522046449007, 'mean_word_length': 3.9205298013245033, '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': '4677201', 'n_tokens_mistral': 1179, 'n_tokens_neox': 1115, 'n_words': 261}