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

Reply

VHDL - renoir shift syntax

 
Thread Tools Search this Thread
Old 02-21-2004, 04:47 AM   #1
Default renoir shift syntax


I was hoping somebody had some insight into what's going on here:

quoting

http://courses.ece.uiuc.edu/ece312/m...s/shifting.htm



How to do shifting in VHDL

HDL Designer, for whatever reason, doesn't like standard VHDL shifting syntax.
Like most shortcomings of HDL Designer, though, this can be worked around. Shown
below are some possible way to do shifting in a way that HDL Designer will
accept. Note that these may not be the most elegant, but they work.

In the examples below, SigA gets SigB shifted by SigC places. The examples
assume that SigA, SigB, and SigC are std_logic_vectors, and that SigA and SigB
are the same size.

Shifting left
SigA <= std_logic_vector("sll"(unsigned(SigB), to_integer(unsigned(SigC))));

Shifting right (logical)
SigA <= std_logic_vector("srl"(unsigned(SigB), to_integer(unsigned(SigC))));

Shift right (arithmetic)
COUNT := to_integer(unsigned(SigC(3 downto 0)));
if (SigC(3 downto 0) = "0000") then
SigA <= SigB; --Perform no shifting
else
SigA(15 - COUNT downto 0) := SigB(15 downto COUNT);
SigA(15 downto (15 - COUNT + 1)) := (others => SigB(15));
end if;

Note: COUNT is a variable of type integer, and must be declared earlier in your
VHDL.

If you have found a more elegant way to make shifting work, please e-mail the
head TA with how you did it.

</quoting>

Basically this is weird. I have checked every vhdl93 looking option I can find,
and I still get errors trying to use the standard syntax. Does anybody know what
is going wrong?

Thanks in advance


dan list
  Reply With Quote
Old 02-23-2004, 10:09 PM   #2
Mike Treseler
 
Posts: n/a
Default Re: renoir shift syntax
dan list wrote:

> HDL Designer, for whatever reason, doesn't like
> standard VHDL shifting syntax. Like most
> shortcomings of HDL Designer, though,
> this can be worked around.


A better work-around would be to bypass HDL designer completely.
Use your text editor to write code the way you really want it.
Use modelsim to verify the syntax and function of the code.
Finally, use leonardo to synth the code once it sims correctly.

Renoir/HDL designer is one way for the
schematically-oriented to generate VHDL code.
If you already know the language, skip the code generators.

-- Mike Treseler



Mike Treseler
  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
VHDL sll shift question ohaqqi Hardware 4 09-29-2009 11:27 AM
Python, syntax error for nothing darkie Software 0 01-18-2009 11:36 AM
Need help on Modelsim VHDL syntax? ASAP:) kaji General Help Related Topics 0 03-14-2007 10:43 PM
Need help on a Modelsim VHDL Syntax? ASAP:) kaji Software 0 03-14-2007 10:43 PM
Need Help on a Modelsim VHDL Syntax....ASAP:) kaji Hardware 0 03-14-2007 10:41 PM




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