aboutsummaryrefslogtreecommitdiff
path: root/projects/libhal-test/Makefile
blob: a38029715f296777011f4488047765071c90f0e3 (plain) (blame)
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
TEST = cores test-bus test-trng test-hash test-aes-key-wrap test-pbkdf2 test-ecdsa test-rsa test-mkmif
#TEST += test-rpc_hash test-rpc_pkey test-rpc_get_version test-rpc_get_random
TEST += test-rpc_server

CFLAGS += -I $(LIBHAL_DIR)
LIBC_OBJS = printf.o gettimeofday.o
LIBS += $(LIBHAL_DIR)/libhal.a $(LIBTFM_DIR)/libtfm.a

all: $(TEST:=.elf)

vpath %.c $(LIBHAL_DIR)/tests $(LIBHAL_DIR)/utils

# .mo extension for files with main() that need to be wrapped as __main()
%.mo: %.c
	$(CC) -c $(CFLAGS) -Dmain=__main -o $@ $<

%.elf: %.mo main.o $(BOARD_OBJS) $(LIBC_OBJS) $(LIBS)
	$(CC) $(CFLAGS) $^ -o $*.elf -T$(LDSCRIPT) -g -Wl,-Map=$*.map
	$(OBJCOPY) -O binary $*.elf $*.bin
	$(SIZE) $*.elf

# don't automatically delete objects, to avoid a lot of unnecessary rebuilding
.SECONDARY: $(BOARD_OBJS) $(LIBC_OBJS)

clean:
	rm -f *.o *.mo
	rm -f *.elf
	rm -f *.bin
	rm -f *.map
/span> output wire [32-1:0] b_out ); // // Output Registers // reg [31:0] bram_reg_b; assign b_out = bram_reg_b; // // Read-Only Port B // always @(posedge clk) // case (b_addr) 4'b0000: bram_reg_b <= 32'h6f15f19d; 4'b0001: bram_reg_b <= 32'h85bce284; 4'b0010: bram_reg_b <= 32'he2817e62; 4'b0011: bram_reg_b <= 32'hf59f4e30; 4'b0100: bram_reg_b <= 32'h4a0f473e; 4'b0101: bram_reg_b <= 32'h1625ceec; 4'b0110: bram_reg_b <= 32'hd765eb83; 4'b0111: bram_reg_b <= 32'h070be242; 4'b1000: bram_reg_b <= 32'h6d6d23d6; 4'b1001: bram_reg_b <= 32'ha2616740; 4'b1010: bram_reg_b <= 32'h69d9d390; 4'b1011: bram_reg_b <= 32'hc9e821b5; endcase endmodule