Coder Social home page Coder Social logo

jawline / c8hardcaml Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 0.0 661 KB

An implementation of a CHIP-8 machine for FPGAs in Hardcaml with a custom assembler for writing test programs

OCaml 91.61% Standard ML 5.83% Assembly 0.38% Rust 2.19%
chip-8 emulators fpga-programming hardcaml

c8hardcaml's Introduction

c8hardcaml

⡿⠿⢏⣉⡹⠿⢏⣉⡹⠿⢏⣉⡹⠿⢏⣉⡹⠿⢏⣉⡹⠿⢏⣉⡹⠿⢏⣉⡹⠿⢏⣉⡹⠿⢏⣉⡹⠿⢏⣉⡹⠿⢏⣉⡹⠿⢏⣉⡹⠿⢏⣉⡹⠿⢏⣉⡹⠿⢏⣉⡹⠿⢏⣉⣹
⡇⠀⠈⠉⠁⠀⠈⠉⠁⠀⠈⠉⠁⠀⠈⠉⠁⠀⠈⠉⠁⠀⠈⠉⠁⠀⠈⠉⠁⠀⠈⠉⠁⠀⠈⠉⠁⠀⠈⠉⠁⠀⠈⠉⠁⠀⠈⠉⠁⠀⠈⠉⠁⠀⠈⠉⠁⠀⠈⠉⠁⠀⠈⠉⢹
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⣀⣀⣀⣀⣀⡀⠀⢀⣀⣀⣀⣀⣀⣀⣀⡀⠀⢀⣀⡀⠀⠀⠀⢀⣀⡀⠀⢀⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡿⠿⠿⠿⠿⠿⠇⠀⢸⣿⡿⠿⠿⠿⢿⣿⡇⠀⢸⣿⡇⠀⠀⠀⢸⣿⡇⠀⢸⣿⡿⠿⠿⠿⠿⠿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⠀⠀⢸⣿⡇⠀⢸⣿⡇⠀⠀⠀⢸⣿⡇⠀⢸⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⠀⠀⢸⣿⡇⠀⠈⢹⣷⡆⠀⢰⣾⡏⠁⠀⢸⣿⣇⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⠀⠀⠀⠀⠀⠀⢸⣿⣷⣶⣶⣶⣾⣿⡇⠀⠀⢸⣿⡇⠀⢸⣿⡇⠀⠀⢸⣿⡿⠿⠿⠿⠿⠿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⡇⠀⠀⠀⠀⠀⠀⠀⢸⣿⡏⠉⠉⠉⢹⣿⡇⠀⠀⠸⢿⣇⣀⣸⡿⠇⠀⠀⢸⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣇⣀⣀⣀⣀⣀⡀⠀⢸⣿⡇⠀⠀⠀⢸⣿⡇⠀⠀⠀⠸⢿⣿⡿⠇⠀⠀⠀⢸⣿⣇⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⠿⠿⠿⠿⠿⠿⠿⠇⠀⠸⠿⠇⠀⠀⠀⠸⠿⠇⠀⠀⠀⠀⠸⠿⠇⠀⠀⠀⠀⠸⠿⠿⠿⠿⠿⠿⠿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⡷⠶⢆⣀⡰⠶⢆⣀⡰⠶⢆⣀⡰⠶⢆⣀⡰⠶⢆⣀⡰⠶⢆⣀⡰⠶⢆⣀⡰⠶⢆⣀⡰⠶⢆⣀⡰⠶⢆⣀⡰⠶⢆⣀⡰⠶⢆⣀⡰⠶⢆⣀⡰⠶⢆⣀⡰⠶⢆⣀⡰⠶⢆⣀⣸
⠓⠒⠚⠛⠓⠒⠚⠛⠓⠒⠚⠛⠓⠒⠚⠛⠓⠒⠚⠛⠓⠒⠚⠛⠓⠒⠚⠛⠓⠒⠚⠛⠓⠒⠚⠛⠓⠒⠚⠛⠓⠒⠚⠛⠓⠒⠚⠛⠓⠒⠚⠛⠓⠒⠚⠛⠓⠒⠚⠛⠓⠒⠚⠛⠛ 
⡏⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⢉⣉⣉⣉⣉⡉⢉⣉⣉⣉⣉⡉⢉⣉⣉⣉⣉⣉⡉⢉⣉⣉⣉⣉⡉⢉⣉⣉⣉⣉⡉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⢹
⡇⠰⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠆⠀⢈⡉⠉⠉⠉⠁⢈⡉⠉⠉⢹⡇⢈⡉⠉⠉⠉⢹⡇⢈⡉⠉⠉⠉⠁⢈⡉⠉⠉⠉⠁⠀⠰⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠆⢸
⡇⠀⠰⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠆⠀⠀⠸⠷⠶⠶⢶⡆⢸⣷⣶⣶⣾⡇⢸⣷⣶⣶⣶⣾⡇⢸⡇⠀⠀⠀⠀⢸⡷⠆⠀⠀⠀⠀⠀⠰⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠆⠀⢸
⡇⠰⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠆⠀⢰⣶⣶⣶⣾⡇⢸⡏⠉⠉⠉⠁⢸⡏⠉⠉⠉⢹⡇⢸⣷⣶⣶⣶⡆⢸⣷⣶⣶⣶⡆⠀⠰⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠆⢸
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⠉⠁⠈⠁⠀⠀⠀⠀⠈⠁⠀⠀⠀⠈⠁⠈⠉⠉⠉⠉⠁⠈⠉⠉⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⠀⢰⡆⢰⡶⠶⠶⠶⢶⡆⢰⣶⡆⠀⠀⠀⢰⡆⠀⢰⡶⠶⠶⢶⡆⠀⢰⡶⠶⠶⠶⢆⡀⢰⡶⠶⠶⠶⠆⢰⡶⠶⠶⠶⢶⡆⢰⡶⠶⠶⠶⠶⠆⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⢀⣸⡇⢸⣇⡀⠀⠀⢸⡇⠸⢿⡇⠀⠀⢰⡾⠇⢰⣾⡷⠶⠶⠾⢷⡆⢸⣷⡆⠀⠀⢸⡇⢸⣷⡶⠶⠆⠀⢸⡷⢶⡶⠶⠾⠇⠸⠷⠶⠶⢶⣶⡆⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⢸⣿⡇⢸⣿⡇⠀⠀⢸⡇⠀⠸⢷⡆⢰⡾⠇⠀⢸⣿⡇⠀⠀⠀⢸⡇⢸⣿⡇⠀⠀⢸⡇⢸⣿⡇⠀⠀⠀⢸⡇⠸⠷⢶⣶⡆⠀⠀⠀⠀⢸⣿⡇⠀⠀⠀⠀⠀⢸
⡇⠀⠀⠀⠀⠀⠸⠿⠇⠸⠿⠇⠀⠀⠸⠇⠀⠀⠸⠷⠾⠇⠀⠀⠸⠿⠇⠀⠀⠀⠸⠇⠸⠿⠷⠶⠶⠎⠁⠸⠿⠷⠶⠶⠆⠸⠇⠀⠀⠸⠿⠇⠰⠶⠶⠶⠾⠿⠇⠀⠀⠀⠀⠀⢸
⡇⠀⢀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⡀⠀⢸
⡇⠀⢸⡏⠉⠉⠉⠉⠉⠉⠉⠉⢉⡉⠉⠉⠉⠉⢉⡉⢉⡉⠉⠉⠉⠉⢉⡉⠉⠉⠉⢉⡉⠉⠉⠉⢉⣉⣉⣉⣉⣉⡉⠉⠉⠉⠉⠉⠉⠉⠉⠉⢉⡉⠉⠉⠉⢉⣉⡉⠉⢹⡇⠀⢸
⡇⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⠀⢈⣱⡆⠰⢆⣰⣎⡁⢸⡇⠀⠀⠀⠀⢸⡇⠀⠀⠀⢸⡇⠀⠀⠀⢸⣏⡉⠉⠉⠉⢱⡆⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⢀⡀⢸⣿⡇⠀⢸⡇⠀⢸
⡇⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⠀⢸⡏⢱⣶⡎⢹⣿⡇⠸⠷⢶⣆⣰⡶⠾⠇⠀⠀⠀⢸⡇⠀⠀⠀⢸⣿⡇⠀⠀⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⠀⢸⡇⠀⢸⡇⠈⢹⡇⠀⢸⡇⠀⢸
⡇⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⠀⠸⠇⠸⠿⠇⠸⠿⠇⠀⠀⠈⠹⠏⠁⠀⠀⠀⠀⠀⠸⠇⠀⠀⠀⠸⠿⠷⠶⠶⠶⠎⠁⠀⠀⠀⠀⠀⠀⠀⠀⠸⠷⠶⠎⠱⠶⠾⠇⠀⢸⡇⠀⢸
⡇⠀⠸⠷⢶⡶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⠶⢶⡶⠾⠇⠀⢸
⣇⣀⣀⣀⣸⣇⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣸⣇⣀⣀⣀⣸
⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛
⡏⢉⡹⠏⠉⢉⡹⠏⠹⢏⡉⠉⠹⢏⡉⠉⠹⢏⡉⠉⠉⢉⡹⠏⠉⢉⡹⠏⠹⢏⡉⠉⠹⢏⡉⠉⠉⢉⡹⠏⠉⢉⡹⠏⠹⢏⡉⠉⠹⢏⡉⠉⠉⢉⡹⠏⠹⢏⡉⠉⠹⢏⡉⠉⢹
⡷⠎⠁⢀⡰⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⣸
⡷⢆⡀⠈⠁⢀⡰⠎⠁⢀⡰⠎⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⢹
⡇⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⣸
⡷⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⢹
⡇⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⣸
⡷⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠁⢀⡰⠎⠁⢀⡰⠎⠱⢆⡀⠈⠱⢆⡀⠈⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⠱⢆⡀⠈⠁⢀⡰⠎⠁⢀⡰⠎⢹
⡇⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⡀⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⣸
⡷⢆⡀⠈⠁⢀⡰⠎⠁⢀⡰⠎⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⢹
⡇⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⣸
⡷⢆⡀⠈⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠁⢀⡰⠎⠁⢀⡰⠎⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⢹
⡇⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⣸
⡷⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠱⢆⡀⠈⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⢹
⡇⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⡰⠎⠁⢀⣸
⡇⢀⡰⠎⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠁⢀⡰⠎⠁⢀⡰⠎⠱⢆⡀⠈⠁⢀⡰⠎⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠁⢀⡰⠎⠁⢀⡰⠎⢹
⡷⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⡀⠈⠱⢆⡰⠎⠁⢀⡀⠈⠱⢆⡀⠈⠱⢆⡀⠈⠱⢆⡰⠎⠁⢀⡰⠎⠁⢀⣸
⠓⠒⠒⠚⠓⠒⠒⠚⠓⠒⠒⠚⠓⠒⠒⠚⠓⠒⠒⠚⠓⠒⠒⠚⠓⠒⠒⠚⠓⠒⠒⠚⠓⠒⠒⠚⠓⠒⠒⠚⠓⠒⠒⠚⠓⠒⠒⠚⠓⠒⠒⠚⠓⠒⠒⠚⠓⠒⠒⠚⠓⠒⠒⠚⠛ 

An implementation of CHIP-8 in Hardcaml that can be executed in simulator or on physical hardware.

Architecture

The programmable CPU core is the root circuit. Through inputs to this circuit we can initially program the board-ram to prepare a program for execution and we can also use it to read the frame buffer.

CPU core holds all of the CHIP-8 implementation, calling out to different circuits like draw, bcd, xor_shift for instructions that are more complex.

Board ram is used for system memory and instructions all assume one cycle to read or write which is hardcoded into their implementation.

Testing

This project is tested visually using ppx_expect and the Hardcaml simulator. To start a visual test we initialize an instance of Programmable_cpu_core in sim and then program a test supplied ROM into board RAM by cycling the simulator. A test harness then cycles the simulator for a specific number of cycles and then uses debug inputs to Programmable_cpu_core to read the framebuffer from board RAM. The data in the framebuffer is then rendered to a string using the drawille library and printed to stdout so that ppx_expect can spot when the framebuffer changes between executions of tests.

c8hardcaml's People

Contributors

jawline avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.