https://github.com/ben-marshall/microcoder
Define custom assembly-like instructions and use them to write programs which are transpiled into synthesisable Verilog code.
https://github.com/ben-marshall/microcoder
assembly microcode microcontroller synthesis verilog
Last synced: 2 months ago
JSON representation
Define custom assembly-like instructions and use them to write programs which are transpiled into synthesisable Verilog code.
- Host: GitHub
- URL: https://github.com/ben-marshall/microcoder
- Owner: ben-marshall
- License: mit
- Created: 2017-05-27T14:31:26.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-08T22:29:33.000Z (over 6 years ago)
- Last Synced: 2025-03-29T18:01:57.148Z (3 months ago)
- Topics: assembly, microcode, microcontroller, synthesis, verilog
- Language: Python
- Homepage: http://microcoder.readthedocs.io/README/
- Size: 121 KB
- Stars: 10
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# uCode
[](http://microcoder.readthedocs.io/README/)
A toy project for turning user-defined assembly-like programs into
synthesisable verilog code. This verilog code can then be implemented on
an FPGA.More information on what this tool might be used for is found
[here](docs/usage.md).---
## Aims
The aim for this project is to allow people to define a set of their own
assembly-like *micro-instructions* using a very simple syntax. Using these
definitions, they can then write programs which are then transpiled into a
verilog state-machine. These programs then communicate with the outside world
using custom IO ports.## Progress
Currently, one can use the tool to:
- Define arbitrary instructions, with arguments and their own set of
operations on those arguments.
- Define arbitrary inputs and outputs to the micro-code program, known as
*ports*.
- Define global state variables which the instructions can access and modfy.
- Write assembly-like programs, with basic blocks, instructions and
conditional jumps between those blocks.Within each block, instructions can read and write the program ports, as well
as the global state variables.## Documentation
All documentation is found in the [docs/](./docs/) folder of the project.
These same files are also hosted on
[microcoder.readthedocs.io](http://microcoder.readthedocs.io/README/).## Examples
There are some simple examples bundled with the repositiory:
**Counter** - This is a really boring counter which simply counts down
from 10 and then loops. Forever.```sh
$> make all run EXAMPLE=count
```**Fibonacci** - This program takes an `n` value, and computes the `n`'th
number in the Fibonacci sequence.```sh
$> make all run EXAMPLE=fibonacci
```**DMA** - An example of a DMA memcopy co-processor which coppies multiple
words from one memory base address to another.```sh
$> make all run EXAMPLE=dma
```The output wave files for both examples are written to `work/waves.vcd`. This
can be viewed using a program like
[GTKWave](http://iverilog.wikia.com/wiki/GTKWAVE).