Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

I need help with verilog asap.

  1. May 15, 2005 #1
    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)
    for(i=0; i <=255; i=i+1)


    As far as I can tell, gclk is used in the always statement so why xilinix say "unconnected in block <pwm>"?
  2. jcsd
  3. May 16, 2005 #2
  4. May 17, 2005 #3
    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)
    counter = counter +1;
    if(counter == 5) //50000000
    gclk= ~gclk;
    counter =0;
    Last edited: May 17, 2005
  5. May 17, 2005 #4
    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 thier 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.)
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook