Skip to content

Commit

Permalink
Formatted Output more nicely.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ty Morrow committed Dec 4, 2014
1 parent c353c50 commit f9b6a73
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 51 deletions.
6 changes: 3 additions & 3 deletions Cdc.App/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ static void Main(string[] args)
var cdc7600 = new Cdc7600();
sb.AppendLine("Executing Instruction Set 1");
cdc7600.AddInstructions(set7600.InstructionSet1);
sb.AppendLine(cdc6600.Run());
sb.AppendLine(cdc7600.Run());
sb.AppendLine("Executing Instruction Set 2");
cdc7600.AddInstructions(set7600.InstructionSet2);
sb.AppendLine(cdc6600.Run());
sb.AppendLine(cdc7600.Run());
sb.AppendLine("Executing Instruction Set 3");
cdc7600.AddInstructions(set7600.InstructionSet3);
sb.AppendLine(cdc6600.Run());
sb.AppendLine(cdc7600.Run());

// Output the results to a file.
const string outputFolder = @"Results\";
Expand Down
8 changes: 4 additions & 4 deletions Cdc.Simulator6600/Cdc6600.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ private void PrintSchedule()
{
Console.WriteLine();
Console.WriteLine(NAME);
Console.WriteLine("========================== Timing Schedule ==========================");
Console.WriteLine("Code\t\tLength\tIssue\tStart\tResult\tUnit\tFetch\tStore");
Console.WriteLine("============================= Timing Schedule =============================");
Console.WriteLine("Inst.\t\tOpCode\tLength\tIssue\tStart\tResult\tUnit\tFetch\tStore");
foreach (var i in _output)
{
Console.WriteLine(i);
Expand All @@ -426,8 +426,8 @@ private string GetSchedule()
var stringbuilder = new StringBuilder();
stringbuilder.AppendLine();
stringbuilder.AppendLine(NAME);
stringbuilder.AppendLine("========================== Timing Schedule ==========================");
stringbuilder.AppendLine("Code\t\tLength\tIssue\tStart\tResult\tUnit\tFetch\tStore");
stringbuilder.AppendLine("============================= Timing Schedule =============================");
stringbuilder.AppendLine("Inst.\t\tOpCode\tLength\tIssue\tStart\tResult\tUnit\tFetch\tStore");
foreach (var i in _output)
{
stringbuilder.AppendLine(i);
Expand Down
2 changes: 1 addition & 1 deletion Cdc.Simulator6600/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// </summary>
public enum Register
{
K = 0,
Ki = 0,
X0,
X1, // Read
X2, // Read
Expand Down
5 changes: 3 additions & 2 deletions Cdc.Simulator6600/Instruction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ public override string ToString()
/// <returns>Returns a string.</returns>
public string GetScheduleOutput()
{
return string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}",
OpCode.ToString().Substring(0, 10),
return string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}",
OutputRegister + "=" + Operand1 + "," + Operand2,
(int)OpCode,
Length.ToString()[0],
Issue,
Start,
Expand Down
34 changes: 17 additions & 17 deletions Cdc.Simulator6600/InstructionSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class InstructionSet
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A1,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.X1,
IsStartOfWord = true,
IsEndOfWord = false,
Expand All @@ -28,7 +28,7 @@ public class InstructionSet
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A2,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.X2,
IsStartOfWord = false,
IsEndOfWord = true,
Expand Down Expand Up @@ -59,7 +59,7 @@ public class InstructionSet
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A3,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.X3,
IsStartOfWord = false,
IsEndOfWord = true,
Expand All @@ -80,7 +80,7 @@ public class InstructionSet
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A7,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.X7,
IsStartOfWord = false,
IsEndOfWord = true
Expand All @@ -96,7 +96,7 @@ public class InstructionSet
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A1,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.X1,
IsStartOfWord = true,
IsEndOfWord = false,
Expand All @@ -107,7 +107,7 @@ public class InstructionSet
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A2,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.X2,
IsStartOfWord = false,
IsEndOfWord = true,
Expand Down Expand Up @@ -138,7 +138,7 @@ public class InstructionSet
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A3,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.X3,
IsStartOfWord = false,
IsEndOfWord = true,
Expand All @@ -149,7 +149,7 @@ public class InstructionSet
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A4,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.X4,
IsStartOfWord = true,
IsEndOfWord = false
Expand Down Expand Up @@ -189,7 +189,7 @@ public class InstructionSet
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A7,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.X7,
IsStartOfWord = false,
IsEndOfWord = true
Expand All @@ -207,7 +207,7 @@ public InstructionSet()
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A1,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.B1,
IsStartOfWord = true,
IsEndOfWord = false,
Expand All @@ -218,7 +218,7 @@ public InstructionSet()
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A1,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.X1,
IsStartOfWord = false,
IsEndOfWord = true,
Expand All @@ -229,7 +229,7 @@ public InstructionSet()
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A2,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.X2,
IsStartOfWord = true,
IsEndOfWord = false,
Expand All @@ -240,7 +240,7 @@ public InstructionSet()
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A3,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.X3,
IsStartOfWord = false,
IsEndOfWord = true,
Expand All @@ -251,7 +251,7 @@ public InstructionSet()
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A4,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.B2,
IsStartOfWord = true,
IsEndOfWord = false,
Expand All @@ -262,7 +262,7 @@ public InstructionSet()
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A5,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.X5,
IsStartOfWord = false,
IsEndOfWord = true,
Expand Down Expand Up @@ -334,7 +334,7 @@ public InstructionSet()
OpCode = OpCode.SumAjandKToXi,
Length = InstructionLength.Long,
Operand1 = Register.A7,
Operand2 = Register.K,
Operand2 = Register.Ki,
OutputRegister = Register.X7,
IsStartOfWord = false,
IsEndOfWord = true
Expand All @@ -345,7 +345,7 @@ public InstructionSet()
Length = InstructionLength.Long,
Operand1 = Register.B1,
Operand2 = Register.B0,
OutputRegister = Register.K,
OutputRegister = Register.Ki,
IsStartOfWord = true,
IsEndOfWord = true,
BranchTo = InstructionSet3[5]
Expand Down
8 changes: 4 additions & 4 deletions Cdc.Simulator7600/Cdc7600.cs
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ private void PrintSchedule()
{
Console.WriteLine();
Console.WriteLine(NAME);
Console.WriteLine("========================== Timing Schedule ==========================");
Console.WriteLine("Code\t\tLength\tIssue\tStart\tResult\tUnit\tFetch\tStore");
Console.WriteLine("============================= Timing Schedule =============================");
Console.WriteLine("Inst.\t\tOpCode\tLength\tIssue\tStart\tResult\tUnit\tFetch\tStore");
foreach (var i in _output)
{
Console.WriteLine(i);
Expand All @@ -440,8 +440,8 @@ private string GetSchedule()
var stringbuilder = new StringBuilder();
stringbuilder.AppendLine();
stringbuilder.AppendLine(NAME);
stringbuilder.AppendLine("========================== Timing Schedule ==========================");
stringbuilder.AppendLine("Code\t\tLength\tIssue\tStart\tResult\tUnit\tFetch\tStore");
stringbuilder.AppendLine("============================= Timing Schedule =============================");
stringbuilder.AppendLine("Inst.\t\tOpCode\tLength\tIssue\tStart\tResult\tUnit\tFetch\tStore");
foreach (var i in _output)
{
stringbuilder.AppendLine(i);
Expand Down
2 changes: 1 addition & 1 deletion Cdc.Simulator7600/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// </summary>
public enum Register
{
K = 0,
Ki = 0,
X0,
X1, // Read
X2, // Read
Expand Down
5 changes: 3 additions & 2 deletions Cdc.Simulator7600/Instruction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ public override string ToString()
/// <returns>Returns a string.</returns>
public string GetScheduleOutput()
{
return string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}",
OpCode.ToString().Substring(0, 10),
return string.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}",
OutputRegister + "=" + Operand1 + "," + Operand2,
(int)OpCode,
Length.ToString()[0],
Issue,
Start,
Expand Down
Loading

0 comments on commit f9b6a73

Please # to comment.