jadedfox
Member level 1
multi-source error!!
pls help me with this piece of code....
it's giving error like "Multi-source in unit control_block on signal DCO_CONTRL[7]&[6]"
how to fix this error..??
thanks in advance
pls help me with this piece of code....
it's giving error like "Multi-source in unit control_block on signal DCO_CONTRL[7]&[6]"
how to fix this error..??
Code:
module control_block( reset, enable, ext_clk, clk2, fast, slow, up, dn, DCO_CONTRL, phase_acquisition_mode, pll_lock );
input reset, enable, ext_clk, clk2, fast, slow, up, dn;
output [7:0] DCO_CONTRL;
output phase_acquisition_mode, pll_lock;
reg [7:0] DCO_CONTRL;
reg pll_lock;
reg mode_adjust_done;
reg [5:0] pointer;
reg phase_acquisition_mode;
//mode adjust in the frequency acquisition mode
always @( posedge reset or posedge ext_clk )
begin
if( reset ) begin
DCO_CONTRL[7] <= 1'b1;
DCO_CONTRL[6] <= 1'b0;
mode_adjust_done <= 1'b0;
end
else if( !clk2 ) begin
if( !enable ) DCO_CONTRL <= DCO_CONTRL;
else if( fast & !DCO_CONTRL[7] & !DCO_CONTRL[6] & !mode_adjust_done ) mode_adjust_done <= 1'b1;
else if( fast & !mode_adjust_done ) begin
DCO_CONTRL[7] <= 1'b0;
DCO_CONTRL[6] <= DCO_CONTRL[7] & !DCO_CONTRL[6];
end
else if( slow & !mode_adjust_done ) begin
mode_adjust_done <= 1'b1;
DCO_CONTRL[7] <= ( !DCO_CONTRL[7] & DCO_CONTRL[6] ) | ( DCO_CONTRL[7] & !DCO_CONTRL[6] );
DCO_CONTRL[6] <= !DCO_CONTRL[6];
end
end
end
//adjust control register in the frequency acquisition mode
always @( posedge reset or posedge ext_clk )
begin
if( reset ) begin
DCO_CONTRL[5:0] <= 6'h3f;
pointer[5:0] <= 6'h20;
phase_acquisition_mode <= 1'b0;
pll_lock <= 1'b0;
end
else if( !clk2 ) begin
if( !enable ) DCO_CONTRL <= DCO_CONTRL;
else if( phase_acquisition_mode ) begin
if( up ) begin
pll_lock <= 1'b1;
DCO_CONTRL <= DCO_CONTRL + 1;
end
else if( dn ) begin
pll_lock <= 1'b1;
DCO_CONTRL <= DCO_CONTRL - 1;
end
end
else if( pointer == 6'h00 ) phase_acquisition_mode <= 1'b1;
else if( fast & mode_adjust_done ) begin
DCO_CONTRL <= DCO_CONTRL - pointer;
pointer <= pointer >> 1;
end
else if( slow & mode_adjust_done ) begin
DCO_CONTRL <= DCO_CONTRL + pointer;
pointer <= pointer >> 1;
end
end
end
endmodule
thanks in advance