edacation 0.3.9 → 0.3.11
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/project/configuration.d.ts +31 -0
- package/dist/project/configuration.js +3 -2
- package/dist/project/configuration.js.map +1 -1
- package/dist/project/project.d.ts +2 -0
- package/dist/project/yosys.js +34 -13
- package/dist/project/yosys.js.map +1 -1
- package/dist/util.js +1 -1
- package/dist/util.js.map +1 -1
- package/package.json +1 -1
|
@@ -119,10 +119,13 @@ declare const schemaWorkerTarget: z.ZodObject<{
|
|
|
119
119
|
}>;
|
|
120
120
|
declare const schemaYosysOptions: z.ZodObject<{
|
|
121
121
|
optimize: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
topLevelModule: z.ZodOptional<z.ZodString>;
|
|
122
123
|
}, "strip", z.ZodTypeAny, {
|
|
123
124
|
optimize?: boolean | undefined;
|
|
125
|
+
topLevelModule?: string | undefined;
|
|
124
126
|
}, {
|
|
125
127
|
optimize?: boolean | undefined;
|
|
128
|
+
topLevelModule?: string | undefined;
|
|
126
129
|
}>;
|
|
127
130
|
declare const schemaYosys: z.ZodObject<{
|
|
128
131
|
commands: z.ZodOptional<z.ZodObject<{
|
|
@@ -137,14 +140,18 @@ declare const schemaYosys: z.ZodObject<{
|
|
|
137
140
|
}>>;
|
|
138
141
|
options: z.ZodOptional<z.ZodObject<{
|
|
139
142
|
optimize: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
topLevelModule: z.ZodOptional<z.ZodString>;
|
|
140
144
|
}, "strip", z.ZodTypeAny, {
|
|
141
145
|
optimize?: boolean | undefined;
|
|
146
|
+
topLevelModule?: string | undefined;
|
|
142
147
|
}, {
|
|
143
148
|
optimize?: boolean | undefined;
|
|
149
|
+
topLevelModule?: string | undefined;
|
|
144
150
|
}>>;
|
|
145
151
|
}, "strip", z.ZodTypeAny, {
|
|
146
152
|
options?: {
|
|
147
153
|
optimize?: boolean | undefined;
|
|
154
|
+
topLevelModule?: string | undefined;
|
|
148
155
|
} | undefined;
|
|
149
156
|
commands?: {
|
|
150
157
|
useGenerated: boolean;
|
|
@@ -153,6 +160,7 @@ declare const schemaYosys: z.ZodObject<{
|
|
|
153
160
|
}, {
|
|
154
161
|
options?: {
|
|
155
162
|
optimize?: boolean | undefined;
|
|
163
|
+
topLevelModule?: string | undefined;
|
|
156
164
|
} | undefined;
|
|
157
165
|
commands?: {
|
|
158
166
|
useGenerated?: boolean | undefined;
|
|
@@ -176,14 +184,18 @@ declare const schemaYosysTarget: z.ZodObject<{
|
|
|
176
184
|
}>>;
|
|
177
185
|
options: z.ZodOptional<z.ZodObject<{
|
|
178
186
|
optimize: z.ZodOptional<z.ZodBoolean>;
|
|
187
|
+
topLevelModule: z.ZodOptional<z.ZodString>;
|
|
179
188
|
}, "strip", z.ZodTypeAny, {
|
|
180
189
|
optimize?: boolean | undefined;
|
|
190
|
+
topLevelModule?: string | undefined;
|
|
181
191
|
}, {
|
|
182
192
|
optimize?: boolean | undefined;
|
|
193
|
+
topLevelModule?: string | undefined;
|
|
183
194
|
}>>;
|
|
184
195
|
}, "strip", z.ZodTypeAny, {
|
|
185
196
|
options?: {
|
|
186
197
|
optimize?: boolean | undefined;
|
|
198
|
+
topLevelModule?: string | undefined;
|
|
187
199
|
} | undefined;
|
|
188
200
|
commands?: {
|
|
189
201
|
useGenerated: boolean;
|
|
@@ -193,6 +205,7 @@ declare const schemaYosysTarget: z.ZodObject<{
|
|
|
193
205
|
}, {
|
|
194
206
|
options?: {
|
|
195
207
|
optimize?: boolean | undefined;
|
|
208
|
+
topLevelModule?: string | undefined;
|
|
196
209
|
} | undefined;
|
|
197
210
|
commands?: {
|
|
198
211
|
useGenerated?: boolean | undefined;
|
|
@@ -345,14 +358,18 @@ export declare const schemaProjectConfiguration: z.ZodObject<{
|
|
|
345
358
|
}>>;
|
|
346
359
|
options: z.ZodOptional<z.ZodObject<{
|
|
347
360
|
optimize: z.ZodOptional<z.ZodBoolean>;
|
|
361
|
+
topLevelModule: z.ZodOptional<z.ZodString>;
|
|
348
362
|
}, "strip", z.ZodTypeAny, {
|
|
349
363
|
optimize?: boolean | undefined;
|
|
364
|
+
topLevelModule?: string | undefined;
|
|
350
365
|
}, {
|
|
351
366
|
optimize?: boolean | undefined;
|
|
367
|
+
topLevelModule?: string | undefined;
|
|
352
368
|
}>>;
|
|
353
369
|
}>, "strip", z.ZodTypeAny, {
|
|
354
370
|
options?: {
|
|
355
371
|
optimize?: boolean | undefined;
|
|
372
|
+
topLevelModule?: string | undefined;
|
|
356
373
|
} | undefined;
|
|
357
374
|
inputFiles?: {
|
|
358
375
|
useGenerated: boolean;
|
|
@@ -369,6 +386,7 @@ export declare const schemaProjectConfiguration: z.ZodObject<{
|
|
|
369
386
|
}, {
|
|
370
387
|
options?: {
|
|
371
388
|
optimize?: boolean | undefined;
|
|
389
|
+
topLevelModule?: string | undefined;
|
|
372
390
|
} | undefined;
|
|
373
391
|
inputFiles?: {
|
|
374
392
|
useGenerated?: boolean | undefined;
|
|
@@ -469,6 +487,7 @@ export declare const schemaProjectConfiguration: z.ZodObject<{
|
|
|
469
487
|
yosys?: {
|
|
470
488
|
options?: {
|
|
471
489
|
optimize?: boolean | undefined;
|
|
490
|
+
topLevelModule?: string | undefined;
|
|
472
491
|
} | undefined;
|
|
473
492
|
inputFiles?: {
|
|
474
493
|
useGenerated: boolean;
|
|
@@ -506,6 +525,7 @@ export declare const schemaProjectConfiguration: z.ZodObject<{
|
|
|
506
525
|
yosys?: {
|
|
507
526
|
options?: {
|
|
508
527
|
optimize?: boolean | undefined;
|
|
528
|
+
topLevelModule?: string | undefined;
|
|
509
529
|
} | undefined;
|
|
510
530
|
inputFiles?: {
|
|
511
531
|
useGenerated?: boolean | undefined;
|
|
@@ -594,14 +614,18 @@ export declare const schemaProjectConfiguration: z.ZodObject<{
|
|
|
594
614
|
}>>;
|
|
595
615
|
options: z.ZodOptional<z.ZodObject<{
|
|
596
616
|
optimize: z.ZodOptional<z.ZodBoolean>;
|
|
617
|
+
topLevelModule: z.ZodOptional<z.ZodString>;
|
|
597
618
|
}, "strip", z.ZodTypeAny, {
|
|
598
619
|
optimize?: boolean | undefined;
|
|
620
|
+
topLevelModule?: string | undefined;
|
|
599
621
|
}, {
|
|
600
622
|
optimize?: boolean | undefined;
|
|
623
|
+
topLevelModule?: string | undefined;
|
|
601
624
|
}>>;
|
|
602
625
|
}>, "strip", z.ZodTypeAny, {
|
|
603
626
|
options?: {
|
|
604
627
|
optimize?: boolean | undefined;
|
|
628
|
+
topLevelModule?: string | undefined;
|
|
605
629
|
} | undefined;
|
|
606
630
|
inputFiles?: {
|
|
607
631
|
useGenerated: boolean;
|
|
@@ -621,6 +645,7 @@ export declare const schemaProjectConfiguration: z.ZodObject<{
|
|
|
621
645
|
}, {
|
|
622
646
|
options?: {
|
|
623
647
|
optimize?: boolean | undefined;
|
|
648
|
+
topLevelModule?: string | undefined;
|
|
624
649
|
} | undefined;
|
|
625
650
|
inputFiles?: {
|
|
626
651
|
useGenerated?: boolean | undefined;
|
|
@@ -748,6 +773,7 @@ export declare const schemaProjectConfiguration: z.ZodObject<{
|
|
|
748
773
|
yosys?: {
|
|
749
774
|
options?: {
|
|
750
775
|
optimize?: boolean | undefined;
|
|
776
|
+
topLevelModule?: string | undefined;
|
|
751
777
|
} | undefined;
|
|
752
778
|
inputFiles?: {
|
|
753
779
|
useGenerated: boolean;
|
|
@@ -798,6 +824,7 @@ export declare const schemaProjectConfiguration: z.ZodObject<{
|
|
|
798
824
|
yosys?: {
|
|
799
825
|
options?: {
|
|
800
826
|
optimize?: boolean | undefined;
|
|
827
|
+
topLevelModule?: string | undefined;
|
|
801
828
|
} | undefined;
|
|
802
829
|
inputFiles?: {
|
|
803
830
|
useGenerated?: boolean | undefined;
|
|
@@ -850,6 +877,7 @@ export declare const schemaProjectConfiguration: z.ZodObject<{
|
|
|
850
877
|
yosys?: {
|
|
851
878
|
options?: {
|
|
852
879
|
optimize?: boolean | undefined;
|
|
880
|
+
topLevelModule?: string | undefined;
|
|
853
881
|
} | undefined;
|
|
854
882
|
inputFiles?: {
|
|
855
883
|
useGenerated: boolean;
|
|
@@ -895,6 +923,7 @@ export declare const schemaProjectConfiguration: z.ZodObject<{
|
|
|
895
923
|
yosys?: {
|
|
896
924
|
options?: {
|
|
897
925
|
optimize?: boolean | undefined;
|
|
926
|
+
topLevelModule?: string | undefined;
|
|
898
927
|
} | undefined;
|
|
899
928
|
inputFiles?: {
|
|
900
929
|
useGenerated: boolean;
|
|
@@ -940,6 +969,7 @@ export declare const schemaProjectConfiguration: z.ZodObject<{
|
|
|
940
969
|
yosys?: {
|
|
941
970
|
options?: {
|
|
942
971
|
optimize?: boolean | undefined;
|
|
972
|
+
topLevelModule?: string | undefined;
|
|
943
973
|
} | undefined;
|
|
944
974
|
inputFiles?: {
|
|
945
975
|
useGenerated?: boolean | undefined;
|
|
@@ -985,6 +1015,7 @@ export declare const schemaProjectConfiguration: z.ZodObject<{
|
|
|
985
1015
|
yosys?: {
|
|
986
1016
|
options?: {
|
|
987
1017
|
optimize?: boolean | undefined;
|
|
1018
|
+
topLevelModule?: string | undefined;
|
|
988
1019
|
} | undefined;
|
|
989
1020
|
inputFiles?: {
|
|
990
1021
|
useGenerated?: boolean | undefined;
|
|
@@ -9,7 +9,7 @@ exports.DEFAULT_CONFIGURATION = {
|
|
|
9
9
|
name: 'ECP5 - LFE5U-12 - caBGA381',
|
|
10
10
|
vendor: 'lattice',
|
|
11
11
|
family: 'ecp5',
|
|
12
|
-
device: 'lfe5u-
|
|
12
|
+
device: 'lfe5u-25',
|
|
13
13
|
package: 'caBGA381'
|
|
14
14
|
}
|
|
15
15
|
]
|
|
@@ -30,7 +30,8 @@ const schemaWorkerTarget = zod_1.z.object({
|
|
|
30
30
|
outputFiles: schemaValueListTarget.optional()
|
|
31
31
|
});
|
|
32
32
|
const schemaYosysOptions = zod_1.z.object({
|
|
33
|
-
optimize: zod_1.z.boolean().optional()
|
|
33
|
+
optimize: zod_1.z.boolean().optional(),
|
|
34
|
+
topLevelModule: zod_1.z.string().optional()
|
|
34
35
|
});
|
|
35
36
|
const schemaYosys = zod_1.z.object({
|
|
36
37
|
commands: schemaValueList.optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../src/project/configuration.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAIT,QAAA,qBAAqB,GAAyB;IACvD,OAAO,EAAE;QACL;YACI,EAAE,EAAE,SAAS;YACb,IAAI,EAAE,4BAA4B;YAElC,MAAM,EAAE,SAAS;YACjB,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,UAAU;SACtB;KACJ;CACJ,CAAC;AAEF,MAAM,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7B,YAAY,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAClD,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CACrD,CAAC,CAAC;AACH,MAAM,qBAAqB,GAAG,eAAe,CAAC,MAAM,CAAC;IACjD,UAAU,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;CACnD,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1B,UAAU,EAAE,eAAe,CAAC,QAAQ,EAAE;IACtC,WAAW,EAAE,eAAe,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AACH,MAAM,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChC,UAAU,EAAE,qBAAqB,CAAC,QAAQ,EAAE;IAC5C,WAAW,EAAE,qBAAqB,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAEH,MAAM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;AAChE,MAAM,2BAA2B,GAAG,kBAAkB,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;AAElF,MAAM,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,KAAK,EAAE,mBAAmB,CAAC,QAAQ,EAAE;IACrC,OAAO,EAAE,qBAAqB,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1B,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAEhB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IAEnB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAEhC,KAAK,EAAE,yBAAyB,CAAC,QAAQ,EAAE;IAC3C,OAAO,EAAE,2BAA2B,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAEU,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IACzC,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,YAAY,CAAC;CACjC,CAAC,CAAC"}
|
|
@@ -57,6 +57,7 @@ export declare class Project {
|
|
|
57
57
|
yosys?: {
|
|
58
58
|
options?: {
|
|
59
59
|
optimize?: boolean | undefined;
|
|
60
|
+
topLevelModule?: string | undefined;
|
|
60
61
|
} | undefined;
|
|
61
62
|
inputFiles?: {
|
|
62
63
|
useGenerated: boolean;
|
|
@@ -102,6 +103,7 @@ export declare class Project {
|
|
|
102
103
|
yosys?: {
|
|
103
104
|
options?: {
|
|
104
105
|
optimize?: boolean | undefined;
|
|
106
|
+
topLevelModule?: string | undefined;
|
|
105
107
|
} | undefined;
|
|
106
108
|
inputFiles?: {
|
|
107
109
|
useGenerated: boolean;
|
package/dist/project/yosys.js
CHANGED
|
@@ -11,14 +11,38 @@ const target_js_1 = require("./target.js");
|
|
|
11
11
|
const DEFAULT_OPTIONS = {
|
|
12
12
|
optimize: true
|
|
13
13
|
};
|
|
14
|
+
const getFileIngestCommands = (inputFiles, options) => {
|
|
15
|
+
const commands = [];
|
|
16
|
+
// Load vhdl files
|
|
17
|
+
const vhdlFiles = inputFiles.filter((file) => util_js_1.FILE_EXTENSIONS_VHDL.includes(path_1.default.extname(file).substring(1)));
|
|
18
|
+
if (vhdlFiles.length) {
|
|
19
|
+
if (!options.topLevelModule) {
|
|
20
|
+
throw new Error('Top level module must be defined when synthesizing VHDL');
|
|
21
|
+
}
|
|
22
|
+
commands.push('plugin -i ghdl', `ghdl ${vhdlFiles.join(' ')} -e ${options.topLevelModule}`);
|
|
23
|
+
}
|
|
24
|
+
// Load verilog files
|
|
25
|
+
const verilogFiles = inputFiles.filter((file) => util_js_1.FILE_EXTENSIONS_VERILOG.includes(path_1.default.extname(file).substring(1)));
|
|
26
|
+
if (verilogFiles.length) {
|
|
27
|
+
commands.push(...verilogFiles.map((file) => `read_verilog -sv "${file}"`));
|
|
28
|
+
}
|
|
29
|
+
// (auto-)set top-level module
|
|
30
|
+
if (options.topLevelModule) {
|
|
31
|
+
commands.push(`hierarchy -top ${options.topLevelModule}`);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
commands.push('hierarchy -auto-top');
|
|
35
|
+
}
|
|
36
|
+
return commands;
|
|
37
|
+
};
|
|
14
38
|
const getSynthCommands = (arch, outFile) => {
|
|
15
39
|
const commands = [];
|
|
16
40
|
if (arch === 'generic') {
|
|
17
41
|
commands.push('synth;');
|
|
18
|
-
commands.push(`write_json ${outFile};`);
|
|
42
|
+
commands.push(`write_json "${outFile}";`);
|
|
19
43
|
}
|
|
20
44
|
else {
|
|
21
|
-
commands.push(`synth_${arch} -json ${outFile};`);
|
|
45
|
+
commands.push(`synth_${arch} -json "${outFile}";`);
|
|
22
46
|
}
|
|
23
47
|
return commands;
|
|
24
48
|
};
|
|
@@ -37,7 +61,7 @@ const generateYosysWorkerOptions = (configuration, projectInputFiles, targetId)
|
|
|
37
61
|
(0, target_js_1.getTargetFile)(target, 'luts.yosys.json')
|
|
38
62
|
];
|
|
39
63
|
const tool = 'yosys';
|
|
40
|
-
const commands = [...inputFiles
|
|
64
|
+
const commands = [...getFileIngestCommands(inputFiles, options), 'proc;'];
|
|
41
65
|
if (options.optimize) {
|
|
42
66
|
commands.push('opt;');
|
|
43
67
|
}
|
|
@@ -71,29 +95,26 @@ const getYosysWorkerOptions = (project, targetId) => {
|
|
|
71
95
|
};
|
|
72
96
|
exports.getYosysWorkerOptions = getYosysWorkerOptions;
|
|
73
97
|
const generateYosysRTLCommands = (workerOptions) => {
|
|
74
|
-
const verilogFiles = workerOptions.inputFiles.filter((file) => util_js_1.FILE_EXTENSIONS_VERILOG.includes(path_1.default.extname(file).substring(1)));
|
|
75
98
|
// Yosys commands taken from yosys2digitaljs (https://github.com/tilk/yosys2digitaljs/blob/1b4afeae61/src/index.js#L1225)
|
|
76
99
|
return [
|
|
77
|
-
...
|
|
78
|
-
'hierarchy -auto-top;',
|
|
100
|
+
...getFileIngestCommands(workerOptions.inputFiles, workerOptions.options),
|
|
79
101
|
'proc;',
|
|
80
102
|
'opt;',
|
|
81
103
|
'memory -nomap;',
|
|
82
104
|
'wreduce -memx;',
|
|
83
105
|
'opt -full;',
|
|
84
106
|
`tee -q -o ${(0, target_js_1.getTargetFile)(workerOptions.target, 'stats.yosys.json')} stat -json -width *;`,
|
|
85
|
-
`write_json ${(0, target_js_1.getTargetFile)(workerOptions.target, 'rtl.yosys.json')};`,
|
|
107
|
+
`write_json "${(0, target_js_1.getTargetFile)(workerOptions.target, 'rtl.yosys.json')}";`,
|
|
86
108
|
''
|
|
87
109
|
];
|
|
88
110
|
};
|
|
89
111
|
exports.generateYosysRTLCommands = generateYosysRTLCommands;
|
|
90
112
|
const generateYosysSynthPrepareCommands = (workerOptions) => {
|
|
91
|
-
const verilogFiles = workerOptions.inputFiles.filter((file) => util_js_1.FILE_EXTENSIONS_VERILOG.includes(path_1.default.extname(file).substring(1)));
|
|
92
113
|
return [
|
|
93
|
-
...
|
|
114
|
+
...getFileIngestCommands(workerOptions.inputFiles, workerOptions.options),
|
|
94
115
|
'proc;',
|
|
95
116
|
'opt;',
|
|
96
|
-
`write_json ${(0, target_js_1.getTargetFile)(workerOptions.target, 'presynth.yosys.json')};`,
|
|
117
|
+
`write_json "${(0, target_js_1.getTargetFile)(workerOptions.target, 'presynth.yosys.json')}";`,
|
|
97
118
|
''
|
|
98
119
|
];
|
|
99
120
|
};
|
|
@@ -103,14 +124,14 @@ const generateYosysSynthCommands = (workerOptions) => {
|
|
|
103
124
|
const vendor = devices_js_1.VENDORS[target.vendor];
|
|
104
125
|
const family = vendor.families[target.family];
|
|
105
126
|
return [
|
|
106
|
-
`read_json ${(0, target_js_1.getTargetFile)(workerOptions.target, 'presynth.yosys.json')}`,
|
|
127
|
+
`read_json "${(0, target_js_1.getTargetFile)(workerOptions.target, 'presynth.yosys.json')}"`,
|
|
107
128
|
...getSynthCommands(family.architecture, workerOptions.outputFiles[0]),
|
|
108
129
|
'',
|
|
109
130
|
'design -reset',
|
|
110
131
|
'',
|
|
111
|
-
`read_json ${(0, target_js_1.getTargetFile)(workerOptions.target, 'presynth.yosys.json')};`,
|
|
132
|
+
`read_json "${(0, target_js_1.getTargetFile)(workerOptions.target, 'presynth.yosys.json')}";`,
|
|
112
133
|
'synth -lut 4;',
|
|
113
|
-
`write_json ${workerOptions.outputFiles[1]};`,
|
|
134
|
+
`write_json "${workerOptions.outputFiles[1]}";`,
|
|
114
135
|
''
|
|
115
136
|
];
|
|
116
137
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yosys.js","sourceRoot":"","sources":["../../src/project/yosys.ts"],"names":[],"mappings":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,wBAAwB,4BAcnC;AAEK,MAAM,iCAAiC,GAAG,CAAC,aAAiC,EAAY,EAAE;IAC7F,OAAO;QACH,GAAG,qBAAqB,CAAC,aAAa,CAAC,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC;QACzE,OAAO;QACP,MAAM;QACN,eAAe,IAAA,yBAAa,EAAC,aAAa,CAAC,MAAM,EAAE,qBAAqB,CAAC,IAAI;QAC7E,EAAE;KACL,CAAC;AACN,CAAC,CAAC;AARW,QAAA,iCAAiC,qCAQ5C;AAEK,MAAM,0BAA0B,GAAG,CAAC,aAAiC,EAAY,EAAE;IACtF,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;IACpC,MAAM,MAAM,GAAG,oBAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAE9C,OAAO;QACH,cAAc,IAAA,yBAAa,EAAC,aAAa,CAAC,MAAM,EAAE,qBAAqB,CAAC,GAAG;QAC3E,GAAG,gBAAgB,CAAC,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACtE,EAAE;QACF,eAAe;QACf,EAAE;QACF,cAAc,IAAA,yBAAa,EAAC,aAAa,CAAC,MAAM,EAAE,qBAAqB,CAAC,IAAI;QAC5E,eAAe;QACf,eAAe,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI;QAC/C,EAAE;KACL,CAAC;AACN,CAAC,CAAC;AAhBW,QAAA,0BAA0B,8BAgBrC"}
|
package/dist/util.js
CHANGED
|
@@ -12,7 +12,7 @@ exports.decodeText = decodeText;
|
|
|
12
12
|
const decodeJSON = (input) => JSON.parse((0, exports.decodeText)(input));
|
|
13
13
|
exports.decodeJSON = decodeJSON;
|
|
14
14
|
exports.FILE_EXTENSIONS_VERILOG = ['v', 'vh', 'sv', 'svh'];
|
|
15
|
-
exports.FILE_EXTENSIONS_VHDL = ['vhd'];
|
|
15
|
+
exports.FILE_EXTENSIONS_VHDL = ['vhd', 'vhdl'];
|
|
16
16
|
exports.FILE_EXTENSIONS_HDL = [...exports.FILE_EXTENSIONS_VERILOG, ...exports.FILE_EXTENSIONS_VHDL];
|
|
17
17
|
const formatArguments = (args) => args.reduce((prev, arg) => arg.startsWith('--')
|
|
18
18
|
? [...prev, arg]
|
package/dist/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;AAIA,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;AACtC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;AAE/B,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC;AAAhG,QAAA,UAAU,cAAsF;AACtG,MAAM,UAAU,GAAG,CAAC,KAAc,EAAE,MAAM,GAAG,KAAK,EAAE,EAAE,CACzD,IAAA,kBAAU,EAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AAD5D,QAAA,UAAU,cACkD;AAElE,MAAM,UAAU,GAAG,CAAC,KAA2C,EAAU,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAAhG,QAAA,UAAU,cAAsF;AACtG,MAAM,UAAU,GAAG,CAAC,KAA2C,EAAW,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAA,kBAAU,EAAC,KAAK,CAAC,CAAC,CAAC;AAArG,QAAA,UAAU,cAA2F;AAErG,QAAA,uBAAuB,GAAG,CAAC,GAAG,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MAAM,eAAe,GAAG,CAAC,IAAc,EAAE,EAAE,CAC9C,IAAI,CAAC,MAAM,CACP,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CACV,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;IAChB,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC;IAChB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,EAChF,EAAc,CACjB,CAAC;AAPO,QAAA,eAAe,mBAOtB"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "edacation",
|
|
3
3
|
"description": "Library and CLI for interacting with Yosys and nextpnr.",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.11",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Danielle Huisman <danielle@huisman.me> (https://github.com/DanielleHuisman)",
|
|
8
8
|
"Mike Almeloo <git@mikealmel.ooo> (https://github.com/DismissedGuy)"
|