Skip to content

Commit f2ed272

Browse files
committed
Added Fmax test projects for Quartus and for Vivado
1 parent 8d95647 commit f2ed272

File tree

16 files changed

+595
-0
lines changed

16 files changed

+595
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#------------------------------------------------------------------------------
2+
# .gitignore for Intel Quartus
3+
# Konstantin Pavlov, pavlovconst@gmail.com
4+
#------------------------------------------------------------------------------
5+
6+
# INFO ------------------------------------------------------------------------
7+
# rename the file to ".gitignore" and place into your Quartus project directory
8+
#
9+
10+
11+
# junk files
12+
*.qws
13+
*_assignment_defaults.qdf
14+
c5_pin_model_dump.txt
15+
*.ipregen.rpt
16+
*_summary.csv
17+
*_early_pwr.csv
18+
19+
# junk directories
20+
/.qsys_edit
21+
/db
22+
/incremental_db
23+
/greybox_tmp
24+
25+
# design space explorer
26+
/dse
27+
dse1_base.qpf
28+
dse1_base.qsf
29+
*.dse.rpt
30+
*.archive.rpt
31+
32+
/out
33+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
@echo off
2+
rem ------------------------------------------------------------------------------
3+
rem clean_quartus.bat
4+
rem Konstantin Pavlov, pavlovconst@gmail.com
5+
rem ------------------------------------------------------------------------------
6+
7+
rem Use this file as a boilerplate for your custom clean script
8+
rem for Quartus projects
9+
10+
SET PROJ=test
11+
12+
rem Common junk files
13+
del /s /q .\%PROJ%.qws
14+
del /s /q .\c5_pin_model_dump.txt
15+
del /s /q .\%PROJ%.ipregen.rpt
16+
del /s /f /q .\.qsys_edit\*
17+
rmdir /s /q .\.qsys_edit\
18+
del /s /q .\%PROJ%_assignment_defaults.qdf
19+
20+
rem Compilation databases
21+
del /s /f /q .\db\*
22+
rmdir /s /q .\db\
23+
del /s /f /q .\incremental_db\*
24+
rmdir /s /q .\incremental_db\
25+
del /s /f /q .\greybox_tmp\*
26+
rmdir /s /q .\greybox_tmp\
27+
28+
rem Output directory
29+
del /s /f /q .\out\*
30+
rmdir /s /q .\out\
31+
32+
rem Design space explorer files
33+
del /s /f /q .\dse\*
34+
rmdir /s /q .\dse\
35+
del /s /q .\dse1_base.qpf
36+
del /s /q .\dse1_base.qsf
37+
del /s /q .\%PROJ%.dse.rpt
38+
del /s /q .\%PROJ%.archive.rpt
39+
40+
rem Early power estimator files
41+
del /s /q .\%PROJ%_early_pwr.csv
42+
43+
pause
44+
goto :eof
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//------------------------------------------------------------------------------
2+
// clk_divider.sv
3+
// published as part of https://github.com/pConst/basic_verilog
4+
// Konstantin Pavlov, pavlovconst@gmail.com
5+
//------------------------------------------------------------------------------
6+
7+
// INFO ------------------------------------------------------------------------
8+
// Divides main clock to get derivative slower synchronous clocks
9+
//
10+
11+
/* --- INSTANTIATION TEMPLATE BEGIN ---
12+
13+
clk_divider #(
14+
.WIDTH( 32 )
15+
) CD1 (
16+
.clk( clk ),
17+
.nrst( 1'b1 ),
18+
.ena( 1'b1 ),
19+
.out( )
20+
);
21+
22+
--- INSTANTIATION TEMPLATE END ---*/
23+
24+
25+
module clk_divider #( parameter
26+
WIDTH = 32
27+
)(
28+
input clk,
29+
input nrst,
30+
input ena,
31+
output logic [(WIDTH-1):0] out = '0
32+
);
33+
34+
35+
always_ff @(posedge clk) begin
36+
if ( ~nrst ) begin
37+
out[(WIDTH-1):0] <= '0;
38+
end else if (ena) begin
39+
out[(WIDTH-1):0] <= out[(WIDTH-1):0] + 1'b1;
40+
end
41+
end
42+
43+
endmodule
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
# main reference clock, 500 MHz
3+
create_clock -period 2.000 -waveform { 0.000 1.000 } [get_ports {clk}]
4+
5+
derive_pll_clocks
6+
derive_clock_uncertainty
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
//------------------------------------------------------------------------------
2+
// main.sv
3+
// published as part of https://github.com/pConst/basic_verilog
4+
// Konstantin Pavlov, pavlovconst@gmail.com
5+
//------------------------------------------------------------------------------
6+
7+
// INFO ------------------------------------------------------------------------
8+
// minimal FMAX test project template, v3
9+
//
10+
// - use this as a boilerplate for fast prototyping and FMAX investigating
11+
// - inputs and outputs are registered to allow valid timequest output
12+
// even if your custom logic/IPs have combinational outputs
13+
// - SDC constraint file assigns clk to 500MHz to force fitter to synthesize
14+
// the fastest possible circuit
15+
//
16+
17+
`define WIDTH 64
18+
19+
module main(
20+
21+
input clk,
22+
input nrst,
23+
24+
input [`WIDTH-1:0] in_data,
25+
output logic [`WIDTH-1:0] out_data
26+
);
27+
28+
// input registers
29+
logic [`WIDTH-1:0] in_data_reg = '0;
30+
always_ff @(posedge clk) begin
31+
if( ~nrst ) begin
32+
in_data_reg[`WIDTH-1:0] <= '0;
33+
end else begin
34+
in_data_reg[`WIDTH-1:0] <= in_data;
35+
end
36+
end
37+
38+
logic [`WIDTH-1:0] out_data_comb = '0;
39+
40+
// place your test logic here ==================================================
41+
42+
logic [31:0] div_clk;
43+
clk_divider #(
44+
.WIDTH( 32 )
45+
) cd1 (
46+
.clk( clk ),
47+
.nrst( nrst ),
48+
.ena( 1'b1 ),
49+
.out( div_clk[31:0] )
50+
);
51+
52+
always_comb begin
53+
out_data_comb[`WIDTH-1:0] <= in_data_reg[`WIDTH-1:0] ^ div_clk[31:0];
54+
end
55+
56+
57+
// =============================================================================
58+
59+
// output registers
60+
always_ff @(posedge clk) begin
61+
if( ~nrst ) begin
62+
out_data[`WIDTH-1:0] <= '0;
63+
end else begin
64+
out_data[`WIDTH-1:0] <= out_data_comb[`WIDTH-1:0];
65+
end
66+
end
67+
68+
endmodule
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PROJECT_REVISION = "test"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
set_global_assignment -name FAMILY "Cyclone V"
3+
set_global_assignment -name DEVICE 5CGXFC4C7F27C8
4+
set_global_assignment -name LAST_QUARTUS_VERSION "20.1.0 Lite Edition"
5+
6+
set_global_assignment -name PROJECT_OUTPUT_DIRECTORY out
7+
set_global_assignment -name NUM_PARALLEL_PROCESSORS ALL
8+
set_global_assignment -name TOP_LEVEL_ENTITY main
9+
10+
11+
set_global_assignment -name SYSTEMVERILOG_FILE ./src/main.sv
12+
set_global_assignment -name SYSTEMVERILOG_FILE ./src/clk_divider.sv
13+
set_global_assignment -name SDC_FILE ./src/main.sdc
14+
15+
16+
set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
17+
set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top
18+
set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top
19+
20+
21+
22+
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
-128 KB
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
3+
*.cache
4+
*.hw
5+
*.runs
6+
*.sim
7+
.Xil
8+
9+
*.jou
10+
*.log
11+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@echo off
2+
rem ------------------------------------------------------------------------------
3+
rem clean.bat
4+
rem Konstantin Pavlov, pavlovconst@gmail.com
5+
rem ------------------------------------------------------------------------------
6+
7+
rem Use this file as a boilerplate for your custom clean script
8+
rem for Vivado/Vitis projects
9+
10+
SET PROJ=test
11+
12+
del /s /f /q .\%PROJ%.cache\*
13+
rmdir /s /q .\%PROJ%.cache\
14+
15+
del /s /f /q .\%PROJ%.hw\*
16+
rmdir /s /q .\%PROJ%.hw\
17+
18+
del /s /f /q .\%PROJ%.runs\*
19+
rmdir /s /q .\%PROJ%.runs\
20+
21+
del /s /f /q .\%PROJ%.sim\*
22+
rmdir /s /q .\%PROJ%.sim\
23+
24+
del /s /f /q .\.Xil\*
25+
rmdir /s /q .\.Xil\
26+
27+
del /s /f /q .\*.jou
28+
del /s /f /q .\*.log
29+
30+
pause
31+
exit

0 commit comments

Comments
 (0)