Add Hardware Integration
ONE WARE Studio is a comprehensive development environment designed for hardware and software integration. It features a system that allows you to add any FPGA development board using JSON configuration files. This is useful for configuring the graphical user interface (GUI) and ensuring that your toolchain supports your hardware.
Directory Structure​
ONE WARE Studio organizes its files in a structured manner to facilitate easy management and integration of hardware components. Here is an overview of the directory structure:
First, let's have a look at the OneWareStudio
folder inside your home directory.
The directory structure within ONE WARE Studio looks similar to this:
OneWareStudio
├── Packages
│ ├── Hardware
│ ├── Local
| ├── FPGA
| ├── Extensions
| ├── PMOD
| ├── CRUVI_LS
| ├── CRUVI_HS
│ ├── OneWare.MAX1000
| ├── FPGA
| ├── MAX1000
| ├── fpga.json
| ├── gui.json
...
Local
is the default package name where you can add your own hardware components. However, it's also possible to create a new directory for your own hardware package. This is useful if you want to sync your hardware integration with Git. Just ensure that the paths within your package follow the same structure as in Local
.
- FPGA Boards are located inside
Packages/Hardware/<PACKAGENAME>/FPGA/<YOUR_FPGA_BOARD_NAME>
. - Extension Boards are located inside
Packages/Hardware/<PACKAGENAME>/Extensions/<CONNECTOR>/<YOUR_EXTENSION_BOARD_NAME>
.
Adding an FPGA Board​
- Create a folder inside
Packages/Hardware/Local/FPGA/<YOUR_BOARD_NAME>
. - Inside this folder, create a file named
fpga.json
.
In that file you can add the pins of your board, the properties needed to compile for it and interfaces that are used for extensions or autoconnect.
To see how this file can look like when finished, you can have a look at the fpga.json for the MAX1000
The basic file structure for the fpga.json
looks like this.
{
"properties": {
"quartusToolchainFamily": "MAX 10",
...
},
"pins": [
{
"description": "CLK",
"name": "H6"
},
...
],
"interfaces": [
{
"name": "CLK",
"pins": [
{
"name": "1",
"pin": "35"
}
]
},
...
]
}
Properties​
Valid properties at the moment are for compiling using Yosys and/or Quartus. These follow the documentation for the respective tools and control how the arguments are set for running the commands needed to compile/program the hardware.
This is an example that is valid for the Icebreaker V1.0 using OSS CAD Suite
"properties": {
"yosysToolchainYosysSynthTool": "synth_ice40",
"yosysToolchainYosysFlags": "",
"yosysToolchainNextPnrTool": "nextpnr-ice40",
"yosysToolchainNextPnrFlags": "--package sg48 --up5k",
"yosysToolchainPackTool": "icepack",
"yosysToolchainPackFlags": "",
"openFpgaLoaderBoard": "ice40_generic",
"openFpgaLoaderShortTermFlags": "",
"openFpgaLoaderLongTermFlags": ""
}
This is an example that is valid for the MAX1000 using Quartus
"properties": {
"quartusToolchainFamily": "MAX 10",
"quartusToolchainDevice": "10M08SAU169C8G",
"quartusProgrammerShortTermMode": "JTAG",
"quartusProgrammerShortTermOperation": "P",
"quartusProgrammerLongTermMode": "JTAG",
"quartusProgrammerLongTermFormat": "POF",
"quartusProgrammerLongTermOperation": "P"
}
Pins​
Pins are a simple array of JSON objects that look like this:
{
"description": "CLK",
"name": "H6"
}
They simply set the pins that are available for your hardware, so you can connect them in the GUI.
Interfaces​
Interfaces can be used to graphically connect extensions for your hardware.
This is how you would define the PMOD Interface for the MAX1000:
"interfaces": [
{
"name": "PMOD_1",
"connector": "PMOD",
"pins": [
{
"name": "1",
"pin": "M3"
},
{
"name": "2",
"pin": "L3"
},
{
"name": "3",
"pin": "M2"
},
{
"name": "4",
"pin": "M1"
},
{
"name": "5",
"pin": "N3"
},
{
"name": "6",
"pin": "N2"
},
{
"name": "7",
"pin": "K2"
},
{
"name": "8",
"pin": "K1"
}
]
},
...
]
The pin
value must point to a pin that is already defined in Pins, while the name
value provides the respective name that extensions can use to know where the real pin is located.
Adding an FPGA Extension​
To add an FPGA extension, follow these steps:
- Create a folder inside
Packages/Hardware/Local/Extensions/<CONNECTOR>/<YOUR_EXTENSION_NAME>
. - Inside this folder, create a file named
extension.json
.
In that file you can define the pins and interfaces for your extension.
Here is an example of what the extension.json
might look like:
{
"name": "MyExtension",
"connector": "PMOD",
"pins": [
{
"description": "TX",
"name": "A1"
},
{
"description": "RX",
"name": "B1"
}
],
"interfaces": [
{
"name": "UART",
"pins": [
{
"name": "TX",
"pin": "A1"
},
{
"name": "RX",
"pin": "B1"
}
]
}
]
}
Adding a GUI​
Adding a GUI is similar for both FPGA boards and extensions. Start by adding a gui.json
file to your hardware folder (same location as fpga.json
). A gui.json
file consists of width
, height
, and an array of GUI elements like this:
{
"width": 480,
"height": 480,
"elements": [
{
"type": "rect",
"x": 40,
"y": 40,
"width": 400,
"height": 400,
"color": "#096845"
},
...
]
}
The width and height can be calculated by multiplying the board size in millimeters by 4. For example, a board that is 100x100mm would have dimensions of 400x400px. It is recommended to use a border of 40px on each side, so you should set the width and height to 480x480.
The IDE will show a live preview of your gui.json
file!
Just open them next to each other, and view your changes on every save.
Here is a list of valid GUI Elements that can be added, including their possible attributes:
- The
textColor
will default to the IDE's default text color (white in darkmode / black in light mode). If you want to draw it on top of rectangles, you should choose a color with good contrast. - The
fontSize
will default to 10.
Rect​
Creates a rectangle. This can be used as a background for the hardware.
Property | Description | Type | Example | Required |
---|---|---|---|---|
x | X coordinate in px | double | 100 | ✅ |
y | Y coordinate in px | double | 100 | ✅ |
rotation | Angle to rotate in degree | double | 90 | |
width | Width in px | double | 100 | ✅ |
height | Height in px | double | 100 | ✅ |
color | Background color | string | "#AA00BB" | ✅ |
cornerRadius | CornerRadius | string | "10 15 20 10" | |
boxShadow | Shadow for the element | string | "0 0 5 5 #77000000" | |
text | Text to draw in the center | string | "Test" | |
textColor | Text color as hex code | string | "#FFFFFF" | |
fontWeight | Font weight | string | "bold" | |
fontSize | Size for the text in pt | int | 10 |
Ellipse​
Creates an ellipse.
Property | Description | Type | Example | Required |
---|---|---|---|---|
x | X coordinate in px | double | 100 | ✅ |
y | Y coordinate in px | double | 100 | ✅ |
rotation | Angle to rotate in degree | double | 90 | |
width | Width in px | double | 100 | ✅ |
height | Height in px | double | 100 |