I am searching for auto tools that can be used to calculate the number of the real-consumed cycle or number of logical and mathematical operations for a code of thousands of lines?
I think you need to be more specific about your cycle counting requirements. As has been stated previously, this is an unsolved problem in the general sense. However, for certain practical applications (e.g. real time DSP), cycle counting is possible - essential even - for proper operation. The critical pieces of code are usually very short, however..and contain only a single execution path for the critical part of the code (they are usually short interrupt-driven routines). Furthermore, critical code segments must disable all interrupts, otherwise cycle counting is useless. This is why high speed real-time processing is best done in dedicated ASIC processors or FPGAs.