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.

multi-source error!! -how to fix this error..?

Status
Not open for further replies.

jadedfox

Member level 1
Joined
Jan 25, 2008
Messages
33
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,459
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..??
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
 

multi-source error!!

Most of the code is duplicated in the above text. It seems like a simple copy and past error, just correct it. If it's intentionally however, it can't work.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top