Skip to content

Commit 2186783

Browse files
committed
de0_nano: Integrate de0 nano to new format
1 parent 161228f commit 2186783

5 files changed

Lines changed: 329 additions & 27 deletions

File tree

de0_nano/Makefile

Lines changed: 0 additions & 16 deletions
This file was deleted.

de0_nano/index.md

Lines changed: 52 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
---
22
title: De0 Nano
33
layout: page
4-
parent: Platforms
4+
parent: FuseSoC
55
---
66

7-
## DE0 Nano Tutorial
7+
## Prerequisites
88

9-
If you downloaded the tutorials as a release archive, you can directly
10-
start. If you have cloned the git repository, you instead need to
11-
follow the instructions for building the hardware and software as
12-
described below. Please also follow the
13-
[common tutorial setup](../index.html).
9+
#### System
10+
11+
* An x86 Linux workstation
12+
* The `curl` command line utilities
13+
* OpenOCD
14+
* The quartus FPGA design software
15+
* `fusesoc` - The [FuseSoC build system](../fusesoc.html).
16+
* `or1k-elf-` Toolchain as installed in our [newlib tutorial](../newlib.html).
17+
18+
#### Files
19+
20+
* [hello.c](../sw/hello/hello.c) - A Hello World test program.
21+
* [timer.c](../sw/timer/timer.c) - A baremetal example using the OpenRISC timer api's provided by newlib.
22+
23+
## DE0 Nano
24+
25+
To confirm you have all of the required tools installed check with the following:
1426

1527
To run the demo you need:
1628

@@ -36,12 +48,35 @@ the bottom of the board as depicted below.
3648

3749
![uart](doc/uart.png "Connect UART to board")
3850

51+
### Setup the Environment
52+
53+
To get started we will want to have a directory with all
54+
of our build files in one place.
55+
56+
```bash
57+
mkdir /tmp/or1k-de0nano
58+
cd /tmp/or1k-de0nano
59+
60+
curl -L -O https://openrisc.io/tutorials/sw/hello/hello.c
61+
curl -L -O https://openrisc.io/tutorials/sw/timer/timer.c
62+
63+
fusesoc library add de0_nano https://github.com/olofk/de0_nano.git
64+
```
65+
66+
### Build the FPGA bitstream
67+
68+
```bash
69+
fusesoc build de0_nano
70+
```
71+
3972
### Program the FPGA bitstream
4073

4174
Once the board is setup, you can download the FPGA bitstream by
4275
running
4376

44-
make program
77+
```bash
78+
fusesoc pgm de0_nano
79+
```
4580

4681
### Start the OpenOCD daemon
4782

@@ -69,11 +104,18 @@ You should see the LEDs counting and UART output once a second.
69104

70105
You can rebuilt the hardware by running:
71106

72-
make build-hw
107+
```bash
108+
fusesoc build de0_nano
109+
```
73110

74111
## (Re-)build the software
75112

76113
Some example software is available, that you can (re-)build for the
77114
DE0 nano board by running
78115

79-
make build-sw
116+
```bash
117+
CFLAGS=-mboard=de0_nano -DDE0_NANO
118+
119+
or1k-elf-gcc -g -o hello.elf ${CFLAGS} ../sw/hello/hello.c
120+
or1k-elf-gcc -g -o timer.elf ${CFLAGS} ../sw/timer/timer.c
121+
```

fusesoc.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: FuseSoC
3+
layout: page
4+
nav_order: 3
5+
parent: Platforms
6+
---
7+
8+
The FuseSoC build system, dependency manager and fpga integration platform
9+
allows for easy creation of OpenRISC systems. If is featured in our
10+
[Quick Start with Docker Images](images/) as our main fpga development
11+
platform. For in depth documentation see:
12+
13+
* [FuseSoC Manual](https://fusesoc.readthedocs.io/en/stable/index.html) - Full documentation.
14+
* [olofk/fusesoc](https://github.com/olofk/fusesoc) - The github project
15+
16+
## Installing FuseSoC
17+
18+
FuseSoC is a python program and can be installed using `pip`. The easiest way to get started is
19+
simplly:
20+
21+
```
22+
pip3 install --upgrade --user fusesoc
23+
```
24+
25+
## Available SoCs
26+
27+
In our tutorials we will mainly use the `mor1kx-generic` fusesoc
28+
SoC but there are a few more out there. Also available are:
29+
30+
* [stffrdhrn/mor1kx-generic](https://github.com/stffrdhrn/mor1kx-generic) - A generic SoC that can be used as a starting point.
31+
It supports both [mor1kx](https://github.com/openrisc/mor1kx) and [marocchino](https://github.com/openrisc/or1k_marocchino) CPU cores
32+
with both [iverilog](https://bleyer.org/icarus/) and [verilator](https://www.veripool.org/verilator/) simulation backends.
33+
* [olofk/de0_nano](https://github.com/olofk/de0_nano) - An SoC for the [Terasic De0 Nano](https://www.terasic.com.tw/cgi-bin/page/archive.pl?No=593) FPGA development board.
34+
* [stffrdhrn/de0_nano-multicore](https://github.com/stffrdhrn/de0_nano-multicore) - A De0 Nano SoC supporting multiple mor1kx cores used to test SMP Linux.
35+
* [orpsoc-cores](https://github.com/openrisc/orpsoc-cores/tree/master/systems) - There are also several SoC's that have not yet been converted from the orpsoc-cores to fusesoc stand alone cores structure. These include support for de1, de2 and atlys FPGA boards.
36+
37+
If you have developed fusesoc support for a board not mentioned here please mail the [OpenRISC mailing](mailto:linux-openrisc@vger.kernel.org)
38+
list or create a PR for this tutorial and we can add it here.
39+

index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This downloads all free and open tools. Unfortunately, you will still
2626
need to install closed (but free) tools from the FPGA vendors:
2727

2828
* [Altera Quartus Prime](#altera-quartus-prime) for Altera FPGAs
29-
([DE0 nano](de0_nano/README.md).
29+
([DE0 nano](de0_nano/)).
3030

3131
You can now start with the [tutorials](#tutorials).
3232

0 commit comments

Comments
 (0)