EDAboard.com | EDAboard.eu | EDAboard.de | EDAboard.co.uk | RTV forum PL | NewsGroups PL

unused outputs ?

Ask a question - edaboard.com

elektroda.net NewsGroups Forum Index - Verilog Language - unused outputs ?

Chris Hinsley
Guest

Wed Apr 13, 2011 3:14 pm   



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

Mark Curry
Guest

Wed Apr 13, 2011 5:00 pm   



In article <2011041316142829620-chrishinsley_at_gmailcom>,
Chris Hinsley <chris.hinsley_at_gmail.com> wrote:
Quote:
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

Chris Hinsley
Guest

Wed Apr 13, 2011 5:44 pm   



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

Quote:
In article <2011041316142829620-chrishinsley_at_gmailcom>,
Chris Hinsley <chris.hinsley_at_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

Mark Curry
Guest

Wed Apr 13, 2011 6:32 pm   



In article <2011041318441358718-chrishinsley_at_gmailcom>,
Chris Hinsley <chris.hinsley_at_gmail.com> wrote:
Quote:
On 2011-04-13 18:00:40 +0100, Mark Curry said:

In article <2011041316142829620-chrishinsley_at_gmailcom>,
Chris Hinsley <chris.hinsley_at_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

unfrostedpoptart
Guest

Thu Apr 14, 2011 12:50 am   



On Wednesday, April 13, 2011 10:00:40 AM UTC-7, Mark Curry wrote:
Quote:
In article <2011041316142829620-chrishinsley_at_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

Chris Hinsley
Guest

Thu Apr 14, 2011 11:21 am   



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

Quote:
On Wednesday, April 13, 2011 10:00:40 AM UTC-7, Mark Curry wrote:
In article <2011041316142829620-chrishinsley_at_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

Gabor
Guest

Fri Apr 15, 2011 7:01 pm   



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

[snip]

Quote:

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

elektroda.net NewsGroups Forum Index - Verilog Language - unused outputs ?

Ask a question - edaboard.com

Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
RTV map EDAboard.com map News map EDAboard.eu map EDAboard.de map EDAboard.co.uk map Opony