Coder Social home page Coder Social logo

clash-tinybasic's Introduction

Tiny BASIC computer implemented in Clash

As seen in https://unsafePerform.IO/blog/2020-11-17-a_tiny_computer_for_tiny_basic/

This code is part of the book Retrocomputing with Clash: Haskell for FPGA Hardware Design at https://unsafePerform.IO/retroclash/.

Building into a bitfile

The included mk script runs the included Shake rules and creates a bitfile ready to upload on a supported FPGA dev board. Targets are made up from three specifiers: core, IO and FPGA board.

Available CPU cores:

  • intel8080

Available IO modes:

  • serial: serial IO
  • video: PS/2 keyboard input, 640⨯480 VGA output

Available FPGA boards:

Note that only the Nexys A7-50T target is tested extensively, the others might accumulate some bit-rot.

First, create a build.mk file that describes your local build environment and your build target:

VIVADO_ROOT=/path/to/vivado/installation
TARGET=intel8080/video/nexys-a7-50t

Alternatively, if you are using the Vivado or ISE toolchain via a wrapper script (e.g. to run it in Docker), instead of VIVADO_ROOT or ISE_ROOT, you can set VIVADO or ISE to the wrapper script's name:

VIVADO=/path/to/vivado-wrapper

The script will be called with the first argument being the Vivado tool's name, and the rest of the arguments are the arguments to the tool itself.

Once you have build.mk, you can run mk and upload to your FPGA board the TinyBASICVIdeo.bit file from the _build/intel8080/video/nexys-a7-50t/synth/TinyBASICVIdeo/TinyBASICVideo.runs/impl_1 directory (or just do ./mk intel8080/video/nexys-a7-50t/upload).

Building the simulators

There are two simulators included:

  • A "very high-level" simulation that only uses the CPU implementation from Clash, and the rest is Haskell.

  • A logic board simulation that simulates not just the CPU, but also the memory elements, including the memory address decoding.

To build the simulations, just do a stack build.

clash-tinybasic's People

Contributors

gergoerdi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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