-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5dcbc5
commit fd5f7bd
Showing
19 changed files
with
192 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule nextpnr-src
updated
82 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/package-lock.json | ||
/package.json | ||
/node_modules | ||
/dist | ||
|
||
/*.wasm | ||
/gen | ||
/share | ||
/index.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
export type Tree = { | ||
[name: string]: Tree | string | Uint8Array | ||
}; | ||
|
||
export type InputStream = | ||
(byteLength: number) => Uint8Array | null; | ||
|
||
export type OutputStream = | ||
(bytes: Uint8Array | null) => void; | ||
|
||
export type RunOptions = { | ||
stdin?: InputStream | null; | ||
stdout?: OutputStream | null; | ||
stderr?: OutputStream | null; | ||
decodeASCII?: boolean; | ||
synchronously?: boolean; | ||
}; | ||
|
||
export type Command = | ||
(args?: string[], files?: Tree, options?: RunOptions) => Promise<Tree> | Tree | undefined; | ||
|
||
export class Exit extends Error { | ||
code: number; | ||
files: Tree; | ||
} | ||
|
||
//--------8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<-------- | ||
|
||
export const runNextpnrHimbaechelGowin: Command; | ||
|
||
export const commands: { | ||
'gowin_pll': Command, | ||
'gowin_pack': Command, | ||
'gowin_unpack': Command, | ||
'nextpnr-himbaechel-gowin': Command, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Application } from '@yowasp/runtime'; | ||
import { instantiate as instantiateNextpnrHimbaechelGowin } from '../gen/nextpnr-himbaechel-gowin.js'; | ||
|
||
export { Exit } from '@yowasp/runtime'; | ||
|
||
const resources = () => import('./resources-nextpnr-himbaechel-gowin.js'); | ||
|
||
const runGowinPll = () => { throw new Error("unimplemented") }; // TODO | ||
const runGowinPack = () => { throw new Error("unimplemented") }; // TODO | ||
const runGowinUnpack = () => { throw new Error("unimplemented") }; // TODO | ||
|
||
const nextpnrHimbaechelGowin = new Application(resources, instantiateNextpnrHimbaechelGowin, 'yowasp-nextpnr-himbaechel-gowin'); | ||
const runNextpnrHimbaechelGowin = nextpnrHimbaechelGowin.run.bind(nextpnrHimbaechelGowin); | ||
|
||
export { | ||
runGowinPll, | ||
runGowinPack, | ||
runGowinUnpack, | ||
runNextpnrHimbaechelGowin, | ||
}; | ||
|
||
export const commands = { | ||
'gowin_pll': runGowinPll, | ||
'gowin_pack': runGowinPack, | ||
'gowin_unpack': runGowinUnpack, | ||
'nextpnr-himbaechel-gowin': runNextpnrHimbaechelGowin, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../npmjs-common/package-in.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"scripts": { | ||
"transpile": [ | ||
"../nextpnr-build/nextpnr-himbaechel-gowin.wasm" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../npmjs-common/prepare.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh -ex | ||
|
||
cd $(dirname $0) | ||
|
||
PYTHON=${PYTHON:-python} | ||
|
||
mkdir -p npmjs-himbaechel-gowin/share/himbaechel/gowin | ||
cp nextpnr-build/share/himbaechel/gowin/*.bin \ | ||
npmjs-himbaechel-gowin/share/himbaechel/gowin | ||
|
||
cd npmjs-himbaechel-gowin | ||
${PYTHON} prepare.py himbaechel-gowin | ||
npm install | ||
npm run all | ||
|
||
mkdir -p dist | ||
npm pack --pack-destination dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh -ex | ||
|
||
PYTHON=${PYTHON:-python} | ||
|
||
cd $(dirname $0) | ||
|
||
mkdir -p pypi-himbaechel-gowin/yowasp_nextpnr_himbaechel_gowin/bin/ | ||
cp nextpnr-build/nextpnr-himbaechel-gowin.wasm \ | ||
pypi-himbaechel-gowin/yowasp_nextpnr_himbaechel_gowin/ | ||
mkdir -p pypi-himbaechel-gowin/yowasp_nextpnr_himbaechel_gowin/share/himbaechel/gowin | ||
cp nextpnr-build/share/himbaechel/gowin/*.bin \ | ||
pypi-himbaechel-gowin/yowasp_nextpnr_himbaechel_gowin/share/himbaechel/gowin | ||
|
||
cd pypi-himbaechel-gowin | ||
rm -rf build && ${PYTHON} -m build -w | ||
sha256sum dist/*.whl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
__pycache__/ | ||
/*.egg-info | ||
/.eggs | ||
/build | ||
/dist | ||
|
||
/yowasp_*/share |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../apycula-meta/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
yowasp-runtime~=1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[build-system] | ||
requires = ["setuptools~=67.0", "setuptools_scm~=6.2"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
dynamic = ["version", "dependencies"] | ||
|
||
name = "yowasp-nextpnr-himbaechel-gowin" | ||
description = "nextpnr-himbaechel-gowin FPGA place and route tool" | ||
readme = "README.md" | ||
authors = [{name = "Catherine", email = "[email protected]"}] | ||
license = {text = "ISC"} | ||
classifiers = [ | ||
"License :: OSI Approved :: ISC License (ISCL)" | ||
] | ||
|
||
[project.scripts] | ||
yowasp-nextpnr-himbaechel-gowin = "yowasp_nextpnr_himbaechel_gowin:_run_nextpnr_himbaechel_gowin_argv" | ||
|
||
[project.urls] | ||
"Homepage" = "https://yowasp.org/" | ||
"Source Code" = "https://github.com/YoWASP/nextpnr" | ||
"Bug Tracker" = "https://github.com/YoWASP/nextpnr/issues" | ||
|
||
[tool.setuptools.package-data] | ||
yowasp_nextpnr_himbaechel_gowin = [ | ||
"*.wasm", | ||
"share/himbaechel/gowin/chipdb-*.bin", | ||
] | ||
|
||
[tool.setuptools.dynamic] | ||
dependencies = {file = ["dependencies.txt", "dependencies-apycula.txt"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import os, sys | ||
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "pypi-common")) | ||
|
||
from setuptools import setup | ||
from yowasp_nextpnr_version import version | ||
|
||
|
||
setup( | ||
version=version(), | ||
) |
11 changes: 11 additions & 0 deletions
11
pypi-himbaechel-gowin/yowasp_nextpnr_himbaechel_gowin/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import sys | ||
import yowasp_runtime | ||
|
||
|
||
def run_nextpnr_himbaechel_gowin(argv): | ||
return yowasp_runtime.run_wasm(__package__, "nextpnr-himbaechel-gowin.wasm", resources=["share"], | ||
argv=["yowasp-nextpnr-himbaechel-gowin", *argv]) | ||
|
||
|
||
def _run_nextpnr_himbaechel_gowin_argv(): | ||
sys.exit(run_nextpnr_himbaechel_gowin(sys.argv[1:])) |