Skip to content

Commit 44aea7e

Browse files
author
Pavel Kurochkin
committed
Branch for checking of clock sources
It blinks led #3, #4 by using of 100 MHz and 156.25 MHz generators.
1 parent 6157c1e commit 44aea7e

File tree

20 files changed

+78
-958
lines changed

20 files changed

+78
-958
lines changed

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
# c10gx: Serial Flash Loader
1+
# c10gx: led blinker
22

3-
This small project is intended for writing of working firmware to configuration
4-
flash EPCQ256L, which is connected to the Cyclone 10GX chip.
3+
This project is intended for fast checking of on-board clock generators,
4+
connected to Cyclone 10 GX chip. It blinks leds with 1Hz frequency. Each led
5+
is fed by one clock generator.
56

6-
## How to use
7+
## How it works
8+
9+
There are two generators to be checked:
10+
11+
* BQ3, [DSC6102CI2A-100.0000, 100 MHz](http://ww1.microchip.com/downloads/en/DeviceDoc/20005624B.pdf). Single-ended connection
12+
* BQ2, [ASEMPLV-156.250MHZ-LR-T, 156.25 MHz](https://abracon.com/Oscillators/ASEMP.pdf). Differential connection
713

8-
Perform following steps to write your working bitstream (SOF) to EPCQ256L:
14+
Clock 100 MHz is divided by 100.000.000 and blinks led #3.
15+
16+
Clock 156.25 MHz is divided by 156.250.000 and blinks led #3.
17+
18+
## How to use
919

10-
1. create .jic file, see [1], ch.1.5.1. At this step you should specify
11-
working firmware which should be loaded from EPCQ256L
12-
2. build this firmware in Quartus Prime
13-
3. connect JTAG to the board
14-
4. program this (sfl) firmware to FPGA. Leds 3-8 should start blinking.
15-
5. open .jic file with Quartus Prime Programmer and check
16-
'Program/Configure'. Start programming. Be patient, it takes time :)
17-
6. power off the board, disconnect JTAG and power on again. FPGA should run
18-
with working bitstream specified in 1st step
20+
1. Build led blinker firmware: open c10gx.qpf and run Full Compilation in
21+
Quartus Prime 18 Pro. Firmware will become available at 'out/c10gx.sof'.
22+
2. Program device by JTAG or with Serial Flash Loader (see [1]).
23+
3. Watch or/and measure frequency on LED #3, LED #4. It should be equal to 1Hz
1924

2025
## Links
2126

22-
1. [Application Note about using of Serial Flash Loader](https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/an/an370.pdf)
27+
1. TODO: link to serial flash loader firmware
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# -------------------------------------------------------------------------- #
22
#
33
# Copyright (C) 2018 Intel Corporation. All rights reserved.
4-
# Your use of Intel Corporation's design tools, logic functions
5-
# and other software and tools, and its AMPP partner logic
6-
# functions, and any output files from any of the foregoing
7-
# (including device programming or simulation files), and any
8-
# associated documentation or information are expressly subject
9-
# to the terms and conditions of the Intel Program License
4+
# Your use of Intel Corporation's design tools, logic functions
5+
# and other software and tools, and its AMPP partner logic
6+
# functions, and any output files from any of the foregoing
7+
# (including device programming or simulation files), and any
8+
# associated documentation or information are expressly subject
9+
# to the terms and conditions of the Intel Program License
1010
# Subscription Agreement, the Intel Quartus Prime License Agreement,
1111
# the Intel FPGA IP License Agreement, or other applicable license
1212
# agreement, including, without limitation, that your use is for
@@ -18,13 +18,14 @@
1818
#
1919
# Quartus Prime
2020
# Version 18.0.0 Build 219 04/25/2018 SJ Pro Edition
21-
# Date created = 01:03:13 Май 08, 2018
21+
# Date created = 14:19:16 July 13, 2018
2222
#
2323
# -------------------------------------------------------------------------- #
2424

2525
QUARTUS_VERSION = "18.0"
26-
DATE = "01:03:13 Май 08, 2018"
26+
DATE = "14:19:16 July 13, 2018"
2727

2828
# Revisions
2929

30+
PROJECT_REVISION = "c10gx"
3031
PROJECT_REVISION = "sfl"

sfl.qsf renamed to c10gx.qsf

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,32 @@ set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)"
1717
############## PROJECT FILES ##################
1818

1919
set_global_assignment -name SYSTEMVERILOG_FILE main.sv
20-
set_global_assignment -name QIP_FILE sfl/sfl.qip
20+
set_global_assignment -name SDC_FILE c10gx.sdc
2121

2222
############## PIN ASSIGNMENTS ##################
2323

24-
set_location_assignment PIN_AC13 -to clkusr_100m
24+
## Clocks
25+
26+
### 100 MHz, single-ended
27+
set_location_assignment PIN_AC13 -to clk100
28+
set_instance_assignment -name IO_STANDARD "1.8 V" -to clk100 -entity main
29+
30+
### 156.25 MHz, differential
31+
set_location_assignment PIN_U22 -to clk156p
32+
set_instance_assignment -name IO_STANDARD LVDS -to clk156p -entity main
33+
set_instance_assignment -name XCVR_REFCLK_PIN_TERMINATION AC_COUPLING -to clk156p -entity main
34+
set_instance_assignment -name OUTPUT_TERMINATION OCT_100_OHMS -to clk156p -entity main
35+
set_instance_assignment -name OUTPUT_TERMINATION OCT_100_OHMS -to "clk156p(n)" -entity main
36+
37+
## LEDs
38+
2539
set_location_assignment PIN_A2 -to led[3]
2640
set_location_assignment PIN_A3 -to led[4]
2741
set_location_assignment PIN_A4 -to led[5]
2842
set_location_assignment PIN_A6 -to led[6]
2943
set_location_assignment PIN_A8 -to led[7]
3044
set_location_assignment PIN_A9 -to led[8]
3145

32-
set_instance_assignment -name IO_STANDARD "1.8 V" -to clkusr_100m -entity main
3346
set_instance_assignment -name IO_STANDARD "1.8 V" -to led[3] -entity main
3447
set_instance_assignment -name IO_STANDARD "1.8 V" -to led[4] -entity main
3548
set_instance_assignment -name IO_STANDARD "1.8 V" -to led[5] -entity main
@@ -39,14 +52,14 @@ set_instance_assignment -name IO_STANDARD "1.8 V" -to led[8] -entity main
3952

4053
set_global_assignment -name AUTO_RESERVE_CLKUSR_FOR_CALIBRATION OFF
4154

42-
4355
############## ADDED BY QUARTUS ##################
4456

45-
set_global_assignment -name IP_FILE sfl.ip
4657
set_global_assignment -name ENABLE_CONFIGURATION_PINS OFF
4758
set_global_assignment -name ENABLE_BOOT_SEL_PIN OFF
4859
set_global_assignment -name STRATIXV_CONFIGURATION_SCHEME "ACTIVE SERIAL X4"
4960
set_global_assignment -name USE_CONFIGURATION_DEVICE ON
5061
set_global_assignment -name GENERATE_PR_RBF_FILE OFF
5162
set_global_assignment -name CRC_ERROR_OPEN_DRAIN ON
5263
set_global_assignment -name ACTIVE_SERIAL_CLOCK FREQ_100MHZ
64+
set_instance_assignment -name PARTITION_COLOUR 4288537343 -to main -entity main
65+
set_instance_assignment -name PARTITION_COLOUR 4291690369 -to auto_fab_0 -entity main

c10gx.sdc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
derive_pll_clocks
2+
derive_clock_uncertainty
3+
4+
create_clock -period "156.250MHz" [get_ports { clk156p }]
5+
create_clock -period "100.000MHz" [get_ports { clk100 }]

main.sv

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,39 @@
22
// Intel / Altera Cyclone 10 GX board test project
33
// General R&D, 2018
44

5-
module main(
5+
`define LED_100MHZ 3
6+
`define LED_156MHZ 4
7+
8+
`define CLK_100MHZ 32'd100000000
9+
`define CLK_156MHZ 32'd156250000
610

7-
input clkusr_100m, // 100 MHz, single-ended
8-
output [8:3]led
11+
module main(
12+
input clk100, // 100 MHz, single-ended
13+
input clk156p, // 156.25 MHz, diff pair
14+
output reg [8:3]led
915
);
1016

11-
/* Blink leds
17+
/* Blink leds from 100Mhz and 156Mhz references
1218
*/
1319
logic [31:0] clk100_cntr;
14-
always_ff @(posedge clkusr_100m)
20+
logic [31:0] clk156_cntr;
21+
22+
always_ff @(posedge clk100) begin
1523
clk100_cntr <= clk100_cntr + 1'b1;
24+
if ( clk100_cntr == (`CLK_100MHZ/2 - 1) ) begin
25+
led[`LED_100MHZ] <= ~led[`LED_100MHZ];
26+
clk100_cntr <= 32'd0;
27+
end
28+
end
1629

17-
assign led[8:3] = clk100_cntr[29:24];
30+
always_ff @(posedge clk156p) begin
31+
clk156_cntr <= clk156_cntr + 1'b1;
32+
if ( clk156_cntr == (`CLK_156MHZ/2 - 1) ) begin
33+
led[`LED_156MHZ] <= ~led[`LED_156MHZ];
34+
clk156_cntr <= 32'd0;
35+
end
36+
end
1837

19-
/* Serial Flash Loader instance
20-
*/
21-
sfl u0 (
22-
.noe_in ( 1'b0 ) // 0 = enabled
23-
);
38+
assign led[8:`LED_156MHZ+1] = '0;
2439

2540
endmodule

sfl.ip

Lines changed: 0 additions & 173 deletions
This file was deleted.

0 commit comments

Comments
 (0)