-
Notifications
You must be signed in to change notification settings - Fork 531
Description
I am trying to set the clock and the Vivado timing constraints.
According to this table: https://github.com/aws/aws-fpga/blob/master/hdk/docs/clock_recipes.csv
the A2 clock group sets the clk_main_a0 clock to 15.625 MHz, which is a period of 64.0 nanoseconds.
I want to request that configuration, however when I try to do that, these flags "--aws_clk_gen --clock_recipe_a=A2" to aws_build_dcp_from_cl.py do not seem to actually work.
Here is the line I run:
nohup time -v nice \
./aws_build_dcp_from_cl.py -c PROJECT_NAME \
--aws_clk_gen --clock_recipe_a=A2 &
and here is the output I get in generated_cl_clocks_aws.xdc
#CL HBM reference clock @100MHz \
create_clock -period 10.000 -name clk_hbm_ref -waveform {0.000 5.000} [get_ports clk_hbm_ref]
# Group A Clocks
create_clock -period 4 -name clk_main_a0 -waveform {0.000 2} [get_ports clk_main_a0]
A period of 4 nanoseconds means that the clk_main_a0 clock is running at 250 MHz, which is the value from the A1 clock group. The script build/scripts/aws_build_dcp_from_cl.py seems to have this as its default:
parser.add_option("--clock_recipe_a",
dest="clock_recipe_a",
help="Select Clock Recipe for Clock Group A (A0 | A1 | A2)",
default="A1")
I would overwrite the entry in generated_cl_clocks_aws.xdc except that it is being generated at compile time.
I have tried changing it in build/constraints/cl_timing_user.xdc but I just get a CRITICAL WARNING telling me to not do it.
Parsing XDC File [/home/ubuntu/aws-fpga/hdk/cl/examples/PROJECT_NAME/build/con\
straints/cl_timing_user.xdc]
CRITICAL WARNING: [Constraints 18-1056] Clock 'sys_clk' completely overrides cl\
ock 'clk_main_a0'.
New: create_clock -period 58.000 -name sys_clk [get_ports clk_main_a0], [/home/\
ubuntu/aws-fpga/hdk/cl/examples/PROJECT_NAME/build/constraints/cl_timing_user.\
xdc:22]
Previous: create_clock -period 4.000 -name clk_main_a0 -waveform {0.000 2.000} \
[get_ports clk_main_a0], [/home/ubuntu/aws-fpga/hdk/cl/examples/PROJECT_NAME/b\
uild/constraints/generated_cl_clocks_aws.xdc:11]
Resolution: Review the constraint files and remove the redundant clock definiti\
on(s). If the clock constraints are not saved in a file, you can first save the\
constraints to an XDC file and reload the design once the constraints have bee\
n corrected.
Finished Parsing XDC File [/home/ubuntu/aws-fpga/hdk/cl/examples/PROJECT_NAME/\
build/constraints/cl_timing_user.xdc]
The .vivado.log file says the following, which seems to be a script that creates the generated_cl_clocks_aws.xdc:
## set clocks_file [open "$CL_DIR/build/constraints/generated_cl_clocks_aws.xdc\
" w]
. . .
## puts $clocks_file "# Do not edit this file! It is auto-generated from $argv0\
."
. . .
## puts $clocks_file "# Group A Clocks"
## puts $clocks_file "create_clock -period $clk_main_a0_period -name clk_main_\
a0 -waveform {0.000 $clk_main_a0_half_period} \[get_ports clk_main_a0\]"
## close $clocks_file
However it seems to get the period from here (from the .vivado.log):
# source $HDK_SHELL_DIR/build/scripts/aws_gen_clk_constraints.tcl
## switch $clock_recipe_a {
. . .
## "A2" {
## #NOT SUPPORTED# set clk_main_a0_period 64
## #NOT SUPPORTED# set clk_main_a0_half_period 32
## set clk_main_a0_period 4
## set clk_main_a0_half_period 2
. . .
## }
As you can see, the clk_main_a0_period is 4, which implies 250 MHz, not 15.625 MHz, as, again, is stated here: https://github.com/aws/aws-fpga/blob/master/hdk/docs/clock_recipes.csv
In fact, ALL of the clk_main_a0 periods are the same, for all of the clock groups, A0, A1, and A2 !
What is going on here? How do I set my clock and my timing constraints?