T
Tobias Weingartner
Guest
I'm trying to put together a simple DCO style circuit, using a counter
to count a number of edges, and flipping a register each time my counter
reaches zero. For some reason xilinx ISE software does not find my clock
signal? Any way to "educate" it? (Newbie alert!)
Can someone give me a hand with what I'm (not?) doing here? Basically
the Xst is telling me various things, all of which are hard to believe.
module dco(clk,reset,enable,load,data,q);
input clk; // sysnthesis attribute clock_signal of clk is yes
input reset;
input enable;
input load;
input [13:0] data;
output reg q;
reg [13:0] count;
reg [13:0] stage;
// Handle reset, make quiet
always @(negedge reset) begin
if(~reset) begin
count <= 0;
stage <= 0;
//q <= 0; // Problematic, why?
end
end
// Stage && Load
always @(negedge load) begin
stage <= data;
if(~|count)
count <= data;
end
// Reload && Counter
// Why do I need both these blocks, why can't I just say
// on any transition of "clk"?
always @(posedge clk) begin
case (count)
0:
count <= stage;
1: begin
count <= stage;
q <= ~q;
end
default
count <= count - 1;
endcase
end
always @(negedge clk) begin
case (count)
0:
count <= stage;
1: begin
count <= stage;
q <= ~q;
end
default
count <= count - 1;
endcase
end
endmodule
Thank you for any help,
--
[100~Plax]sb16i0A2172656B63616820636420726568746F6E61207473754A[dZ1!=b]salax
to count a number of edges, and flipping a register each time my counter
reaches zero. For some reason xilinx ISE software does not find my clock
signal? Any way to "educate" it? (Newbie alert!)
Can someone give me a hand with what I'm (not?) doing here? Basically
the Xst is telling me various things, all of which are hard to believe.
module dco(clk,reset,enable,load,data,q);
input clk; // sysnthesis attribute clock_signal of clk is yes
input reset;
input enable;
input load;
input [13:0] data;
output reg q;
reg [13:0] count;
reg [13:0] stage;
// Handle reset, make quiet
always @(negedge reset) begin
if(~reset) begin
count <= 0;
stage <= 0;
//q <= 0; // Problematic, why?
end
end
// Stage && Load
always @(negedge load) begin
stage <= data;
if(~|count)
count <= data;
end
// Reload && Counter
// Why do I need both these blocks, why can't I just say
// on any transition of "clk"?
always @(posedge clk) begin
case (count)
0:
count <= stage;
1: begin
count <= stage;
q <= ~q;
end
default
count <= count - 1;
endcase
end
always @(negedge clk) begin
case (count)
0:
count <= stage;
1: begin
count <= stage;
q <= ~q;
end
default
count <= count - 1;
endcase
end
endmodule
Thank you for any help,
--
[100~Plax]sb16i0A2172656B63616820636420726568746F6E61207473754A[dZ1!=b]salax