Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Spartan 3E Digital Clock Manager Problem

Status
Not open for further replies.

newbie123FPGA

Newbie level 1
Joined
Nov 10, 2016
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
10
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






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
 

Your reset isn't active when clk is active so counter is never reset to 0.

Don't use names that are only different by the case of the name! This is a big no-no and just makes your code confusing. Also if you develop this bad habit, if you ever start using VHDL all your signals that you named with different cases will be shorted together.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top