newbie123FPGA
Newbie level 1
I am using a DCM to go from 50 MHz to 25 MHz.This code was just for confirmation and it doesn't work.I've listed 'clk' as output to view DCM output.It's exactly hal of input CLK, as it should be.When I change to @posedge CLK, the simulation works, with the DCM output clock, the always block doesn't seem to be working.
Simulation : https://obrazki.elektroda.pl/4112796400_1478817837.jpg
Simulation : https://obrazki.elektroda.pl/4112796400_1478817837.jpg
Code:
module v(
input CLK,
input RESET,
output reg counter,
output clk
);
clo instance_name (
.CLKIN_IN(CLK),
.CLKFX_OUT(clk),
.CLKIN_IBUFG_OUT(CLKIN_IBUFG_OUT)
);
always @ (posedge clk)
begin
if(RESET)
counter <= 0;
else
counter <= ~counter;
end