Fixing Xilinx Error: Unconnected Block in Verilog

  • Thread starter Thread starter david90
  • Start date Start date
Click For Summary
The Xilinx error "All outputs of the instance <N1> of the block <clkdiv> are unconnected in block <pwm>" arises because the output signal `gclk` from the `clkdiv` module is not properly connected in the `pwm` module. The `gclk` signal is used in the `always` block but is not declared as an output in the `clkdiv` module's port list. To resolve this, ensure that `gclk` is correctly defined as an output in the `clkdiv` module and connected in the `pwm` module instantiation. Additionally, using named port lists when instantiating modules can help avoid such connection issues. Proper project file management in Xilinx ISE is also crucial to ensure all modules are recognized during compilation.
david90
Messages
311
Reaction score
2
I'm getting this error a lot now and I'm not sure why

WARNING:Xst:524 - All outputs of the instance <N1> of the block <clkdiv> are unconnected in block <pwm>

here's my code

module pwm(clk,in,pwm_out);
input clk;
input [7:0] in;
output pwm_out;

clkdiv N1(clk,gclk);

reg i,pwm_out;

always @(posedge gclk)
begin
for(i=0; i <=255; i=i+1)
begin
pwm_out<=1;
end

end
endmodule
====================

As far as I can tell, gclk is used in the always statement so why xilinix say "unconnected in block <pwm>"?
 
Engineering news on Phys.org
thanks for responding. I've been getting a lot of those unconnected warnings so it must be a bad habit that I don't know about. I just wnana figure out what I've been doing wrong. Can u edit the code so that it can syn without the warnings? the code doesn't do anything in particular.
here is the clkdiv module.
---------------------
module clkdiv(clk,gclk);
input clk;
output gclk;
reg gclk;
reg [26:0] counter;
initial counter=0;
initial gclk=0;
always @(posedge clk)
begin
counter = counter +1;
if(counter == 5) //50000000
begin
gclk= ~gclk;
counter =0;
end
end
endmodule
 
Last edited:
I did a visual inspection of both files and I don't see any syntax errors
but I do see one logical error (pwm_out is never set low). To be sure
I compiled both and no errors or warnings were produced.

I am not familiar with the Xilinx verilog compiler (I only use ISE to place
and route edifs) but I would guess the problem is due to the fact that
the compiler cannot find the definition of the clkdiv module when it is
compiling the pwm module. So it doesn't figure out that clkdiv::gclk is
an output.

Are you using the gui to manage the xilinx project? If so make sure you
followed their produce to add files to the project exactly.
If you are using the command line tool then you probably have to add
each module to the command line and clkdiv has to come first (I would
do this once in a script.)
 
I am trying to understand how transferring electric from the powerplant to my house is more effective using high voltage. The suggested explanation that the current is equal to the power supply divided by the voltage, and hence higher voltage leads to lower current and as a result to a lower power loss on the conductives is very confusing me. I know that the current is determined by the voltage and the resistance, and not by a power capability - which defines a limit to the allowable...

Similar threads

  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
8K
Replies
20
Views
4K
Replies
2
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
21K
  • · Replies 1 ·
Replies
1
Views
3K