yosys2digitaljs 0.7.0 → 0.9.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/dist/index.d.ts CHANGED
@@ -1,152 +1,20 @@
1
1
  #!/usr/bin/env node
2
- declare namespace Digitaljs {
3
- type FilePosition = {
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
- type BitChar = '0' | '1' | 'x';
58
- type Bit = number | '0' | '1' | 'x';
59
- type BitVector = Bit[];
60
- type Port = {
61
- direction: 'input' | 'output' | 'inout';
62
- bits: any;
63
- };
64
- type Parameters = {
65
- WIDTH?: JsonConstant;
66
- A_WIDTH?: JsonConstant;
67
- B_WIDTH?: JsonConstant;
68
- S_WIDTH?: JsonConstant;
69
- Y_WIDTH?: JsonConstant;
70
- A_SIGNED?: JsonConstant;
71
- B_SIGNED?: JsonConstant;
72
- CLK_POLARITY?: JsonConstant;
73
- EN_POLARITY?: JsonConstant;
74
- ARST_POLARITY?: JsonConstant;
75
- ARST_VALUE: JsonConstant;
76
- CTRL_IN_WIDTH?: JsonConstant;
77
- CTRL_OUT_WIDTH?: JsonConstant;
78
- TRANS_NUM?: JsonConstant;
79
- STATE_NUM?: JsonConstant;
80
- STATE_NUM_LOG2?: JsonConstant;
81
- STATE_RST?: JsonConstant;
82
- RD_PORTS?: JsonConstant;
83
- WR_PORTS?: JsonConstant;
84
- RD_CLK_POLARITY?: JsonConstant;
85
- RD_CLK_ENABLE?: JsonConstant;
86
- RD_CLK_TRANSPARENT?: JsonConstant;
87
- WR_CLK_POLARITY?: JsonConstant;
88
- WR_CLK_ENABLE?: JsonConstant;
89
- [key: string]: any;
90
- };
91
- type JsonConstant = number | string;
92
- type Attributes = {
93
- init: JsonConstant;
94
- [key: string]: any;
95
- };
96
- type Cell = {
97
- hide_name: 0 | 1;
98
- type: string;
99
- parameters: Parameters;
100
- attributes: Attributes;
101
- port_directions: {
102
- [key: string]: 'input' | 'output';
103
- };
104
- connections: {
105
- [key: string]: BitVector;
106
- };
107
- };
108
- type Net = {
109
- hide_name: 0 | 1;
110
- bits: BitVector;
111
- attributes: {
112
- [key: string]: string;
113
- };
114
- };
115
- type Module = {
116
- ports: {
117
- [key: string]: Port;
118
- };
119
- cells: {
120
- [key: string]: Cell;
121
- };
122
- netnames: {
123
- [key: string]: Net;
124
- };
125
- };
126
- type Output = {
127
- modules: {
128
- [key: string]: Module;
129
- };
130
- };
131
- }
132
- declare type ConvertOptions = {
133
- propagation?: number;
134
- };
135
- declare type Options = ConvertOptions & {
2
+ import { ConvertOptions, Digitaljs } from './core';
3
+ type Options = ConvertOptions & {
136
4
  optimize?: boolean;
137
5
  fsmexpand?: boolean;
138
6
  fsm?: boolean | "nomap";
139
7
  timeout?: number;
140
8
  lint?: boolean;
141
9
  };
142
- declare type Output = {
10
+ type Output = {
143
11
  output?: Digitaljs.TopModule;
144
12
  yosys_output?: any;
145
13
  yosys_stdout: string;
146
14
  yosys_stderr: string;
147
15
  lint?: LintMessage[];
148
16
  };
149
- declare type LintMessage = {
17
+ type LintMessage = {
150
18
  type: string;
151
19
  file: string;
152
20
  line: number;
@@ -154,9 +22,7 @@ declare type LintMessage = {
154
22
  message: string;
155
23
  };
156
24
  export declare function verilator_lint(filenames: string[], dirname?: string, options?: Options): Promise<LintMessage[]>;
157
- export declare function yosys2digitaljs(obj: Yosys.Output, options?: ConvertOptions): Digitaljs.TopModule;
158
25
  export declare function process(filenames: string[], dirname?: string, options?: Options): Promise<Output>;
159
- export declare function io_ui(output: Digitaljs.Module): void;
160
26
  export declare function process_files(data: {
161
27
  [key: string]: string;
162
28
  }, options?: Options): Promise<Output>;