Fixing Xilinx Error: Unconnected Block in Verilog

  • Thread starter Thread starter david90
  • Start date Start date
Click For Summary

Discussion Overview

The discussion centers around resolving a warning message from Xilinx related to unconnected outputs in a Verilog module. Participants are examining the code for a PWM (Pulse Width Modulation) generator and its associated clock divider module, focusing on the implications of module connections and potential logical errors.

Discussion Character

  • Technical explanation
  • Debugging
  • Conceptual clarification

Main Points Raised

  • One participant reports receiving a warning about unconnected outputs in the PWM module, specifically regarding the instance of the clkdiv module.
  • Another participant questions whether the gclk signal is properly defined as an output in the clkdiv module, suggesting that this could be the source of the warning.
  • A participant expresses a desire to correct the code to eliminate warnings, indicating a lack of clarity on the underlying issues.
  • One participant notes a logical error in the PWM module, pointing out that pwm_out is never set low, which could lead to unintended behavior.
  • There is speculation that the Xilinx compiler may not be recognizing the clkdiv module correctly, possibly due to project setup issues or file management in the Xilinx environment.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the exact cause of the warning or the best approach to resolve it. Multiple viewpoints are presented regarding the potential issues in the code and project setup.

Contextual Notes

There are indications of missing assumptions regarding module connections and project configuration in Xilinx. The discussion does not resolve these uncertainties.

Who May Find This Useful

Individuals working with Verilog in Xilinx environments, particularly those encountering similar warnings or issues with module connections and project setup.

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.)
 

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
3K
  • · 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
3K