// ======================================================================================================== // ======================================================================================================== // ********************************************** utility.h *********************************************** // ======================================================================================================== // ======================================================================================================== #include #include #include #include #include #include #include #ifndef TIMING_STRUCTS typedef struct { int vecpair_id; int PO_num; char rise_or_fall; float *PNs; } TimingValCacheStruct; #define TIMING_STRUCTS #endif // Scratch pad string size #define MAX_STRING_LEN 2048 // HELP currently uses 2048 PNR and 2048 PNF to create 2048 PNDiffs. #define NUM_REQUIRED_PNDIFFS 2048 float Round(float d); float ComputeMean(int num_vals, float *vals); float ComputeMedian(int num_vals, float *vals); float ComputeStdDev(int num_vals, float mean, float *vals); int GetBitFromByte(unsigned char byte, int bit_pos); void SetBitInByte(unsigned char *byte_ptr, int bit_val, int bit_pos); void ConvertBinVecMaskToASCII(int num_PI_POs, unsigned char *vec_mask_bin, char *vec_mask_asc); void ConvertASCIIVecMaskToBinary(int num_PI_POs, char *vec_mask_asc, unsigned char *vec_mask_bin);