From ce65e4ba417302f2499fed6f48a9c1a103031afb Mon Sep 17 00:00:00 2001 From: umarcor Date: Thu, 6 Jan 2022 13:09:23 +0100 Subject: [PATCH] add submodule hdl/constraints --- .gitmodules | 3 + .prettierignore | 1 + ICETool/__init__.py | 193 +++++++++++++ ICETool/constraints | 1 + README.md | 36 +-- constraints/boards/regenerate_pinouts.py | 31 --- controllers/menu.js | 2 +- gruntfile.js | 4 +- {constraints => resources}/README.md | 0 .../boards/Alchitry-Cu/info.json | 0 .../boards/Alchitry-Cu/iomode.json | 0 .../boards/Alchitry-Cu/pinout.pcf | 0 .../boards/Alchitry-Cu/rules.json | 0 .../boards/ColorLight-5A-75B-V61/info.json | 0 .../boards/ColorLight-5A-75B-V61/pinout.lpf | 0 .../boards/ColorLight-5A-75B-V61/rules.json | 0 .../boards/ColorLight-5A-75B-V8/info.json | 0 .../boards/ColorLight-5A-75B-V8/pinout.lpf | 0 .../boards/ColorLight-5A-75B-V8/rules.json | 0 .../boards/ColorLight-5A-75E-V6/info.json | 0 .../boards/ColorLight-5A-75E-V6/pinout.lpf | 0 .../boards/ColorLight-5A-75E-V6/rules.json | 0 .../boards/ColorLight-5A-75E-V71/info.json | 0 .../boards/ColorLight-5A-75E-V71/pinout.lpf | 0 .../boards/ColorLight-5A-75E-V71/rules.json | 0 .../boards/OK-iCE40Pro/info.json | 0 .../boards/OK-iCE40Pro/pinout.pcf | 0 .../boards/OK-iCE40Pro/pinout.svg | 0 .../boards/OK-iCE40Pro/rules.json | 0 .../boards/TinyFPGA-B2/info.json | 0 .../boards/TinyFPGA-B2/iomode.json | 0 .../boards/TinyFPGA-B2/pinout.pcf | 0 .../boards/TinyFPGA-B2/rules.json | 0 .../boards/TinyFPGA-BX/info.json | 0 .../boards/TinyFPGA-BX/iomode.json | 0 .../boards/TinyFPGA-BX/pinout.pcf | 0 .../boards/TinyFPGA-BX/rules.json | 0 .../boards/_ColorLight-5A-75B-V7/info.json | 0 .../boards/_ColorLight-5A-75B-V7/rules.json | 0 .../boards/_ColorLight-i5-v70/info.json | 0 .../boards/_ColorLight-i5-v70/pinout.png | Bin .../boards/_ColorLight-i5-v70/rules.json | 0 .../boards/_iCE40HX8K-EVB/info.json | 0 .../boards/_iCE40HX8K-EVB/pinout.json | 0 .../boards/_iCE40HX8K-EVB/pinout.pcf | 0 .../boards/_iCE40HX8K-EVB/rules.json | 0 .../boards/_iCESugar-Pro/info.json | 0 .../boards/_iCESugar-Pro/pinout.png | Bin .../boards/_iCESugar-Pro/rules.json | 0 .../boards/_iCEblink40-HX1K/pinout.json | 0 .../boards/_iCEblink40-HX1K/pinout.pcf | 0 .../boards/_iCEblink40-HX1K/rules.json | 0 .../boards/alhambra-ii/info.json | 0 .../boards/alhambra-ii/iomode.json | 0 .../boards/alhambra-ii/pinout.pcf | 0 .../boards/alhambra-ii/pinout.svg | 0 .../boards/alhambra-ii/rules.json | 0 .../boards/blackice-ii/info.json | 0 .../boards/blackice-ii/iomode.json | 0 .../boards/blackice-ii/pinout.pcf | 0 .../boards/blackice-ii/rules.json | 0 .../boards/blackice-mx/info.json | 0 .../boards/blackice-mx/pinout.pcf | 0 .../boards/blackice-mx/pinout.svg | 0 .../boards/blackice-mx/rules.json | 0 .../boards/blackice/info.json | 0 .../boards/blackice/iomode.json | 0 .../boards/blackice/pinout.pcf | 0 .../boards/blackice/rules.json | 0 .../boards/doppler/info.json | 0 .../boards/doppler/pinout.pcf | 0 .../boards/doppler/rules.json | 0 .../boards/edu-ciaa-fpga/info.json | 0 .../boards/edu-ciaa-fpga/iomode.json | 0 .../boards/edu-ciaa-fpga/pinout.pcf | 0 .../boards/edu-ciaa-fpga/pinout.svg | 0 .../boards/edu-ciaa-fpga/rules.json | 0 .../boards/fomu/info.json | 0 .../boards/fomu/iomode.json | 0 .../boards/fomu/pinout.pcf | 0 .../boards/fomu/rules.json | 0 .../boards/fpga101/info.json | 0 .../boards/fpga101/iomode.json | 0 .../boards/fpga101/pinout.json | 0 .../boards/fpga101/pinout.pcf | 0 .../boards/fpga101/rules.json | 0 .../boards/go-board/info.json | 0 .../boards/go-board/iomode.json | 0 .../boards/go-board/pinout.pcf | 0 .../boards/go-board/rules.json | 0 .../boards/iCE40-HX8K/info.json | 0 .../boards/iCE40-HX8K/iomode.json | 0 .../boards/iCE40-HX8K/pinout.pcf | 0 .../boards/iCE40-HX8K/pinout.svg | 0 .../boards/iCE40-HX8K/rules.json | 0 .../boards/iCE40-UP5K/info.json | 0 .../boards/iCE40-UP5K/iomode.json | 0 .../boards/iCE40-UP5K/pinout.pcf | 0 .../boards/iCE40-UP5K/rules.json | 0 .../boards/iCEBreaker-bitsy/info.json | 0 .../boards/iCEBreaker-bitsy/iomode.json | 0 .../boards/iCEBreaker-bitsy/pinout.pcf | 0 .../boards/iCEBreaker-bitsy/rules.json | 0 .../boards/iCEBreaker/info.json | 0 .../boards/iCEBreaker/iomode.json | 0 .../boards/iCEBreaker/pinout.pcf | 0 .../boards/iCEBreaker/rules.json | 0 .../boards/iCESugar_1_5/info.json | 0 .../boards/iCESugar_1_5/pinout.pcf | 0 .../boards/iCESugar_1_5/pinout.svg | 0 .../boards/iCESugar_1_5/rules.json | 0 .../boards/icefun/info.json | 0 .../boards/icefun/pinout.pcf | 0 .../boards/icefun/rules.json | 0 .../boards/icestick/info.json | 0 .../boards/icestick/iomode.json | 0 .../boards/icestick/pinout.pcf | 0 .../boards/icestick/rules.json | 0 .../boards/icezum/info.json | 0 .../boards/icezum/iomode.json | 0 .../boards/icezum/pinout.pcf | 0 .../boards/icezum/pinout.svg | 0 .../boards/icezum/rules.json | 0 .../boards/icoboard/info.json | 0 .../boards/icoboard/iomode.json | 0 .../boards/icoboard/pinout.pcf | 0 .../boards/icoboard/rules.json | 0 .../boards/kefir/info.json | 0 .../boards/kefir/iomode.json | 0 .../boards/kefir/pinout.pcf | 0 .../boards/kefir/pinout.svg | 0 .../boards/kefir/rules.json | 0 .../boards/orangecrab-r02-25f/info.json | 0 .../boards/orangecrab-r02-25f/iomode.json | 0 .../boards/orangecrab-r02-25f/pinout.lpf | 0 .../boards/orangecrab-r02-25f/rules.json | 0 .../boards/ulx3s-12f/info.json | 0 .../boards/ulx3s-12f/iomode.json | 0 .../boards/ulx3s-12f/pinout.lpf | 0 .../boards/ulx3s-12f/rules.json | 0 .../boards/ulx3s-25f/info.json | 0 .../boards/ulx3s-25f/iomode.json | 0 .../boards/ulx3s-25f/pinout.lpf | 0 .../boards/ulx3s-25f/rules.json | 0 .../boards/ulx3s-45f/info.json | 0 .../boards/ulx3s-45f/iomode.json | 0 .../boards/ulx3s-45f/pinout.lpf | 0 .../boards/ulx3s-45f/rules.json | 0 .../boards/ulx3s-85f/info.json | 0 .../boards/ulx3s-85f/iomode.json | 0 .../boards/ulx3s-85f/pinout.lpf | 0 .../boards/ulx3s-85f/rules.json | 0 .../boards/upduino/info.json | 0 .../boards/upduino/iomode.json | 0 .../boards/upduino/pinout.pcf | 0 .../boards/upduino/rules.json | 0 .../boards/upduino2/info.json | 0 .../boards/upduino2/iomode.json | 0 .../boards/upduino2/pinout.pcf | 0 .../boards/upduino2/rules.json | 0 .../boards/upduino21/info.json | 0 .../boards/upduino21/iomode.json | 0 .../boards/upduino21/pinout.pcf | 0 .../boards/upduino21/rules.json | 0 .../boards/upduino3/info.json | 0 .../boards/upduino3/iomode.json | 0 .../boards/upduino3/pinout.pcf | 0 .../boards/upduino3/rules.json | 0 {constraints => resources}/devices/HX1K.json | 0 {constraints => resources}/devices/HX8K.json | 0 {constraints => resources}/devices/LP8K.json | 0 {constraints => resources}/devices/UP5K.json | 0 services/common.js | 11 +- services/tools.js | 7 +- tools/ICETool | 259 ------------------ viewers/plain/pcf.html | 2 +- viewers/svg/pinout.html | 2 +- 177 files changed, 227 insertions(+), 325 deletions(-) create mode 100755 ICETool/__init__.py create mode 160000 ICETool/constraints delete mode 100755 constraints/boards/regenerate_pinouts.py rename {constraints => resources}/README.md (100%) rename {constraints => resources}/boards/Alchitry-Cu/info.json (100%) rename {constraints => resources}/boards/Alchitry-Cu/iomode.json (100%) rename {constraints => resources}/boards/Alchitry-Cu/pinout.pcf (100%) rename {constraints => resources}/boards/Alchitry-Cu/rules.json (100%) rename {constraints => resources}/boards/ColorLight-5A-75B-V61/info.json (100%) rename {constraints => resources}/boards/ColorLight-5A-75B-V61/pinout.lpf (100%) rename {constraints => resources}/boards/ColorLight-5A-75B-V61/rules.json (100%) rename {constraints => resources}/boards/ColorLight-5A-75B-V8/info.json (100%) rename {constraints => resources}/boards/ColorLight-5A-75B-V8/pinout.lpf (100%) rename {constraints => resources}/boards/ColorLight-5A-75B-V8/rules.json (100%) rename {constraints => resources}/boards/ColorLight-5A-75E-V6/info.json (100%) rename {constraints => resources}/boards/ColorLight-5A-75E-V6/pinout.lpf (100%) rename {constraints => resources}/boards/ColorLight-5A-75E-V6/rules.json (100%) rename {constraints => resources}/boards/ColorLight-5A-75E-V71/info.json (100%) rename {constraints => resources}/boards/ColorLight-5A-75E-V71/pinout.lpf (100%) rename {constraints => resources}/boards/ColorLight-5A-75E-V71/rules.json (100%) rename {constraints => resources}/boards/OK-iCE40Pro/info.json (100%) rename {constraints => resources}/boards/OK-iCE40Pro/pinout.pcf (100%) rename {constraints => resources}/boards/OK-iCE40Pro/pinout.svg (100%) rename {constraints => resources}/boards/OK-iCE40Pro/rules.json (100%) rename {constraints => resources}/boards/TinyFPGA-B2/info.json (100%) rename {constraints => resources}/boards/TinyFPGA-B2/iomode.json (100%) rename {constraints => resources}/boards/TinyFPGA-B2/pinout.pcf (100%) rename {constraints => resources}/boards/TinyFPGA-B2/rules.json (100%) rename {constraints => resources}/boards/TinyFPGA-BX/info.json (100%) rename {constraints => resources}/boards/TinyFPGA-BX/iomode.json (100%) rename {constraints => resources}/boards/TinyFPGA-BX/pinout.pcf (100%) rename {constraints => resources}/boards/TinyFPGA-BX/rules.json (100%) rename {constraints => resources}/boards/_ColorLight-5A-75B-V7/info.json (100%) rename {constraints => resources}/boards/_ColorLight-5A-75B-V7/rules.json (100%) rename {constraints => resources}/boards/_ColorLight-i5-v70/info.json (100%) rename {constraints => resources}/boards/_ColorLight-i5-v70/pinout.png (100%) rename {constraints => resources}/boards/_ColorLight-i5-v70/rules.json (100%) rename {constraints => resources}/boards/_iCE40HX8K-EVB/info.json (100%) rename {constraints => resources}/boards/_iCE40HX8K-EVB/pinout.json (100%) rename {constraints => resources}/boards/_iCE40HX8K-EVB/pinout.pcf (100%) rename {constraints => resources}/boards/_iCE40HX8K-EVB/rules.json (100%) rename {constraints => resources}/boards/_iCESugar-Pro/info.json (100%) rename {constraints => resources}/boards/_iCESugar-Pro/pinout.png (100%) rename {constraints => resources}/boards/_iCESugar-Pro/rules.json (100%) rename {constraints => resources}/boards/_iCEblink40-HX1K/pinout.json (100%) rename {constraints => resources}/boards/_iCEblink40-HX1K/pinout.pcf (100%) rename {constraints => resources}/boards/_iCEblink40-HX1K/rules.json (100%) rename {constraints => resources}/boards/alhambra-ii/info.json (100%) rename {constraints => resources}/boards/alhambra-ii/iomode.json (100%) rename {constraints => resources}/boards/alhambra-ii/pinout.pcf (100%) rename {constraints => resources}/boards/alhambra-ii/pinout.svg (100%) rename {constraints => resources}/boards/alhambra-ii/rules.json (100%) rename {constraints => resources}/boards/blackice-ii/info.json (100%) rename {constraints => resources}/boards/blackice-ii/iomode.json (100%) rename {constraints => resources}/boards/blackice-ii/pinout.pcf (100%) rename {constraints => resources}/boards/blackice-ii/rules.json (100%) rename {constraints => resources}/boards/blackice-mx/info.json (100%) rename {constraints => resources}/boards/blackice-mx/pinout.pcf (100%) rename {constraints => resources}/boards/blackice-mx/pinout.svg (100%) rename {constraints => resources}/boards/blackice-mx/rules.json (100%) rename {constraints => resources}/boards/blackice/info.json (100%) rename {constraints => resources}/boards/blackice/iomode.json (100%) rename {constraints => resources}/boards/blackice/pinout.pcf (100%) rename {constraints => resources}/boards/blackice/rules.json (100%) rename {constraints => resources}/boards/doppler/info.json (100%) rename {constraints => resources}/boards/doppler/pinout.pcf (100%) rename {constraints => resources}/boards/doppler/rules.json (100%) rename {constraints => resources}/boards/edu-ciaa-fpga/info.json (100%) rename {constraints => resources}/boards/edu-ciaa-fpga/iomode.json (100%) rename {constraints => resources}/boards/edu-ciaa-fpga/pinout.pcf (100%) rename {constraints => resources}/boards/edu-ciaa-fpga/pinout.svg (100%) rename {constraints => resources}/boards/edu-ciaa-fpga/rules.json (100%) rename {constraints => resources}/boards/fomu/info.json (100%) rename {constraints => resources}/boards/fomu/iomode.json (100%) rename {constraints => resources}/boards/fomu/pinout.pcf (100%) rename {constraints => resources}/boards/fomu/rules.json (100%) rename {constraints => resources}/boards/fpga101/info.json (100%) rename {constraints => resources}/boards/fpga101/iomode.json (100%) rename {constraints => resources}/boards/fpga101/pinout.json (100%) rename {constraints => resources}/boards/fpga101/pinout.pcf (100%) rename {constraints => resources}/boards/fpga101/rules.json (100%) rename {constraints => resources}/boards/go-board/info.json (100%) rename {constraints => resources}/boards/go-board/iomode.json (100%) rename {constraints => resources}/boards/go-board/pinout.pcf (100%) rename {constraints => resources}/boards/go-board/rules.json (100%) rename {constraints => resources}/boards/iCE40-HX8K/info.json (100%) rename {constraints => resources}/boards/iCE40-HX8K/iomode.json (100%) rename {constraints => resources}/boards/iCE40-HX8K/pinout.pcf (100%) rename {constraints => resources}/boards/iCE40-HX8K/pinout.svg (100%) rename {constraints => resources}/boards/iCE40-HX8K/rules.json (100%) rename {constraints => resources}/boards/iCE40-UP5K/info.json (100%) rename {constraints => resources}/boards/iCE40-UP5K/iomode.json (100%) rename {constraints => resources}/boards/iCE40-UP5K/pinout.pcf (100%) rename {constraints => resources}/boards/iCE40-UP5K/rules.json (100%) rename {constraints => resources}/boards/iCEBreaker-bitsy/info.json (100%) rename {constraints => resources}/boards/iCEBreaker-bitsy/iomode.json (100%) rename {constraints => resources}/boards/iCEBreaker-bitsy/pinout.pcf (100%) rename {constraints => resources}/boards/iCEBreaker-bitsy/rules.json (100%) rename {constraints => resources}/boards/iCEBreaker/info.json (100%) rename {constraints => resources}/boards/iCEBreaker/iomode.json (100%) rename {constraints => resources}/boards/iCEBreaker/pinout.pcf (100%) rename {constraints => resources}/boards/iCEBreaker/rules.json (100%) rename {constraints => resources}/boards/iCESugar_1_5/info.json (100%) rename {constraints => resources}/boards/iCESugar_1_5/pinout.pcf (100%) rename {constraints => resources}/boards/iCESugar_1_5/pinout.svg (100%) rename {constraints => resources}/boards/iCESugar_1_5/rules.json (100%) rename {constraints => resources}/boards/icefun/info.json (100%) rename {constraints => resources}/boards/icefun/pinout.pcf (100%) rename {constraints => resources}/boards/icefun/rules.json (100%) rename {constraints => resources}/boards/icestick/info.json (100%) rename {constraints => resources}/boards/icestick/iomode.json (100%) rename {constraints => resources}/boards/icestick/pinout.pcf (100%) rename {constraints => resources}/boards/icestick/rules.json (100%) rename {constraints => resources}/boards/icezum/info.json (100%) rename {constraints => resources}/boards/icezum/iomode.json (100%) rename {constraints => resources}/boards/icezum/pinout.pcf (100%) rename {constraints => resources}/boards/icezum/pinout.svg (100%) rename {constraints => resources}/boards/icezum/rules.json (100%) rename {constraints => resources}/boards/icoboard/info.json (100%) rename {constraints => resources}/boards/icoboard/iomode.json (100%) rename {constraints => resources}/boards/icoboard/pinout.pcf (100%) rename {constraints => resources}/boards/icoboard/rules.json (100%) rename {constraints => resources}/boards/kefir/info.json (100%) rename {constraints => resources}/boards/kefir/iomode.json (100%) rename {constraints => resources}/boards/kefir/pinout.pcf (100%) rename {constraints => resources}/boards/kefir/pinout.svg (100%) rename {constraints => resources}/boards/kefir/rules.json (100%) rename {constraints => resources}/boards/orangecrab-r02-25f/info.json (100%) rename {constraints => resources}/boards/orangecrab-r02-25f/iomode.json (100%) rename {constraints => resources}/boards/orangecrab-r02-25f/pinout.lpf (100%) rename {constraints => resources}/boards/orangecrab-r02-25f/rules.json (100%) rename {constraints => resources}/boards/ulx3s-12f/info.json (100%) rename {constraints => resources}/boards/ulx3s-12f/iomode.json (100%) rename {constraints => resources}/boards/ulx3s-12f/pinout.lpf (100%) rename {constraints => resources}/boards/ulx3s-12f/rules.json (100%) rename {constraints => resources}/boards/ulx3s-25f/info.json (100%) rename {constraints => resources}/boards/ulx3s-25f/iomode.json (100%) rename {constraints => resources}/boards/ulx3s-25f/pinout.lpf (100%) rename {constraints => resources}/boards/ulx3s-25f/rules.json (100%) rename {constraints => resources}/boards/ulx3s-45f/info.json (100%) rename {constraints => resources}/boards/ulx3s-45f/iomode.json (100%) rename {constraints => resources}/boards/ulx3s-45f/pinout.lpf (100%) rename {constraints => resources}/boards/ulx3s-45f/rules.json (100%) rename {constraints => resources}/boards/ulx3s-85f/info.json (100%) rename {constraints => resources}/boards/ulx3s-85f/iomode.json (100%) rename {constraints => resources}/boards/ulx3s-85f/pinout.lpf (100%) rename {constraints => resources}/boards/ulx3s-85f/rules.json (100%) rename {constraints => resources}/boards/upduino/info.json (100%) rename {constraints => resources}/boards/upduino/iomode.json (100%) rename {constraints => resources}/boards/upduino/pinout.pcf (100%) rename {constraints => resources}/boards/upduino/rules.json (100%) rename {constraints => resources}/boards/upduino2/info.json (100%) rename {constraints => resources}/boards/upduino2/iomode.json (100%) rename {constraints => resources}/boards/upduino2/pinout.pcf (100%) rename {constraints => resources}/boards/upduino2/rules.json (100%) rename {constraints => resources}/boards/upduino21/info.json (100%) rename {constraints => resources}/boards/upduino21/iomode.json (100%) rename {constraints => resources}/boards/upduino21/pinout.pcf (100%) rename {constraints => resources}/boards/upduino21/rules.json (100%) rename {constraints => resources}/boards/upduino3/info.json (100%) rename {constraints => resources}/boards/upduino3/iomode.json (100%) rename {constraints => resources}/boards/upduino3/pinout.pcf (100%) rename {constraints => resources}/boards/upduino3/rules.json (100%) rename {constraints => resources}/devices/HX1K.json (100%) rename {constraints => resources}/devices/HX8K.json (100%) rename {constraints => resources}/devices/LP8K.json (100%) rename {constraints => resources}/devices/UP5K.json (100%) delete mode 100755 tools/ICETool diff --git a/.gitmodules b/.gitmodules index f4a3dcc0d..8a1243c23 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "collection"] path = collection url = https://github.com/FPGAwars/collection-default +[submodule "constraints"] + path = ICETool/constraints + url = https://github.com/hdl/constraints diff --git a/.prettierignore b/.prettierignore index c713da7df..a7cbe58df 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,6 +2,7 @@ /docs/ /fonts/ /collection/ +/ICETool/constraints/ /plugins/serial-term/ /cache/ /dist/ diff --git a/ICETool/__init__.py b/ICETool/__init__.py new file mode 100755 index 000000000..8c61e501c --- /dev/null +++ b/ICETool/__init__.py @@ -0,0 +1,193 @@ +#!/usr/bin/env python3 + +from sys import ( + argv as sys_argv, + exit as sys_exit, + stdout as sys_stdout, + stderr as sys_stderr +) +from os import getenv +from shutil import which +from pathlib import Path +from subprocess import check_call +import click +import re +import json + +from ICETool.constraints.constraints import getBoardsInfo + + +def getBoard(board): + """ + Get board info from hdl/constraints. + """ + ConvertBoardNameFromIcestudioToConstraints = { + "icezum": "IceZumAlhambra", + "alhambra-ii": "IceZumAlhambraII", + "icestick": "IceStick", + "upduino": "UPDuino-v1.0", + "upduino2": "UPDuino-v2.0", + "upduino21": "UPDuino-v2.1", + "upduino3": "UPDuino-v3.0" + } + boardInfo = getBoardsInfo(verbose=False)[( + ConvertBoardNameFromIcestudioToConstraints[board] + if board in ConvertBoardNameFromIcestudioToConstraints else + board + )] + print(boardInfo) + return boardInfo + + +def execCommand(cmd, cwd): + """ + Print a command, execute it, and flush stdout and stderr. + """ + print(cmd) + check_call(cmd, cwd=cwd) + sys_stdout.flush() + sys_stderr.flush() + + +@click.command("verify") +@click.pass_context +@click.option("-p", "--project-dir", type=str, metavar="path", help="Set the target directory for the project.") +@click.option("-b", "--board", type=str, metavar="board", help="Set the board.") +@click.option("-v", "--verbose", is_flag=True, help="Show the entire output of the command.") +def VerifyCommand(ctx, board, project_dir, verbose): + """ + Verify verilog sources through Icarus Verilog. + """ + + YOSYS_SHARE_PATH = Path(which('yosys')).parent.parent / 'share/yosys' + + boardInfo = getBoard(board) + + device = boardInfo.Device.split('-')[0].lower() + + sources = " ".join([item.name for item in Path(project_dir).glob("*.v")]) + + opts = '-D NO_ICE40_DEFAULT_ASSIGNMENTS' if device == 'ice40' else '-D NO_INCLUDES' + + execCommand( + f'iverilog -D VCD_OUTPUT=sim.vcd {opts} {YOSYS_SHARE_PATH!s}/{device}/cells_sim.v {sources}', + project_dir + ) + + print("verbose:", verbose) + + ctx.exit(0) + + +@click.command("build") +@click.pass_context +@click.option("-b", "--board", type=str, metavar="board", help="Set the board.") +@click.option("--device", type=str, metavar="device", help="Set the FPGA device.") +@click.option("--package", type=str, metavar="package", help="Set the FPGA package.") +@click.option("-p", "--project-dir", type=str, metavar="path", help="Set the target directory for the project.") +@click.option("-v", "--verbose", is_flag=True, help="Show the entire output of the command.") +@click.option("--verbose-yosys", is_flag=True, help="Show the yosys output of the command.") +@click.option("--verbose-pnr", is_flag=True, help="Show the pnr output of the command.") +def BuildCommand(ctx, board, device, package, project_dir, verbose, verbose_yosys, verbose_pnr): + """ + Generate bitstream through Yosys and Nextpnr. + """ + + sources = " ".join([item.name for item in Path(project_dir).glob("*.v")]) + opts = '' if verbose or verbose_yosys else '-q' + + execCommand( + f'yosys {opts} -p "proc; read_verilog {sources}; synth_ice40 -top main -json synth.json"', + project_dir + ) + + boardInfo = getBoard(board) + device = boardInfo.Device.split('-')[1].lower() if device is None else device + package = boardInfo.Package.lower() if package is None else package + pcf = [item.name for item in Path(project_dir).glob("*.pcf")][0] + opts = '' if verbose or verbose_pnr else '-q' + + execCommand( + f'nextpnr-ice40 {opts} --{device} --package {package} --pcf {pcf} --json synth.json --asc pnr.asc', + project_dir + ) + + execCommand( + 'icepack pnr.asc design.bin', + project_dir + ) + + ctx.exit(0) + + +@click.command("upload") +@click.pass_context +@click.option("-b", "--board", type=str, metavar="board", help="Set the board.") +@click.option("--serial-port", type=str, metavar="serial-port", help="Set the serial port.") +@click.option("--ftdi-id", type=str, metavar="ftdi-id", help="Set the FTDI id.") +@click.option("-s", "--sram", is_flag=True, help="Perform SRAM programming.") +@click.option("-f", "--flash", is_flag=True, help="Perform FLASH programming.") +@click.option("-p", "--project-dir", type=str, metavar="path", help="Set the target directory for the project.") +@click.option("-v", "--verbose", is_flag=True, help="Show the entire output of the command.") +@click.option("--verbose-yosys", is_flag=True, help="Show the yosys output of the command.") +@click.option("--verbose-pnr", is_flag=True, help="Show the pnr output of the command.") +def UploadCommand(ctx, board, serial_port, ftdi_id, sram, flash, project_dir, verbose, verbose_yosys, verbose_pnr): + """ + Upload bitstream to the board through openFPGALoader. + """ + + print("board:", board) + print("serial_port:", serial_port) + print("ftdi_id:", ftdi_id) + print("sram:", sram) + print("flash:", flash) + print("verbose:", verbose) + print("verbose_yosys:", verbose_yosys) + print("verbose_pnr:", verbose_pnr) + + ctx.exit(0) + + +@click.command("regenerate-pinouts") +@click.pass_context +@click.option("-d", "--rdir", type=str, metavar="rdir", help="Resources directory.") +def RegeneratePinoutsCommand(ctx, rdir): + p = Path(rdir) + + for item in list(p.glob('*')): + if item.is_dir() and item.name[0] != '_': + path = item + cfile = path / 'pinout.pcf' + if not cfile.exists(): + cfile = path / 'pinout.lpf' + if not cfile.exists(): + raise Exception('No known constraints file found in %s', str(path)) + + print('· Processing %s file %s' % (item.name, cfile.name)) + + pattern = 'set_io\s+(--warn-no-port|-nowarn)?\s*(.*?)\s+(.*?)\s+(#+\s+)?' if cfile.suffix == '.pcf' else r'LOCATE\s*?COMP\s*?"(.*)"\s*?SITE\s*?"(.*)";\s*?#?\s*?' + pinout = re.findall(pattern, cfile.read_text()) + + if len(pinout) == 0: + print(' !!! Something went wrong; empty pinout list') + continue + + info = json.loads((path / 'info.json').read_text()) + + info['pinout'] = { item[1]: item[2] for item in sorted(pinout, key=lambda pinout: pinout[1],reverse=True) } if cfile.suffix == '.pcf' else { item[0]: item[1] for item in pinout } + + (path / 'info.json').write_text(json.dumps(info, indent=2) + "\n") + + +@click.group() +def cli(): + pass + +cli.add_command(VerifyCommand) +cli.add_command(BuildCommand) +cli.add_command(UploadCommand) +cli.add_command(RegeneratePinoutsCommand) + + +if __name__ == '__main__': + cli() diff --git a/ICETool/constraints b/ICETool/constraints new file mode 160000 index 000000000..148fffb91 --- /dev/null +++ b/ICETool/constraints @@ -0,0 +1 @@ +Subproject commit 148fffb919adb7309d029a39471bf5bc415d2cf5 diff --git a/README.md b/README.md index 8dfc36702..2431d2e05 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ 'icestudio' workflow status

-Visual editor for Verilog designs, built on top of [OSS CAD Suite](https://github.com/YosysHQ/oss-cad-suite-build). +Visual editor for Verilog designs. Find installation guidelines, user guide and further information at [juanmard.github.io/icestudio](https://juanmard.github.io/icestudio). @@ -22,9 +22,9 @@ Find installation guidelines, user guide and further information at

-**IMPORTANT: Since June 2021, several enhancements available in this variant are being applied [upstream](https://github.com/FPGAwars/icestudio). Find further details in the [WIKI](https://github.com/juanmard/icestudio/wiki).** +**IMPORTANT: Since June 2021, several frontend and internal enhancements available in this variant are being applied [upstream](https://github.com/FPGAwars/icestudio). Find further details in the [WIKI](https://github.com/juanmard/icestudio/wiki).** ---- +# Installation Unlike the [upstream](https://github.com/FPGAwars/icestudio), _Icestudio Nightly_ is agnostic to the toolchain installation solution and it does not require admin/sudo permissions. @@ -34,32 +34,24 @@ See [hdl/packages](https://github.com/hdl/packages). By the same token, the usage of virtual environments is optional, although recommended when using Python based packaging systems such as Conda or apio. -Furthermore, _Icestudio Nightly_ uses `ICETool` by default, instead of `apio`. -[ICETool](tools/ICETool) is a Python script that allows translating `verify`, `build` and `upload` commands from -Icestudio into the entrypoints provided by [FuseSoC](https://github.com/olofk/FuseSoC)/[Edalize](https://github.com/olofk/edalize/), -apio, or any other EDA workflow provider. -See [Electronic Design Automation Abstraction (EDA²)](https://edaa-org.github.io/). - +Furthermore, _Icestudio Nightly_ uses [ICETool](ICETool) by default, a Python script that allows executing +`verify`, `build` and `upload` commands without the SCons infrastructure required by `apio`. Currently, ICETool is in an early development stage and it is not published through PyPI. -Therefore, the location of the script needs to be made available before starting Icestudio. - -On GNU/Linux or MSYS2, add subdir `tools` to the PATH: - -```sh -PATH=$(pwd)/tools:$PATH yarn start -``` - -On the Windows CMD, use PYTHONPATH: +Therefore, the location of the package needs to be added to the PYTHONPATH before starting Icestudio: ```sh -PYTHONPATH=$(pwd)/tools:$PATH yarn start +PYTHONPATH=$(pwd) yarn start ``` Moreover, environment variable `ICETOOL_CMD` allows overriding the backend. ```sh # Use apio -ICETOOL_CMD=apio PATH=$(pwd)/tools:$PATH yarn start -# Use edalize -ICETOOL_CMD=edalize PATH=$(pwd)/tools:$PATH yarn start +ICETOOL_CMD=apio yarn start + +# Use custom tool +ICETOOL_CMD=mytool yarn start ``` + +Do you want to convert Icestudio commands into [FuseSoC](https://github.com/olofk/FuseSoC)/[Edalize](https://github.com/olofk/edalize/) or any other EDA workflow provider? [Let us know!](https://github.com/juanmard/icestudio/issues)! +See [Electronic Design Automation Abstraction (EDA²)](https://edaa-org.github.io/). diff --git a/constraints/boards/regenerate_pinouts.py b/constraints/boards/regenerate_pinouts.py deleted file mode 100755 index 30e5245e9..000000000 --- a/constraints/boards/regenerate_pinouts.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/python3 - -import re -import json -from pathlib import Path - -p = Path(__file__).resolve().parent - -for item in list(p.glob('*')): - if item.is_dir() and item.name[0] != '_': - path = item - cfile = path / 'pinout.pcf' - if not cfile.exists(): - cfile = path / 'pinout.lpf' - if not cfile.exists(): - raise Exception('No known constraints file found in %s', str(path)) - - print('· Processing %s file %s' % (item.name, cfile.name)) - - pattern = 'set_io\s+(--warn-no-port|-nowarn)?\s*(.*?)\s+(.*?)\s+(#+\s+)?' if cfile.suffix == '.pcf' else r'LOCATE\s*?COMP\s*?"(.*)"\s*?SITE\s*?"(.*)";\s*?#?\s*?' - pinout = re.findall(pattern, cfile.read_text()) - - if len(pinout) == 0: - print(' !!! Something went wrong; empty pinout list') - continue - - info = json.loads((path / 'info.json').read_text()) - - info['pinout'] = { item[1]: item[2] for item in sorted(pinout, key=lambda pinout: pinout[1],reverse=True) } if cfile.suffix == '.pcf' else { item[0]: item[1] for item in pinout } - - (path / 'info.json').write_text(json.dumps(info, indent=2) + "\n") diff --git a/controllers/menu.js b/controllers/menu.js index 62ab3ad2e..a177d3cfe 100644 --- a/controllers/menu.js +++ b/controllers/menu.js @@ -751,7 +751,7 @@ angular if (common.selectedBoard) { return nodeFs.existsSync( nodePath.join( - 'constraints', + 'resources', 'boards', common.selectedBoard.name, 'pinout.svg' diff --git a/gruntfile.js b/gruntfile.js index 339d0b977..43573b6a0 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -66,7 +66,7 @@ module.exports = function (grunt) { 'collection/**', 'controllers/**', 'graphics/**', - 'constraints/**/*.*', + 'resources/**/*.*', 'images/**/*.*', 'locale/**/*.*', 'plugins/**/*.*', @@ -166,7 +166,7 @@ module.exports = function (grunt) { watch: { scripts: { files: [ - 'constraints/**/*.*', + 'resources/**/*.*', 'controllers/*.js', 'fonts/**', 'graphics/*.js', diff --git a/constraints/README.md b/resources/README.md similarity index 100% rename from constraints/README.md rename to resources/README.md diff --git a/constraints/boards/Alchitry-Cu/info.json b/resources/boards/Alchitry-Cu/info.json similarity index 100% rename from constraints/boards/Alchitry-Cu/info.json rename to resources/boards/Alchitry-Cu/info.json diff --git a/constraints/boards/Alchitry-Cu/iomode.json b/resources/boards/Alchitry-Cu/iomode.json similarity index 100% rename from constraints/boards/Alchitry-Cu/iomode.json rename to resources/boards/Alchitry-Cu/iomode.json diff --git a/constraints/boards/Alchitry-Cu/pinout.pcf b/resources/boards/Alchitry-Cu/pinout.pcf similarity index 100% rename from constraints/boards/Alchitry-Cu/pinout.pcf rename to resources/boards/Alchitry-Cu/pinout.pcf diff --git a/constraints/boards/Alchitry-Cu/rules.json b/resources/boards/Alchitry-Cu/rules.json similarity index 100% rename from constraints/boards/Alchitry-Cu/rules.json rename to resources/boards/Alchitry-Cu/rules.json diff --git a/constraints/boards/ColorLight-5A-75B-V61/info.json b/resources/boards/ColorLight-5A-75B-V61/info.json similarity index 100% rename from constraints/boards/ColorLight-5A-75B-V61/info.json rename to resources/boards/ColorLight-5A-75B-V61/info.json diff --git a/constraints/boards/ColorLight-5A-75B-V61/pinout.lpf b/resources/boards/ColorLight-5A-75B-V61/pinout.lpf similarity index 100% rename from constraints/boards/ColorLight-5A-75B-V61/pinout.lpf rename to resources/boards/ColorLight-5A-75B-V61/pinout.lpf diff --git a/constraints/boards/ColorLight-5A-75B-V61/rules.json b/resources/boards/ColorLight-5A-75B-V61/rules.json similarity index 100% rename from constraints/boards/ColorLight-5A-75B-V61/rules.json rename to resources/boards/ColorLight-5A-75B-V61/rules.json diff --git a/constraints/boards/ColorLight-5A-75B-V8/info.json b/resources/boards/ColorLight-5A-75B-V8/info.json similarity index 100% rename from constraints/boards/ColorLight-5A-75B-V8/info.json rename to resources/boards/ColorLight-5A-75B-V8/info.json diff --git a/constraints/boards/ColorLight-5A-75B-V8/pinout.lpf b/resources/boards/ColorLight-5A-75B-V8/pinout.lpf similarity index 100% rename from constraints/boards/ColorLight-5A-75B-V8/pinout.lpf rename to resources/boards/ColorLight-5A-75B-V8/pinout.lpf diff --git a/constraints/boards/ColorLight-5A-75B-V8/rules.json b/resources/boards/ColorLight-5A-75B-V8/rules.json similarity index 100% rename from constraints/boards/ColorLight-5A-75B-V8/rules.json rename to resources/boards/ColorLight-5A-75B-V8/rules.json diff --git a/constraints/boards/ColorLight-5A-75E-V6/info.json b/resources/boards/ColorLight-5A-75E-V6/info.json similarity index 100% rename from constraints/boards/ColorLight-5A-75E-V6/info.json rename to resources/boards/ColorLight-5A-75E-V6/info.json diff --git a/constraints/boards/ColorLight-5A-75E-V6/pinout.lpf b/resources/boards/ColorLight-5A-75E-V6/pinout.lpf similarity index 100% rename from constraints/boards/ColorLight-5A-75E-V6/pinout.lpf rename to resources/boards/ColorLight-5A-75E-V6/pinout.lpf diff --git a/constraints/boards/ColorLight-5A-75E-V6/rules.json b/resources/boards/ColorLight-5A-75E-V6/rules.json similarity index 100% rename from constraints/boards/ColorLight-5A-75E-V6/rules.json rename to resources/boards/ColorLight-5A-75E-V6/rules.json diff --git a/constraints/boards/ColorLight-5A-75E-V71/info.json b/resources/boards/ColorLight-5A-75E-V71/info.json similarity index 100% rename from constraints/boards/ColorLight-5A-75E-V71/info.json rename to resources/boards/ColorLight-5A-75E-V71/info.json diff --git a/constraints/boards/ColorLight-5A-75E-V71/pinout.lpf b/resources/boards/ColorLight-5A-75E-V71/pinout.lpf similarity index 100% rename from constraints/boards/ColorLight-5A-75E-V71/pinout.lpf rename to resources/boards/ColorLight-5A-75E-V71/pinout.lpf diff --git a/constraints/boards/ColorLight-5A-75E-V71/rules.json b/resources/boards/ColorLight-5A-75E-V71/rules.json similarity index 100% rename from constraints/boards/ColorLight-5A-75E-V71/rules.json rename to resources/boards/ColorLight-5A-75E-V71/rules.json diff --git a/constraints/boards/OK-iCE40Pro/info.json b/resources/boards/OK-iCE40Pro/info.json similarity index 100% rename from constraints/boards/OK-iCE40Pro/info.json rename to resources/boards/OK-iCE40Pro/info.json diff --git a/constraints/boards/OK-iCE40Pro/pinout.pcf b/resources/boards/OK-iCE40Pro/pinout.pcf similarity index 100% rename from constraints/boards/OK-iCE40Pro/pinout.pcf rename to resources/boards/OK-iCE40Pro/pinout.pcf diff --git a/constraints/boards/OK-iCE40Pro/pinout.svg b/resources/boards/OK-iCE40Pro/pinout.svg similarity index 100% rename from constraints/boards/OK-iCE40Pro/pinout.svg rename to resources/boards/OK-iCE40Pro/pinout.svg diff --git a/constraints/boards/OK-iCE40Pro/rules.json b/resources/boards/OK-iCE40Pro/rules.json similarity index 100% rename from constraints/boards/OK-iCE40Pro/rules.json rename to resources/boards/OK-iCE40Pro/rules.json diff --git a/constraints/boards/TinyFPGA-B2/info.json b/resources/boards/TinyFPGA-B2/info.json similarity index 100% rename from constraints/boards/TinyFPGA-B2/info.json rename to resources/boards/TinyFPGA-B2/info.json diff --git a/constraints/boards/TinyFPGA-B2/iomode.json b/resources/boards/TinyFPGA-B2/iomode.json similarity index 100% rename from constraints/boards/TinyFPGA-B2/iomode.json rename to resources/boards/TinyFPGA-B2/iomode.json diff --git a/constraints/boards/TinyFPGA-B2/pinout.pcf b/resources/boards/TinyFPGA-B2/pinout.pcf similarity index 100% rename from constraints/boards/TinyFPGA-B2/pinout.pcf rename to resources/boards/TinyFPGA-B2/pinout.pcf diff --git a/constraints/boards/TinyFPGA-B2/rules.json b/resources/boards/TinyFPGA-B2/rules.json similarity index 100% rename from constraints/boards/TinyFPGA-B2/rules.json rename to resources/boards/TinyFPGA-B2/rules.json diff --git a/constraints/boards/TinyFPGA-BX/info.json b/resources/boards/TinyFPGA-BX/info.json similarity index 100% rename from constraints/boards/TinyFPGA-BX/info.json rename to resources/boards/TinyFPGA-BX/info.json diff --git a/constraints/boards/TinyFPGA-BX/iomode.json b/resources/boards/TinyFPGA-BX/iomode.json similarity index 100% rename from constraints/boards/TinyFPGA-BX/iomode.json rename to resources/boards/TinyFPGA-BX/iomode.json diff --git a/constraints/boards/TinyFPGA-BX/pinout.pcf b/resources/boards/TinyFPGA-BX/pinout.pcf similarity index 100% rename from constraints/boards/TinyFPGA-BX/pinout.pcf rename to resources/boards/TinyFPGA-BX/pinout.pcf diff --git a/constraints/boards/TinyFPGA-BX/rules.json b/resources/boards/TinyFPGA-BX/rules.json similarity index 100% rename from constraints/boards/TinyFPGA-BX/rules.json rename to resources/boards/TinyFPGA-BX/rules.json diff --git a/constraints/boards/_ColorLight-5A-75B-V7/info.json b/resources/boards/_ColorLight-5A-75B-V7/info.json similarity index 100% rename from constraints/boards/_ColorLight-5A-75B-V7/info.json rename to resources/boards/_ColorLight-5A-75B-V7/info.json diff --git a/constraints/boards/_ColorLight-5A-75B-V7/rules.json b/resources/boards/_ColorLight-5A-75B-V7/rules.json similarity index 100% rename from constraints/boards/_ColorLight-5A-75B-V7/rules.json rename to resources/boards/_ColorLight-5A-75B-V7/rules.json diff --git a/constraints/boards/_ColorLight-i5-v70/info.json b/resources/boards/_ColorLight-i5-v70/info.json similarity index 100% rename from constraints/boards/_ColorLight-i5-v70/info.json rename to resources/boards/_ColorLight-i5-v70/info.json diff --git a/constraints/boards/_ColorLight-i5-v70/pinout.png b/resources/boards/_ColorLight-i5-v70/pinout.png similarity index 100% rename from constraints/boards/_ColorLight-i5-v70/pinout.png rename to resources/boards/_ColorLight-i5-v70/pinout.png diff --git a/constraints/boards/_ColorLight-i5-v70/rules.json b/resources/boards/_ColorLight-i5-v70/rules.json similarity index 100% rename from constraints/boards/_ColorLight-i5-v70/rules.json rename to resources/boards/_ColorLight-i5-v70/rules.json diff --git a/constraints/boards/_iCE40HX8K-EVB/info.json b/resources/boards/_iCE40HX8K-EVB/info.json similarity index 100% rename from constraints/boards/_iCE40HX8K-EVB/info.json rename to resources/boards/_iCE40HX8K-EVB/info.json diff --git a/constraints/boards/_iCE40HX8K-EVB/pinout.json b/resources/boards/_iCE40HX8K-EVB/pinout.json similarity index 100% rename from constraints/boards/_iCE40HX8K-EVB/pinout.json rename to resources/boards/_iCE40HX8K-EVB/pinout.json diff --git a/constraints/boards/_iCE40HX8K-EVB/pinout.pcf b/resources/boards/_iCE40HX8K-EVB/pinout.pcf similarity index 100% rename from constraints/boards/_iCE40HX8K-EVB/pinout.pcf rename to resources/boards/_iCE40HX8K-EVB/pinout.pcf diff --git a/constraints/boards/_iCE40HX8K-EVB/rules.json b/resources/boards/_iCE40HX8K-EVB/rules.json similarity index 100% rename from constraints/boards/_iCE40HX8K-EVB/rules.json rename to resources/boards/_iCE40HX8K-EVB/rules.json diff --git a/constraints/boards/_iCESugar-Pro/info.json b/resources/boards/_iCESugar-Pro/info.json similarity index 100% rename from constraints/boards/_iCESugar-Pro/info.json rename to resources/boards/_iCESugar-Pro/info.json diff --git a/constraints/boards/_iCESugar-Pro/pinout.png b/resources/boards/_iCESugar-Pro/pinout.png similarity index 100% rename from constraints/boards/_iCESugar-Pro/pinout.png rename to resources/boards/_iCESugar-Pro/pinout.png diff --git a/constraints/boards/_iCESugar-Pro/rules.json b/resources/boards/_iCESugar-Pro/rules.json similarity index 100% rename from constraints/boards/_iCESugar-Pro/rules.json rename to resources/boards/_iCESugar-Pro/rules.json diff --git a/constraints/boards/_iCEblink40-HX1K/pinout.json b/resources/boards/_iCEblink40-HX1K/pinout.json similarity index 100% rename from constraints/boards/_iCEblink40-HX1K/pinout.json rename to resources/boards/_iCEblink40-HX1K/pinout.json diff --git a/constraints/boards/_iCEblink40-HX1K/pinout.pcf b/resources/boards/_iCEblink40-HX1K/pinout.pcf similarity index 100% rename from constraints/boards/_iCEblink40-HX1K/pinout.pcf rename to resources/boards/_iCEblink40-HX1K/pinout.pcf diff --git a/constraints/boards/_iCEblink40-HX1K/rules.json b/resources/boards/_iCEblink40-HX1K/rules.json similarity index 100% rename from constraints/boards/_iCEblink40-HX1K/rules.json rename to resources/boards/_iCEblink40-HX1K/rules.json diff --git a/constraints/boards/alhambra-ii/info.json b/resources/boards/alhambra-ii/info.json similarity index 100% rename from constraints/boards/alhambra-ii/info.json rename to resources/boards/alhambra-ii/info.json diff --git a/constraints/boards/alhambra-ii/iomode.json b/resources/boards/alhambra-ii/iomode.json similarity index 100% rename from constraints/boards/alhambra-ii/iomode.json rename to resources/boards/alhambra-ii/iomode.json diff --git a/constraints/boards/alhambra-ii/pinout.pcf b/resources/boards/alhambra-ii/pinout.pcf similarity index 100% rename from constraints/boards/alhambra-ii/pinout.pcf rename to resources/boards/alhambra-ii/pinout.pcf diff --git a/constraints/boards/alhambra-ii/pinout.svg b/resources/boards/alhambra-ii/pinout.svg similarity index 100% rename from constraints/boards/alhambra-ii/pinout.svg rename to resources/boards/alhambra-ii/pinout.svg diff --git a/constraints/boards/alhambra-ii/rules.json b/resources/boards/alhambra-ii/rules.json similarity index 100% rename from constraints/boards/alhambra-ii/rules.json rename to resources/boards/alhambra-ii/rules.json diff --git a/constraints/boards/blackice-ii/info.json b/resources/boards/blackice-ii/info.json similarity index 100% rename from constraints/boards/blackice-ii/info.json rename to resources/boards/blackice-ii/info.json diff --git a/constraints/boards/blackice-ii/iomode.json b/resources/boards/blackice-ii/iomode.json similarity index 100% rename from constraints/boards/blackice-ii/iomode.json rename to resources/boards/blackice-ii/iomode.json diff --git a/constraints/boards/blackice-ii/pinout.pcf b/resources/boards/blackice-ii/pinout.pcf similarity index 100% rename from constraints/boards/blackice-ii/pinout.pcf rename to resources/boards/blackice-ii/pinout.pcf diff --git a/constraints/boards/blackice-ii/rules.json b/resources/boards/blackice-ii/rules.json similarity index 100% rename from constraints/boards/blackice-ii/rules.json rename to resources/boards/blackice-ii/rules.json diff --git a/constraints/boards/blackice-mx/info.json b/resources/boards/blackice-mx/info.json similarity index 100% rename from constraints/boards/blackice-mx/info.json rename to resources/boards/blackice-mx/info.json diff --git a/constraints/boards/blackice-mx/pinout.pcf b/resources/boards/blackice-mx/pinout.pcf similarity index 100% rename from constraints/boards/blackice-mx/pinout.pcf rename to resources/boards/blackice-mx/pinout.pcf diff --git a/constraints/boards/blackice-mx/pinout.svg b/resources/boards/blackice-mx/pinout.svg similarity index 100% rename from constraints/boards/blackice-mx/pinout.svg rename to resources/boards/blackice-mx/pinout.svg diff --git a/constraints/boards/blackice-mx/rules.json b/resources/boards/blackice-mx/rules.json similarity index 100% rename from constraints/boards/blackice-mx/rules.json rename to resources/boards/blackice-mx/rules.json diff --git a/constraints/boards/blackice/info.json b/resources/boards/blackice/info.json similarity index 100% rename from constraints/boards/blackice/info.json rename to resources/boards/blackice/info.json diff --git a/constraints/boards/blackice/iomode.json b/resources/boards/blackice/iomode.json similarity index 100% rename from constraints/boards/blackice/iomode.json rename to resources/boards/blackice/iomode.json diff --git a/constraints/boards/blackice/pinout.pcf b/resources/boards/blackice/pinout.pcf similarity index 100% rename from constraints/boards/blackice/pinout.pcf rename to resources/boards/blackice/pinout.pcf diff --git a/constraints/boards/blackice/rules.json b/resources/boards/blackice/rules.json similarity index 100% rename from constraints/boards/blackice/rules.json rename to resources/boards/blackice/rules.json diff --git a/constraints/boards/doppler/info.json b/resources/boards/doppler/info.json similarity index 100% rename from constraints/boards/doppler/info.json rename to resources/boards/doppler/info.json diff --git a/constraints/boards/doppler/pinout.pcf b/resources/boards/doppler/pinout.pcf similarity index 100% rename from constraints/boards/doppler/pinout.pcf rename to resources/boards/doppler/pinout.pcf diff --git a/constraints/boards/doppler/rules.json b/resources/boards/doppler/rules.json similarity index 100% rename from constraints/boards/doppler/rules.json rename to resources/boards/doppler/rules.json diff --git a/constraints/boards/edu-ciaa-fpga/info.json b/resources/boards/edu-ciaa-fpga/info.json similarity index 100% rename from constraints/boards/edu-ciaa-fpga/info.json rename to resources/boards/edu-ciaa-fpga/info.json diff --git a/constraints/boards/edu-ciaa-fpga/iomode.json b/resources/boards/edu-ciaa-fpga/iomode.json similarity index 100% rename from constraints/boards/edu-ciaa-fpga/iomode.json rename to resources/boards/edu-ciaa-fpga/iomode.json diff --git a/constraints/boards/edu-ciaa-fpga/pinout.pcf b/resources/boards/edu-ciaa-fpga/pinout.pcf similarity index 100% rename from constraints/boards/edu-ciaa-fpga/pinout.pcf rename to resources/boards/edu-ciaa-fpga/pinout.pcf diff --git a/constraints/boards/edu-ciaa-fpga/pinout.svg b/resources/boards/edu-ciaa-fpga/pinout.svg similarity index 100% rename from constraints/boards/edu-ciaa-fpga/pinout.svg rename to resources/boards/edu-ciaa-fpga/pinout.svg diff --git a/constraints/boards/edu-ciaa-fpga/rules.json b/resources/boards/edu-ciaa-fpga/rules.json similarity index 100% rename from constraints/boards/edu-ciaa-fpga/rules.json rename to resources/boards/edu-ciaa-fpga/rules.json diff --git a/constraints/boards/fomu/info.json b/resources/boards/fomu/info.json similarity index 100% rename from constraints/boards/fomu/info.json rename to resources/boards/fomu/info.json diff --git a/constraints/boards/fomu/iomode.json b/resources/boards/fomu/iomode.json similarity index 100% rename from constraints/boards/fomu/iomode.json rename to resources/boards/fomu/iomode.json diff --git a/constraints/boards/fomu/pinout.pcf b/resources/boards/fomu/pinout.pcf similarity index 100% rename from constraints/boards/fomu/pinout.pcf rename to resources/boards/fomu/pinout.pcf diff --git a/constraints/boards/fomu/rules.json b/resources/boards/fomu/rules.json similarity index 100% rename from constraints/boards/fomu/rules.json rename to resources/boards/fomu/rules.json diff --git a/constraints/boards/fpga101/info.json b/resources/boards/fpga101/info.json similarity index 100% rename from constraints/boards/fpga101/info.json rename to resources/boards/fpga101/info.json diff --git a/constraints/boards/fpga101/iomode.json b/resources/boards/fpga101/iomode.json similarity index 100% rename from constraints/boards/fpga101/iomode.json rename to resources/boards/fpga101/iomode.json diff --git a/constraints/boards/fpga101/pinout.json b/resources/boards/fpga101/pinout.json similarity index 100% rename from constraints/boards/fpga101/pinout.json rename to resources/boards/fpga101/pinout.json diff --git a/constraints/boards/fpga101/pinout.pcf b/resources/boards/fpga101/pinout.pcf similarity index 100% rename from constraints/boards/fpga101/pinout.pcf rename to resources/boards/fpga101/pinout.pcf diff --git a/constraints/boards/fpga101/rules.json b/resources/boards/fpga101/rules.json similarity index 100% rename from constraints/boards/fpga101/rules.json rename to resources/boards/fpga101/rules.json diff --git a/constraints/boards/go-board/info.json b/resources/boards/go-board/info.json similarity index 100% rename from constraints/boards/go-board/info.json rename to resources/boards/go-board/info.json diff --git a/constraints/boards/go-board/iomode.json b/resources/boards/go-board/iomode.json similarity index 100% rename from constraints/boards/go-board/iomode.json rename to resources/boards/go-board/iomode.json diff --git a/constraints/boards/go-board/pinout.pcf b/resources/boards/go-board/pinout.pcf similarity index 100% rename from constraints/boards/go-board/pinout.pcf rename to resources/boards/go-board/pinout.pcf diff --git a/constraints/boards/go-board/rules.json b/resources/boards/go-board/rules.json similarity index 100% rename from constraints/boards/go-board/rules.json rename to resources/boards/go-board/rules.json diff --git a/constraints/boards/iCE40-HX8K/info.json b/resources/boards/iCE40-HX8K/info.json similarity index 100% rename from constraints/boards/iCE40-HX8K/info.json rename to resources/boards/iCE40-HX8K/info.json diff --git a/constraints/boards/iCE40-HX8K/iomode.json b/resources/boards/iCE40-HX8K/iomode.json similarity index 100% rename from constraints/boards/iCE40-HX8K/iomode.json rename to resources/boards/iCE40-HX8K/iomode.json diff --git a/constraints/boards/iCE40-HX8K/pinout.pcf b/resources/boards/iCE40-HX8K/pinout.pcf similarity index 100% rename from constraints/boards/iCE40-HX8K/pinout.pcf rename to resources/boards/iCE40-HX8K/pinout.pcf diff --git a/constraints/boards/iCE40-HX8K/pinout.svg b/resources/boards/iCE40-HX8K/pinout.svg similarity index 100% rename from constraints/boards/iCE40-HX8K/pinout.svg rename to resources/boards/iCE40-HX8K/pinout.svg diff --git a/constraints/boards/iCE40-HX8K/rules.json b/resources/boards/iCE40-HX8K/rules.json similarity index 100% rename from constraints/boards/iCE40-HX8K/rules.json rename to resources/boards/iCE40-HX8K/rules.json diff --git a/constraints/boards/iCE40-UP5K/info.json b/resources/boards/iCE40-UP5K/info.json similarity index 100% rename from constraints/boards/iCE40-UP5K/info.json rename to resources/boards/iCE40-UP5K/info.json diff --git a/constraints/boards/iCE40-UP5K/iomode.json b/resources/boards/iCE40-UP5K/iomode.json similarity index 100% rename from constraints/boards/iCE40-UP5K/iomode.json rename to resources/boards/iCE40-UP5K/iomode.json diff --git a/constraints/boards/iCE40-UP5K/pinout.pcf b/resources/boards/iCE40-UP5K/pinout.pcf similarity index 100% rename from constraints/boards/iCE40-UP5K/pinout.pcf rename to resources/boards/iCE40-UP5K/pinout.pcf diff --git a/constraints/boards/iCE40-UP5K/rules.json b/resources/boards/iCE40-UP5K/rules.json similarity index 100% rename from constraints/boards/iCE40-UP5K/rules.json rename to resources/boards/iCE40-UP5K/rules.json diff --git a/constraints/boards/iCEBreaker-bitsy/info.json b/resources/boards/iCEBreaker-bitsy/info.json similarity index 100% rename from constraints/boards/iCEBreaker-bitsy/info.json rename to resources/boards/iCEBreaker-bitsy/info.json diff --git a/constraints/boards/iCEBreaker-bitsy/iomode.json b/resources/boards/iCEBreaker-bitsy/iomode.json similarity index 100% rename from constraints/boards/iCEBreaker-bitsy/iomode.json rename to resources/boards/iCEBreaker-bitsy/iomode.json diff --git a/constraints/boards/iCEBreaker-bitsy/pinout.pcf b/resources/boards/iCEBreaker-bitsy/pinout.pcf similarity index 100% rename from constraints/boards/iCEBreaker-bitsy/pinout.pcf rename to resources/boards/iCEBreaker-bitsy/pinout.pcf diff --git a/constraints/boards/iCEBreaker-bitsy/rules.json b/resources/boards/iCEBreaker-bitsy/rules.json similarity index 100% rename from constraints/boards/iCEBreaker-bitsy/rules.json rename to resources/boards/iCEBreaker-bitsy/rules.json diff --git a/constraints/boards/iCEBreaker/info.json b/resources/boards/iCEBreaker/info.json similarity index 100% rename from constraints/boards/iCEBreaker/info.json rename to resources/boards/iCEBreaker/info.json diff --git a/constraints/boards/iCEBreaker/iomode.json b/resources/boards/iCEBreaker/iomode.json similarity index 100% rename from constraints/boards/iCEBreaker/iomode.json rename to resources/boards/iCEBreaker/iomode.json diff --git a/constraints/boards/iCEBreaker/pinout.pcf b/resources/boards/iCEBreaker/pinout.pcf similarity index 100% rename from constraints/boards/iCEBreaker/pinout.pcf rename to resources/boards/iCEBreaker/pinout.pcf diff --git a/constraints/boards/iCEBreaker/rules.json b/resources/boards/iCEBreaker/rules.json similarity index 100% rename from constraints/boards/iCEBreaker/rules.json rename to resources/boards/iCEBreaker/rules.json diff --git a/constraints/boards/iCESugar_1_5/info.json b/resources/boards/iCESugar_1_5/info.json similarity index 100% rename from constraints/boards/iCESugar_1_5/info.json rename to resources/boards/iCESugar_1_5/info.json diff --git a/constraints/boards/iCESugar_1_5/pinout.pcf b/resources/boards/iCESugar_1_5/pinout.pcf similarity index 100% rename from constraints/boards/iCESugar_1_5/pinout.pcf rename to resources/boards/iCESugar_1_5/pinout.pcf diff --git a/constraints/boards/iCESugar_1_5/pinout.svg b/resources/boards/iCESugar_1_5/pinout.svg similarity index 100% rename from constraints/boards/iCESugar_1_5/pinout.svg rename to resources/boards/iCESugar_1_5/pinout.svg diff --git a/constraints/boards/iCESugar_1_5/rules.json b/resources/boards/iCESugar_1_5/rules.json similarity index 100% rename from constraints/boards/iCESugar_1_5/rules.json rename to resources/boards/iCESugar_1_5/rules.json diff --git a/constraints/boards/icefun/info.json b/resources/boards/icefun/info.json similarity index 100% rename from constraints/boards/icefun/info.json rename to resources/boards/icefun/info.json diff --git a/constraints/boards/icefun/pinout.pcf b/resources/boards/icefun/pinout.pcf similarity index 100% rename from constraints/boards/icefun/pinout.pcf rename to resources/boards/icefun/pinout.pcf diff --git a/constraints/boards/icefun/rules.json b/resources/boards/icefun/rules.json similarity index 100% rename from constraints/boards/icefun/rules.json rename to resources/boards/icefun/rules.json diff --git a/constraints/boards/icestick/info.json b/resources/boards/icestick/info.json similarity index 100% rename from constraints/boards/icestick/info.json rename to resources/boards/icestick/info.json diff --git a/constraints/boards/icestick/iomode.json b/resources/boards/icestick/iomode.json similarity index 100% rename from constraints/boards/icestick/iomode.json rename to resources/boards/icestick/iomode.json diff --git a/constraints/boards/icestick/pinout.pcf b/resources/boards/icestick/pinout.pcf similarity index 100% rename from constraints/boards/icestick/pinout.pcf rename to resources/boards/icestick/pinout.pcf diff --git a/constraints/boards/icestick/rules.json b/resources/boards/icestick/rules.json similarity index 100% rename from constraints/boards/icestick/rules.json rename to resources/boards/icestick/rules.json diff --git a/constraints/boards/icezum/info.json b/resources/boards/icezum/info.json similarity index 100% rename from constraints/boards/icezum/info.json rename to resources/boards/icezum/info.json diff --git a/constraints/boards/icezum/iomode.json b/resources/boards/icezum/iomode.json similarity index 100% rename from constraints/boards/icezum/iomode.json rename to resources/boards/icezum/iomode.json diff --git a/constraints/boards/icezum/pinout.pcf b/resources/boards/icezum/pinout.pcf similarity index 100% rename from constraints/boards/icezum/pinout.pcf rename to resources/boards/icezum/pinout.pcf diff --git a/constraints/boards/icezum/pinout.svg b/resources/boards/icezum/pinout.svg similarity index 100% rename from constraints/boards/icezum/pinout.svg rename to resources/boards/icezum/pinout.svg diff --git a/constraints/boards/icezum/rules.json b/resources/boards/icezum/rules.json similarity index 100% rename from constraints/boards/icezum/rules.json rename to resources/boards/icezum/rules.json diff --git a/constraints/boards/icoboard/info.json b/resources/boards/icoboard/info.json similarity index 100% rename from constraints/boards/icoboard/info.json rename to resources/boards/icoboard/info.json diff --git a/constraints/boards/icoboard/iomode.json b/resources/boards/icoboard/iomode.json similarity index 100% rename from constraints/boards/icoboard/iomode.json rename to resources/boards/icoboard/iomode.json diff --git a/constraints/boards/icoboard/pinout.pcf b/resources/boards/icoboard/pinout.pcf similarity index 100% rename from constraints/boards/icoboard/pinout.pcf rename to resources/boards/icoboard/pinout.pcf diff --git a/constraints/boards/icoboard/rules.json b/resources/boards/icoboard/rules.json similarity index 100% rename from constraints/boards/icoboard/rules.json rename to resources/boards/icoboard/rules.json diff --git a/constraints/boards/kefir/info.json b/resources/boards/kefir/info.json similarity index 100% rename from constraints/boards/kefir/info.json rename to resources/boards/kefir/info.json diff --git a/constraints/boards/kefir/iomode.json b/resources/boards/kefir/iomode.json similarity index 100% rename from constraints/boards/kefir/iomode.json rename to resources/boards/kefir/iomode.json diff --git a/constraints/boards/kefir/pinout.pcf b/resources/boards/kefir/pinout.pcf similarity index 100% rename from constraints/boards/kefir/pinout.pcf rename to resources/boards/kefir/pinout.pcf diff --git a/constraints/boards/kefir/pinout.svg b/resources/boards/kefir/pinout.svg similarity index 100% rename from constraints/boards/kefir/pinout.svg rename to resources/boards/kefir/pinout.svg diff --git a/constraints/boards/kefir/rules.json b/resources/boards/kefir/rules.json similarity index 100% rename from constraints/boards/kefir/rules.json rename to resources/boards/kefir/rules.json diff --git a/constraints/boards/orangecrab-r02-25f/info.json b/resources/boards/orangecrab-r02-25f/info.json similarity index 100% rename from constraints/boards/orangecrab-r02-25f/info.json rename to resources/boards/orangecrab-r02-25f/info.json diff --git a/constraints/boards/orangecrab-r02-25f/iomode.json b/resources/boards/orangecrab-r02-25f/iomode.json similarity index 100% rename from constraints/boards/orangecrab-r02-25f/iomode.json rename to resources/boards/orangecrab-r02-25f/iomode.json diff --git a/constraints/boards/orangecrab-r02-25f/pinout.lpf b/resources/boards/orangecrab-r02-25f/pinout.lpf similarity index 100% rename from constraints/boards/orangecrab-r02-25f/pinout.lpf rename to resources/boards/orangecrab-r02-25f/pinout.lpf diff --git a/constraints/boards/orangecrab-r02-25f/rules.json b/resources/boards/orangecrab-r02-25f/rules.json similarity index 100% rename from constraints/boards/orangecrab-r02-25f/rules.json rename to resources/boards/orangecrab-r02-25f/rules.json diff --git a/constraints/boards/ulx3s-12f/info.json b/resources/boards/ulx3s-12f/info.json similarity index 100% rename from constraints/boards/ulx3s-12f/info.json rename to resources/boards/ulx3s-12f/info.json diff --git a/constraints/boards/ulx3s-12f/iomode.json b/resources/boards/ulx3s-12f/iomode.json similarity index 100% rename from constraints/boards/ulx3s-12f/iomode.json rename to resources/boards/ulx3s-12f/iomode.json diff --git a/constraints/boards/ulx3s-12f/pinout.lpf b/resources/boards/ulx3s-12f/pinout.lpf similarity index 100% rename from constraints/boards/ulx3s-12f/pinout.lpf rename to resources/boards/ulx3s-12f/pinout.lpf diff --git a/constraints/boards/ulx3s-12f/rules.json b/resources/boards/ulx3s-12f/rules.json similarity index 100% rename from constraints/boards/ulx3s-12f/rules.json rename to resources/boards/ulx3s-12f/rules.json diff --git a/constraints/boards/ulx3s-25f/info.json b/resources/boards/ulx3s-25f/info.json similarity index 100% rename from constraints/boards/ulx3s-25f/info.json rename to resources/boards/ulx3s-25f/info.json diff --git a/constraints/boards/ulx3s-25f/iomode.json b/resources/boards/ulx3s-25f/iomode.json similarity index 100% rename from constraints/boards/ulx3s-25f/iomode.json rename to resources/boards/ulx3s-25f/iomode.json diff --git a/constraints/boards/ulx3s-25f/pinout.lpf b/resources/boards/ulx3s-25f/pinout.lpf similarity index 100% rename from constraints/boards/ulx3s-25f/pinout.lpf rename to resources/boards/ulx3s-25f/pinout.lpf diff --git a/constraints/boards/ulx3s-25f/rules.json b/resources/boards/ulx3s-25f/rules.json similarity index 100% rename from constraints/boards/ulx3s-25f/rules.json rename to resources/boards/ulx3s-25f/rules.json diff --git a/constraints/boards/ulx3s-45f/info.json b/resources/boards/ulx3s-45f/info.json similarity index 100% rename from constraints/boards/ulx3s-45f/info.json rename to resources/boards/ulx3s-45f/info.json diff --git a/constraints/boards/ulx3s-45f/iomode.json b/resources/boards/ulx3s-45f/iomode.json similarity index 100% rename from constraints/boards/ulx3s-45f/iomode.json rename to resources/boards/ulx3s-45f/iomode.json diff --git a/constraints/boards/ulx3s-45f/pinout.lpf b/resources/boards/ulx3s-45f/pinout.lpf similarity index 100% rename from constraints/boards/ulx3s-45f/pinout.lpf rename to resources/boards/ulx3s-45f/pinout.lpf diff --git a/constraints/boards/ulx3s-45f/rules.json b/resources/boards/ulx3s-45f/rules.json similarity index 100% rename from constraints/boards/ulx3s-45f/rules.json rename to resources/boards/ulx3s-45f/rules.json diff --git a/constraints/boards/ulx3s-85f/info.json b/resources/boards/ulx3s-85f/info.json similarity index 100% rename from constraints/boards/ulx3s-85f/info.json rename to resources/boards/ulx3s-85f/info.json diff --git a/constraints/boards/ulx3s-85f/iomode.json b/resources/boards/ulx3s-85f/iomode.json similarity index 100% rename from constraints/boards/ulx3s-85f/iomode.json rename to resources/boards/ulx3s-85f/iomode.json diff --git a/constraints/boards/ulx3s-85f/pinout.lpf b/resources/boards/ulx3s-85f/pinout.lpf similarity index 100% rename from constraints/boards/ulx3s-85f/pinout.lpf rename to resources/boards/ulx3s-85f/pinout.lpf diff --git a/constraints/boards/ulx3s-85f/rules.json b/resources/boards/ulx3s-85f/rules.json similarity index 100% rename from constraints/boards/ulx3s-85f/rules.json rename to resources/boards/ulx3s-85f/rules.json diff --git a/constraints/boards/upduino/info.json b/resources/boards/upduino/info.json similarity index 100% rename from constraints/boards/upduino/info.json rename to resources/boards/upduino/info.json diff --git a/constraints/boards/upduino/iomode.json b/resources/boards/upduino/iomode.json similarity index 100% rename from constraints/boards/upduino/iomode.json rename to resources/boards/upduino/iomode.json diff --git a/constraints/boards/upduino/pinout.pcf b/resources/boards/upduino/pinout.pcf similarity index 100% rename from constraints/boards/upduino/pinout.pcf rename to resources/boards/upduino/pinout.pcf diff --git a/constraints/boards/upduino/rules.json b/resources/boards/upduino/rules.json similarity index 100% rename from constraints/boards/upduino/rules.json rename to resources/boards/upduino/rules.json diff --git a/constraints/boards/upduino2/info.json b/resources/boards/upduino2/info.json similarity index 100% rename from constraints/boards/upduino2/info.json rename to resources/boards/upduino2/info.json diff --git a/constraints/boards/upduino2/iomode.json b/resources/boards/upduino2/iomode.json similarity index 100% rename from constraints/boards/upduino2/iomode.json rename to resources/boards/upduino2/iomode.json diff --git a/constraints/boards/upduino2/pinout.pcf b/resources/boards/upduino2/pinout.pcf similarity index 100% rename from constraints/boards/upduino2/pinout.pcf rename to resources/boards/upduino2/pinout.pcf diff --git a/constraints/boards/upduino2/rules.json b/resources/boards/upduino2/rules.json similarity index 100% rename from constraints/boards/upduino2/rules.json rename to resources/boards/upduino2/rules.json diff --git a/constraints/boards/upduino21/info.json b/resources/boards/upduino21/info.json similarity index 100% rename from constraints/boards/upduino21/info.json rename to resources/boards/upduino21/info.json diff --git a/constraints/boards/upduino21/iomode.json b/resources/boards/upduino21/iomode.json similarity index 100% rename from constraints/boards/upduino21/iomode.json rename to resources/boards/upduino21/iomode.json diff --git a/constraints/boards/upduino21/pinout.pcf b/resources/boards/upduino21/pinout.pcf similarity index 100% rename from constraints/boards/upduino21/pinout.pcf rename to resources/boards/upduino21/pinout.pcf diff --git a/constraints/boards/upduino21/rules.json b/resources/boards/upduino21/rules.json similarity index 100% rename from constraints/boards/upduino21/rules.json rename to resources/boards/upduino21/rules.json diff --git a/constraints/boards/upduino3/info.json b/resources/boards/upduino3/info.json similarity index 100% rename from constraints/boards/upduino3/info.json rename to resources/boards/upduino3/info.json diff --git a/constraints/boards/upduino3/iomode.json b/resources/boards/upduino3/iomode.json similarity index 100% rename from constraints/boards/upduino3/iomode.json rename to resources/boards/upduino3/iomode.json diff --git a/constraints/boards/upduino3/pinout.pcf b/resources/boards/upduino3/pinout.pcf similarity index 100% rename from constraints/boards/upduino3/pinout.pcf rename to resources/boards/upduino3/pinout.pcf diff --git a/constraints/boards/upduino3/rules.json b/resources/boards/upduino3/rules.json similarity index 100% rename from constraints/boards/upduino3/rules.json rename to resources/boards/upduino3/rules.json diff --git a/constraints/devices/HX1K.json b/resources/devices/HX1K.json similarity index 100% rename from constraints/devices/HX1K.json rename to resources/devices/HX1K.json diff --git a/constraints/devices/HX8K.json b/resources/devices/HX8K.json similarity index 100% rename from constraints/devices/HX8K.json rename to resources/devices/HX8K.json diff --git a/constraints/devices/LP8K.json b/resources/devices/LP8K.json similarity index 100% rename from constraints/devices/LP8K.json rename to resources/devices/LP8K.json diff --git a/constraints/devices/UP5K.json b/resources/devices/UP5K.json similarity index 100% rename from constraints/devices/UP5K.json rename to resources/devices/UP5K.json diff --git a/services/common.js b/services/common.js index e5834c2ca..71e2eb522 100644 --- a/services/common.js +++ b/services/common.js @@ -78,7 +78,10 @@ angular this.APP_DIR = nodePath.dirname(process.execPath); - this.ICETOOL = 'ICETool'; + this.ICETOOL = ['python', '-m', 'ICETool.__init__']; + if (process.env.ICETOOL_CMD != undefined) { + this.ICETOOL = [process.env.ICETOOL_CMD]; + } const nodeTmp = require('tmp'); @@ -108,13 +111,13 @@ angular this.isEditingSubmodule = false; - // Read list of subdirs of 'constraints' which do not start with '_'; + // Read list of subdirs of 'resources' which do not start with '_'; // for each, read 'info.json' and 'rules'.json'. // Generate list of boards and list of devices. try { var boards = []; var devices = []; - var dpath = nodePath.join('constraints', 'devices'); + var dpath = nodePath.join('resources', 'devices'); nodeFs.readdirSync(dpath).forEach((ditem) => { const ddata = _readJSONFile(dpath, ditem); devices.push({ @@ -122,7 +125,7 @@ angular resources: ddata, }); }); - var rpath = nodePath.join('constraints', 'boards'); + var rpath = nodePath.join('resources', 'boards'); nodeFs.readdirSync(rpath).forEach((bdir) => { if (bdir[0] !== '_' && !nodePath.extname(bdir)) { const bpath = nodePath.join(rpath, bdir); diff --git a/services/tools.js b/services/tools.js index 3e0828a31..c9f2ee363 100644 --- a/services/tools.js +++ b/services/tools.js @@ -90,7 +90,7 @@ angular .then(function () { var command = commands[0]; if (command === 'build' || command === 'upload') { - commands = commands.concat('--verbose-pnr'); + commands = commands.concat('--verbose'); } return executeLocal(commands); }) @@ -264,8 +264,7 @@ angular function executeLocal(commands) { return new Promise(function (resolve) { - var command = [common.ICETOOL] - .concat(commands) + var command = common.ICETOOL.concat(commands) .concat(['-p', `"${common.BUILD_DIR}"`]) .join(' '); if ( @@ -306,7 +305,7 @@ angular var stderr = result.stderr; return new Promise(function (resolve, reject) { - if (_error || stderr) { + if (_error) { // -- Process errors reject(); if (stdout) { diff --git a/tools/ICETool b/tools/ICETool deleted file mode 100755 index 252395a56..000000000 --- a/tools/ICETool +++ /dev/null @@ -1,259 +0,0 @@ -#!/usr/bin/env python3 - -from sys import ( - argv as sys_argv, - exit as sys_exit, - stdout as sys_stdout, - stderr as sys_stderr -) -from os import getenv -from pathlib import Path -from subprocess import check_call -import click - - -@click.command("verify") -@click.pass_context -@click.option( - "-p", - "--project-dir", - type=str, - metavar="path", - help="Set the target directory for the project.", -) -@click.option( - "-b", - "--board", - type=str, - metavar="board", - help="Set the board." -) -@click.option( - "-v", - "--verbose", - is_flag=True, - help="Show the entire output of the command.", -) -def VerifyCommand(ctx, board, project_dir, verbose): - """ - Verify verilog sources through Icarus Verilog. - """ - - device = 'ice40' if board in ['TinyFPGA-B2'] else 'ecp5' - - IVER_PATH = 'apath' - TARGET_SIM = 'atarget' - YOSYS_PATH = 'path' - - sources = " ".join([item.name for item in Path(project_dir).glob("*.v")]) - - opts = '-D NO_ICE40_DEFAULT_ASSIGNMENTS' if device == 'ice40' else '-D NO_INCLUDES' - - #cmd = f'iverilog {IVER_PATH} -o $TARGET -D VCD_OUTPUT={TARGET_SIM} {opts} {YOSYS_PATH}/{device}/cells_sim.v {sources}' - cmd = f'iverilog {opts} {sources}' - - print(cmd) - check_call(cmd, cwd=project_dir) - - print("verbose:", verbose) - - ctx.exit(0) - - -@click.command("build") -@click.pass_context -@click.option( - "-b", - "--board", - type=str, - metavar="board", - help="Set the board." -) -@click.option( - "--device", - type=str, - metavar="device", - help="Set the FPGA device." -) -@click.option( - "--package", - type=str, - metavar="package", - help="Set the FPGA package." -) -@click.option( - "-p", - "--project-dir", - type=str, - metavar="path", - help="Set the target directory for the project.", -) -@click.option( - "-v", - "--verbose", - is_flag=True, - help="Show the entire output of the command.", -) -@click.option( - "--verbose-yosys", - is_flag=True, - help="Show the yosys output of the command.", -) -@click.option( - "--verbose-pnr", - is_flag=True, - help="Show the pnr output of the command." -) -def BuildCommand( - ctx, - board, - device, - package, - project_dir, - verbose, - verbose_yosys, - verbose_pnr, -): - """ - Generate bitstream through Yosys and Nextpnr. - """ - - sources = " ".join([item.name for item in Path(project_dir).glob("*.v")]) - opts = '' if verbose or verbose_yosys else '-q' - cmd = f'yosys -p "proc; synth_ice40 -top main -json synth.json" {opts} {sources}' - - print(cmd) - check_call(cmd, cwd=project_dir) - sys_stdout.flush() - sys_stderr.flush() - - boards = { - 'icezum': { - 'device': 'ICE40-HX1K', - 'package': 'TQ144' - } - } - - device = boards[board]['device'].split('-')[1].lower() if device is None else device - package = boards[board]['package'].lower() if package is None else package - - pcf = [item.name for item in Path(project_dir).glob("*.pcf")][0] - opts = '' if verbose or verbose_pnr else '-q' - cmd = f'nextpnr-ice40 --{device} --package {package} --pcf {pcf} --json synth.json --asc pnr.asc {opts}' - - print(cmd) - check_call(cmd, cwd=project_dir) - sys_stdout.flush() - sys_stderr.flush() - - cmd = 'icepack pnr.asc design.bin' - - print(cmd) - check_call(cmd, cwd=project_dir) - sys_stdout.flush() - sys_stderr.flush() - - print('board:', board) - - ctx.exit(0) - - -@click.command("upload") -@click.pass_context -@click.option( - "-b", - "--board", - type=str, - metavar="board", - help="Set the board." -) -@click.option( - "--serial-port", - type=str, - metavar="serial-port", - help="Set the serial port.", -) -@click.option( - "--ftdi-id", - type=str, - metavar="ftdi-id", - help="Set the FTDI id." -) -@click.option( - "-s", - "--sram", - is_flag=True, - help="Perform SRAM programming." -) -@click.option( - "-f", - "--flash", - is_flag=True, - help="Perform FLASH programming." -) -@click.option( - "-p", - "--project-dir", - type=str, - metavar="path", - help="Set the target directory for the project.", -) -@click.option( - "-v", - "--verbose", - is_flag=True, - help="Show the entire output of the command.", -) -@click.option( - "--verbose-yosys", - is_flag=True, - help="Show the yosys output of the command.", -) -@click.option( - "--verbose-pnr", - is_flag=True, - help="Show the pnr output of the command." -) -def UploadCommand( - ctx, - board, - serial_port, - ftdi_id, - sram, - flash, - project_dir, - verbose, - verbose_yosys, - verbose_pnr, -): - """ - Upload bitstream to the board through openFPGALoader. - """ - - print("board:", board) - print("serial_port:", serial_port) - print("ftdi_id:", ftdi_id) - print("sram:", sram) - print("flash:", flash) - print("verbose:", verbose) - print("verbose_yosys:", verbose_yosys) - print("verbose_pnr:", verbose_pnr) - - ctx.exit(0) - - -@click.group() -def cli(): - pass - -cli.add_command(VerifyCommand) -cli.add_command(BuildCommand) -cli.add_command(UploadCommand) - - -if __name__ == '__main__': - toolenv = getenv('ICETOOL_CMD', 'ICETool') - if toolenv != 'ICETool': - check_call([toolenv] + sys_argv[1:]) - sys_exit() - cli() diff --git a/viewers/plain/pcf.html b/viewers/plain/pcf.html index 5289a7a14..51113cddf 100644 --- a/viewers/plain/pcf.html +++ b/viewers/plain/pcf.html @@ -37,7 +37,7 @@ } window.onload = function () { const nodeFs = require('fs'); - const path = `constraints/boards/${getURLParameter('board')}/pinout`; + const path = `resources/boards/${getURLParameter('board')}/pinout`; let ext = 'pcf'; if (!nodeFs.existsSync(`${path}.pcf`)) { if (!nodeFs.existsSync(`${path}.lpf`)) { diff --git a/viewers/svg/pinout.html b/viewers/svg/pinout.html index 924255d45..de8f6b9aa 100644 --- a/viewers/svg/pinout.html +++ b/viewers/svg/pinout.html @@ -26,7 +26,7 @@ var elem = document.getElementById('pinout'); elem.setAttribute( 'src', - `../../constraints/boards/${getURLParameter('board')}/pinout.svg` + `../../resources/boards/${getURLParameter('board')}/pinout.svg` ); setTimeout(function () { svgPanZoom(elem, {