From 33e80b96c7aac6b93e6bee18572abf529f8cc1fa Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Mon, 16 Feb 2015 12:41:48 +0100 Subject: Added YosysJS wrapper --- misc/yosys.html | 237 ----------------------------------------------- misc/yosysjs/demo01.html | 237 +++++++++++++++++++++++++++++++++++++++++++++++ misc/yosysjs/demo02.html | 102 ++++++++++++++++++++ misc/yosysjs/yosysjs.js | 159 +++++++++++++++++++++++++++++++ 4 files changed, 498 insertions(+), 237 deletions(-) delete mode 100644 misc/yosys.html create mode 100644 misc/yosysjs/demo01.html create mode 100644 misc/yosysjs/demo02.html create mode 100644 misc/yosysjs/yosysjs.js (limited to 'misc') diff --git a/misc/yosys.html b/misc/yosys.html deleted file mode 100644 index 264a58f96..000000000 --- a/misc/yosys.html +++ /dev/null @@ -1,237 +0,0 @@ - - yosys.js example application - -

yosys.js example application

-
[ load example ]
- - -
-

Loading...
- - - - diff --git a/misc/yosysjs/demo01.html b/misc/yosysjs/demo01.html new file mode 100644 index 000000000..e0ba0248f --- /dev/null +++ b/misc/yosysjs/demo01.html @@ -0,0 +1,237 @@ + + YosysJS Example Application #01 + +

YosysJS Example Application #01

+
[ load example ]
+ + +
+

Loading...
+ + + + diff --git a/misc/yosysjs/demo02.html b/misc/yosysjs/demo02.html new file mode 100644 index 000000000..ec33198c7 --- /dev/null +++ b/misc/yosysjs/demo02.html @@ -0,0 +1,102 @@ + + YosysJS Example Application #02 + + + +

YosysJS Example Application #02

+

+

+ + + +

+ + + + diff --git a/misc/yosysjs/yosysjs.js b/misc/yosysjs/yosysjs.js new file mode 100644 index 000000000..ad6df348b --- /dev/null +++ b/misc/yosysjs/yosysjs.js @@ -0,0 +1,159 @@ +var YosysJS = new function() { + this.script_element = document.currentScript; + this.viz_element = undefined; + + this.url_prefix = this.script_element.src.replace(/[^/]+$/, '') + + this.load_viz = function() { + if (this.viz_element) + return; + + this.viz_element = document.createElement('iframe') + this.viz_element.style.display = 'none' + document.body.appendChild(this.viz_element); + + this.viz_element.contentWindow.document.open() + this.viz_element.contentWindow.document.write('