yosys2digitaljs 0.2.3 → 0.6.0
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/ChangeLog.md +33 -0
- package/README.md +4 -4
- package/dist/index.d.ts +164 -0
- package/dist/index.js +1132 -0
- package/package.json +12 -4
- package/process.js +13 -2
- package/src/index.ts +1284 -0
- package/tests/cycleadder.sv +1 -1
- package/tests/cycleadder_arst.sv +1 -1
- package/tests/dff_masterslave.sv +1 -1
- package/tests/dlatch_gate.sv +1 -1
- package/tests/fsm.sv +4 -3
- package/tsconfig.json +15 -0
- package/.travis.yml +0 -8
- package/index.js +0 -878
package/package.json
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yosys2digitaljs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Export Yosys netlists to a logic simulator",
|
|
5
|
-
"main": "index
|
|
5
|
+
"main": "dist/index",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
6
7
|
"scripts": {
|
|
8
|
+
"prepare": "npm run build",
|
|
9
|
+
"cjs": "tsc -m commonjs",
|
|
10
|
+
"build": "npm run cjs",
|
|
7
11
|
"test": "./run_tests.sh"
|
|
8
12
|
},
|
|
9
13
|
"author": "Marek Materzok",
|
|
10
14
|
"license": "BSD-2-Clause",
|
|
11
15
|
"dependencies": {
|
|
12
|
-
"3vl": "^0.3.
|
|
13
|
-
"big-integer": "^1.6.
|
|
16
|
+
"3vl": "^0.3.5",
|
|
17
|
+
"big-integer": "^1.6.49",
|
|
14
18
|
"hashmap": "^2.4.0",
|
|
15
19
|
"minimist": "^1.2.5",
|
|
16
20
|
"sanitize-filename": "^1.6.3",
|
|
@@ -24,5 +28,9 @@
|
|
|
24
28
|
"repository": {
|
|
25
29
|
"type": "git",
|
|
26
30
|
"url": "https://github.com/tilk/yosys2digitaljs.git"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^16.10.3",
|
|
34
|
+
"typescript": "^4.4.3"
|
|
27
35
|
}
|
|
28
36
|
}
|
package/process.js
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const argv = require('minimist')(
|
|
6
6
|
process.argv.slice(2),
|
|
7
|
-
{boolean: ["optimize", "
|
|
7
|
+
{boolean: ["optimize", "yosys_out", "yosys_output", "html", "no_io_ui", "tmpdir", "noindent", "fsmexpand"],
|
|
8
|
+
string: ["fsm"],
|
|
9
|
+
default: {fsm: true}}
|
|
8
10
|
);
|
|
9
11
|
const util = require('util');
|
|
10
12
|
|
|
@@ -29,10 +31,12 @@ if (argv._.length === 0) {
|
|
|
29
31
|
console.error('No Verilog files passed!');
|
|
30
32
|
process.exit(1);
|
|
31
33
|
}
|
|
32
|
-
const yosys2digitaljs = require('./index.js');
|
|
34
|
+
const yosys2digitaljs = require('./dist/index.js');
|
|
33
35
|
const opts = {};
|
|
34
36
|
if (argv.optimize) opts.optimize = true;
|
|
35
37
|
if (argv.fsm) opts.fsm = argv.fsm;
|
|
38
|
+
if (argv.fsmexpand) opts.fsmexpand = true;
|
|
39
|
+
if (argv.lint) opts.lint = true;
|
|
36
40
|
if (argv.propagation !== undefined) opts.propagation = Number(argv.propagation);
|
|
37
41
|
const result = argv.tmpdir ? yosys2digitaljs.process_files(read_files(argv._), opts) : yosys2digitaljs.process(argv._, null, opts);
|
|
38
42
|
result.then(res => {
|
|
@@ -50,6 +54,13 @@ result.then(res => {
|
|
|
50
54
|
console.log(util.inspect(res.yosys_output, {showHidden: false, depth: null, colors: process.stdout.isTTY && process.stdout.hasColors()}));
|
|
51
55
|
console.log('*/');
|
|
52
56
|
}
|
|
57
|
+
if (opts.lint && res.lint && res.lint.length) {
|
|
58
|
+
console.log('/*');
|
|
59
|
+
for (const lint of res.lint) {
|
|
60
|
+
console.log(`${lint.type} ${lint.file}:${lint.line}:${lint.column} ${lint.message}`);
|
|
61
|
+
}
|
|
62
|
+
console.log('*/');
|
|
63
|
+
}
|
|
53
64
|
const output = res.output;
|
|
54
65
|
if (!argv.no_io_ui) yosys2digitaljs.io_ui(output);
|
|
55
66
|
console.log(JSON.stringify(output, null, argv.noindent ? 0 : 2));
|