Skip to content

Commit 57d041d

Browse files
Initial version of the blinking LED tutorial for A10 PCIe devkit
1 parent 5305134 commit 57d041d

23 files changed

+1768
-1
lines changed

tutorials/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ This directory contains tutorials related to the Intel FPGA Partial Reconfigurat
77

88

99
- [Arria 10 SoC Devkit Blinking LED Tutorial](a10_soc_devkit_blinking_led/)
10-
10+
- [Arria 10 GX FPGA Devkit Blinking LED Tutorial](a10_pcie_devkit_blinking_led/)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Arria 10 Blinking LED Partial Reconfiguration Tutorial for the Arria 10 GX FPGA Development Kit
2+
3+
This readme file accompanies the Arria 10 Blinking LED Partial Reconfiguration Tutorial for the Arria 10 GX FPGA Development Kit. This version of the design has been verified using Quartus Prime Pro v16.1.
4+
5+
This readme file contains the following information:
6+
7+
* Arria 10 Blinking LED Partial Reconfiguration Tutorial Contents--lists the contents of this tutorial.
8+
* Technical Documentation--directs you where to find documentation for Arria 10 Blinking LED Partial Reconfiguration walkthrough.
9+
* System Requirements--lists the system requirements.
10+
11+
## Arria 10 Blinking LED Partial Reconfiguration Tutorial Contents
12+
13+
* flat/ - This directory contains the *flat* version of the reference design. The following are the design files available in this folder:
14+
* top.sv--top-level file containing the flat implementation of the design.
15+
* blinking_led.sdc--defines the timing constraints for the project.
16+
* blinking_led.sv--System Verilog file that causes the LEDs to blink using a 32-bit counter.
17+
* blinking_led.qpf--Quartus Prime project file containing the base revision information.
18+
* blinking_led.qsf--Quartus Prime settings file containing the assignments and settings for the project.
19+
20+
* pr/ - This directory contains the PR version of the reference design. The following are the complete set of files you will be creating with this tutorial:
21+
* blinking_led.sv--System Verilog file that causes the LEDs to blink using a 32-bit counter.
22+
* blinking_led.qpf--Quartus Prime project file containing the synthesis revision information for the personas.
23+
* blinking_led.qsf--Quartus Prime settings file containing the assignments and settings for the PR project.
24+
* blinking_led.sdc--Defines the timing constraints for the PR project.
25+
* blinking_led_default.qsf--Quartus Prime settings file containing the assignments and settings for the blinking_led_default persona.
26+
* blinking_led_empty.qsf--Quartus Prime project file containing the assignments and settings for blinking_led_empty persona.
27+
* blinking_led_empty.sv--System Verilog file that causes the LEDs to stay ON.
28+
* blinking_led_pr_alpha.qsf--Quartus Prime settings file containing the assignments and settings for the blinking_led project.
29+
* blinking_led_pr_bravo.qsf--Quartus Prime settings file containing the assignments and settings for the blinking_led project.
30+
* blinking_led_pr_charlie.qsf--Quartus Prime settings file containing the assignments and settings for the blinking_led project.
31+
* blinking_slow_led.qsf--Quartus Prime project file containing the assignments and settings for blinking_led_slow persona.
32+
* blinking_slow_led.sv--System Verilog file that causes the LEDs to blink slower.
33+
* jtag.sdc--Timing constraints for JTAG
34+
* pr_ip.ip--IP variation file for instantiating PR IP core in the design
35+
* setup.tcl--contains configuration for the a10_partial_reconfig.tcl flow script
36+
* top.sv--top-level file containing the PR implementation of the design.
37+
38+
## Technical Documentation
39+
40+
## System Requirements
41+
42+
* Quartus Prime Pro Edition software version 16.1
43+
* [Arria 10 GX FPGA Development Kit](https://www.altera.com/products/boards_and_kits/dev-kits/altera/kit-a10-gx-fpga.html)
44+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (C) 2001-2016 Intel Corporation. All rights reserved.
2+
# Your use of Intel Corporation's design tools, logic functions
3+
# and other software and tools, and its AMPP partner logic
4+
# functions, and any output files from any of the foregoing
5+
# (including device programming or simulation files), and any
6+
# associated documentation or information are expressly subject
7+
# to the terms and conditions of the Intel Program License
8+
# Subscription Agreement, the Intel Quartus Prime License Agreement,
9+
# the Intel MegaCore Function License Agreement, or other
10+
# applicable license agreement, including, without limitation,
11+
# that your use is for the sole purpose of programming logic
12+
# devices manufactured by Intel and sold by Intel or its
13+
# authorized distributors. Please refer to the applicable
14+
# agreement for further details.
15+
16+
17+
QUARTUS_VERSION = "16.0"
18+
19+
# Revisions
20+
21+
PROJECT_REVISION = "blinking_led"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright (C) 2001-2016 Intel Corporation. All rights reserved.
2+
# Your use of Intel Corporation's design tools, logic functions
3+
# and other software and tools, and its AMPP partner logic
4+
# functions, and any output files from any of the foregoing
5+
# (including device programming or simulation files), and any
6+
# associated documentation or information are expressly subject
7+
# to the terms and conditions of the Intel Program License
8+
# Subscription Agreement, the Intel Quartus Prime License Agreement,
9+
# the Intel MegaCore Function License Agreement, or other
10+
# applicable license agreement, including, without limitation,
11+
# that your use is for the sole purpose of programming logic
12+
# devices manufactured by Intel and sold by Intel or its
13+
# authorized distributors. Please refer to the applicable
14+
# agreement for further details.
15+
16+
17+
set_global_assignment -name FAMILY "Arria 10"
18+
set_global_assignment -name DEVICE 10AX115S2F45I1SG
19+
set_global_assignment -name TOP_LEVEL_ENTITY top
20+
set_global_assignment -name SYSTEMVERILOG_FILE top.sv
21+
set_global_assignment -name SYSTEMVERILOG_FILE blinking_led.sv
22+
set_global_assignment -name SDC_FILE blinking_led.sdc
23+
set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files
24+
set_location_assignment PIN_AU33 -to clock
25+
set_location_assignment PIN_L28 -to led_zero_on
26+
set_location_assignment PIN_K26 -to led_two_on
27+
set_location_assignment PIN_K25 -to led_one_on
28+
set_location_assignment PIN_L25 -to led_three_on
29+
set_instance_assignment -name IO_STANDARD "1.8 V" -to led_zero_on
30+
set_instance_assignment -name IO_STANDARD "1.8 V" -to led_one_on
31+
set_instance_assignment -name IO_STANDARD "1.8 V" -to led_two_on
32+
set_instance_assignment -name IO_STANDARD "1.8 V" -to led_three_on
33+
set_instance_assignment -name SLEW_RATE 1 -to led_zero_on
34+
set_instance_assignment -name SLEW_RATE 1 -to led_one_on
35+
set_instance_assignment -name SLEW_RATE 1 -to led_two_on
36+
set_instance_assignment -name SLEW_RATE 1 -to led_three_on
37+
set_instance_assignment -name CURRENT_STRENGTH_NEW 12MA -to clock
38+
set_instance_assignment -name CURRENT_STRENGTH_NEW 12MA -to led_zero_on
39+
set_instance_assignment -name CURRENT_STRENGTH_NEW 12MA -to led_one_on
40+
set_instance_assignment -name CURRENT_STRENGTH_NEW 12MA -to led_two_on
41+
set_instance_assignment -name CURRENT_STRENGTH_NEW 12MA -to led_three_on
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (c) 2001-2016 Intel Corporation
2+
#
3+
# Permission is hereby granted, free of charge, to any person obtaining a
4+
# copy of this software and associated documentation files (the
5+
# "Software"), to deal in the Software without restriction, including
6+
# without limitation the rights to use, copy, modify, merge, publish,
7+
# distribute, sublicense, and/or sell copies of the Software, and to
8+
# permit persons to whom the Software is furnished to do so, subject to
9+
# the following conditions:
10+
#
11+
# The above copyright notice and this permission notice shall be included
12+
# in all copies or substantial portions of the Software.
13+
#
14+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18+
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
22+
# The clock is defined as a 100MHz clock (10ns period)
23+
create_clock -name {clock} -period 10.00 -waveform { 0.00 5.00 } [get_ports {clock}]
24+
25+
# allocating a 1ns flight time for LED control signals on the board
26+
set_output_delay -clock clock 1 [get_ports {led_*_on}]
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Copyright (c) 2001-2016 Intel Corporation
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a
4+
// copy of this software and associated documentation files (the
5+
// "Software"), to deal in the Software without restriction, including
6+
// without limitation the rights to use, copy, modify, merge, publish,
7+
// distribute, sublicense, and/or sell copies of the Software, and to
8+
// permit persons to whom the Software is furnished to do so, subject to
9+
// the following conditions:
10+
//
11+
// The above copyright notice and this permission notice shall be included
12+
// in all copies or substantial portions of the Software.
13+
//
14+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18+
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19+
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
22+
///////////////////////////////////////////////////////////
23+
// blinking_led.v
24+
// a simple design to get LEDs blink using a 32-bit counter
25+
///////////////////////////////////////////////////////////
26+
`timescale 1 ps / 1 ps
27+
`default_nettype none
28+
29+
module blinking_led
30+
(
31+
// Control signals for the LEDs
32+
led_two_on,
33+
led_three_on,
34+
35+
// clock
36+
clock
37+
);
38+
39+
// assuming single bit control signal to turn LED 'on'
40+
output wire led_two_on;
41+
output wire led_three_on;
42+
43+
// clock
44+
input wire clock;
45+
46+
// the 32-bit counter
47+
reg [31:0] count;
48+
49+
localparam COUNTER_TAP = 23;
50+
51+
// The counter:
52+
always_ff @(posedge clock)
53+
begin
54+
count <= count + 1;
55+
end
56+
57+
assign led_two_on = count[COUNTER_TAP];
58+
assign led_three_on = ~count[COUNTER_TAP];
59+
60+
endmodule
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
// Copyright (c) 2001-2016 Intel Corporation
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a
4+
// copy of this software and associated documentation files (the
5+
// "Software"), to deal in the Software without restriction, including
6+
// without limitation the rights to use, copy, modify, merge, publish,
7+
// distribute, sublicense, and/or sell copies of the Software, and to
8+
// permit persons to whom the Software is furnished to do so, subject to
9+
// the following conditions:
10+
//
11+
// The above copyright notice and this permission notice shall be included
12+
// in all copies or substantial portions of the Software.
13+
//
14+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18+
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19+
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20+
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21+
22+
////////////////////////////////////////////////////////////////////////////
23+
// top.v
24+
// a simple design to get LEDs blink using a 32-bit counter
25+
//
26+
// Some of the lines of code are commented out. They are not
27+
// needed since this is the flat implementation of the design
28+
//
29+
// As the accompanied application note document explains, the commented lines
30+
// would be needed as the design implementation migrates from flat to
31+
// Partial-Reconfiguration (PR) mode
32+
////////////////////////////////////////////////////////////////////////////
33+
`timescale 1 ps / 1 ps
34+
`default_nettype none
35+
36+
module top
37+
(
38+
39+
////////////////////////////////////////////////////////////////////////
40+
// Control signals for the LEDs
41+
////////////////////////////////////////////////////////////////////////
42+
led_zero_on,
43+
led_one_on,
44+
led_two_on,
45+
led_three_on,
46+
47+
////////////////////////////////////////////////////////////////////////
48+
// clock
49+
////////////////////////////////////////////////////////////////////////
50+
clock
51+
);
52+
53+
////////////////////////////////////////////////////////////////////////
54+
// assuming single bit control signal to turn LED 'on'
55+
////////////////////////////////////////////////////////////////////////
56+
output reg led_zero_on;
57+
output reg led_one_on;
58+
output reg led_two_on;
59+
output reg led_three_on;
60+
61+
////////////////////////////////////////////////////////////////////////
62+
// clock
63+
////////////////////////////////////////////////////////////////////////
64+
input wire clock;
65+
66+
localparam COUNTER_TAP = 24;
67+
68+
////////////////////////////////////////////////////////////////////////
69+
// the 32-bit counter
70+
////////////////////////////////////////////////////////////////////////
71+
reg [31:0] count;
72+
73+
////////////////////////////////////////////////////////////////////////
74+
// wire declarations
75+
////////////////////////////////////////////////////////////////////////
76+
wire freeze; // freeze is not used until design is changed to PR
77+
wire [2:0] pr_ip_status;
78+
wire pr_led_two_on;
79+
wire pr_led_three_on;
80+
81+
wire led_zero_on_w;
82+
wire led_one_on_w;
83+
wire led_two_on_w;
84+
wire led_three_on_w;
85+
86+
////////////////////////////////////////////////////////////////////////
87+
// The counter:
88+
////////////////////////////////////////////////////////////////////////
89+
always_ff @(posedge clock)
90+
begin
91+
count <= count + 1;
92+
end
93+
94+
////////////////////////////////////////////////////////////////////////
95+
// Register the LED outputs
96+
////////////////////////////////////////////////////////////////////////
97+
always_ff @(posedge clock)
98+
begin
99+
led_zero_on <= led_zero_on_w;
100+
led_one_on <= led_one_on_w;
101+
led_two_on <= led_two_on_w;
102+
led_three_on <= led_three_on_w;
103+
end
104+
105+
////////////////////////////////////////////////////////////////////////
106+
// driving LEDs to show PR as the rest of logic is running
107+
////////////////////////////////////////////////////////////////////////
108+
assign led_zero_on_w = count[COUNTER_TAP];
109+
assign led_one_on_w = count[COUNTER_TAP];
110+
111+
////////////////////////////////////////////////////////////////////////
112+
// When moving from flat design to PR the following two
113+
// lines of assign statements need to be used.
114+
// User needs to uncomment them.
115+
//
116+
// The output ports driven by PR logic need to stablized
117+
// during PR reprograming. Using "freeze" control signal,
118+
// from PR IP, to drive these output to logic 1 during
119+
// reconfiguration. The logic 1 is chosen because LED is active low.
120+
////////////////////////////////////////////////////////////////////////
121+
// The following line is used in PR implementation
122+
// assign led_two_on_w = freeze ? 1'b1 : pr_led_two_on;
123+
124+
// The following line is used in PR implementation
125+
// assign led_three_on_w = freeze ? 1'b1 : pr_led_three_on;
126+
127+
////////////////////////////////////////////////////////////////////////
128+
// instance of the default persona
129+
////////////////////////////////////////////////////////////////////////
130+
blinking_led u_blinking_led
131+
(
132+
.led_two_on (led_two_on_w), // used in flat implementation
133+
// .led_two_on (pr_led_two_on), // used in PR implementation
134+
135+
.led_three_on (led_three_on_w), // used in flat implementation
136+
// .led_three_on (pr_led_three_on), // used in PR implementation
137+
138+
.clock (clock)
139+
);
140+
141+
// ////////////////////////////////////////////////////////////////////////
142+
// // when moving from flat design to PR then the following
143+
// // pr_ip needs to be instantiated in order to be able to
144+
// // partially reconfigure the design.
145+
// //
146+
// // This tutorial implements PR over JTAG
147+
// ////////////////////////////////////////////////////////////////////////
148+
// pr_ip u_pr_ip
149+
// (
150+
// .clk (clock),
151+
// .nreset (1'b1),
152+
// .freeze (freeze),
153+
// .pr_start (1'b0), // ignored for JTAG
154+
// .status (pr_ip_status),
155+
// .data (16'b0),
156+
// .data_valid (1'b0),
157+
// .data_ready ()
158+
// );
159+
160+
endmodule
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (C) 2001-2016 Intel Corporation. All rights reserved.
2+
# Your use of Intel Corporation's design tools, logic functions
3+
# and other software and tools, and its AMPP partner logic
4+
# functions, and any output files from any of the foregoing
5+
# (including device programming or simulation files), and any
6+
# associated documentation or information are expressly subject
7+
# to the terms and conditions of the Intel Program License
8+
# Subscription Agreement, the Intel Quartus Prime License Agreement,
9+
# the Intel MegaCore Function License Agreement, or other
10+
# applicable license agreement, including, without limitation,
11+
# that your use is for the sole purpose of programming logic
12+
# devices manufactured by Intel and sold by Intel or its
13+
# authorized distributors. Please refer to the applicable
14+
# agreement for further details.
15+
16+
17+
QUARTUS_VERSION = "16.1"
18+
DATE = "15:33:29 September 14, 2016"
19+
20+
# Revisions
21+
22+
PROJECT_REVISION = "blinking_led"
23+
PROJECT_REVISION = "blinking_led_pr_charlie"
24+
PROJECT_REVISION = "blinking_led_pr_bravo"
25+
PROJECT_REVISION = "blinking_led_pr_alpha"
26+
PROJECT_REVISION = "blinking_led_default"
27+
PROJECT_REVISION = "blinking_slow_led"
28+
PROJECT_REVISION = "blinking_led_empty"

0 commit comments

Comments
 (0)