L
Legalex
Guest
I have this code written in verilog for a counter but my program xilinx is
14.1 finds 2 errors:
ERROR:Xst:899 - "numarator9.v" line 45: The logic for <counter_out> doe
not match a known FF or Latch template. The description style you are usin
to describe a register or latch is not supported in the current softwar
release.
ERROR:Xst:899 - "numarator9.v" line 44: The logic for <carry_out> does no
match a known FF or Latch template. The description style you are using t
describe a register or latch is not supported in the current softwar
release.
Can someone help me and tell me what's wrong about my code?
module counter9 (
clock ,
reset ,
enable ,
counter_out,
carry_out,
preset
);
input clock ;
input reset ;
input enable ;
input [3:0] preset;
output [3:0] counter_out ;
output carry_out;
wire clock ;
wire reset ;
wire enable ;
wire [3:0] preset;
reg [3:0] counter_out ;
reg carry_out;
reg a;
always @ (posedge clock or negedge reset)
begin : COUNTER
if (enable == 1'b1) begin
a<=1'b1;
end
else begin a<=1'b0;
end
if (reset == 1'b0) begin
counter_out <= preset;
carry_out<= 1'b0;
a<=1'b0;
end
else if (a == 1'b1) begin
counter_out <= counter_out - 1;
end
if(counter_out==4'b0)begin
carry_out<=~carry_out;
counter_out<= counter_out + 9;
end
else begin
carry_out<=1'b0;
end
end
endmodule
---------------------------------------
Posted through http://www.FPGARelated.com
14.1 finds 2 errors:
ERROR:Xst:899 - "numarator9.v" line 45: The logic for <counter_out> doe
not match a known FF or Latch template. The description style you are usin
to describe a register or latch is not supported in the current softwar
release.
ERROR:Xst:899 - "numarator9.v" line 44: The logic for <carry_out> does no
match a known FF or Latch template. The description style you are using t
describe a register or latch is not supported in the current softwar
release.
Can someone help me and tell me what's wrong about my code?
module counter9 (
clock ,
reset ,
enable ,
counter_out,
carry_out,
preset
);
input clock ;
input reset ;
input enable ;
input [3:0] preset;
output [3:0] counter_out ;
output carry_out;
wire clock ;
wire reset ;
wire enable ;
wire [3:0] preset;
reg [3:0] counter_out ;
reg carry_out;
reg a;
always @ (posedge clock or negedge reset)
begin : COUNTER
if (enable == 1'b1) begin
a<=1'b1;
end
else begin a<=1'b0;
end
if (reset == 1'b0) begin
counter_out <= preset;
carry_out<= 1'b0;
a<=1'b0;
end
else if (a == 1'b1) begin
counter_out <= counter_out - 1;
end
if(counter_out==4'b0)begin
carry_out<=~carry_out;
counter_out<= counter_out + 9;
end
else begin
carry_out<=1'b0;
end
end
endmodule
---------------------------------------
Posted through http://www.FPGARelated.com