wkoszek / Cpu60
Licence: other
Example of CPU simulation in software
Stars: ✭ 152
Programming Languages
c
50402 projects - #5 most used programming language
Projects that are alternatives of or similar to Cpu60
8800-simulator
A JavaScript simulator to demonstrate the front panel operations of Altair 8800.
Stars: ✭ 65 (-57.24%)
Mutual labels: simulator, cpu
Jupiter
RISC-V Assembler and Runtime Simulator
Stars: ✭ 326 (+114.47%)
Mutual labels: education, simulator
OpenCircuits
A free, open source, online digital circuit/logic designer.
Stars: ✭ 140 (-7.89%)
Mutual labels: education, simulator
Forth Cpu
A Forth CPU and System on a Chip, based on the J1, written in VHDL
Stars: ✭ 244 (+60.53%)
Mutual labels: cpu, simulator
Tenyr
Simple, orthogonal 32-bit computer architecture and environment
Stars: ✭ 24 (-84.21%)
Mutual labels: cpu, simulator
ARMStrong
A fast and simple ARM Simulator made for education based upon Unicorn and Keystone engines
Stars: ✭ 99 (-34.87%)
Mutual labels: simulator, cpu
Mipt Mips
Cycle-accurate pre-silicon simulator of RISC-V and MIPS CPUs
Stars: ✭ 250 (+64.47%)
Mutual labels: cpu, simulator
Ripes
A graphical processor simulator and assembly editor for the RISC-V ISA
Stars: ✭ 584 (+284.21%)
Mutual labels: education, simulator
Rars
RARS -- RISC-V Assembler and Runtime Simulator
Stars: ✭ 413 (+171.71%)
Mutual labels: education, simulator
drmips
I don't maintain this project anymore. Feel free to fork it! - Educational MIPS simulator
Stars: ✭ 41 (-73.03%)
Mutual labels: education, simulator
Vulcan
RISC-V Instruction Set Simulator (Built for education).
Stars: ✭ 80 (-47.37%)
Mutual labels: education, simulator
Riscv vhdl
Portable RISC-V System-on-Chip implementation: RTL, debugger and simulators
Stars: ✭ 356 (+134.21%)
Mutual labels: cpu, simulator
Digital
A digital logic designer and circuit simulator.
Stars: ✭ 1,108 (+628.95%)
Mutual labels: education, simulator
Edumips64
Free cross-platform educational MIPS64 CPU Simulator
Stars: ✭ 126 (-17.11%)
Mutual labels: education, simulator
Inginious
INGInious is a secure and automated exercises assessment platform using your own tests, also providing a pluggable interface with your existing LMS.
Stars: ✭ 138 (-9.21%)
Mutual labels: education
Psu Firmware
Firmware for programmable bench power supply EEZ H24005
Stars: ✭ 144 (-5.26%)
Mutual labels: simulator
Amdovx Core
AMD OpenVX Core -- a sub-module of amdovx-modules:
Stars: ✭ 139 (-8.55%)
Mutual labels: cpu
Openki
We moved to GitLab 💔 Openki is a tool to build up and organize local communities – Open education for real.
Stars: ✭ 137 (-9.87%)
Mutual labels: education
Zalo.github.io
A home for knowledge that is hard to find elsewhere
Stars: ✭ 143 (-5.92%)
Mutual labels: education
Simple CPU model written in 60 lines of code
CPU60 is a simple CPU model written in 60 lines of C code.
It supports 8 registers and several simple instructions: mov
, add
,
addi
, sub
, subi
, and
, andi
, or
, ori
instructions. Following
each instruction is the CPU register dump. By default input is read from the
standard input.
Flag -r
might be passed to simulate the proper reset of the CPU. Upon
reset, all registers are filled with 0's. Without -r
, the values of the
registers are undefined, and your program instructions can't depend on
register's content.
How to build
To build:
make
How to run
Either manually:
% ./cpu60
reg0=a7 reg1=f1 reg2=d9 reg3=2a reg4=82 reg5=c8 reg6=d8 reg7=fe
sub r0,r0,r0
reg0=00 reg1=f1 reg2=d9 reg3=2a reg4=82 reg5=c8 reg6=d8 reg7=fe sub r0,r0,r0
sub r1,r1,r1
reg0=00 reg1=00 reg2=d9 reg3=2a reg4=82 reg5=c8 reg6=d8 reg7=fe sub r1,r1,r1
ori r0,r0,1
reg0=01 reg1=00 reg2=d9 reg3=2a reg4=82 reg5=c8 reg6=d8 reg7=fe ori r0,r0,1
ori r1,r1,2
reg0=01 reg1=02 reg2=d9 reg3=2a reg4=82 reg5=c8 reg6=d8 reg7=fe ori r1,r1,2
add r2,r0,r1
reg0=01 reg1=02 reg2=03 reg3=2a reg4=82 reg5=c8 reg6=d8 reg7=fe add r2,r0,r1
Or from file:
% cpu60 < file
Where file can have any valid opcodes.
How to test
To unit test the model, hit:
make test
Author
- Wojciech Adam Koszek, [email protected]
- http://www.koszek.com
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].