diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-06-30 01:49:55 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-06-30 01:49:55 +0200 |
commit | 7987f232003ea30ac9200e4ba0f5d14eae69505c (patch) | |
tree | c4ac0ce41c01f0137fda827e6e7d6b0ae2008eaf /misc/yosysjs/demo02.html | |
parent | 77e89399a659e5c16e5cd6a8040e38e811e7192d (diff) | |
parent | 358e41591891fc74045860b0c3364cb155726b30 (diff) | |
download | yosys-7987f232003ea30ac9200e4ba0f5d14eae69505c.tar.gz yosys-7987f232003ea30ac9200e4ba0f5d14eae69505c.tar.bz2 yosys-7987f232003ea30ac9200e4ba0f5d14eae69505c.zip |
Merge branch 'master' of github.com:cliffordwolf/yosys
Diffstat (limited to 'misc/yosysjs/demo02.html')
-rw-r--r-- | misc/yosysjs/demo02.html | 57 |
1 files changed, 25 insertions, 32 deletions
diff --git a/misc/yosysjs/demo02.html b/misc/yosysjs/demo02.html index d36e223c9..a6c4eb96b 100644 --- a/misc/yosysjs/demo02.html +++ b/misc/yosysjs/demo02.html @@ -7,7 +7,6 @@ padding:15px; text-align:center;"><span id="popupmsg">Loading...</span></div> </div> <h1>YosysJS Example Application #02</h1> - <iframe id="ys" style="width: 800px; height: 100px;"></iframe><p/> <textarea id="code" style="width: 800px; height: 300px;"> // borrowed with some modifications from // http://www.ee.ed.ac.uk/~gerard/Teach/Verilog/manual/Example/lrgeEx2/cooley.html @@ -56,47 +55,41 @@ endmodule document.getElementById('popupmsg').textContent = 'Please wait..'; } function synth1() { - function work() { - ys.write_file("input.v", document.getElementById('code').value); - ys.run('design -reset; read_verilog input.v; show -stretch'); - YosysJS.dot_into_svg(ys.read_file('show.dot'), 'svg'); - document.getElementById('popup').style.visibility = 'hidden'; - } document.getElementById('popup').style.visibility = 'visible'; - window.setTimeout(work, 100); + ys.write_file("input.v", document.getElementById('code').value); + ys.run('design -reset; read_verilog input.v; show -stretch'); + ys.read_file('show.dot', (function(text){ + YosysJS.dot_into_svg(text, 'svg'); + document.getElementById('popup').style.visibility = 'hidden'; + })); } function synth2() { - function work() { - ys.write_file("input.v", document.getElementById('code').value); - ys.run('design -reset; read_verilog input.v; proc; opt_clean; show -stretch'); - YosysJS.dot_into_svg(ys.read_file('show.dot'), 'svg'); - document.getElementById('popup').style.visibility = 'hidden'; - } document.getElementById('popup').style.visibility = 'visible'; - window.setTimeout(work, 100); + ys.write_file("input.v", document.getElementById('code').value); + ys.run('design -reset; read_verilog input.v; proc; opt_clean; show -stretch'); + ys.read_file('show.dot', (function(text){ + YosysJS.dot_into_svg(text, 'svg'); + document.getElementById('popup').style.visibility = 'hidden'; + })); } function synth3() { - function work() { - ys.write_file("input.v", document.getElementById('code').value); - ys.run('design -reset; read_verilog input.v; synth -run coarse; show -stretch'); - YosysJS.dot_into_svg(ys.read_file('show.dot'), 'svg'); - document.getElementById('popup').style.visibility = 'hidden'; - } document.getElementById('popup').style.visibility = 'visible'; - window.setTimeout(work, 100); + ys.write_file("input.v", document.getElementById('code').value); + ys.run('design -reset; read_verilog input.v; synth -run coarse; show -stretch'); + ys.read_file('show.dot', (function(text){ + YosysJS.dot_into_svg(text, 'svg'); + document.getElementById('popup').style.visibility = 'hidden'; + })); } function synth4() { - function work() { - ys.write_file("input.v", document.getElementById('code').value); - ys.run('design -reset; read_verilog input.v; synth -run coarse; synth -run fine; show -stretch'); - YosysJS.dot_into_svg(ys.read_file('show.dot'), 'svg'); - document.getElementById('popup').style.visibility = 'hidden'; - } document.getElementById('popup').style.visibility = 'visible'; - window.setTimeout(work, 100); + ys.write_file("input.v", document.getElementById('code').value); + ys.run('design -reset; read_verilog input.v; synth -run coarse; synth -run fine; show -stretch'); + ys.read_file('show.dot', (function(text){ + YosysJS.dot_into_svg(text, 'svg'); + document.getElementById('popup').style.visibility = 'hidden'; + })); } - var ys = YosysJS.create('ys', on_ys_ready); - ys.verbose = true; - ys.echo = true; + var ys = YosysJS.create_worker(on_ys_ready); </script> </body></html> |