Time chart for different scheduling algorithms

For Programmers

The software provides two .jar files to do further programming for static scheduling (with forwarding and without forwarding) and dynamic scheduling (Tomasulo and Scoreboarding).

Some of the important classes used for implementation which are visible to programmers are:

Getters and setters are defined corresponding to each of these primary classes to access the private fields. Source code is available for these classes and various fields and functions are self-explanatory.

Four main classes which implements the different scheduling algorithms are:

All these four main classes implements following two functions which are visible to programmers are:

Output is stored in 2-D string array called "timechart" which is defined in all the four main classes implementing various scheduling algorithms.

 

Sample code for implementing "static scheduling with forwarding"

WithForwardingInstructionGraph withforwardingInstrGraph = new WithForwardingInstructionGraph (int number_of_instruction, PipelineUnit p, FunctionalUnit f);

 

for(int i=0; i<number_of_instruction; i++) {

Instruction tempInstr = new Instruction (String type, String destination, String source1, String source2, int execution_cycle);

InstructionNode tempNode = new InstructionNode(tempInstr, i);

withforwardingInstrGraph.addInstr(tempNode);

}

 

withforwardingInstrGraph.generateDateHazardGraph();

withforwardingInstrGraph.topologicalTraversal();

 

// output is available in 2-D string array called "timechart" which is a element of withforwardingInstrGraph.

Sample code for implementing "static scheduling without forwarding"

WithoutForwardingInstructionGraph withoutforwardingInstrGraph = new WithoutForwardingInstructionGraph (int number_of_instruction, PipelineUnit p, FunctionalUnit f);

 

for(int i=0; i<number_of_instruction; i++) {

Instruction tempInstr = new Instruction (String type, String destination, String source1, String source2, int execution_cycle);

InstructionNode tempNode = new InstructionNode(tempInstr, i);

withoutforwardingInstrGraph.addInstr(tempNode);

}

 

withoutforwardingInstrGraph.generateDateHazardGraph();

withoutforwardingInstrGraph.topologicalTraversal();

 

// output is available in 2-D string array called "timechart" which is a element of withoutforwardingInstrGraph.

Sample code for implementing "dynamic scheduling - Tomasulo"

TomasuloInstructionGraph tomasuloInstrGraph = new TomasuloInstructionGraph (int number_of_instruction, PipelineUnit p, FunctionalUnit f, FunctionalUnit reservation_stations);

 

for(int i=0; i<number_of_instruction; i++) {

Instruction tempInstr = new Instruction (String type, String destination, String source1, String source2, int execution_cycle);

InstructionNode tempNode = new InstructionNode(tempInstr, i);

tomasuloInstrGraph.addInstr(tempNode);

}

 

tomasuloIInstrGraph.generateDateHazardGraph();

tomasuloIInstrGraph.topologicalTraversal();

 

// output is available in 2-D string array called "timechart" which is a element of tomasuloInstrGraph.

Sample code for implementing "dynamic scheduling - Scoreboarding"

ScoreboardingInstructionGraph withoutforwardingInstrGraph = new ScoreboardingInstructionGraph (int number_of_instruction, PipelineUnit p, FunctionalUnit f);

 

for(int i=0; i<number_of_instruction; i++) {

Instruction tempInstr = new Instruction (String type, String destination, String source1, String source2, int execution_cycle);

InstructionNode tempNode = new InstructionNode(tempInstr, i);

scoreboardingInstrGraph.addInstr(tempNode);

}

 

scoreboardingInstrGraph.generateDateHazardGraph();

scoreboardingInstrGraph.topologicalTraversal();

 

// output is available in 2-D string array called "timechart" which is a element of scoreboardingInstrGraph.