DE0-Nano/JavaRock
[
Front page
] [
New
|
List of pages
|
Search
|
Recent changes
]
Start:
[[labs.beatcraft.com]]~
[[DE0-Nano]]~
#contents
* DE0-Nano/JavaRock [#l506a151]
>
This article explains how to install JavaRock and exe...
~
This article is organized as it is followed:
>
- About Host Machine~
This section shows the set up. It uses a virtual machine ...
~
- Configuring Ubuntu and Editing Files~
This section explains how to install the development tool...
~
- Writing to DE0-Nano~
It shows how to transfer the program from Ubuntu to DE0-N...
~
* About Host Machine [#y0ca2362]
>
These are details of the host machine.~
~
OS:~
- Host OS: Windows 7 (64bit version, hereafter ?Windows?)~
- Guest OS: Ubuntu 12.04 LTS (32bit version, hereafter ?U...
>
Applications:~
- VMware Player (Windows, 64bit version)~
- DE0-Nano System Builder (Windows)~
- Quartus II 12.0sp1 (Ubuntu, hereafter ?Quartus?)~
~
Create Ubuntu image on [[VMware Player>https://my.vmware....
~
[[DE0-Nano System Builder>http://www.terasic.com.tw/cgi-b...
~
[[Quartus>http://www.altera.com/products/software/quartus...
~
Quartus is installed on Ubuntu. 12.0sp1 version of Quartu...
* Configuring Ubuntu and Editing Files [#e19a1fb1]
>
This part explains how to set up the guest OS of Ubuntu.
** Installing the development tool [#f03c31c3]
>
Install the development tool and OpenJDK. The former is u...
$ sudo apt-get install build-essential
$ sudo apt-get install openjdk-7-jdk
** Adding udev rules [#gabc49e0]
>
To make Ubuntu recognize the USB-Blaster, add the rule fi...
~
After adding the rule file of USB-Blaster, please reboot ...
$ sudo vi /etc/udev/rules.d/51-usbblaster.rules
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idV...
ATTRS{idProduct}=="6001", MODE="0666", SYMLINK+="usbbla...
~
$ sudo udevadm control --reload-rules
** Constitution of working directory [#o2c67801]
>
The diagram shown below shows the organization of working...
>
${HOME}
|-- altera/ <- The install direct...
|
`-- JavaRock
|- javarock_20130708.jar <- The execution file...
`- samples/ <- Extraction directo...
|
<snip>
|
|-- de0-nano/ <- Added working dire...
| |- model/ <- The directory for ...
| | |- test.qpf
| | `- test.qsf
| |
| |- test.java
| `- test.sh
<snip>
|
`-- led/
|- counter.java
`- led.java
** Configuring environment variables [#je46cb58]
To increase boot speed of Quartus, PATH of Quartus is add...
<Code>
** About the files of newly added directories [#o590e701]
>
The files added for this article are shown below.~
- de0-nano/model/test.qpf: This a project file, which DE0...
~
- de0-nano/model/test.qsf: This is a qsf (pin-assignment ...
~
- de0-nano/test.sh, test.java: samples/test/test.sh, test...
*** About editing test.sh and test.java [#fd7f0502]
>
test.sh and test.java are edited as they are shown below....
~
- test.sh
$ diff -upN samples_orig/test/test.sh samples/de0-nano/t...
--- samples_orig/test/test.sh 2013-07-08 07:25:19.0000...
+++ samples/de0-nano/test.sh 2014-05-20 18:30:01.5160...
@@ -1,5 +1,3 @@
-java -cp $JAVAROCK:../led:../sc1602:../echo:. openjdk.c...
+java -cp $JAVAROCK:../led:. openjdk.com.sun.tools.javac...
../led/counter.java ../led/led.java \
- ../sc1602/SC1602Wrapper.java ../sc1602/SC1602Writer.j...
- ../echo/echo.java ./rs232c.java \
test.java
~
- test.java~
$ diff -upN samples_orig/test/test.java samples/de0-nano...
--- samples_orig/test/test.java 2013-07-08 07:25:19.0000...
+++ samples/de0-nano/test.java 2014-05-20 17:38:47.5280...
@@ -3,8 +3,8 @@ import net.wasamon.javarock.rt.*;
@javarockhdl
public class test{
led obj0 = new led();
- echo obj1 = new echo();
- sc1602_test obj2 = new sc1602_test();
+ //echo obj1 = new echo();
+ //sc1602_test obj2 = new sc1602_test();
//VGAJavaTest vga = new VGAJavaTest();
@combination
@@ -15,8 +15,8 @@ public class test{
@auto
public void main(){
obj0.start();
- obj1.start();
- obj2.start();
+ //obj1.start();
+ //obj2.start();
//vga.start();
}
}
*** Executing test.sh [#m7cb8ed6]
>
After the modification of test.sh and test.java are compl...
$ ./test.sh
Compile: counter
Compile: led
Compile: test
pass: connection
pass: bypass
pass: optimization
pass: linkage
pass: generate
$ ls
counter.vhd led.vhd model test.class test.java test...
*** About test.qpf and test.qsf [#e0abcbe7]
>
For the details of test.qpf and test.qsf, please download...
~
test.qsf is modified to match the variables in a part of ...
~
Also the generated vhd files (test.vhd, led.vhd, and coun...
~
#ref(test.qpf);~
#ref(test.qsf);~
~
- test.vhd (for reference)~
entity test is -- net.wasamon.javarock.model.vhdl.VHDLMo...
port (
notify_method_busy : OUT std_logic;
output_port_led : OUT std_logic;
notify_method_request : IN std_logic;
reset : IN std_logic;
clk : IN std_logic
); -- net.wasamon.javarock.model.vhdl.VHDLModule@33117...
~
- model/testqsf~
#======================================================...
# CLOCK
#======================================================...
-set_location_assignment PIN_R8 -to CLOCK_50
-set_instance_assignment -name IO_STANDARD "3.3-V LVTTL"...
+set_location_assignment PIN_R8 -to clk
+set_instance_assignment -name IO_STANDARD "3.3-V LVTTL"...
#======================================================...
# LED
#======================================================...
-set_location_assignment PIN_A15 -to LED[0]
-set_instance_assignment -name IO_STANDARD "3.3-V LVTTL"...
+set_location_assignment PIN_A15 -to output_port_led
+set_instance_assignment -name IO_STANDARD "3.3-V LVTTL"...
#======================================================...
# End of pin assignments by Terasic System Builder
#======================================================...
+set_location_assignment PIN_A11 -to reset
+set_instance_assignment -name IO_STANDARD 2.5V -to reset
+set_global_assignment -name VHDL_FILE ../led.vhd
+set_global_assignment -name VHDL_FILE ../counter.vhd
+set_global_assignment -name VHDL_FILE ../test.vhd
+set_global_assignment -name PARTITION_NETLIST_TYPE SOUR...
+set_global_assignment -name PARTITION_FITTER_PRESERVATI...
+set_global_assignment -name PARTITION_COLOR 16764057 -s...
+
+set_global_assignment -name STRATIX_DEVICE_IO_STANDARD ...
+
+
+
+set_instance_assignment -name PARTITION_HIERARCHY root_...
* Writing to DE0-Nano [#uaa3f83c]
>
Steps to write the generated files to DE0-Nano are shown ...
~
1. Start up Quartus~
Quartus is needed for writing the generated project file,...
$ quartus
#ref(quartus01.png,,60%); ~
~
2. Read the project file~
Read test.qpf (a project file) from Open Project.~
#ref(quartus02.png,,60%); ~
~
3. Compile the Project~
Click ?Start Complication? that is located at ?Processing...
~
4. Check the pin-assignments~
Click ?Pin Planner? that is the part of ?Assignments? of ...
~
The configuration (allocation) of pins for this article i...
#ref(quartus04.png,,60%); ~
~
5. Start up Programmer~
Click ?Programmer? that is categorized as the part of ?To...
~
If the pop-up window indicates ?NO Hardware,? click ?Hard...
~
Caution: If USB-Blaster DOES NOT appear at the selection,...
~
#ref(quartus07.png,,60%); ~
~
6. Transfer the image to DE0-Nano~
Click ?Start? that is located inside ?Programmer?. The ge...
~
Please check the ?Progress? reaches at 100% (Successful)....
~
#ref(quartus06.png,,60%); ~
~
#ref(javarock.jpg,,20%); ~
~
* Revision History [#m2da94a6]
>
-2014/12/25 This article is initially uploaded
End:
[[labs.beatcraft.com]]~
[[DE0-Nano]]~
#contents
* DE0-Nano/JavaRock [#l506a151]
>
This article explains how to install JavaRock and exe...
~
This article is organized as it is followed:
>
- About Host Machine~
This section shows the set up. It uses a virtual machine ...
~
- Configuring Ubuntu and Editing Files~
This section explains how to install the development tool...
~
- Writing to DE0-Nano~
It shows how to transfer the program from Ubuntu to DE0-N...
~
* About Host Machine [#y0ca2362]
>
These are details of the host machine.~
~
OS:~
- Host OS: Windows 7 (64bit version, hereafter ?Windows?)~
- Guest OS: Ubuntu 12.04 LTS (32bit version, hereafter ?U...
>
Applications:~
- VMware Player (Windows, 64bit version)~
- DE0-Nano System Builder (Windows)~
- Quartus II 12.0sp1 (Ubuntu, hereafter ?Quartus?)~
~
Create Ubuntu image on [[VMware Player>https://my.vmware....
~
[[DE0-Nano System Builder>http://www.terasic.com.tw/cgi-b...
~
[[Quartus>http://www.altera.com/products/software/quartus...
~
Quartus is installed on Ubuntu. 12.0sp1 version of Quartu...
* Configuring Ubuntu and Editing Files [#e19a1fb1]
>
This part explains how to set up the guest OS of Ubuntu.
** Installing the development tool [#f03c31c3]
>
Install the development tool and OpenJDK. The former is u...
$ sudo apt-get install build-essential
$ sudo apt-get install openjdk-7-jdk
** Adding udev rules [#gabc49e0]
>
To make Ubuntu recognize the USB-Blaster, add the rule fi...
~
After adding the rule file of USB-Blaster, please reboot ...
$ sudo vi /etc/udev/rules.d/51-usbblaster.rules
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idV...
ATTRS{idProduct}=="6001", MODE="0666", SYMLINK+="usbbla...
~
$ sudo udevadm control --reload-rules
** Constitution of working directory [#o2c67801]
>
The diagram shown below shows the organization of working...
>
${HOME}
|-- altera/ <- The install direct...
|
`-- JavaRock
|- javarock_20130708.jar <- The execution file...
`- samples/ <- Extraction directo...
|
<snip>
|
|-- de0-nano/ <- Added working dire...
| |- model/ <- The directory for ...
| | |- test.qpf
| | `- test.qsf
| |
| |- test.java
| `- test.sh
<snip>
|
`-- led/
|- counter.java
`- led.java
** Configuring environment variables [#je46cb58]
To increase boot speed of Quartus, PATH of Quartus is add...
<Code>
** About the files of newly added directories [#o590e701]
>
The files added for this article are shown below.~
- de0-nano/model/test.qpf: This a project file, which DE0...
~
- de0-nano/model/test.qsf: This is a qsf (pin-assignment ...
~
- de0-nano/test.sh, test.java: samples/test/test.sh, test...
*** About editing test.sh and test.java [#fd7f0502]
>
test.sh and test.java are edited as they are shown below....
~
- test.sh
$ diff -upN samples_orig/test/test.sh samples/de0-nano/t...
--- samples_orig/test/test.sh 2013-07-08 07:25:19.0000...
+++ samples/de0-nano/test.sh 2014-05-20 18:30:01.5160...
@@ -1,5 +1,3 @@
-java -cp $JAVAROCK:../led:../sc1602:../echo:. openjdk.c...
+java -cp $JAVAROCK:../led:. openjdk.com.sun.tools.javac...
../led/counter.java ../led/led.java \
- ../sc1602/SC1602Wrapper.java ../sc1602/SC1602Writer.j...
- ../echo/echo.java ./rs232c.java \
test.java
~
- test.java~
$ diff -upN samples_orig/test/test.java samples/de0-nano...
--- samples_orig/test/test.java 2013-07-08 07:25:19.0000...
+++ samples/de0-nano/test.java 2014-05-20 17:38:47.5280...
@@ -3,8 +3,8 @@ import net.wasamon.javarock.rt.*;
@javarockhdl
public class test{
led obj0 = new led();
- echo obj1 = new echo();
- sc1602_test obj2 = new sc1602_test();
+ //echo obj1 = new echo();
+ //sc1602_test obj2 = new sc1602_test();
//VGAJavaTest vga = new VGAJavaTest();
@combination
@@ -15,8 +15,8 @@ public class test{
@auto
public void main(){
obj0.start();
- obj1.start();
- obj2.start();
+ //obj1.start();
+ //obj2.start();
//vga.start();
}
}
*** Executing test.sh [#m7cb8ed6]
>
After the modification of test.sh and test.java are compl...
$ ./test.sh
Compile: counter
Compile: led
Compile: test
pass: connection
pass: bypass
pass: optimization
pass: linkage
pass: generate
$ ls
counter.vhd led.vhd model test.class test.java test...
*** About test.qpf and test.qsf [#e0abcbe7]
>
For the details of test.qpf and test.qsf, please download...
~
test.qsf is modified to match the variables in a part of ...
~
Also the generated vhd files (test.vhd, led.vhd, and coun...
~
#ref(test.qpf);~
#ref(test.qsf);~
~
- test.vhd (for reference)~
entity test is -- net.wasamon.javarock.model.vhdl.VHDLMo...
port (
notify_method_busy : OUT std_logic;
output_port_led : OUT std_logic;
notify_method_request : IN std_logic;
reset : IN std_logic;
clk : IN std_logic
); -- net.wasamon.javarock.model.vhdl.VHDLModule@33117...
~
- model/testqsf~
#======================================================...
# CLOCK
#======================================================...
-set_location_assignment PIN_R8 -to CLOCK_50
-set_instance_assignment -name IO_STANDARD "3.3-V LVTTL"...
+set_location_assignment PIN_R8 -to clk
+set_instance_assignment -name IO_STANDARD "3.3-V LVTTL"...
#======================================================...
# LED
#======================================================...
-set_location_assignment PIN_A15 -to LED[0]
-set_instance_assignment -name IO_STANDARD "3.3-V LVTTL"...
+set_location_assignment PIN_A15 -to output_port_led
+set_instance_assignment -name IO_STANDARD "3.3-V LVTTL"...
#======================================================...
# End of pin assignments by Terasic System Builder
#======================================================...
+set_location_assignment PIN_A11 -to reset
+set_instance_assignment -name IO_STANDARD 2.5V -to reset
+set_global_assignment -name VHDL_FILE ../led.vhd
+set_global_assignment -name VHDL_FILE ../counter.vhd
+set_global_assignment -name VHDL_FILE ../test.vhd
+set_global_assignment -name PARTITION_NETLIST_TYPE SOUR...
+set_global_assignment -name PARTITION_FITTER_PRESERVATI...
+set_global_assignment -name PARTITION_COLOR 16764057 -s...
+
+set_global_assignment -name STRATIX_DEVICE_IO_STANDARD ...
+
+
+
+set_instance_assignment -name PARTITION_HIERARCHY root_...
* Writing to DE0-Nano [#uaa3f83c]
>
Steps to write the generated files to DE0-Nano are shown ...
~
1. Start up Quartus~
Quartus is needed for writing the generated project file,...
$ quartus
#ref(quartus01.png,,60%); ~
~
2. Read the project file~
Read test.qpf (a project file) from Open Project.~
#ref(quartus02.png,,60%); ~
~
3. Compile the Project~
Click ?Start Complication? that is located at ?Processing...
~
4. Check the pin-assignments~
Click ?Pin Planner? that is the part of ?Assignments? of ...
~
The configuration (allocation) of pins for this article i...
#ref(quartus04.png,,60%); ~
~
5. Start up Programmer~
Click ?Programmer? that is categorized as the part of ?To...
~
If the pop-up window indicates ?NO Hardware,? click ?Hard...
~
Caution: If USB-Blaster DOES NOT appear at the selection,...
~
#ref(quartus07.png,,60%); ~
~
6. Transfer the image to DE0-Nano~
Click ?Start? that is located inside ?Programmer?. The ge...
~
Please check the ?Progress? reaches at 100% (Successful)....
~
#ref(quartus06.png,,60%); ~
~
#ref(javarock.jpg,,20%); ~
~
* Revision History [#m2da94a6]
>
-2014/12/25 This article is initially uploaded
Page: