From 0fdd4ef709dfffe32c68304afb58dc099930e1f1 Mon Sep 17 00:00:00 2001 From: Thomas Pircher Date: Sat, 24 Oct 2015 10:12:35 +0100 Subject: [PATCH] Added mentioning of dos2unix in the README file. --- README.md | 4 ++++ test/performance.sh | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cd697d4..a10b1df 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,10 @@ Then the script can be called like an application. ./pycrc.py [options] +If you get an error "No such file or directory" when running ./pycrc.py then +make sure the file is saved in UNIX file endings: + + dos2unix pycrc.py Getting help diff --git a/test/performance.sh b/test/performance.sh index 7e92c53..7b6b239 100755 --- a/test/performance.sh +++ b/test/performance.sh @@ -4,7 +4,7 @@ set -e PYCRC=`dirname $0`/../pycrc.py cleanup() { - rm -f a.out performance.c crc_bbb.[ch] crc_bbf.[ch] crc_tb[l4].[ch] crc_bw[e4].[ch] + rm -f a.out performance.c crc_bbb.[ch] crc_bbf.[ch] crc_tb[l4].[ch] crc_sb4.[ch] } trap cleanup 0 1 2 3 15 @@ -23,6 +23,9 @@ $PYCRC --model $model --symbol-prefix crc_${prefix}_ --generate c -o crc_$prefix prefix=tb4 $PYCRC --model $model --symbol-prefix crc_${prefix}_ --generate h -o crc_$prefix.h --algo table-driven --table-idx-width 4 $PYCRC --model $model --symbol-prefix crc_${prefix}_ --generate c -o crc_$prefix.c --algo table-driven --table-idx-width 4 +prefix=sb4 +$PYCRC --model $model --symbol-prefix crc_${prefix}_ --generate h -o crc_$prefix.h --algo table-driven --slice-by 4 +$PYCRC --model $model --symbol-prefix crc_${prefix}_ --generate c -o crc_$prefix.c --algo table-driven --slice-by 4 print_main() { @@ -31,6 +34,7 @@ cat < #include #include @@ -46,6 +50,7 @@ void test_bbb(unsigned char *buf, size_t buf_len, size_t num_runs, clock_t clock void test_bbf(unsigned char *buf, size_t buf_len, size_t num_runs, clock_t clock_per_sec); void test_tbl(unsigned char *buf, size_t buf_len, size_t num_runs, clock_t clock_per_sec); void test_tb4(unsigned char *buf, size_t buf_len, size_t num_runs, clock_t clock_per_sec); +void test_sb4(unsigned char *buf, size_t buf_len, size_t num_runs, clock_t clock_per_sec); /** * Print results. @@ -94,6 +99,9 @@ int main(void) // table-driven idx4 test_tb4(buf, sizeof(buf), NUM_RUNS / 2, clock_per_sec); + // table-driven slice-by 4 + test_sb4(buf, sizeof(buf), NUM_RUNS, clock_per_sec); + return 0; } EOF @@ -133,6 +141,7 @@ print_routine "bit-by-bit" bbb >> performance.c print_routine "bit-by-bit-fast" bbf >> performance.c print_routine "table-driven" tbl >> performance.c print_routine "table-driven idx4" tb4 >> performance.c +print_routine "table-driven sb4" sb4 >> performance.c -gcc -W -Wall -O3 crc_bbb.c crc_bbf.c crc_tbl.c crc_tb4.c performance.c +gcc -W -Wall -O3 crc_bbb.c crc_bbf.c crc_tbl.c crc_tb4.c crc_sb4.c performance.c ./a.out