Well you've only posted half the code, and you haven't posted the input file. Don't post the whole lot though: cut it down to the minimum needed to reproduce the problem, and post that. For example if you remove the calls to scheduling_type0(), dispatch(), ifetch_decode_unit() and printqueues(), replacing them with minimal "stub" code needed to let everything else work, and similarly replace the pipe.ifetchqueue statements, plus just enough of the the input file, then we may be able to help.