-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
49 lines (35 loc) · 1.17 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
CAP ?= 128
ifeq ($(CAP), 128)
BSCFLAGS = -D CAP128
else
BSCFLAGS = -D CAP64
endif
CAPTYPE ?= CapPipe
BSCFLAGS += -D CAPTYPE=$(CAPTYPE)
ARCH ?= RISCV
ifeq ($(ARCH), RISCV)
BSCFLAGS += -D RISCV
endif
BSV_VERILOG_WRAPPERS_DIR ?= $(CURDIR)/build/
BUILD_DIR = $(BSV_VERILOG_WRAPPERS_DIR)
COUNTEREXAMPLE_DIR = $(CURDIR)/counterexamples/
BSCFLAGS += -bdir $(BUILD_DIR)
all: verilog-wrappers blarney-wrappers
$(BUILD_DIR):
mkdir -p $@
$(COUNTEREXAMPLE_DIR):
mkdir -p $@
verilog-wrappers: CHERICapWrap.bsv CHERICap.bsv CHERICC_Fat.bsv $(BUILD_DIR)
bsc $(BSCFLAGS) -vdir $(BSV_VERILOG_WRAPPERS_DIR) -verilog -u $<
verilog-props: CHERICapProps.bsv CHERICap.bsv CHERICC_Fat.bsv $(BUILD_DIR) $(COUNTEREXAMPLE_DIR)
bsc $(BSCFLAGS) -vdir $(COUNTEREXAMPLE_DIR) -verilog -u $<
check-prop: assertions.sv verilog-props $(COUNTEREXAMPLE_DIR)
sby --prefix $(COUNTEREXAMPLE_DIR) -f check.sby
blarney-wrappers: CHERICapWrap.py verilog-wrappers $(BUILD_DIR)
./CHERICapWrap.py -o $(BUILD_DIR)/CHERIBlarneyWrappers $(BUILD_DIR)/*.v
.PHONY: clean clean-counterexamples full-clean
clean-counterexamples:
rm -rf $(COUNTEREXAMPLE_DIR)
clean:
rm -rf $(BUILD_DIR)
full-clean: clean clean-counterexamples