unused outputs ?

C

Chris Hinsley

Guest
I'm currently putting unused wires in my code to say 'I'm not
interested in this output' like this.

add #(REG_WIDTH) u3(i_pc, 4, pc[0], unused_c[0]);
add #(REG_WIDTH) u4(i_pc, sx, pc[1], unused_c[1]);

Is there an official way I should be doing this ? In this older style syntax ?

Regards.

Chris
 
In article <2011041316142829620-chrishinsley@gmailcom>,
Chris Hinsley <chris.hinsley@gmail.com> wrote:
I'm currently putting unused wires in my code to say 'I'm not
interested in this output' like this.

add #(REG_WIDTH) u3(i_pc, 4, pc[0], unused_c[0]);
add #(REG_WIDTH) u4(i_pc, sx, pc[1], unused_c[1]);

Is there an official way I should be doing this ? In this older style syntax ?
Chris,

Well the first thing to do is use named ports - don't depend
on port order - you're begging for trouble. Nothing's
"official" but I'd guess just about everybody does this.

So, the way I handle unused outputs is (I'm guessing at your port names):
add #(.REG_WIDTH(REG_WIDTH)) u3(.a_i(i_pc), .b_i(32'd4), .mode_i(pc[0]), .y_o( ));
add #(.REG_WIDTH(REG_WIDTH)) u4(.a_i(i_pc), .b_i(sx), .mode_i(pc[1]), .y_o( ));

Don't even bother creating the "unused" wires. Less clutter.

--Mark
 
On 2011-04-13 18:00:40 +0100, Mark Curry said:

In article <2011041316142829620-chrishinsley@gmailcom>,
Chris Hinsley <chris.hinsley@gmail.com> wrote:
I'm currently putting unused wires in my code to say 'I'm not
interested in this output' like this.

add #(REG_WIDTH) u3(i_pc, 4, pc[0], unused_c[0]);
add #(REG_WIDTH) u4(i_pc, sx, pc[1], unused_c[1]);

Is there an official way I should be doing this ? In this older style syntax ?

Chris,

Well the first thing to do is use named ports - don't depend
on port order - you're begging for trouble. Nothing's
"official" but I'd guess just about everybody does this.

So, the way I handle unused outputs is (I'm guessing at your port names):
add #(.REG_WIDTH(REG_WIDTH)) u3(.a_i(i_pc), .b_i(32'd4),
.mode_i(pc[0]), .y_o( ));
add #(.REG_WIDTH(REG_WIDTH)) u4(.a_i(i_pc), .b_i(sx), .mode_i(pc[1]),
.y_o( ));

Don't even bother creating the "unused" wires. Less clutter.

--Mark
OK, I should probably move over to named ports.

Is there a standard way of geting an auto generated unit name from the
compiler ? Inside a generate loop you don't need to put anything so is
there an option to just use whatever the generate stuff expands to ?
It's a bit boring to have to keep putting, u1, u2, u3, ...

Chris
 
In article <2011041318441358718-chrishinsley@gmailcom>,
Chris Hinsley <chris.hinsley@gmail.com> wrote:
On 2011-04-13 18:00:40 +0100, Mark Curry said:

In article <2011041316142829620-chrishinsley@gmailcom>,
Chris Hinsley <chris.hinsley@gmail.com> wrote:
I'm currently putting unused wires in my code to say 'I'm not
interested in this output' like this.

add #(REG_WIDTH) u3(i_pc, 4, pc[0], unused_c[0]);
add #(REG_WIDTH) u4(i_pc, sx, pc[1], unused_c[1]);

Is there an official way I should be doing this ? In this older style syntax ?

Chris,

Well the first thing to do is use named ports - don't depend
on port order - you're begging for trouble. Nothing's
"official" but I'd guess just about everybody does this.

So, the way I handle unused outputs is (I'm guessing at your port names):
add #(.REG_WIDTH(REG_WIDTH)) u3(.a_i(i_pc), .b_i(32'd4),
.mode_i(pc[0]), .y_o( ));
add #(.REG_WIDTH(REG_WIDTH)) u4(.a_i(i_pc), .b_i(sx), .mode_i(pc[1]),
.y_o( ));

Don't even bother creating the "unused" wires. Less clutter.

--Mark

OK, I should probably move over to named ports.

Is there a standard way of geting an auto generated unit name from the
compiler ? Inside a generate loop you don't need to put anything so is
there an option to just use whatever the generate stuff expands to ?
It's a bit boring to have to keep putting, u1, u2, u3, ...
Some people use magic from their favorite text editor - but no there's no
general other solution. You gotta name your instances something.
I tend to name them the same as the module name, then add
something for uniqueness, if required.

foo foo();
bar bar1;
bar bar2;
baz baz_thisthing();
baz baz_thatthing();

Don't like "unumber" anymore - debugging in the waveform is easier with
more meaningful names.

--Mark
 
On Wednesday, April 13, 2011 10:00:40 AM UTC-7, Mark Curry wrote:
In article <2011041316142829620-chrishinsley@gmailcom>,
Chris Hinsley <chris....@gmail.com> wrote:
I'm currently putting unused wires in my code to say 'I'm not
interested in this output' like this.

add #(REG_WIDTH) u3(i_pc, 4, pc[0], unused_c[0]);
add #(REG_WIDTH) u4(i_pc, sx, pc[1], unused_c[1]);

Is there an official way I should be doing this ? In this older style syntax ?

Chris,

Well the first thing to do is use named ports - don't depend
on port order - you're begging for trouble. Nothing's
"official" but I'd guess just about everybody does this.

So, the way I handle unused outputs is (I'm guessing at your port names):
add #(.REG_WIDTH(REG_WIDTH)) u3(.a_i(i_pc), .b_i(32'd4), .mode_i(pc[0]), .y_o( ));
add #(.REG_WIDTH(REG_WIDTH)) u4(.a_i(i_pc), .b_i(sx), .mode_i(pc[1]), .y_o( ));

Don't even bother creating the "unused" wires. Less clutter.
I agree, except I put something like this:
add #(.REG_WIDTH(REG_WIDTH)) u3(.a_i(i_pc), .b_i(32'd4), .mode_i(pc[0]), .y_o(/*NOT USED*/ ));

This way I know I'm purposely not using it and didn't just forget it.

David
 
On 2011-04-13 23:50:12 +0100, unfrostedpoptart said:

On Wednesday, April 13, 2011 10:00:40 AM UTC-7, Mark Curry wrote:
In article <2011041316142829620-chrishinsley@gmailcom>,
Chris Hinsley <chris....@gmail.com> wrote:
I'm currently putting unused wires in my code to say 'I'm not
interested in this output' like this.

add #(REG_WIDTH) u3(i_pc, 4, pc[0], unused_c[0]);
add #(REG_WIDTH) u4(i_pc, sx, pc[1], unused_c[1]);

Is there an official way I should be doing this ? In this older style syntax ?

Chris,

Well the first thing to do is use named ports - don't depend
on port order - you're begging for trouble. Nothing's
"official" but I'd guess just about everybody does this.

So, the way I handle unused outputs is (I'm guessing at your port names):
add #(.REG_WIDTH(REG_WIDTH)) u3(.a_i(i_pc), .b_i(32'd4),
.mode_i(pc[0]), .y_o( ));
add #(.REG_WIDTH(REG_WIDTH)) u4(.a_i(i_pc), .b_i(sx), .mode_i(pc[1]), .y_o( ));

Don't even bother creating the "unused" wires. Less clutter.

I agree, except I put something like this:
add #(.REG_WIDTH(REG_WIDTH)) u3(.a_i(i_pc), .b_i(32'd4),
.mode_i(pc[0]), .y_o(/*NOT USED*/ ));

This way I know I'm purposely not using it and didn't just forget it.

David
clu4 u3(.i_c(i_c), .i_p({2'b0, p}), .i_g({2'b0, g}),
..o_c({unused_c[3:2], c}), .o_p(), .o_g());

So how do I ignore just parts of an output vector ? Like the .o_c param here ?

Chris
 
Chris Hinsley wrote:
On 2011-04-13 23:50:12 +0100, unfrostedpoptart said:
[snip]

clu4 u3(.i_c(i_c), .i_p({2'b0, p}), .i_g({2'b0, g}),
.o_c({unused_c[3:2], c}), .o_p(), .o_g());

So how do I ignore just parts of an output vector ? Like the .o_c param
here ?

Chris
I've done exactly the same as you have there, sometimes. Another
approach is to increase the size of c to fill the entire vector and
live with the warnings on the unused bits. If you want to be sure
that the string "unused" is in the signal name in the warning you
could also do:

wire [3:0] c_maybe_unused;

clu4 u3(.i_c(i_c), .i_p({2'b0, p}), .i_g({2'b0, g}),
..o_c(c_maybe_unused), .o_p(), .o_g());

assign c = c_maybe_unused [1:0];

At least for the synthesizer I use, this will re-name the low bits
back to "c" due to the continuous assign, but leave the unused upper
bits "c_maybe_unused".

-- Gabor
 

Welcome to EDABoard.com

Sponsor

Back
Top