yosys2digitaljs 0.8.0 → 0.9.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/dist/core.d.ts +140 -0
- package/dist/core.js +1082 -0
- package/dist/index.d.ts +4 -139
- package/dist/index.js +9 -1089
- package/dist/types.d.ts +174 -0
- package/dist/types.js +6 -0
- package/package.json +20 -7
- package/process.js +3 -2
- package/src/core.ts +1210 -0
- package/src/index.ts +6 -1215
- package/src/types.ts +182 -0
- package/test.sv +0 -31
- package/test1.sv +0 -19
- package/test1.v +0 -19
- package/test2.v +0 -19
- package/test3.sv +0 -63
- package/test3.v +0 -19
- package/test4.sv +0 -62
- package/yosyss +0 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,153 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
line: number;
|
|
5
|
-
column: number;
|
|
6
|
-
};
|
|
7
|
-
type SourcePosition = {
|
|
8
|
-
name: string;
|
|
9
|
-
from: FilePosition;
|
|
10
|
-
to: FilePosition;
|
|
11
|
-
};
|
|
12
|
-
type MemReadPort = {
|
|
13
|
-
clock_polarity?: boolean;
|
|
14
|
-
enable_polarity?: boolean;
|
|
15
|
-
arst_polarity?: boolean;
|
|
16
|
-
srst_polarity?: boolean;
|
|
17
|
-
enable_srst?: boolean;
|
|
18
|
-
transparent?: boolean | boolean[];
|
|
19
|
-
collision?: boolean | boolean[];
|
|
20
|
-
init_value?: string;
|
|
21
|
-
arst_value?: string;
|
|
22
|
-
srst_value?: string;
|
|
23
|
-
};
|
|
24
|
-
type MemWritePort = {
|
|
25
|
-
clock_polarity?: boolean;
|
|
26
|
-
enable_polarity?: boolean;
|
|
27
|
-
no_bit_enable?: boolean;
|
|
28
|
-
};
|
|
29
|
-
type Device = {
|
|
30
|
-
type: string;
|
|
31
|
-
source_positions?: SourcePosition[];
|
|
32
|
-
[key: string]: any;
|
|
33
|
-
};
|
|
34
|
-
type Port = {
|
|
35
|
-
id: string;
|
|
36
|
-
port: string;
|
|
37
|
-
};
|
|
38
|
-
type Connector = {
|
|
39
|
-
from: Port;
|
|
40
|
-
to: Port;
|
|
41
|
-
name?: string;
|
|
42
|
-
source_positions?: SourcePosition[];
|
|
43
|
-
};
|
|
44
|
-
type Module = {
|
|
45
|
-
devices: {
|
|
46
|
-
[key: string]: Device;
|
|
47
|
-
};
|
|
48
|
-
connectors: Connector[];
|
|
49
|
-
};
|
|
50
|
-
type TopModule = Module & {
|
|
51
|
-
subcircuits: {
|
|
52
|
-
[key: string]: Module;
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
declare namespace Yosys {
|
|
57
|
-
const ConstChars: readonly ["0", "1", "x", "z"];
|
|
58
|
-
type BitChar = (typeof ConstChars)[number];
|
|
59
|
-
type Bit = number | BitChar;
|
|
60
|
-
type BitVector = Bit[];
|
|
61
|
-
type Port = {
|
|
62
|
-
direction: 'input' | 'output' | 'inout';
|
|
63
|
-
bits: any;
|
|
64
|
-
};
|
|
65
|
-
type Parameters = {
|
|
66
|
-
WIDTH?: JsonConstant;
|
|
67
|
-
A_WIDTH?: JsonConstant;
|
|
68
|
-
B_WIDTH?: JsonConstant;
|
|
69
|
-
S_WIDTH?: JsonConstant;
|
|
70
|
-
Y_WIDTH?: JsonConstant;
|
|
71
|
-
A_SIGNED?: JsonConstant;
|
|
72
|
-
B_SIGNED?: JsonConstant;
|
|
73
|
-
CLK_POLARITY?: JsonConstant;
|
|
74
|
-
EN_POLARITY?: JsonConstant;
|
|
75
|
-
ARST_POLARITY?: JsonConstant;
|
|
76
|
-
ARST_VALUE: JsonConstant;
|
|
77
|
-
CTRL_IN_WIDTH?: JsonConstant;
|
|
78
|
-
CTRL_OUT_WIDTH?: JsonConstant;
|
|
79
|
-
TRANS_NUM?: JsonConstant;
|
|
80
|
-
STATE_NUM?: JsonConstant;
|
|
81
|
-
STATE_NUM_LOG2?: JsonConstant;
|
|
82
|
-
STATE_RST?: JsonConstant;
|
|
83
|
-
RD_PORTS?: JsonConstant;
|
|
84
|
-
WR_PORTS?: JsonConstant;
|
|
85
|
-
RD_CLK_POLARITY?: JsonConstant;
|
|
86
|
-
RD_CLK_ENABLE?: JsonConstant;
|
|
87
|
-
RD_CLK_TRANSPARENT?: JsonConstant;
|
|
88
|
-
WR_CLK_POLARITY?: JsonConstant;
|
|
89
|
-
WR_CLK_ENABLE?: JsonConstant;
|
|
90
|
-
[key: string]: any;
|
|
91
|
-
};
|
|
92
|
-
type JsonConstant = number | string;
|
|
93
|
-
type Attributes = {
|
|
94
|
-
init: JsonConstant;
|
|
95
|
-
[key: string]: any;
|
|
96
|
-
};
|
|
97
|
-
type Cell = {
|
|
98
|
-
hide_name: 0 | 1;
|
|
99
|
-
type: string;
|
|
100
|
-
parameters: Parameters;
|
|
101
|
-
attributes: Attributes;
|
|
102
|
-
port_directions: {
|
|
103
|
-
[key: string]: 'input' | 'output';
|
|
104
|
-
};
|
|
105
|
-
connections: {
|
|
106
|
-
[key: string]: BitVector;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
type Net = {
|
|
110
|
-
hide_name: 0 | 1;
|
|
111
|
-
bits: BitVector;
|
|
112
|
-
attributes: {
|
|
113
|
-
[key: string]: string;
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
type Module = {
|
|
117
|
-
ports: {
|
|
118
|
-
[key: string]: Port;
|
|
119
|
-
};
|
|
120
|
-
cells: {
|
|
121
|
-
[key: string]: Cell;
|
|
122
|
-
};
|
|
123
|
-
netnames: {
|
|
124
|
-
[key: string]: Net;
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
type Output = {
|
|
128
|
-
modules: {
|
|
129
|
-
[key: string]: Module;
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
declare type ConvertOptions = {
|
|
134
|
-
propagation?: number;
|
|
135
|
-
};
|
|
136
|
-
declare type Options = ConvertOptions & {
|
|
2
|
+
import { ConvertOptions, Digitaljs } from './core';
|
|
3
|
+
type Options = ConvertOptions & {
|
|
137
4
|
optimize?: boolean;
|
|
138
5
|
fsmexpand?: boolean;
|
|
139
6
|
fsm?: boolean | "nomap";
|
|
140
7
|
timeout?: number;
|
|
141
8
|
lint?: boolean;
|
|
142
9
|
};
|
|
143
|
-
|
|
10
|
+
type Output = {
|
|
144
11
|
output?: Digitaljs.TopModule;
|
|
145
12
|
yosys_output?: any;
|
|
146
13
|
yosys_stdout: string;
|
|
147
14
|
yosys_stderr: string;
|
|
148
15
|
lint?: LintMessage[];
|
|
149
16
|
};
|
|
150
|
-
|
|
17
|
+
type LintMessage = {
|
|
151
18
|
type: string;
|
|
152
19
|
file: string;
|
|
153
20
|
line: number;
|
|
@@ -155,9 +22,7 @@ declare type LintMessage = {
|
|
|
155
22
|
message: string;
|
|
156
23
|
};
|
|
157
24
|
export declare function verilator_lint(filenames: string[], dirname?: string, options?: Options): Promise<LintMessage[]>;
|
|
158
|
-
export declare function yosys2digitaljs(obj: Yosys.Output, options?: ConvertOptions): Digitaljs.TopModule;
|
|
159
25
|
export declare function process(filenames: string[], dirname?: string, options?: Options): Promise<Output>;
|
|
160
|
-
export declare function io_ui(output: Digitaljs.Module): void;
|
|
161
26
|
export declare function process_files(data: {
|
|
162
27
|
[key: string]: string;
|
|
163
28
|
}, options?: Options): Promise<Output>;
|