Loading .gitlab-ci.yml +60 −19 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ variables: LONG_TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/renderer --param_file scripts/config/self_test_ltv.prm --use_ltv" LONG_TEST_SUITE_NO_RENDERER: "tests/codec_be_on_mr_nonselection --param_file scripts/config/self_test_ltv.prm --use_ltv" SHORT_TEST_SUITE: "tests/codec_be_on_mr_nonselection" ENCODER_TEST_SUITE: "tests/codec_be_on_mr_nonselection/test_param_file.py --param_file scripts/config/self_test_basop_encoder.prm" TEST_SUITE: "" DUT_ENCODER_PATH: "./IVAS_cod" DUT_DECODER_PATH: "./IVAS_dec" Loading @@ -28,6 +29,8 @@ variables: CI_REGRESSION_THRESH_ODG: "-0.05" GIT_CLEAN_FLAGS: -ffdxq INSTR_DIR: "scripts/c-code_instrument" BUILD_WITH_DEBUG_MODE_INFO: "" ENCODER_TEST: "" MANUAL_PIPELINE_TYPE: description: "Type for the manual pipeline run. Use 'pytest-compare' to run comparison test against reference float codec." value: 'default' Loading Loading @@ -117,11 +120,18 @@ stages: echo "Commit time was $CI_COMMIT_TIMESTAMP" date | xargs echo "System time is" .activate-debug-mode-info-if-set: &activate-debug-mode-info-if-set - if [ "$BUILD_WITH_DEBUG_MODE_INFO" = "true" ]; then - sed -i.bak -e "s/\/\*\ *\(#define\ *DEBUGGING\ *\)\*\//\1/g" lib_com/options.h - sed -i.bak -e "s/\/\*\ *\(#define\ *DEBUG_MODE_INFO\ *\)\*\//\1/g" lib_com/options.h - fi .build-reference-binaries: &build-reference-binaries - current_commit_sha=$(git rev-parse HEAD) ### build reference binaries - git checkout $REFERENCE_BRANCH - git pull - *activate-debug-mode-info-if-set - make clean - make -j - mv ./IVAS_cod ./$REF_ENCODER_PATH Loading @@ -136,6 +146,7 @@ stages: ### build reference binaries - *build-reference-binaries ### build dut binaries - *activate-debug-mode-info-if-set - make clean - make -j Loading @@ -147,7 +158,9 @@ stages: - python3 tests/create_short_testvectors.py # create references - exit_code=0 - python3 -m pytest $TEST_SUITE -v --update_ref 1 --create_ref -n auto --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$? - enc_stats_arg="" - if [ "$ENCODER_TEST" = "true" ]; then enc_stats_arg="--enc_stats"; fi - python3 -m pytest $TEST_SUITE -v --update_ref 1 $enc_stats_arg --create_ref -n auto --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$? .update-scripts-repo: &update-scripts-repo - cd $SCRIPTS_DIR Loading Loading @@ -291,11 +304,17 @@ stages: - if [ $LEVEL_SCALING != "1.0" ];then - *apply-testv-scaling - fi - if [ "$ENCODER_TEST" = "true" ]; then BUILD_WITH_DEBUG_MODE_INFO="true"; fi - *build-and-create-reference-outputs - comp_args="--mld --ssnr --odg" - if [ "$ENCODER_TEST" = "true" ]; then comp_args="${comp_args} --enc_stats"; fi - echo "$comp_args" ### run pytest - exit_code=0 - python3 -m pytest --tb=no $TEST_SUITE -v --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml --mld --ssnr --odg -n auto --testcase_timeout $testcase_timeout --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$? - python3 -m pytest --tb=no $TEST_SUITE -v --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml $comp_args -n auto --testcase_timeout $testcase_timeout --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$? - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - python3 scripts/parse_xml_report.py report-junit.xml $CSV_ARTIFACT_NAME Loading Loading @@ -683,6 +702,24 @@ build-codec-linux-instrumented-make: - bash scripts/prepare_instrumentation.sh -m MEM_ONLY -p BASOP - make -j -C $INSTR_DIR build-codec-linux-debugging-make: rules: - if: $CI_PIPELINE_SOURCE == 'web' - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main - if: $CI_PIPELINE_SOURCE == 'schedule' - if: $CI_PIPELINE_SOURCE == 'push' when: never extends: - .build-job-linux timeout: "7 minutes" variables: BUILD_WITH_DEBUG_MODE_INFO: "true" script: - *print-common-info - *activate-debug-mode-info-if-set - make -j # --------------------------------------------------------------- # Short test jobs that run in merge request pipelines # --------------------------------------------------------------- Loading Loading @@ -771,8 +808,9 @@ ivas-pytest-compare_to_ref-short-enc: - .test-job-linux before_script: - USE_LTV=0 - ENCODER_TEST="true" - DUT_DECODER_PATH=./$REF_DECODER_PATH - TEST_SUITE="$SHORT_TEST_SUITE" - TEST_SUITE="$ENCODER_TEST_SUITE" - LEVEL_SCALING=1.0 <<: *ivas-pytest-anchor Loading @@ -783,8 +821,9 @@ ivas-pytest-compare_to_ref-short-enc-lev-10: - .test-job-linux before_script: - USE_LTV=0 - ENCODER_TEST="true" - DUT_DECODER_PATH=./$REF_DECODER_PATH - TEST_SUITE="$SHORT_TEST_SUITE" - TEST_SUITE="$ENCODER_TEST_SUITE" - LEVEL_SCALING=0.3162 <<: *ivas-pytest-anchor Loading @@ -795,8 +834,9 @@ ivas-pytest-compare_to_ref-short-enc-lev+10: - .test-job-linux before_script: - USE_LTV=0 - ENCODER_TEST="true" - DUT_DECODER_PATH=./$REF_DECODER_PATH - TEST_SUITE="$SHORT_TEST_SUITE" - TEST_SUITE="$ENCODER_TEST_SUITE" - LEVEL_SCALING=3.162 <<: *ivas-pytest-anchor Loading Loading @@ -858,6 +898,7 @@ ivas-pytest-compare_to_ref-short-dec-lev+10: - LEVEL_SCALING=3.162 <<: *ivas-pytest-anchor ### jobs that compare the output synthesis to the input files directly ivas-pytest-compare-to-input-short-dec: extends: - .rules-pytest-to-input-short Loading lib_com/basop32.c +14 −0 Original line number Diff line number Diff line Loading @@ -2825,6 +2825,11 @@ Word16 shr_ro( Word16 var1, Word16 var2, Flag *Overflow ) { var_out = shr_o( var1, var2, Overflow ); #ifdef FIX_1049_SHR_RO_COMPLEXITY #ifdef WMOPS multiCounter[currCounter].shr--; #endif #endif if ( var2 > 0 ) { if ( ( var1 & ( (Word16) 1 << ( var2 - 1 ) ) ) != 0 ) Loading @@ -2833,6 +2838,15 @@ Word16 shr_ro( Word16 var1, Word16 var2, Flag *Overflow ) } } } #ifdef FIX_1049_SHR_RO_COMPLEXITY #ifdef WMOPS multiCounter[currCounter].shr_r++; #endif BASOP_CHECK(); #endif return ( var_out ); } Word16 shr_r_sat( Word16 var1, Word16 var2 ) Loading lib_com/control.c +5 −1 Original line number Diff line number Diff line Loading @@ -21,10 +21,14 @@ #include "stl.h" #ifdef WMOPS int funcId_where_last_call_to_else_occurred; long funcid_total_wmops_at_last_call_to_else; #ifdef FIX_1054_IF_ELSE_CMPLX char func_name_where_last_call_to_else_occurred[MAX_FUNCTION_NAME_LENGTH + 1] = ""; #else int funcId_where_last_call_to_else_occurred; int call_occurred = 1; #endif #endif #ifdef CONTROL_CODE_OPS Loading lib_com/control.h +47 −6 Original line number Diff line number Diff line Loading @@ -33,9 +33,9 @@ #ifndef _CONTROL_H #define _CONTROL_H #include <string.h> #include "stl.h" /***************************************************************************** * * Constants and Globals Loading @@ -45,6 +45,12 @@ extern BASIC_OP multiCounter[MAXCOUNTERS]; extern int currCounter; #define MAX_FUNCTION_NAME_LENGTH 200 /* Maximum length of the function name */ extern long funcid_total_wmops_at_last_call_to_else; #ifdef FIX_1054_IF_ELSE_CMPLX extern char func_name_where_last_call_to_else_occurred[]; #else /* Technical note : * The following 3 variables are only used for correct complexity * evaluation of the following structure : Loading @@ -60,9 +66,10 @@ extern int currCounter; * ... * } */ extern int funcId_where_last_call_to_else_occurred; extern long funcid_total_wmops_at_last_call_to_else; extern int call_occurred; extern int funcId_where_last_call_to_else_occurred; #endif #endif /* ifdef WMOPS */ Loading Loading @@ -172,19 +179,37 @@ static __inline void incrWhile( void ) #define IF( a ) if ( a ) #else /* ifndef WMOPS */ #ifdef FIX_1054_IF_ELSE_CMPLX #define IF( a ) if ( incrIf( __func__ ), a ) #else #define IF( a ) if ( incrIf(), a ) #endif #ifdef FIX_1054_IF_ELSE_CMPLX static __inline void incrIf( const char *func_name ) #else static __inline void incrIf( void ) #endif { /* Technical note : * If the "IF" operator comes just after an "ELSE", its counter * must not be incremented. */ #ifdef FIX_1054_IF_ELSE_CMPLX if ( ( strncmp( func_name, func_name_where_last_call_to_else_occurred, MAX_FUNCTION_NAME_LENGTH ) != 0 ) || ( TotalWeightedOperation() != funcid_total_wmops_at_last_call_to_else ) ) { multiCounter[currCounter].If++; } func_name_where_last_call_to_else_occurred[0] = '\0'; #else if ( ( currCounter != funcId_where_last_call_to_else_occurred ) || ( TotalWeightedOperation() != funcid_total_wmops_at_last_call_to_else ) || ( call_occurred == 1 ) ) multiCounter[currCounter].If++; call_occurred = 0; funcId_where_last_call_to_else_occurred = MAXCOUNTERS; #endif } #endif /* ifndef WMOPS */ Loading @@ -204,22 +229,38 @@ static __inline void incrIf( void ) #define ELSE else #else /* ifndef WMOPS */ #ifdef FIX_1054_IF_ELSE_CMPLX #define ELSE \ else if ( incrElse( __func__ ), 0 ); \ else #else #define ELSE \ else if ( incrElse(), 0 ); \ else #endif #ifdef FIX_1054_IF_ELSE_CMPLX static __inline void incrElse( const char *func_name ) #else static __inline void incrElse( void ) #endif { multiCounter[currCounter].If++; /* We keep track of the funcId of the last function which used ELSE {...} structure. */ funcId_where_last_call_to_else_occurred = currCounter; /* We keep track of the number of WMOPS of this funcId when the ELSE macro was called. */ funcid_total_wmops_at_last_call_to_else = TotalWeightedOperation(); #ifdef FIX_1054_IF_ELSE_CMPLX /* We keep track of the name of the last calling function when the ELSE macro was called */ strncpy( func_name_where_last_call_to_else_occurred, func_name, MAX_FUNCTION_NAME_LENGTH ); func_name_where_last_call_to_else_occurred[MAX_FUNCTION_NAME_LENGTH] = '\0'; #else /* We keep track of the funcId of the last function which used ELSE {...} structure. */ funcId_where_last_call_to_else_occurred = currCounter; /* call_occurred is set to 0, in order to count the next IF (if necessary) */ call_occurred = 0; #endif } #endif /* ifndef WMOPS */ Loading lib_com/count.c +4 −0 Original line number Diff line number Diff line Loading @@ -365,7 +365,9 @@ void setCounter( int counterId ) return; } currCounter = counterId; #ifndef FIX_1054_IF_ELSE_CMPLX call_occurred = 1; #endif #else (void) counterId; #endif /* ifdef WMOPS */ Loading Loading @@ -514,9 +516,11 @@ void Init_WMOPS_counter( void ) LastWOper[currCounter] = 0; funcid[currCounter] = 0; #ifndef FIX_1054_IF_ELSE_CMPLX /* Following line is useful for incrIf(), see control.h */ call_occurred = 1; funcId_where_last_call_to_else_occurred = MAXCOUNTERS; #endif sum_bc[currCounter] = MAX_32; sum_wc[currCounter] = 0; Loading Loading
.gitlab-ci.yml +60 −19 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ variables: LONG_TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/renderer --param_file scripts/config/self_test_ltv.prm --use_ltv" LONG_TEST_SUITE_NO_RENDERER: "tests/codec_be_on_mr_nonselection --param_file scripts/config/self_test_ltv.prm --use_ltv" SHORT_TEST_SUITE: "tests/codec_be_on_mr_nonselection" ENCODER_TEST_SUITE: "tests/codec_be_on_mr_nonselection/test_param_file.py --param_file scripts/config/self_test_basop_encoder.prm" TEST_SUITE: "" DUT_ENCODER_PATH: "./IVAS_cod" DUT_DECODER_PATH: "./IVAS_dec" Loading @@ -28,6 +29,8 @@ variables: CI_REGRESSION_THRESH_ODG: "-0.05" GIT_CLEAN_FLAGS: -ffdxq INSTR_DIR: "scripts/c-code_instrument" BUILD_WITH_DEBUG_MODE_INFO: "" ENCODER_TEST: "" MANUAL_PIPELINE_TYPE: description: "Type for the manual pipeline run. Use 'pytest-compare' to run comparison test against reference float codec." value: 'default' Loading Loading @@ -117,11 +120,18 @@ stages: echo "Commit time was $CI_COMMIT_TIMESTAMP" date | xargs echo "System time is" .activate-debug-mode-info-if-set: &activate-debug-mode-info-if-set - if [ "$BUILD_WITH_DEBUG_MODE_INFO" = "true" ]; then - sed -i.bak -e "s/\/\*\ *\(#define\ *DEBUGGING\ *\)\*\//\1/g" lib_com/options.h - sed -i.bak -e "s/\/\*\ *\(#define\ *DEBUG_MODE_INFO\ *\)\*\//\1/g" lib_com/options.h - fi .build-reference-binaries: &build-reference-binaries - current_commit_sha=$(git rev-parse HEAD) ### build reference binaries - git checkout $REFERENCE_BRANCH - git pull - *activate-debug-mode-info-if-set - make clean - make -j - mv ./IVAS_cod ./$REF_ENCODER_PATH Loading @@ -136,6 +146,7 @@ stages: ### build reference binaries - *build-reference-binaries ### build dut binaries - *activate-debug-mode-info-if-set - make clean - make -j Loading @@ -147,7 +158,9 @@ stages: - python3 tests/create_short_testvectors.py # create references - exit_code=0 - python3 -m pytest $TEST_SUITE -v --update_ref 1 --create_ref -n auto --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$? - enc_stats_arg="" - if [ "$ENCODER_TEST" = "true" ]; then enc_stats_arg="--enc_stats"; fi - python3 -m pytest $TEST_SUITE -v --update_ref 1 $enc_stats_arg --create_ref -n auto --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$? .update-scripts-repo: &update-scripts-repo - cd $SCRIPTS_DIR Loading Loading @@ -291,11 +304,17 @@ stages: - if [ $LEVEL_SCALING != "1.0" ];then - *apply-testv-scaling - fi - if [ "$ENCODER_TEST" = "true" ]; then BUILD_WITH_DEBUG_MODE_INFO="true"; fi - *build-and-create-reference-outputs - comp_args="--mld --ssnr --odg" - if [ "$ENCODER_TEST" = "true" ]; then comp_args="${comp_args} --enc_stats"; fi - echo "$comp_args" ### run pytest - exit_code=0 - python3 -m pytest --tb=no $TEST_SUITE -v --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml --mld --ssnr --odg -n auto --testcase_timeout $testcase_timeout --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$? - python3 -m pytest --tb=no $TEST_SUITE -v --create_cut --html=report.html --self-contained-html --junit-xml=report-junit.xml $comp_args -n auto --testcase_timeout $testcase_timeout --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$? - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true - python3 scripts/parse_xml_report.py report-junit.xml $CSV_ARTIFACT_NAME Loading Loading @@ -683,6 +702,24 @@ build-codec-linux-instrumented-make: - bash scripts/prepare_instrumentation.sh -m MEM_ONLY -p BASOP - make -j -C $INSTR_DIR build-codec-linux-debugging-make: rules: - if: $CI_PIPELINE_SOURCE == 'web' - if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" # only have MR pipelines for MRs to main - if: $CI_PIPELINE_SOURCE == 'schedule' - if: $CI_PIPELINE_SOURCE == 'push' when: never extends: - .build-job-linux timeout: "7 minutes" variables: BUILD_WITH_DEBUG_MODE_INFO: "true" script: - *print-common-info - *activate-debug-mode-info-if-set - make -j # --------------------------------------------------------------- # Short test jobs that run in merge request pipelines # --------------------------------------------------------------- Loading Loading @@ -771,8 +808,9 @@ ivas-pytest-compare_to_ref-short-enc: - .test-job-linux before_script: - USE_LTV=0 - ENCODER_TEST="true" - DUT_DECODER_PATH=./$REF_DECODER_PATH - TEST_SUITE="$SHORT_TEST_SUITE" - TEST_SUITE="$ENCODER_TEST_SUITE" - LEVEL_SCALING=1.0 <<: *ivas-pytest-anchor Loading @@ -783,8 +821,9 @@ ivas-pytest-compare_to_ref-short-enc-lev-10: - .test-job-linux before_script: - USE_LTV=0 - ENCODER_TEST="true" - DUT_DECODER_PATH=./$REF_DECODER_PATH - TEST_SUITE="$SHORT_TEST_SUITE" - TEST_SUITE="$ENCODER_TEST_SUITE" - LEVEL_SCALING=0.3162 <<: *ivas-pytest-anchor Loading @@ -795,8 +834,9 @@ ivas-pytest-compare_to_ref-short-enc-lev+10: - .test-job-linux before_script: - USE_LTV=0 - ENCODER_TEST="true" - DUT_DECODER_PATH=./$REF_DECODER_PATH - TEST_SUITE="$SHORT_TEST_SUITE" - TEST_SUITE="$ENCODER_TEST_SUITE" - LEVEL_SCALING=3.162 <<: *ivas-pytest-anchor Loading Loading @@ -858,6 +898,7 @@ ivas-pytest-compare_to_ref-short-dec-lev+10: - LEVEL_SCALING=3.162 <<: *ivas-pytest-anchor ### jobs that compare the output synthesis to the input files directly ivas-pytest-compare-to-input-short-dec: extends: - .rules-pytest-to-input-short Loading
lib_com/basop32.c +14 −0 Original line number Diff line number Diff line Loading @@ -2825,6 +2825,11 @@ Word16 shr_ro( Word16 var1, Word16 var2, Flag *Overflow ) { var_out = shr_o( var1, var2, Overflow ); #ifdef FIX_1049_SHR_RO_COMPLEXITY #ifdef WMOPS multiCounter[currCounter].shr--; #endif #endif if ( var2 > 0 ) { if ( ( var1 & ( (Word16) 1 << ( var2 - 1 ) ) ) != 0 ) Loading @@ -2833,6 +2838,15 @@ Word16 shr_ro( Word16 var1, Word16 var2, Flag *Overflow ) } } } #ifdef FIX_1049_SHR_RO_COMPLEXITY #ifdef WMOPS multiCounter[currCounter].shr_r++; #endif BASOP_CHECK(); #endif return ( var_out ); } Word16 shr_r_sat( Word16 var1, Word16 var2 ) Loading
lib_com/control.c +5 −1 Original line number Diff line number Diff line Loading @@ -21,10 +21,14 @@ #include "stl.h" #ifdef WMOPS int funcId_where_last_call_to_else_occurred; long funcid_total_wmops_at_last_call_to_else; #ifdef FIX_1054_IF_ELSE_CMPLX char func_name_where_last_call_to_else_occurred[MAX_FUNCTION_NAME_LENGTH + 1] = ""; #else int funcId_where_last_call_to_else_occurred; int call_occurred = 1; #endif #endif #ifdef CONTROL_CODE_OPS Loading
lib_com/control.h +47 −6 Original line number Diff line number Diff line Loading @@ -33,9 +33,9 @@ #ifndef _CONTROL_H #define _CONTROL_H #include <string.h> #include "stl.h" /***************************************************************************** * * Constants and Globals Loading @@ -45,6 +45,12 @@ extern BASIC_OP multiCounter[MAXCOUNTERS]; extern int currCounter; #define MAX_FUNCTION_NAME_LENGTH 200 /* Maximum length of the function name */ extern long funcid_total_wmops_at_last_call_to_else; #ifdef FIX_1054_IF_ELSE_CMPLX extern char func_name_where_last_call_to_else_occurred[]; #else /* Technical note : * The following 3 variables are only used for correct complexity * evaluation of the following structure : Loading @@ -60,9 +66,10 @@ extern int currCounter; * ... * } */ extern int funcId_where_last_call_to_else_occurred; extern long funcid_total_wmops_at_last_call_to_else; extern int call_occurred; extern int funcId_where_last_call_to_else_occurred; #endif #endif /* ifdef WMOPS */ Loading Loading @@ -172,19 +179,37 @@ static __inline void incrWhile( void ) #define IF( a ) if ( a ) #else /* ifndef WMOPS */ #ifdef FIX_1054_IF_ELSE_CMPLX #define IF( a ) if ( incrIf( __func__ ), a ) #else #define IF( a ) if ( incrIf(), a ) #endif #ifdef FIX_1054_IF_ELSE_CMPLX static __inline void incrIf( const char *func_name ) #else static __inline void incrIf( void ) #endif { /* Technical note : * If the "IF" operator comes just after an "ELSE", its counter * must not be incremented. */ #ifdef FIX_1054_IF_ELSE_CMPLX if ( ( strncmp( func_name, func_name_where_last_call_to_else_occurred, MAX_FUNCTION_NAME_LENGTH ) != 0 ) || ( TotalWeightedOperation() != funcid_total_wmops_at_last_call_to_else ) ) { multiCounter[currCounter].If++; } func_name_where_last_call_to_else_occurred[0] = '\0'; #else if ( ( currCounter != funcId_where_last_call_to_else_occurred ) || ( TotalWeightedOperation() != funcid_total_wmops_at_last_call_to_else ) || ( call_occurred == 1 ) ) multiCounter[currCounter].If++; call_occurred = 0; funcId_where_last_call_to_else_occurred = MAXCOUNTERS; #endif } #endif /* ifndef WMOPS */ Loading @@ -204,22 +229,38 @@ static __inline void incrIf( void ) #define ELSE else #else /* ifndef WMOPS */ #ifdef FIX_1054_IF_ELSE_CMPLX #define ELSE \ else if ( incrElse( __func__ ), 0 ); \ else #else #define ELSE \ else if ( incrElse(), 0 ); \ else #endif #ifdef FIX_1054_IF_ELSE_CMPLX static __inline void incrElse( const char *func_name ) #else static __inline void incrElse( void ) #endif { multiCounter[currCounter].If++; /* We keep track of the funcId of the last function which used ELSE {...} structure. */ funcId_where_last_call_to_else_occurred = currCounter; /* We keep track of the number of WMOPS of this funcId when the ELSE macro was called. */ funcid_total_wmops_at_last_call_to_else = TotalWeightedOperation(); #ifdef FIX_1054_IF_ELSE_CMPLX /* We keep track of the name of the last calling function when the ELSE macro was called */ strncpy( func_name_where_last_call_to_else_occurred, func_name, MAX_FUNCTION_NAME_LENGTH ); func_name_where_last_call_to_else_occurred[MAX_FUNCTION_NAME_LENGTH] = '\0'; #else /* We keep track of the funcId of the last function which used ELSE {...} structure. */ funcId_where_last_call_to_else_occurred = currCounter; /* call_occurred is set to 0, in order to count the next IF (if necessary) */ call_occurred = 0; #endif } #endif /* ifndef WMOPS */ Loading
lib_com/count.c +4 −0 Original line number Diff line number Diff line Loading @@ -365,7 +365,9 @@ void setCounter( int counterId ) return; } currCounter = counterId; #ifndef FIX_1054_IF_ELSE_CMPLX call_occurred = 1; #endif #else (void) counterId; #endif /* ifdef WMOPS */ Loading Loading @@ -514,9 +516,11 @@ void Init_WMOPS_counter( void ) LastWOper[currCounter] = 0; funcid[currCounter] = 0; #ifndef FIX_1054_IF_ELSE_CMPLX /* Following line is useful for incrIf(), see control.h */ call_occurred = 1; funcId_where_last_call_to_else_occurred = MAXCOUNTERS; #endif sum_bc[currCounter] = MAX_32; sum_wc[currCounter] = 0; Loading