head	1.7;
access;
symbols;
locks; strict;
comment	@# @;


1.7
date	2008.10.13.13.04.09;	author simon111;	state Exp;
branches;
next	1.6;
commitid	3e6b48f3472a4567;

1.6
date	2008.08.23.07.15.56;	author simon111;	state Exp;
branches;
next	1.5;
commitid	52b548afb8fd4567;

1.5
date	2008.08.19.15.18.01;	author simon111;	state Exp;
branches;
next	1.4;
commitid	4bbb48aae4154567;

1.4
date	2008.08.15.13.35.50;	author simon111;	state Exp;
branches;
next	1.3;
commitid	542048a5861d4567;

1.3
date	2008.08.14.13.09.24;	author simon111;	state Exp;
branches;
next	1.2;
commitid	6fbb48a42e514567;

1.2
date	2008.07.12.11.54.30;	author simon111;	state Exp;
branches;
next	1.1;
commitid	1fd848789b644567;

1.1
date	2008.07.12.11.45.07;	author simon111;	state Exp;
branches;
next	;
commitid	1a19487899354567;


desc
@@


1.7
log
@try to add decrypt module (not finished yet)
@
text
@MODULE=decrypt
TEST_IN_FILE=test_dat/$(MODULE).in
TEST_TIMES=1
DEBUG=y

all:benchm sw_simm rtlm 

rtlm:
	@@echo compiling rtl ...
	@@make -s -C rtl    PROJ_NAME=$(MODULE) DEBUG=$(DEBUG)
 
benchm:
	@@echo compiling bench ...
	@@make -s -C bench  PROJ_NAME=$(MODULE) DEBUG=$(DEBUG)

sw_simm:
	@@echo compiling sw_sim ...
	@@make -s -C sw_sim PROJ_NAME=$(MODULE) DEBUG=$(DEBUG)

synthesis:
	@@make -s -C rtl $(MODULE)

sw:
	@@make -s -C sw_sim $(MODULE)

preare_fn =                                                            \
	str="" ;                                                       \
	for ((i=0;i<$1;i=i+1));                                         \
        do                                                             \
                n=$$(expr $$RANDOM % 256 )    ;                        \
                binstr=$$(echo "ibase=10;obase=2;$$n"|bc) ;           \
                binstr=$$(echo "$$binstr" | awk ' { n=8-length($$1);for(i=0;i<n;i=i+1) printf "0"; printf $$1; }' )             ;                                   \
                str=$$(printf "%s%s" $$str $$binstr) ;                 \
        done          ;                                                \
        echo $$str >$(TEST_IN_FILE)  

preare_block_decypher:
	$(call preare_fn,64)

preare_key_perm:
	$(call preare_fn,8)

preare_key_schedule:
	$(call preare_fn,8)

preare_decrypt:
	$(call preare_fn,196)
        
ifeq ($(DEBUG),y)
check:
	@@(for ((i=0;i<$(TEST_TIMES);i=i+1))                                       \
                do                                                                \
                        make -s -C sw_sim test PROJ_NAME=$(MODULE);               \
                        make -s -C bench test PROJ_NAME=$(MODULE);                \
                        diff test_dat/$(MODULE).out.sw test_dat/$(MODULE).out.v ; \
                done)

else
check:
	@@(for ((i=0;i<$(TEST_TIMES);i=i+1))                                       \
                do                                                                \
                        make -s preare_$(MODULE);                                 \
                        make -s -C sw_sim test PROJ_NAME=$(MODULE);               \
                        make -s -C bench test PROJ_NAME=$(MODULE);                \
                        diff test_dat/$(MODULE).out.sw test_dat/$(MODULE).out.v ; \
                done)
endif


clean:
	@@make -s -C sw_sim clean
	@@make -s -C rtl clean
	@@make -s -C bench clean
	@@rm -fr test_dat/*

cscope:
	@@find . -name "*.[ch]" >cscope.files
	@@cscope -b


@


1.6
log
@finish block_decypher module
@
text
@d1 1
a1 1
MODULE=block_decypher
d6 1
a6 1
all:rtlm benchm sw_simm
d45 3
@


1.5
log
@add the block_perm and block_sbox
@
text
@d4 1
a4 1
DEBUG=n
d26 3
a28 3
preare_key_perm:
	@@str="";                                                       \
	for ((i=0;i<8;i=i+1));                                         \
d30 3
a32 3
                n=$$(expr $$RANDOM % 256 );                            \
                binstr=$$(echo "ibase=10;obase=2;$$n"|bc);             \
                binstr=$$(echo "$$binstr" | awk ' { n=8-length($$1);for(i=0;i<n;i=i+1) printf "0"; printf $$1; }' ) ;                                                \
d34 8
a41 2
        done;                                                          \
        echo $$str >$(TEST_IN_FILE)
d44 1
a44 9
	@@str="";                                                       \
	for ((i=0;i<8;i=i+1));                                         \
        do                                                             \
                n=$$(expr $$RANDOM % 256 );                            \
                binstr=$$(echo "ibase=10;obase=2;$$n"|bc);             \
                binstr=$$(echo "$$binstr" | awk ' { n=8-length($$1);for(i=0;i<n;i=i+1) printf "0"; printf $$1; }' ) ;                                                \
                str=$$(printf "%s%s" $$str $$binstr) ;                 \
        done;                                                          \
        echo $$str >$(TEST_IN_FILE)
@


1.4
log
@finished key_schedule module
@
text
@d1 1
a1 1
MODULE=key_schedule
@


1.3
log
@add key_schedule module(note: this module is not right yet)
@
text
@d4 1
d9 3
a11 2
	@@make -s -C rtl PROJ_NAME=$(MODULE)

d13 2
a14 1
	@@make -s -C bench PROJ_NAME=$(MODULE)
d17 2
a18 1
	@@make -s -C sw_sim PROJ_NAME=$(MODULE)
d48 8
d57 1
a57 1

d66 1
@


1.2
log
@add clean rule for some makefile
@
text
@d1 1
a1 1
MODULE=key_perm
d5 1
a5 1
all:rtl bench sw_sim
d7 2
a8 2
rtl:
	make -C rtl
d10 2
a11 2
bench:
	make -C bench
d13 2
a14 2
sw_sim:
	make -C sw_sim
d17 1
a17 1
	make -C rtl $(MODULE)
d20 1
a20 1
	make -C sw_sim $(MODULE)
d23 1
a23 1
	@@str="";                                                \
d29 1
a29 1
                str=$$(printf "%s%s" $$str $$binstr) ;                  \
d33 12
d47 6
a52 6
	@@(for ((i=0;i<$(TEST_TIMES);i=i+1))                   \
                do                                           \
                        make -s preare_$(MODULE);               \
                        make -s -C sw_sim test PROJ_NAME=$(MODULE);\
                        make -s -C bench test PROJ_NAME=$(MODULE);\
                        diff test_dat/$(MODULE).out.sw test_dat/$(MODULE).out.v ;\
d57 9
a65 4
	make -s -C sw_sim clean
	make -s -C rtl clean
	make -s -C bench clean
	rm -fr test_dat/*
@


1.1
log
@initial version
@
text
@d43 7
@

