@yowasp/yosys 0.0.0-experimental2 → 0.0.0-experimental4
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/gen/bundle-browser.js +5 -7
- package/gen/bundle-node.js +5 -7
- package/package.json +1 -1
package/gen/bundle-browser.js
CHANGED
|
@@ -366,23 +366,23 @@ var BaseApplication = class {
|
|
|
366
366
|
throw e;
|
|
367
367
|
}
|
|
368
368
|
for (const dirName of Object.keys(this._resources))
|
|
369
|
-
delete environment.root[dirName];
|
|
369
|
+
delete environment.root.files[dirName];
|
|
370
370
|
return directoryIntoTree(environment.root);
|
|
371
371
|
}
|
|
372
372
|
};
|
|
373
373
|
|
|
374
374
|
// node_modules/@yowasp/runtime/lib/api-browser.js
|
|
375
375
|
var Application = class extends BaseApplication {
|
|
376
|
-
constructor(
|
|
376
|
+
constructor(baseURL, resourceFilenames, wasmFilenames, instantiate2, argv0) {
|
|
377
377
|
async function getResources() {
|
|
378
378
|
const resources = {};
|
|
379
379
|
for (const [dirName, jsonFilename] of Object.entries(resourceFilenames))
|
|
380
|
-
resources[dirName] = await fetch(new URL(jsonFilename,
|
|
380
|
+
resources[dirName] = await fetch(new URL(jsonFilename, baseURL)).then((resp) => resp.json());
|
|
381
381
|
return resources;
|
|
382
382
|
}
|
|
383
383
|
const wasmModules = {};
|
|
384
384
|
for (const [modName, wasmFilename] of Object.entries(wasmFilenames))
|
|
385
|
-
wasmModules[modName] = fetch(new URL(wasmFilename,
|
|
385
|
+
wasmModules[modName] = fetch(new URL(wasmFilename, baseURL)).then(WebAssembly.compileStreaming);
|
|
386
386
|
super(getResources, wasmModules, instantiate2, argv0);
|
|
387
387
|
}
|
|
388
388
|
};
|
|
@@ -4537,9 +4537,7 @@ async function instantiate(getCoreModule, imports, instantiateCore = WebAssembly
|
|
|
4537
4537
|
}
|
|
4538
4538
|
|
|
4539
4539
|
// lib/api.js
|
|
4540
|
-
var
|
|
4541
|
-
console.log("baseURL", baseURL);
|
|
4542
|
-
var yosys = new Application(baseURL, {
|
|
4540
|
+
var yosys = new Application(import.meta.url, {
|
|
4543
4541
|
"share": "./yosys-share.json"
|
|
4544
4542
|
}, {
|
|
4545
4543
|
"yosys.core.wasm": "./yosys.core.wasm",
|
package/gen/bundle-node.js
CHANGED
|
@@ -369,23 +369,23 @@ var BaseApplication = class {
|
|
|
369
369
|
throw e;
|
|
370
370
|
}
|
|
371
371
|
for (const dirName of Object.keys(this._resources))
|
|
372
|
-
delete environment.root[dirName];
|
|
372
|
+
delete environment.root.files[dirName];
|
|
373
373
|
return directoryIntoTree(environment.root);
|
|
374
374
|
}
|
|
375
375
|
};
|
|
376
376
|
|
|
377
377
|
// node_modules/@yowasp/runtime/lib/api-node.js
|
|
378
378
|
var Application = class extends BaseApplication {
|
|
379
|
-
constructor(
|
|
379
|
+
constructor(baseURL, resourceFilenames, wasmFilenames, instantiate2, argv0) {
|
|
380
380
|
async function getResources() {
|
|
381
381
|
const resources = {};
|
|
382
382
|
for (const [dirName, jsonFilename] of Object.entries(resourceFilenames))
|
|
383
|
-
resources[dirName] = JSON.parse(await readFile(new URL(jsonFilename,
|
|
383
|
+
resources[dirName] = JSON.parse(await readFile(new URL(jsonFilename, baseURL)));
|
|
384
384
|
return resources;
|
|
385
385
|
}
|
|
386
386
|
const wasmModules = {};
|
|
387
387
|
for (const [modName, wasmFilename] of Object.entries(wasmFilenames))
|
|
388
|
-
wasmModules[modName] = readFile(new URL(wasmFilename,
|
|
388
|
+
wasmModules[modName] = readFile(new URL(wasmFilename, baseURL)).then(WebAssembly.compile);
|
|
389
389
|
super(getResources, wasmModules, instantiate2, argv0);
|
|
390
390
|
}
|
|
391
391
|
};
|
|
@@ -4540,9 +4540,7 @@ async function instantiate(getCoreModule, imports, instantiateCore = WebAssembly
|
|
|
4540
4540
|
}
|
|
4541
4541
|
|
|
4542
4542
|
// lib/api.js
|
|
4543
|
-
var
|
|
4544
|
-
console.log("baseURL", baseURL);
|
|
4545
|
-
var yosys = new Application(baseURL, {
|
|
4543
|
+
var yosys = new Application(import.meta.url, {
|
|
4546
4544
|
"share": "./yosys-share.json"
|
|
4547
4545
|
}, {
|
|
4548
4546
|
"yosys.core.wasm": "./yosys.core.wasm",
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@yowasp/yosys", "version": "0.0.0-
|
|
1
|
+
{"name": "@yowasp/yosys", "version": "0.0.0-experimental4", "description": "Yosys Open SYnthesis Suite", "author": "Catherine <whitequark@whitequark.org>", "license": "ISC", "homepage": "https://yowasp.org/", "repository": {"type": "git", "url": "git+https://github.com/YoWASP/yosys.git"}, "bugs": {"url": "https://github.com/YoWASP/yosys/issues"}, "type": "module", "files": ["gen/*.json", "gen/*.wasm", "gen/bundle-*.js"], "exports": {"node": "./gen/bundle-node.js", "browser": "./gen/bundle-browser.js"}, "dependencies": {"@yowasp/runtime": "^2.0.7"}, "devDependencies": {"@bytecodealliance/jco": "^0.14.1", "esbuild": "^0.19.8"}, "scripts": {"pack": "yowasp-pack-resources ../yosys-build/share gen/yosys-share.json", "transpile": "jco new ../yosys-build/yosys.wasm --wasi-command --output yosys.wasm && jco transpile yosys.wasm --instantiation async --no-typescript --no-namespaced-exports --map 'wasi:io/*=runtime#io' --map 'wasi:cli/*=runtime#cli' --map 'wasi:clocks/*=runtime#*' --map 'wasi:filesystem/*=runtime#fs' --out-dir gen/", "build:node": "esbuild --bundle lib/api.js --outfile=gen/bundle-node.js --format=esm --platform=node", "build:browser": "esbuild --bundle lib/api.js --outfile=gen/bundle-browser.js --format=esm --platform=browser"}}
|