OpenCores
URL https://opencores.org/ocsvn/csa/csa/trunk

Subversion Repositories csa

[/] [csa/] [trunk/] [makefile] - Blame information for rev 51

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 8 simon111
 
2 51 simon111
################################################################################
3
# some environment variables
4
################################################################################
5
MODULE          := key_schedule                   # the module name
6
TEST_TIMES      := 1                              # check times
7
DEBUG           := n                              # whether debug is enable
8
 
9
 
10
################################################################################
11
TEST_IN_FILE    := test_dat/$(MODULE).in
12
 
13
 
14
 
15
################################################################################
16
# depend
17
################################################################################
18
 
19 27 simon111
all:bench sw_sim rtl
20 8 simon111
 
21 27 simon111
.PHONY: rtl
22
rtl:
23 15 simon111
        @echo compiling rtl ...
24
        @make -s -C rtl    PROJ_NAME=$(MODULE) DEBUG=$(DEBUG)
25
 
26 27 simon111
.PHONY: bench
27
bench:
28 15 simon111
        @echo compiling bench ...
29
        @make -s -C bench  PROJ_NAME=$(MODULE) DEBUG=$(DEBUG)
30 8 simon111
 
31 27 simon111
.PHONY: sw_sim
32
sw_sim:
33 15 simon111
        @echo compiling sw_sim ...
34
        @make -s -C sw_sim PROJ_NAME=$(MODULE) DEBUG=$(DEBUG)
35 8 simon111
 
36 51 simon111
preare_bin_fn =                                              \
37
        str="" ;                                             \
38
        for ((i=0;i<$1;i=i+1));                              \
39
        do                                                   \
40
                n=$$(expr $$RANDOM % 256 )    ;              \
41
                binstr=$$(echo "ibase=10;obase=16;$$n"|bc) ; \
42
                binstr=$$(echo "000: $$binstr " | xxd -r );  \
43
                str+=$$binstr ;                              \
44
        done          ;                                      \
45
        echo -n $$str  >$(TEST_IN_FILE)  ;
46 8 simon111
 
47 51 simon111
prepare_block_decypher:
48
        $(call preare_bin_fn,64)
49 8 simon111
 
50 51 simon111
prepare_key_perm:
51
        $(call preare_bin_fn,8)
52 8 simon111
 
53 51 simon111
prepare_key_schedule:
54 47 simon111
        $(call preare_bin_fn,8)
55 18 simon111
 
56 51 simon111
prepare_group_decrypt:
57 50 simon111
        $(call preare_bin_fn,192)
58
 
59 51 simon111
prepare_stream_cypher:
60 22 simon111
        $(call preare_fn,24)
61 13 simon111
 
62 15 simon111
check:
63
        @(for ((i=0;i<$(TEST_TIMES);i=i+1))                                       \
64
                do                                                                \
65 13 simon111
                        make -s preare_$(MODULE);                                 \
66
                        make -s -C sw_sim test PROJ_NAME=$(MODULE);               \
67
                        make -s -C bench test PROJ_NAME=$(MODULE);                \
68
                        diff test_dat/$(MODULE).out.sw test_dat/$(MODULE).out.v ; \
69 8 simon111
                done)
70
 
71 11 simon111
clean:
72 27 simon111
        echo clean sw_sim
73 13 simon111
        @make -s -C sw_sim clean
74 27 simon111
        echo clean rtl
75 13 simon111
        @make -s -C rtl clean
76 27 simon111
        echo clean bench
77 13 simon111
        @make -s -C bench clean
78
        @rm -fr test_dat/*
79 11 simon111
 
80 13 simon111
cscope:
81
        @find . -name "*.[ch]" >cscope.files
82
        @cscope -b
83
 
84 51 simon111
help:
85
        @echo "avaliable make tagers:"
86
        @echo "help                  --- display this help information"
87
        @echo "prepare_ --- prepare the input data for test the module"
88
        @echo "all                   --- compile the rtl bench and c programs, don't run test"
89
        @echo "check                 --- run test"
90
        @echo "clean                 --- remove the compiled file"
91
        @echo "cscope                --- gernerate a cscope file for c files( i use vim )"
92
        @echo "avaliable make variable:"
93
        @echo "MODULE                --- the current module name"
94
        @echo "TEST_TIMES            --- check times"
95
        @echo "DEBUG                 --- whether enable debug"
96 13 simon111
 
97 51 simon111
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.