Skip to content

Commit bc19f2d

Browse files
committed
Merge branch 'master' of https://github.com/nturley/netlistsvg
2 parents d01f6f3 + c8f2525 commit bc19f2d

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ You can see an online demo [here](https://nturley.github.io/netlistsvg)
1111

1212
# Installation/Usage Instructions
1313

14+
## Command Line Interface
1415
Install nodejs if isn't already installed
1516
```
1617
npm install -g netlistsvg
@@ -24,6 +25,40 @@ The default value for the output file is out.svg.
2425

2526
Should work on Linux, OSX, and Windows. Running the build scripts (makefiles and the web demo) is easiest on Linux and OSX.
2627

28+
## Web bundle
29+
30+
I have a web bundle hosted on github pages here: https://nturley.github.io/netlistsvg/built/netlistsvg.bundle.js
31+
It doesn't wrap ELKjs, so you'll need to include it separately. ELK creates a global variable, so you'll need to include ELKjs before netlistsvg.
32+
33+
In HTML it would look something like this
34+
```html
35+
<script type="text/javascript" src="https://nturley.github.io/netlistsvg/elk.bundled.js"></script>
36+
<script type="text/javascript" src="https://nturley.github.io/netlistsvg/built/netlistsvg.bundle.js"></script>
37+
```
38+
39+
On ObservableHQ, you can require it like this.
40+
41+
```javascript
42+
netlistsvg = {
43+
var ELK = await require('https://nturley.github.io/netlistsvg/elk.bundled.js')
44+
window.ELK = ELK
45+
return require('https://nturley.github.io/netlistsvg/built/netlistsvg.bundle.js')
46+
}
47+
```
48+
49+
You may want to download and host your own copy.
50+
51+
The web bundle includes both the analog and digital skin and an example netlist for each. Using a promise would look like this.
52+
```javascript
53+
await netlistsvg.render(netlistsvg.digitalSkin, netlistsvg.exampleDigital);
54+
```
55+
Or to log the result to console using the callback API:
56+
```javascript
57+
netlistsvg.render(netlistsvg.digitalSkin, netlistsvg.exampleDigital, (err, result) => console.log(result));
58+
```
59+
60+
To turn Verilog into YosysJSON in the browser, you can use [YosysJS](http://www.clifford.at/yosys/yosysjs.html)
61+
2762
# Examples
2863

2964
Here's an digital netlist produced by Yosys along with the diagram that netlistsvg created from it.

0 commit comments

Comments
 (0)