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

Reply

VHDL - Synthesis Problem

 
Thread Tools Search this Thread
Old 01-07-2005, 10:16 PM   #1
Default Synthesis Problem


Hi everyone!

I've run into a problem with a design I'm working on and I hope someone
may have had a similar problem before. I have a narrow but deep
SelectRam with some data in it, that I am trying to read into a
std_logic_vector. The problem is when I try to synthesize the design
using Synplify Pro, it gives me the following error:

"Expecting constant expression"

which refers to this line of code:

q_out_buff(q_up_idx downto q_idx) <= q_dout(1 downto 0);

The above code is in a clocked process, and executes a finite number of
times to load the vector. On each clock, q_up_idx and q_idx get
incremented and q_dout is the output from the SelectRam.

Now, the synthesizer doesn't like the dynamic index into my vector, even
though functionally it is correct. Does anyone know of a more explicit
way to write this so Synplify can understand what I am trying to do?

Thanks in advance,
Joe Lancaster


Joe Lancaster
  Reply With Quote
Old 01-08-2005, 06:45 AM   #2
Ralf Hildebrandt
 
Posts: n/a
Default Re: Synthesis Problem
Joe Lancaster wrote:

> q_out_buff(q_up_idx downto q_idx) <= q_dout(1 downto 0);


Maybe your synthesis tool does not like this, because there are two
_independent_ values for upper and lower bound: q_up_idx and q_idx. What
happens if you just write:

q_out_buff(q_idx+1 downto q_idx) <= q_dout(1 downto 0); --?

Furthermore: Should q_out_buff be a latch (this is the case te the
moment)? What value do you want for the bits, that are not assigned with
the new value q_dout?


Otherwise I would start with modelling every bit of q_out_buff manually:

-- all latches!
q_out_buff(0) = q_dout(0) when q_idx=0;
q_out_buff(1) = q_dout(1) when q_idx=0 else
q_dout(0) when q_idx=1; -- take care! muxed latch!
-- and so on...

I guess, you will find a way to describe it with a for-generate loop.


Ralf


Ralf Hildebrandt
  Reply With Quote
Old 01-09-2005, 09:22 PM   #3
Tim Hubberstey
 
Posts: n/a
Default Re: Synthesis Problem
Joe Lancaster wrote:
> Hi everyone!
>
> I've run into a problem with a design I'm working on and I hope someone
> may have had a similar problem before. I have a narrow but deep
> SelectRam with some data in it, that I am trying to read into a
> std_logic_vector. The problem is when I try to synthesize the design
> using Synplify Pro, it gives me the following error:
>
> "Expecting constant expression"
>
> which refers to this line of code:
>
> q_out_buff(q_up_idx downto q_idx) <= q_dout(1 downto 0);
>
> The above code is in a clocked process, and executes a finite number of
> times to load the vector. On each clock, q_up_idx and q_idx get
> incremented and q_dout is the output from the SelectRam.
>
> Now, the synthesizer doesn't like the dynamic index into my vector, even
> though functionally it is correct. Does anyone know of a more explicit
> way to write this so Synplify can understand what I am trying to do?


Try splitting the assignment up like this:

q_out_buff(q_up_idx) <= q_dout(1);
q_out_buff(q_idx) <= q_dout(0);

Also, you may have to make sure that your code defines a fixed (not just
finite) number of iterations.

If that doesn't work, you may need to define the implied multiplexer
explicitly and generate an explicit select signal.
--
Tim Hubberstey, P.Eng. . . . . . Hardware/Software Consulting Engineer
Marmot Engineering . . . . . . . VHDL, ASICs, FPGAs, embedded systems
Vancouver, BC, Canada . . . . . . . . . . . http://www.marmot-eng.com



Tim Hubberstey
  Reply With Quote
Old 01-10-2005, 05:58 AM   #4
jtw
 
Posts: n/a
Default Re: Synthesis Problem
I had the same issue recently with Synplify; everything fine in Modelsim,
but then ... it wouldn't synthesize. I just coded mine into a loop (I had
more bits than the two used here), and each pass of the loop assigned each
bit individually. (My implementation was more a barrel shifter.)

Synthesizer is now happy.

Jason

"Tim Hubberstey" <> wrote in message
news:QghEd.15004$06.872@clgrps12...
> Joe Lancaster wrote:
>> Hi everyone!
>>
>> I've run into a problem with a design I'm working on and I hope someone
>> may have had a similar problem before. I have a narrow but deep
>> SelectRam with some data in it, that I am trying to read into a
>> std_logic_vector. The problem is when I try to synthesize the design
>> using Synplify Pro, it gives me the following error:
>>
>> "Expecting constant expression"
>>
>> which refers to this line of code:
>>
>> q_out_buff(q_up_idx downto q_idx) <= q_dout(1 downto 0);
>>
>> The above code is in a clocked process, and executes a finite number of
>> times to load the vector. On each clock, q_up_idx and q_idx get
>> incremented and q_dout is the output from the SelectRam.
>>
>> Now, the synthesizer doesn't like the dynamic index into my vector, even
>> though functionally it is correct. Does anyone know of a more explicit
>> way to write this so Synplify can understand what I am trying to do?

>
> Try splitting the assignment up like this:
>
> q_out_buff(q_up_idx) <= q_dout(1);
> q_out_buff(q_idx) <= q_dout(0);
>
> Also, you may have to make sure that your code defines a fixed (not just
> finite) number of iterations.
>
> If that doesn't work, you may need to define the implied multiplexer
> explicitly and generate an explicit select signal.
> --
> Tim Hubberstey, P.Eng. . . . . . Hardware/Software Consulting Engineer
> Marmot Engineering . . . . . . . VHDL, ASICs, FPGAs, embedded systems
> Vancouver, BC, Canada . . . . . . . . . . . http://www.marmot-eng.com
>





jtw
  Reply With Quote
Old 01-12-2005, 03:32 AM   #5
Joe Lancaster
 
Posts: n/a
Default Re: Synthesis Problem
Hello again!

Thanks to everyone for your help.

Good call Tim, your method worked great and I didn't have to do loops or
enumeration! I just modified

q_out_buff(q_up_idx downto q_idx) <= q_dout(1 downto 0);

to be

q_out_buff(q_idx + 1) <= q_dout(1);
q_out_buff(q_idx) <= q_dout(1);

and Synplicity is happy (and so am I).

Thanks again,
Joe

Tim Hubberstey wrote:
> Joe Lancaster wrote:
>
>> Hi everyone!
>>
>> I've run into a problem with a design I'm working on and I hope
>> someone may have had a similar problem before. I have a narrow but
>> deep SelectRam with some data in it, that I am trying to read into a
>> std_logic_vector. The problem is when I try to synthesize the design
>> using Synplify Pro, it gives me the following error:
>>
>> "Expecting constant expression"
>>
>> which refers to this line of code:
>>
>> q_out_buff(q_up_idx downto q_idx) <= q_dout(1 downto 0);
>>
>> The above code is in a clocked process, and executes a finite number
>> of times to load the vector. On each clock, q_up_idx and q_idx get
>> incremented and q_dout is the output from the SelectRam.
>>
>> Now, the synthesizer doesn't like the dynamic index into my vector,
>> even though functionally it is correct. Does anyone know of a more
>> explicit way to write this so Synplify can understand what I am trying
>> to do?

>
>
> Try splitting the assignment up like this:
>
> q_out_buff(q_up_idx) <= q_dout(1);
> q_out_buff(q_idx) <= q_dout(0);
>
> Also, you may have to make sure that your code defines a fixed (not just
> finite) number of iterations.
>
> If that doesn't work, you may need to define the implied multiplexer
> explicitly and generate an explicit select signal.



Joe Lancaster
  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
Comcast + Wireless Internet Problem shadoweloc General Help Related Topics 1 07-01-2008 06:19 PM
Dial Up Problem smackedass A+ Certification 3 02-02-2007 11:59 PM
Re: Virus Problem ** Help!** David BlandIII A+ Certification 1 03-02-2004 06:00 PM
Re: Serious Computer Problem hootnholler A+ Certification 1 11-24-2003 12:18 PM
Re: Serious Computer Problem Bret A+ Certification 0 11-19-2003 12:51 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