Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Syntax question

 
Thread Tools Search this Thread
Old 08-16-2006, 10:10 PM   #1
Default Syntax question


Hi,

I'm studying opencores DDR controller here:

http://www.opencores.org/pdownloads.cgi/list/ddr_sdr

In file ddr_sdr.vhd here is an excerpt:

architecture behave of ddr_sdr is

-- User Interface
component user_if is
port (
rst_int_n : in std_logic; -- async reset, lo-active
sys_clk : in std_logic;

-- user interface
cmd : in std_logic_vector(U_CMD_WIDTH -1
downto 0); -- command: read, write, nop
cmd_vld : in std_logic;
addr : in std_logic_vector(U_ADDR_WIDTH-1
downto 0); -- ROW, BANK, COLUMN
busy_q : out std_logic; -- busy flag, when
active commands are ignored

-- Datenaustausch mit Controller
init_finished : in boolean;
new_cmd_q : out boolean;
new_cmd_ack : in boolean;
do_prech_q : out boolean; -- precharge followed by
activate
do_wait_q : out boolean; -- additional delay requested

cmd_q : buffer std_logic_vector(U_CMD_WIDTH -1
downto 0);
addr_q : out std_logic_vector(U_ADDR_WIDTH -1
downto 0)
);
end component;

-- Global Buffer BUFG
component bufg
port ( i : in std_ulogic;
o : out std_ulogic );
end component;
-- pragma translate_off
for all: bufg use entity unisim.bufg;
-- pragma translate_on

---CUT

My question is, in all the syntax rules I can find the
"for all: bufg use entity unisim.bufg;" seems like an error.
Why isn't it
for all: bufg
use entity unisim.bufg;
end for;

Where is the "end for;"?

Is this related to the "-- pragma translate_off"?

And more important, WTF is " -- pragma translate_off" supposed
to be doing?

What is all this VOODOO here?

Thanks!

-Dave


David Ashley
  Reply With Quote
Old 08-16-2006, 10:29 PM   #2
Andy Ray
 
Posts: n/a
Default Re: Syntax question
>
> My question is, in all the syntax rules I can find the
> "for all: bufg use entity unisim.bufg;" seems like an error.
> Why isn't it
> for all: bufg
> use entity unisim.bufg;
> end for;
>
> Where is the "end for;"?
>



Good question. I would have expected it to be required as well. For
interest this is a configuration statement selecting bufg from the
xilinx unisim library, as opposed to whatever is in the work library (if
anything).


> Is this related to the "-- pragma translate_off"?
>



Yes and no - its not related to the syntax, but it is related to the
reason the statement's there at all.


> And more important, WTF is " -- pragma translate_off" supposed
> to be doing?
>



The idea of this pragma is that simulators will ignore it completely
while synthesizers will remove the code between
translate_off/translate_on. If you know C then its somewhat like

#ifdef SIMULATOR_ONLY
#endif//SIMULATOR_ONLY

Very useful construct that's equally easy to abuse. It's also worth
noting that specific pragma's are not part of the language spec so no
tool is required to implement them. This one seems to be well supported
though.

Cheers,

Andy.


Andy Ray
  Reply With Quote
Old 08-16-2006, 11:02 PM   #3
David Ashley
 
Posts: n/a
Default Re: Syntax question
Andy Ray wrote:
>...


> Very useful construct that's equally easy to abuse. It's also worth
> noting that specific pragma's are not part of the language spec so no
> tool is required to implement them. This one seems to be well supported
> though.


Andy,

Thanks, that all makes a lot of sense. So when I simulate this
with GHDL it'll ignore the --pragmas and will use the correct
model for the entity, but when I go use the xilinx tools to
synthesize, it'll pay attention to the pragmas and know to
cut out the section and instead use a bufg on the FPGA.

That really clears up a lot for me. Thanks again.

-Dave


David Ashley
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Dial-up Modem Question w_tom A+ Certification 0 09-18-2005 09:12 PM
"Installing two drives" question - what next? Jim A+ Certification 12 08-07-2005 01:19 PM
Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good God DVD Video 3 04-25-2005 04:19 PM
Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good Filthy Mcnasty DVD Video 0 04-25-2005 04:29 AM
Re: Safe Mode Question (A+ question) Gordon Findlay A+ Certification 0 06-16-2004 10:48 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46