Wednesday, May 22, 2013

To Introduce JRuby

In parallel with processor designing for DE0-Nano, I am developing environments related to JRuby.  JRuby is a Ruby environment workable on a Java virtual machine and can be so easily implemented just through a Jar file.  The language Ruby has a high degree of flexibility and enables structuring another language (domain-specific language) on itself.  Designing processor circuits requires the use of such hardware description languages as VHDL and Verilog HDL for logic synthesis.  But it’s a hard work to write down a large-scale circuit for multiprocessor directly without CAD.  Therefore, here I employ a method of automatically generating a VHDL code based on higher-level descriptions written by Ruby.  I am also planning to build compilers based on Ruby.

Having a call facility to DLL in the Windows environment, JRuby enables access to JTAG itself instead of JNA.  And so, here I am offering a JTAG demo program (jtag_demo.jar) based on JRuby.  As the Jar file of JRuby (jruby-complete.jar) is pretty large, the demo program does not include it but is to invoke automatic downloading the latest version through the internet.


Put the downloaded file (jruby-complete.jar) in the same folder of the demo program (jtag_demo.jar) or the Java extensions folder (jre/lib/ext), and next time on it will be workable without downloading.  This way facilitates distributing circuit data and configuration programs in a very compact file alone.  You can refer to the Java and Ruby source codes (to be precise, executable scripts of Ruby) included in the Jar file to use a similar mechanism.