Skip to content

Commit

Permalink
Merge pull request #3 from tyler-marr/master
Browse files Browse the repository at this point in the history
Added individual license notices, Authors file
  • Loading branch information
gizmoguy authored Mar 12, 2019
2 parents 48dc9a8 + 4a56a9c commit f715272
Show file tree
Hide file tree
Showing 31 changed files with 1,339 additions and 53 deletions.
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Rexsim was originally written by Paul Monigatti in 2016 as a personal project.

Rexsim has been passed onto the University of Waikato in 2018 and updated by Daniel Oosterwijk.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

23 changes: 22 additions & 1 deletion RexSimulator/Hardware/Bus.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
using System;
/*
########################################################################
# This file is part of wsim, a WRAMP simulator.
#
# Copyright (C) 2016 Paul Monigatti
# Copyright (C) 2019 The University of Waikato, Hamilton, New Zealand.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
########################################################################
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
23 changes: 22 additions & 1 deletion RexSimulator/Hardware/Rex/ButtonInterrupt.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
using System;
/*
########################################################################
# This file is part of wsim, a WRAMP simulator.
#
# Copyright (C) 2016 Paul Monigatti
# Copyright (C) 2019 The University of Waikato, Hamilton, New Zealand.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
########################################################################
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
23 changes: 22 additions & 1 deletion RexSimulator/Hardware/Rex/MemoryDevice.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
using System;
/*
########################################################################
# This file is part of wsim, a WRAMP simulator.
#
# Copyright (C) 2016 Paul Monigatti
# Copyright (C) 2019 The University of Waikato, Hamilton, New Zealand.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
########################################################################
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
23 changes: 22 additions & 1 deletion RexSimulator/Hardware/Rex/ParallelIO.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
using System;
/*
########################################################################
# This file is part of wsim, a WRAMP simulator.
#
# Copyright (C) 2016 Paul Monigatti
# Copyright (C) 2019 The University of Waikato, Hamilton, New Zealand.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
########################################################################
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
23 changes: 22 additions & 1 deletion RexSimulator/Hardware/Rex/SerialIO.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
using System;
/*
########################################################################
# This file is part of wsim, a WRAMP simulator.
#
# Copyright (C) 2016 Paul Monigatti
# Copyright (C) 2019 The University of Waikato, Hamilton, New Zealand.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
########################################################################
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
23 changes: 22 additions & 1 deletion RexSimulator/Hardware/Rex/Timer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
using System;
/*
########################################################################
# This file is part of wsim, a WRAMP simulator.
#
# Copyright (C) 2016 Paul Monigatti
# Copyright (C) 2019 The University of Waikato, Hamilton, New Zealand.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
########################################################################
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
23 changes: 22 additions & 1 deletion RexSimulator/Hardware/RexBoard.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
using System;
/*
########################################################################
# This file is part of wsim, a WRAMP simulator.
#
# Copyright (C) 2016 Paul Monigatti
# Copyright (C) 2019 The University of Waikato, Hamilton, New Zealand.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
########################################################################
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
23 changes: 22 additions & 1 deletion RexSimulator/Hardware/SimpleWrampCpu.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
using System;
/*
########################################################################
# This file is part of wsim, a WRAMP simulator.
#
# Copyright (C) 2016 Paul Monigatti
# Copyright (C) 2019 The University of Waikato, Hamilton, New Zealand.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
########################################################################
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
25 changes: 23 additions & 2 deletions RexSimulator/Hardware/Wramp/ALU.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
using System;
/*
########################################################################
# This file is part of wsim, a WRAMP simulator.
#
# Copyright (C) 2016 Paul Monigatti
# Copyright (C) 2019 The University of Waikato, Hamilton, New Zealand.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
########################################################################
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -98,7 +119,7 @@ public uint Result

//Misc
case IR.Function.lhi: return mRt << 16;
case IR.Function.inc: return mRs + 1; // Note: This function no longer exists
case IR.Function.inc: return mRs + 1; // Note: This function no longer exists
default: throw new InvalidOperationException("Unknown Function!");
}
}
Expand Down
67 changes: 44 additions & 23 deletions RexSimulator/Hardware/Wramp/IR.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
using System;
/*
########################################################################
# This file is part of wsim, a WRAMP simulator.
#
# Copyright (C) 2016 Paul Monigatti
# Copyright (C) 2019 The University of Waikato, Hamilton, New Zealand.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
########################################################################
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -98,9 +119,9 @@ public int SignedImmed20
}

/// <summary>
/// Gets the number of CPU cycles required to execute this instruction.
/// Assumes no exceptions are thrown, and that the cases mentioned in
/// the comments of this function do not apply.
/// Gets the number of CPU cycles required to execute this instruction.
/// Assumes no exceptions are thrown, and that the cases mentioned in
/// the comments of this function do not apply.
/// </summary>
public int TicksRequired
{
Expand Down Expand Up @@ -144,25 +165,25 @@ public int TicksRequired
case Function.movsg:

case Function.lhi:

// Note: An inc call can not be made by the WRAMP compiler,
// though it could be crafted by a crafty user.
case Function.inc:
return 5;

// Note: An inc call can not be made by the WRAMP compiler,
// though it could be crafted by a crafty user.
case Function.inc:
return 5;

case Function.mult:
return 42;
return 42;

case Function.multu:
return 41;
return 41;

case Function.div:
case Function.rem:
return 44;
return 44;

case Function.divu:
case Function.remu:
return 43;
return 43;

default:
throw new InvalidOperationException("Unknown Instruction!");
Expand All @@ -172,21 +193,21 @@ public int TicksRequired
case Opcode.jr:
case Opcode.beqz: //Note: 1 additional tick if the branch is taken
case Opcode.bnez: //Note: 1 additional tick if the branch is taken
return 5;

case Opcode.lw: //Note: 2 additional ticks if in user mode
return 7;
return 5;

case Opcode.lw: //Note: 2 additional ticks if in user mode
return 7;

case Opcode.sw: //Note: 2 additional ticks if in user mode
case Opcode.sw: //Note: 2 additional ticks if in user mode
case Opcode.jal:
case Opcode.jalr:
return 6;
return 6;

// Default includes break, syscall, rfe
// An unknown instruction will cause a GPF in SimpleWrampCPU.ExecuteInstruction(),
// so we don't need to throw one here.
// Default includes break, syscall, rfe
// An unknown instruction will cause a GPF in SimpleWrampCPU.ExecuteInstruction(),
// so we don't need to throw one here.
default:
return 5;
return 5;
}
}
}
Expand Down
23 changes: 22 additions & 1 deletion RexSimulator/Hardware/Wramp/MPU.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
using System;
/*
########################################################################
# This file is part of wsim, a WRAMP simulator.
#
# Copyright (C) 2016 Paul Monigatti
# Copyright (C) 2019 The University of Waikato, Hamilton, New Zealand.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
########################################################################
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
Expand Down
Loading

0 comments on commit f715272

Please sign in to comment.