prasad1
Newbie level 4
ERROR:Xst:528 - Multi-source in Unit <sin_wave2> on signal <i<3>>
ERROR:Xst:528 - Multi-source in Unit <sin_wave2> on signal <i<2>>
ERROR:Xst:528 - Multi-source in Unit <sin_wave2> on signal <i<1>>
ERROR:Xst:528 - Multi-source in Unit <sin_wave2> on signal <i<0>>
this is my code:
module sin_waveq (clk,rst,I,sine1);
input I,clk,rst;
output [7:0] sine1;
reg [7:0] index;
wire [7:0] value;
reg [7:0] sine1;
reg [1:0] i;
wire clk_4;
wire clk1;
reg en;
initial
begin
i=2'bZZ;
index=8'hzz;
end
assign clk1= clk;
always@(posedge clk)
begin
if (rst==1'b1)
begin
index=8'hzz;
en=0;
end
else
begin
index=8'Hff;
if(I==0)
i=2'b10;
else if (I==1'b1)
i=2'b00;
end
en=1'b1;
end
clock_4 clk123 (en,clk_4);
always @ (posedge clk_4)
begin
case (i)
2'b00 :begin index = index +8'd1;sine1=value;if (index ==8'd124) i= 2'b01; end
2'b01 : begin index = index -8'd1;sine1=value;if (index == 8'd0 ) i= 2'b00;end
2'b10 :begin index = index +8'd1;sine1=-value;if (index ==8'd124) i= 2'b11;end
2'b11 : begin index = index -8'd1;sine1=-value;if (index == 8'd0) i= 2'b10;end
//default :begin sine2=8'bzzzzzzzz; index1=@Q 8'b0; end
endcase
end
luk_sin2 aaa2 (index,value);
endmodule
ERROR:Xst:528 - Multi-source in Unit <sin_wave2> on signal <i<2>>
ERROR:Xst:528 - Multi-source in Unit <sin_wave2> on signal <i<1>>
ERROR:Xst:528 - Multi-source in Unit <sin_wave2> on signal <i<0>>
this is my code:
module sin_waveq (clk,rst,I,sine1);
input I,clk,rst;
output [7:0] sine1;
reg [7:0] index;
wire [7:0] value;
reg [7:0] sine1;
reg [1:0] i;
wire clk_4;
wire clk1;
reg en;
initial
begin
i=2'bZZ;
index=8'hzz;
end
assign clk1= clk;
always@(posedge clk)
begin
if (rst==1'b1)
begin
index=8'hzz;
en=0;
end
else
begin
index=8'Hff;
if(I==0)
i=2'b10;
else if (I==1'b1)
i=2'b00;
end
en=1'b1;
end
clock_4 clk123 (en,clk_4);
always @ (posedge clk_4)
begin
case (i)
2'b00 :begin index = index +8'd1;sine1=value;if (index ==8'd124) i= 2'b01; end
2'b01 : begin index = index -8'd1;sine1=value;if (index == 8'd0 ) i= 2'b00;end
2'b10 :begin index = index +8'd1;sine1=-value;if (index ==8'd124) i= 2'b11;end
2'b11 : begin index = index -8'd1;sine1=-value;if (index == 8'd0) i= 2'b10;end
//default :begin sine2=8'bzzzzzzzz; index1=@Q 8'b0; end
endcase
end
luk_sin2 aaa2 (index,value);
endmodule