Skip to content

Commit eafa8c5

Browse files
committed
Do auto orientation for capacitors
1 parent 3428012 commit eafa8c5

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

examples/analog/common_emitter_full.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"A": "input",
1616
"B": "output"
1717
},
18-
"type": "c_v"
18+
"type": "c"
1919
},
2020
"C2": {
2121
"connections": {
@@ -30,7 +30,7 @@
3030
"A": "input",
3131
"B": "output"
3232
},
33-
"type": "c_h"
33+
"type": "c"
3434
},
3535
"Q": {
3636
"connections": {
@@ -64,7 +64,7 @@
6464
"A": "input",
6565
"B": "output"
6666
},
67-
"type": "r_v"
67+
"type": "r"
6868
},
6969
"R2": {
7070
"connections": {
@@ -79,7 +79,7 @@
7979
"A": "input",
8080
"B": "output"
8181
},
82-
"type": "r_v"
82+
"type": "r"
8383
},
8484
"R3": {
8585
"connections": {
@@ -94,7 +94,7 @@
9494
"A": "input",
9595
"B": "output"
9696
},
97-
"type": "r_v"
97+
"type": "r"
9898
},
9999
"R4": {
100100
"connections": {
@@ -109,7 +109,7 @@
109109
"A": "input",
110110
"B": "output"
111111
},
112-
"type": "r_v"
112+
"type": "r"
113113
},
114114
"gnd83": {
115115
"connections": {

examples/analog/mcu.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
"ports": {},
55
"cells": {
66
"r1": {
7-
"type": "r_h",
7+
"type": "r",
88
"port_directions": {
9-
"A": "output",
10-
"B": "input"
9+
"A": "input",
10+
"B": "output"
1111
},
1212
"connections": {
13-
"A": [ 3 ],
14-
"B": [ 2 ]
13+
"A": [ 2 ],
14+
"B": [ 3 ]
1515
}
1616
},
1717
"c1": {
18-
"type": "c_v",
18+
"type": "c",
1919
"port_directions": {
2020
"A": "input",
2121
"B": "output"
@@ -26,7 +26,7 @@
2626
}
2727
},
2828
"r3": {
29-
"type": "r_h",
29+
"type": "r",
3030
"port_directions": {
3131
"A": "input",
3232
"B": "output"

lib/analog.svg

Lines changed: 1 addition & 0 deletions
Loading

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function render(skin_data, yosys_netlist, done) {
2727

2828
var module = getReformattedModule(yosys_netlist.modules[module_name], skin);
2929

30-
const components = module.nodes.filter(n => n.type === 'r').map(n => n.key)
30+
const components = module.nodes.filter(n => n.type === 'r' || n.type === 'c').map(n => n.key)
3131

3232
const verticalNodeCombinations = [[]].concat(combinations(components))
3333

@@ -36,7 +36,7 @@ function render(skin_data, yosys_netlist, done) {
3636
const m = JSON.parse(JSON.stringify(module))
3737

3838
for (const n of m.nodes) {
39-
if (n.type === 'r') {
39+
if (n.type === 'r' || n.type === 'c') {
4040
if (verticals.includes(n.key)) {
4141
n.type += '_v'
4242
} else {

0 commit comments

Comments
 (0)