Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/isubasinghe/bottlechip
A simple RISC-V processor written in Clash.
https://github.com/isubasinghe/bottlechip
Last synced: 26 days ago
JSON representation
A simple RISC-V processor written in Clash.
- Host: GitHub
- URL: https://github.com/isubasinghe/bottlechip
- Owner: isubasinghe
- Created: 2023-09-27T08:34:46.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-27T08:37:27.000Z (about 1 year ago)
- Last Synced: 2023-09-27T18:35:42.183Z (about 1 year ago)
- Language: Nix
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Nix Starter Project
This starter project contains the scaffolding needed to integrate Clash with the Nix Stack build system. Read [Simple Starter Project](https://github.com/clash-lang/clash-starters/blob/main/simple/README.md) for more information on the various files.# Table of Contents
- [Getting this project](#getting-this-project)
- [Building and testing this project](#building-and-testing-this-project)
- [REPL](#repl)
- [Adding custom dependencies / updating nix](#adding-custom-dependencies--updating-nix)# Getting this project
Run `nix-shell --packages stack --run "stack new my-clash-project clash-lang/simple-nix"`.# Building and testing this project
Build the project with:```bash
nix-build
```Verilog code will be available under the `result/share/verilog` directory.
Modify the `hdl` variable in `default.nix` to configure whether to generate
SystemVerilog or VHDL.However development itself is more streamlined by using a Nix shell. Start one
by invoking:```
nix-shell
```Then, to run the tests defined in `tests/`:
```bash
cabal run test-library
cabal run doctests
```To compile the project to VHDL run:
```bash
cabal run clash -- Example.Project --vhdl
```You can find the HDL files in `vhdl/`. The source can be found in `src/Example/Project.hs`.
# REPL
Clash offers a [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) as a quick way to try things, similar to Python's `python` or Ruby's `irb`. Open the REPL by invoking:```
cabal run clashi
```# Adding custom dependencies / updating nix
`niv` is available after opening `nix-shell`. See [niv on Hackage](https://hackage.haskell.org/package/niv) for more information.