Git Product home page Git Product logo

cpu's Introduction

------------------------------------------------------------------------

This project's goal is to design a custom CPU

Instruction Set
Assembly Language
Compiled Language

Verilog FPGA Implemenation

Processor

24 Instructions
16 Registers

Assembly Language

Assembler
Emulator
Debugger

doc/   - Technical documention describing all aspects of this project.
progs/ - Programs written to run on the CPU.
hdl/   - Hardware to run 


Arithmetic:      7 add,sub,adc,sbc,mul,div,cmp
Load/Store/Move: 5 ldw,ldb,stw,stb,mov
Bitwise:         6 and,or,xor,nor,lsl,lsr
Jumps:           5 jmp,jz,jnz,jl,jge
Other:           1 die,nop
                --
				24

die


#
# Install dependencies.
#
sudo apt-get install libncurses5 libncurses5-dev

#
# Build a ROM and binary file from assembly code.
#
./assembler.py --assemble test.asm -b test.bin > test.rom

#
# Run the ROM in the emulator.
#
./emulator -r test.rom

#
# Run the binary in the emulator.
#
./emulator -b test.bin:0x0

#
# Run the kernel in the emulator.
#
./emulator -b progs/boot.bin:0x4000 -b sd.img:0x5000 -p 0x4000 -i

#
# Run the kernel using the debugger.
#
./emulator -b progs/boot.bin:0x4000 -b sd.img:0x5000 -g progs/all.kernel.bin:0x0 -g progs/lib.bin:0x3000 -p 0x4000 -i -t 2> error.out

#
# Dump heap contents in human readable format.
#
./heap -m emulator.memory -o 0x10000 -z $(( 0x1FF0000 )) -s

cpu's People

Contributors

kevinms avatar

Stargazers

Adam Worgen avatar

Watchers

James Cloos avatar  avatar Adam Worgen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.