Why warnings: "Input <xyz> never used???"

Hi:

I am building my first Verilog project with Xilinx WebPack 5.2i.

I have a module test_delay8 that instantiates a module Delay8Bit, which in turn instantiates two further modules, an 8-bit comparator and an

8-bit counter, where the counter is inferred from the XST library.

But I get lots of warnings about inputs and signals not used:

-------------------------------------------------------------------- Synthesizing Unit . Related source file is cb8ce.v. Found 8-bit up counter for signal . WARNING:Xst:647 - Input is never used. Summary: inferred 1 Counter(s). Unit synthesized.

Synthesizing Unit . Related source file is Delay8Bit.v. WARNING:Xst:647 - Input is never used. WARNING:Xst:647 - Input is never used. WARNING:Xst:647 - Input is never used. WARNING:Xst:647 - Input is never used. WARNING:Xst:647 - Input is never used. WARNING:Xst:647 - Input is never used. WARNING:Xst:647 - Input is never used. WARNING:Xst:647 - Input is never used. Unit synthesized.

Synthesizing Unit . Related source file is test_delay8.v. WARNING:Xst:646 - Signal is assigned but never used. Unit synthesized.

---------------------------------------------------------------------

The logic all seems to work, however.

What are these warnings all about? The signals certainly appear to be used from my perspective. I would like to understand how to code so that the warnings are not generated, since they are not confidence inspiring.

Thanks for assistance

Good day!

P.S. Here are all the modules if you'd like to see. Feel free to criticize my methods in addition to considering my original question:

module test_delay8(Trig_td, Out_td, Clk_td); input wire Trig_td, Clk_td; output wire Out_td;

wire [7:0] Delay_td;

assign Delay_td = 83;

Delay8Bit D1 (.Trig_in(Trig_td), .Out(Out_td), .Clk_in(Clk_td),

.Delay(Delay_td));

endmodule

module Delay8Bit(Trig_in, Out, Clk_in, Delay); input wire Trig_in, Clk_in; input wire [7:0] Delay; output wire Out;

wire [7:0] Qc; wire CompMatchOut; wire nowhere1, nowhere2; supply1 h;

CB8CE Counter1 ( .Q(Qc), .TC(nowhere1), .CE0(nowhere2), .C(Clk_in), .CLR(~Out), .CE(h) );

Compare8 Comp1 (CompMatchOut, Qc, Delay);

FDC FF1 ( .Q(Out), .C(Trig_in), .CLR(CompMatchOut), .D(h) );

endmodule

module Compare8(Q, A, B); output wire Q; input wire [7:0] A; input wire [7:0] B;

wire X7, X6, X5, X4, X3, X2, X1, X0;

xnor XNOR7 (X7, A[7], B[7]), XNOR6 (X6, A[6], B[6]), XNOR5 (X5, A[5], B[5]), XNOR4 (X4, A[4], B[4]), XNOR3 (X3, A[3], B[3]), XNOR2 (X2, A[2], B[2]), XNOR1 (X1, A[1], B[1]), XNOR0 (X0, A[0], B[0]);

and (Q, X7, X6, X5, X4, X3, X2, X1, X0);

endmodule

module CB8CE(Q, TC, CE0, C, CLR, CE); output reg [7:0] Q; output reg TC, CE0; input wire C, CLR, CE;

/* Here is the "Counter binary 8-bit async. clear with enable (CB8CE)" inference code from the Xilinx lib.pdf document: */ always @ (posedge C or posedge CLR) begin if (CLR) Q

Reply to
Chris Carlen
Loading thread data ...

Chris,

I didn't have time to look at your code. I'll just offer a couple of pointers here.

The Xilinx tools will optimize away logic you are not using. In doing so, a path that you thought was complete might endup without logic to connect to. A warning will be issued to let you know.

In general terms, take a look at your design and make sure that every single signal contributes to physical chip outputs. That's the key. If a singnal, say, the high bit of a counter, doesn't influence an output at all, the tools will remove that flip-flop and anything else prior to that flip-flop that does not add anything to the mix.

I soft of doesn't make sense in the context of building out a design, when you might not have all the blocks ready. It can be a real pain. One approach is to put in dummy blocks that do something with signals you are not using yet (a large AND function, for example, with the single output assigned to a pin).

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Martin Euredjian

To send private email:
0_0_0_0_@pacbell.net
where
"0_0_0_0_"  =  "martineu"
Reply to
Martin Euredjian

Yeah, I gather what's happening is that it sees a constant applied to the input of some function, and reduces the logic. In the process, the input becomes superfluous.

Thanks for the reply.

Good day!

--
____________________________________
Christopher R. Carlen
Principal Laser/Optical Technologist
Sandia National Laboratories CA USA
crcarle@sandia.gov
Reply to
Chris Carlen

Hi Chris,

It's off topic, and it is probably none of my business to suggest (I almost used the word "criticize," but I instead used "suggest," so that you won't feel offended.), but why instantiate a vendor specific library primitive and Verilog gate primitives when you don't have to? These are the two examples I am talking about. ______________________________________________________________________ FDC FF1 ( .Q(Out), .C(Trig_in), .CLR(CompMatchOut), .D(h) );

______________________________________________________________________

Why instantiate an FDC? You should be able to replace it with the following code (Assuming that what I am doing is correct), and the synthesis tool should infer you an FDC.

______________________________________________________________________ reg Out;

always @ (posedge Trig_in or posedge CompMatchOut) begin

if (CompMatchOut == 1'b1) begin Out

Reply to
Kevin Brace

Well, it was kinda fun ;-) I am also learning digital logic design by gradual experience, having never taking a formal course in it. So I asked myself "how does one determine the equality of two binary words?" I proceeded to twiddle with bits and bytes and truth tables on paper, and came up with the above blob of gates. I proceeded to implement it structurally, again just to cement my comfortability with this inefficient coding style.

Then I discovered on further perusing the Xilinx library that they had the same thing available to me already.

In the interest of learning I also experimented with the following way in dataflow style:

assign Q = & ( A ~^ B );

which seemed to work fine. I also wondered if it was possible to write the operation in the way you show here:

But actually, I wonder if you can do this:

assign Q = (A == B); // ???

Ok, thanks for the reply.

Good day!

--
____________________________________
Christopher R. Carlen
Principal Laser/Optical Technologist
Sandia National Laboratories CA USA
crcarle@sandia.gov
Reply to
Chris Carlen

Is the book you are using called Verilog Digital System Design by Zainalabedin Navabi? It sounds like that because that book gets into boring stuff like structural modeling.

Right, you probably should avoid using vendor specific features if there is no benefit like performance gain or logic resources reduction. Otherwise, keeping the logic generic makes sense for portability reasons.

I am personally sure how to answer this question, but even if you are interested in modeling a FF, in Verilog "reg" is as simple as things get. That being said, if you are interested in instantiating a vendor specific primitive like FDC from Xilinx's primitive library (Other firms have a similar primitive with similar names.), you can do that, but, of course, the code will become vendor specific.

Because of synthesis tools, I haven't used truth tables for years (Last time I did so in a college digital logic course.), however, when I had to build timing critical logic, I ended up reverting back to drawing gates on a paper (Really, equivalent of doing schematics.), mapping those gates into 4-input LUTs (Look-Up Tables), convert the paper schematics into Verilog assign statement equations using & (AND), | (OR), ^ (XOR), and ~ (NOT), and finally, slapping "keep" attribute of a synthesis tool (XST in my case.) to the wires coming out of assign statements to prevent the synthesis tool from messing up the carefully crafted equations I wrote (Still, XST ignored the keep attribute in some cases, but 95% of the equations survived intact.). What I just described is a really low level coding style, and I wish I didn't have to do so, but I had no choice.

Yes, the above "assign Q = (A == B);" should work, however, I usually like to specify the bit range, so that nothing unexpected happens. Generally speaking, Verilog is not a strict language, and lets to do things like comparison without specifying the bit range, however, I heard (I am not 100% sure.) that VHDL may not let you do that.

Kevin Brace

Reply to
Kevin Brace

Bhasker, "A verilog HDL Primer." I also have the synthesis book, which I'll read after the primer.

I figured I'd be safe doing some real-world projects using structural modeling, since there isn't much to think about in terms of synthesis issues at this level.

So there's another book that deals with boring structural modeling!

I see.

Thanks for the input.

Good day!

--
____________________________________
Christopher R. Carlen
Principal Laser/Optical Technologist
Sandia National Laboratories CA USA
crcarle@sandia.gov
Reply to
Chris Carlen

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.