@silinx/nextpnr-himbaechel-xc7 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/api.d.ts ADDED
@@ -0,0 +1,101 @@
1
+ // @silinx/nextpnr-himbaechel-xc7: nextpnr-himbaechel with the Xilinx 7-series (xilinx, on Project X-Ray's database), in
2
+ // WebAssembly, run by YoWASP's runtime (@yowasp/runtime). Everything this file declares is the package's public
3
+ // interface; before 1.0.0 a minor version may change it (the package's README: "Stability").
4
+
5
+ /** A folder of files: a name maps to a sub-folder, or to a file's contents (a string or bytes). */
6
+ export type Tree = {
7
+ [name: string]: Tree | string | Uint8Array
8
+ };
9
+
10
+ /** nextpnr's standard input: asked for up to byteLength bytes, returns them, or null at the end. */
11
+ export type InputStream =
12
+ (byteLength: number) => Uint8Array | null;
13
+
14
+ /** nextpnr's standard output or error: given each chunk of bytes, then null when nextpnr ends. */
15
+ export type OutputStream =
16
+ (bytes: Uint8Array | null) => void;
17
+
18
+ /** The download of the runtime's resources (the WebAssembly module and its share/ folder), on the first run. */
19
+ export type ProgressCallback =
20
+ (event: { source: Application, totalLength: number, doneLength: number }) => void;
21
+
22
+ /** How a run talks to its caller (YoWASP's runtime's options). */
23
+ export type RunOptions = {
24
+ /** nextpnr's standard input (none: an empty one). */
25
+ stdin?: InputStream | null;
26
+ /** nextpnr's standard output (undefined: console.log, line by line; null: dropped). */
27
+ stdout?: OutputStream | null;
28
+ /** nextpnr's standard error (undefined: console.log, line by line; null: dropped). */
29
+ stderr?: OutputStream | null;
30
+ /** The files returned: an ASCII one as a string (true, the default), or every one as bytes (false). */
31
+ decodeASCII?: boolean;
32
+ /** Run synchronously, the result a Tree rather than a Promise (only once a first, asynchronous run has loaded the resources). */
33
+ synchronously?: boolean;
34
+ /** Told of the resources' download. */
35
+ fetchProgress?: ProgressCallback;
36
+ };
37
+
38
+ /** A WebAssembly command (YoWASP's runtime's Application): a type only, the module exports none. */
39
+ export interface Application {
40
+ argv0: string;
41
+
42
+ /** Runs the command with args, on the files given (its working folder); returns the files it wrote. */
43
+ run(args?: string[], files?: Tree, options?: RunOptions): Promise<Tree> | Tree | undefined;
44
+ }
45
+
46
+ /**
47
+ * Thrown when nextpnr exits with a code other than 0. An error nextpnr stops on may also come out as another exception
48
+ * (WebAssembly's, with no message): either way its "ERROR:" lines on the output say why.
49
+ */
50
+ export class Exit extends Error {
51
+ /** nextpnr's exit code. */
52
+ code: number;
53
+ /** The files as they were when nextpnr exited. */
54
+ files: Tree;
55
+ }
56
+
57
+ //--------8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<--------
58
+
59
+ /** A run of nextpnr: its command-line arguments, its input files, its streams; resolves to the files it wrote. */
60
+ export type Command =
61
+ (args?: string[], files?: Tree, options?: RunOptions) => Promise<Tree> | Tree | undefined;
62
+
63
+ /**
64
+ * nextpnr-himbaechel with the xilinx micro-architecture. The arguments Silinx passes (the README's "The command"):
65
+ * --device <part> --chipdb <file> --json <netlist> -o xdc=<constraints> -o fasm=<fasm> --write <routed>, and --seed,
66
+ * --freq, --router, --timing-allow-fail. Example:
67
+ *
68
+ * const files = await runNextpnrHimbaechelXilinx(
69
+ * ['--device', 'xc7a35tcpg236-1', '--chipdb', 'chipdb.bin', '--json', 'design.json', '-o', 'xdc=design.xdc',
70
+ * '-o', 'fasm=design.fasm'],
71
+ * { 'chipdb.bin': await chipdb('xc7a35tcpg236-1'), 'design.json': netlist, 'design.xdc': xdc });
72
+ * files['design.fasm'];
73
+ */
74
+ export const runNextpnrHimbaechelXilinx: Command;
75
+
76
+ /** The package's commands by name (as @yowasp/* packages list theirs). */
77
+ export const commands: {
78
+ 'nextpnr-himbaechel-xilinx': Command,
79
+ };
80
+
81
+ /** The package's version (as in its package.json). */
82
+ export const version: string;
83
+
84
+ /** The devices whose chip databases the package has (xc7a50t, xc7a100t): a minor version may add some. */
85
+ export const devices: string[];
86
+
87
+ /**
88
+ * The device whose chip database a part takes, in lower case (xc7a100tcsg324-1 -> xc7a100t; xc7a35tcpg236-1 -> xc7a50t,
89
+ * the xc7a35t being the xc7a50t's fabric in Project X-Ray's database); throws for a part without a chip database.
90
+ */
91
+ export function deviceOf(part: string): string;
92
+
93
+ /** URL of a part's chip database file, gzipped: chipdb/chipdb-<device>.bin.gz, beside the package's bundle. */
94
+ export function chipdbUrl(part: string): URL;
95
+
96
+ /**
97
+ * A part's chip database, decompressed: give it to nextpnr as a file, with --chipdb. Read from disk in Node (a missing
98
+ * file: Node's ENOENT error, with its path), fetched over HTTP in a browser (a failure: an Error with the HTTP status).
99
+ * A chip database works with the nextpnr of its own package version only.
100
+ */
101
+ export function chipdb(part: string): Promise<Uint8Array>;
package/package.json CHANGED
@@ -1,6 +1,33 @@
1
1
  {
2
2
  "name": "@silinx/nextpnr-himbaechel-xc7",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "nextpnr-himbaechel with the Xilinx 7-series (xilinx, on Project X-Ray's database), in WebAssembly, for Silinx ISE",
5
+ "license": "ISC",
6
+ "homepage": "https://github.com/pmnmalo/nextpnr-spartan",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/pmnmalo/nextpnr-spartan.git"
10
+ },
11
+ "type": "module",
12
+ "files": [
13
+ "lib/api.d.ts",
14
+ "CHANGELOG.md",
15
+ "gen/bundle.js",
16
+ "gen/*.wasm",
17
+ "gen/*-resources*.tar",
18
+ "chipdb/*.bin.gz"
19
+ ],
20
+ "exports": {
21
+ "types": "./lib/api.d.ts",
22
+ "default": "./gen/bundle.js"
23
+ },
24
+ "types": "./lib/api.d.ts",
25
+ "engines": {
26
+ "node": ">=22"
27
+ },
28
+ "devDependencies": {
29
+ "@bytecodealliance/jco": "1.19.0",
30
+ "@yowasp/runtime": "11.0.72",
31
+ "esbuild": "^0.25.11"
32
+ }
33
+ }