I am new to FPGAs. I am using an Artix-7 that comes in the Nexys4DDR, and I am programming in Verilog. I want to create a simple D Flip-Flop that will be triggered by a CLK of 50MHz. The CLK in the board comes in through pin E3 and it is 100MHz, I understand I can divide by 2 this clock in the Verilog code itself, but I thought I wanted to use a derived clock from the 100MHz. So I do this in the Constraint file:
Clock signal
set_property -dict { PACKAGE_PIN E3 IOSTANDARD LVCMOS33 } [get_ports { CLK100MHZ }];
create_clock -name sys_clk_pin -period 10.00 -waveform {0 5} [get_ports { CLK100MHZ }];
create_generated_clock -name clkdiv2 -source [get_ports CLK100MHZ] -divide_by 2 [get_pins REGA/Q];
How can I use the generated clock in my Verilog code? This is probably a very simple question, but how can I take the Q pin of the REGA and use it as my clock in the D Flip-Flop?, how can I complete this design? Do I have to instantiate REGA? If so, how? I have tried many ways, but none work. Thank you for your help.
module D_ff_behavior
(
input D,
input CLK100MHZ,
output reg Q
);
wire clk_div_2;
always @ (posedge clk_div_2)
Q <= D;
endmodule
set_property
is a description for timing analysis. It is up to you to make the logic that produces the clock. \$\endgroup\$