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

Confused with syntax

Ask a question - edaboard.com

elektroda.net NewsGroups Forum Index - Verilog Language - Confused with syntax

Daku
Guest

Mon May 09, 2011 5:25 am   



Could some Verilog guru please clarify a small thing ? Recently, while
going over some RTL code I saw:
dff #(1) d0_0 (
..l1clk(l1clk),
..siclk(siclk),
..soclk(soclk),
..d(fdin[0:0]),
..si(scan_in),
..so(scan_out),
..q(dout[0:0])
);

May I know what the "#(1)" is supposed to mean, in this context,
i.e., instantiating a dff ?
Any hints, suggestions would be of immense help. Thanks in
advance.

Jonathan Bromley
Guest

Mon May 09, 2011 4:30 pm   



On Sun, 8 May 2011 20:25:45 -0700 (PDT), Daku <dakupoto_at_gmail.com>
wrote:

Quote:
Could some Verilog guru please clarify a small thing ? Recently, while
going over some RTL code I saw:
dff #(1) d0_0 (
.l1clk(l1clk),
.siclk(siclk),
.soclk(soclk),
.d(fdin[0:0]),
.si(scan_in),
.so(scan_out),
.q(dout[0:0])
);

May I know what the "#(1)" is supposed to mean, in this context,
i.e., instantiating a dff ?
Any hints, suggestions would be of immense help. Thanks in
advance.

hi Daku,

It's just a parameter override. Presumably module dff looks
something like this:

module dff #(parameter n_bits = Cool
(input llclk, .... );

And when you create your instance d0_0 of dff, you need
to set the parameter "n_bits" to the value 1.

Modern versions of Verilog allow you to do named parameter
mapping as well as port mapping, so you could have this:

dff #(.n_bits(1)) d0_0(...);

Anyway, look up "module parameters" in whatever texts you have,
to find out more details.
--
Jonathan Bromley

elektroda.net NewsGroups Forum Index - Verilog Language - Confused with syntax

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