Initialising a constant with a return value from a function
Author |
Message |
ferg.. #1 / 11
|
Initialising a constant with a return value from a function
Does anyone know how to make synopsys use a functions return value to initilise a constant. BTW the function uses parameters in the generic list!. This work fine for simulation but not for synthesis. I know ther must be a way of doing this knid of thing. thanks jonathan Sent via Deja.com http://www.*-*-*.com/ Before you buy.
|
Sun, 19 Jan 2003 03:00:00 GMT |
|
|
fred_bes #2 / 11
|
Initialising a constant with a return value from a function
Jonathan, Quote: >Does anyone know how to make synopsys use a functions return >value to initilise a constant
Why are you using a function to initialize your constant? The value of a constant cannot be changed after it is created. Are you trying to do a deferred constant declaration? It would help if you posted the relevent part of the code. Regards, Fred Best ----------------------------------------------------------- Got questions? Get answers over the phone at Keen.com. Up to 100 minutes free! http://www.keen.com
|
Sun, 19 Jan 2003 03:00:00 GMT |
|
|
Ray Andrak #3 / 11
|
Initialising a constant with a return value from a function
I'm sure he's trying to initialize it with something that depends on a relatively complex function of an input attribute or generic. I've done it many times with synplicity, but synopsis... I dunno. This comes up from time to time in parameterized code, especially in arithmetic applications. Quote:
> Jonathan, > >Does anyone know how to make synopsys use a functions return > >value to initilise a constant > Why are you using a function to initialize your constant? > The value of a constant cannot be changed after it is created. > Are you trying to do a deferred constant declaration? > It would help if you posted the relevent part of the code. > Regards, > Fred Best > ----------------------------------------------------------- > Got questions? Get answers over the phone at Keen.com. > Up to 100 minutes free! > http://www.keen.com
|
Sun, 19 Jan 2003 03:00:00 GMT |
|
|
John McCluske #4 / 11
|
Initialising a constant with a return value from a function
Ray is absolutely correct. Many people don't realize this, but the ability to initialize a constant with a function call implies that a synthesys tool must also include SIMULATION capability. The simulation comes at elaboration time when the function is evaluated. I use this ALL the time... A simple example: Use the sin() function in the IEEE real_math package to intialized a constant integer array with a table of sine values, scaled appropriately. Then an indexed lookup into the constant array becomes a quantized Sine function, suitable for synthesis as a Numerical Controlled Oscillator (DDS). I do it in a fancy fashion, passing the integer vector to a ROM component with pipelining... I can do a 1024x16 (effective sine wave length & width) Sine function in an Orca 4E2 device at 225 MHz, and the Sine function is generated "on-the-fly" at compile time. If I want a longer or shorter sine wave, well, it's pretty trivial to change the length parameter. It beats all hell out of writing a C program to generate a ROM table. Another example: I can generate CRC components with arbitrary polynomials, using a function call to compute the parity matrix at compile time. No need to write a C function to calculate this beforehand. The list of applications goes on and on... Now if I could only convince the synthesis vendors to let me do File IO during elaboration, I'd be a very happy camper.... John McCluskey Quote:
> I'm sure he's trying to initialize it with something that depends on a > relatively complex function of an input attribute or generic. I've done > it many times with synplicity, but synopsis... I dunno. This comes up > from time to time in parameterized code, especially in arithmetic > applications.
> > Jonathan, > > >Does anyone know how to make synopsys use a functions return > > >value to initilise a constant > > Why are you using a function to initialize your constant? > > The value of a constant cannot be changed after it is created. > > Are you trying to do a deferred constant declaration? > > It would help if you posted the relevent part of the code. > > Regards, > > Fred Best > > ----------------------------------------------------------- > > Got questions? Get answers over the phone at Keen.com. > > Up to 100 minutes free! > > http://www.keen.com
|
Sun, 19 Jan 2003 03:00:00 GMT |
|
|
ferg.. #5 / 11
|
Initialising a constant with a return value from a function
i found my problem...synopsys only allows integers to be assined to constants!! i was using an array of integers..why synopsys can't handle this, i don't know!! Thanks Jonathan
Quote: > Ray is absolutely correct. Many people don't realize this, > but the ability to initialize a constant with a function call implies > that a synthesys tool must also include SIMULATION capability. > The simulation comes at elaboration time when the function is evaluated. > I use this ALL the time... > A simple example: Use the sin() function in the IEEE real_math package > to intialized a constant integer array with a table of sine values, scaled > appropriately. > Then an indexed lookup into the constant array becomes a quantized Sine > function, > suitable for synthesis as a Numerical Controlled Oscillator (DDS). I do it > in a > fancy fashion, passing the integer vector to a ROM component with > pipelining... > I can do a 1024x16 (effective sine wave length & width) Sine function in an > Orca 4E2 > device at 225 MHz, and the Sine function is generated "on-the-fly" at > compile time. > If I want a longer or shorter sine wave, well, it's pretty trivial to change > the length parameter. > It beats all hell out of writing a C program to generate a ROM table. > Another example: I can generate CRC components with arbitrary polynomials, > using > a function call to compute the parity matrix at compile time. No need to > write a C function > to calculate this beforehand. The list of applications goes on and on... > Now if I could only convince the synthesis vendors to let me do File IO > during elaboration, > I'd be a very happy camper.... > John McCluskey
> > I'm sure he's trying to initialize it with something that depends on a > > relatively complex function of an input attribute or generic. I've done > > it many times with synplicity, but synopsis... I dunno. This comes up > > from time to time in parameterized code, especially in arithmetic > > applications.
> > > Jonathan, > > > >Does anyone know how to make synopsys use a functions return > > > >value to initilise a constant > > > Why are you using a function to initialize your constant? > > > The value of a constant cannot be changed after it is created. > > > Are you trying to do a deferred constant declaration? > > > It would help if you posted the relevent part of the code. > > > Regards, > > > Fred Best > > > ----------------------------------------------------------- > > > Got questions? Get answers over the phone at Keen.com. > > > Up to 100 minutes free! > > > http://www.keen.com
Sent via Deja.com http://www.deja.com/ Before you buy.
|
Mon, 20 Jan 2003 03:00:00 GMT |
|
|
e.. #6 / 11
|
Initialising a constant with a return value from a function
Quote:
>Does anyone know how to make synopsys use a functions return value to >initilise a constant. BTW the function uses parameters in the generic >list!. This work fine for simulation but not for synthesis. I know >ther must be a way of doing this knid of thing. >thanks >jonathan
I think you'll have to change your code. It often seems to me that Synopsys's VHDL subset is based on what Verilog can do, and you can't do this in Verilog (not till Verilog 2000, anyway). Evan
|
Mon, 20 Jan 2003 03:00:00 GMT |
|
|
ferg.. #7 / 11
|
Initialising a constant with a return value from a function
John, are you synopsys to initaise a array of constant integer...this what i NEED to do...
Quote: > Ray is absolutely correct. Many people don't realize this, > but the ability to initialize a constant with a function call implies > that a synthesys tool must also include SIMULATION capability. > The simulation comes at elaboration time when the function is evaluated. > I use this ALL the time... > A simple example: Use the sin() function in the IEEE real_math package > to intialized a constant integer array with a table of sine values, scaled > appropriately. > Then an indexed lookup into the constant array becomes a quantized Sine > function, > suitable for synthesis as a Numerical Controlled Oscillator (DDS). I do it > in a > fancy fashion, passing the integer vector to a ROM component with > pipelining... > I can do a 1024x16 (effective sine wave length & width) Sine function in an > Orca 4E2 > device at 225 MHz, and the Sine function is generated "on-the-fly" at > compile time. > If I want a longer or shorter sine wave, well, it's pretty trivial to change > the length parameter. > It beats all hell out of writing a C program to generate a ROM table. > Another example: I can generate CRC components with arbitrary polynomials, > using > a function call to compute the parity matrix at compile time. No need to > write a C function > to calculate this beforehand. The list of applications goes on and on... > Now if I could only convince the synthesis vendors to let me do File IO > during elaboration, > I'd be a very happy camper.... > John McCluskey
> > I'm sure he's trying to initialize it with something that depends on a > > relatively complex function of an input attribute or generic. I've done > > it many times with synplicity, but synopsis... I dunno. This comes up > > from time to time in parameterized code, especially in arithmetic > > applications.
> > > Jonathan, > > > >Does anyone know how to make synopsys use a functions return > > > >value to initilise a constant > > > Why are you using a function to initialize your constant? > > > The value of a constant cannot be changed after it is created. > > > Are you trying to do a deferred constant declaration? > > > It would help if you posted the relevent part of the code. > > > Regards, > > > Fred Best > > > ----------------------------------------------------------- > > > Got questions? Get answers over the phone at Keen.com. > > > Up to 100 minutes free! > > > http://www.keen.com
Sent via Deja.com http://www.deja.com/ Before you buy.
|
Mon, 20 Jan 2003 03:00:00 GMT |
|
|
John McCluske #8 / 11
|
Initialising a constant with a return value from a function
In the past (I can't speak for the present), Synopsys did not support generic parameters other than integers. I have haven't looked at it lately... Perhaps I should revisit... John McCluskey Quote:
> John, are you synopsys to initaise a array of constant integer...this > what i NEED to do...
> > Ray is absolutely correct. Many people don't realize this, > > but the ability to initialize a constant with a function call implies > > that a synthesys tool must also include SIMULATION capability. > > The simulation comes at elaboration time when the function is > evaluated. > > I use this ALL the time... > > A simple example: Use the sin() function in the IEEE real_math > package > > to intialized a constant integer array with a table of sine values, > scaled > > appropriately. > > Then an indexed lookup into the constant array becomes a quantized > Sine > > function, > > suitable for synthesis as a Numerical Controlled Oscillator (DDS). > I do it > > in a > > fancy fashion, passing the integer vector to a ROM component with > > pipelining... > > I can do a 1024x16 (effective sine wave length & width) Sine function > in an > > Orca 4E2 > > device at 225 MHz, and the Sine function is generated "on-the-fly" at > > compile time. > > If I want a longer or shorter sine wave, well, it's pretty trivial to > change > > the length parameter. > > It beats all hell out of writing a C program to generate a ROM table. > > Another example: I can generate CRC components with arbitrary > polynomials, > > using > > a function call to compute the parity matrix at compile time. No > need to > > write a C function > > to calculate this beforehand. The list of applications goes on and > on... > > Now if I could only convince the synthesis vendors to let me do File > IO > > during elaboration, > > I'd be a very happy camper.... > > John McCluskey
> > > I'm sure he's trying to initialize it with something that depends > on a > > > relatively complex function of an input attribute or generic. I've > done > > > it many times with synplicity, but synopsis... I dunno. This comes > up > > > from time to time in parameterized code, especially in arithmetic > > > applications.
> > > > Jonathan, > > > > >Does anyone know how to make synopsys use a functions return > > > > >value to initilise a constant > > > > Why are you using a function to initialize your constant? > > > > The value of a constant cannot be changed after it is created. > > > > Are you trying to do a deferred constant declaration? > > > > It would help if you posted the relevent part of the code. > > > > Regards, > > > > Fred Best > > > > ----------------------------------------------------------- > > > > Got questions? Get answers over the phone at Keen.com. > > > > Up to 100 minutes free! > > > > http://www.keen.com > Sent via Deja.com http://www.deja.com/ > Before you buy.
|
Mon, 20 Jan 2003 03:00:00 GMT |
|
|
ferg.. #9 / 11
|
Initialising a constant with a return value from a function
it's not the generics that are causing me problems...i need an array of constant integers and want to generate this array using a quite complex function during elaboration. ( just as you said before ) but as far as i can see synopsys will only allow me to assign integers to constants during elaboration! why you can use arrays on integers is behond me.. you would have thought that this would be perfectly legal..but nope it's not!!!. and now i'm off to write some C to generate the arrays and the i'm going to have to copy and paste!!!!!!! Jonthan
Quote: > In the past (I can't speak for the present), Synopsys did not support > generic parameters other than integers. > I have haven't looked at it lately... Perhaps I should revisit... > John McCluskey
> > John, are you synopsys to initaise a array of constant integer...this > > what i NEED to do...
> > > Ray is absolutely correct. Many people don't realize this, > > > but the ability to initialize a constant with a function call implies > > > that a synthesys tool must also include SIMULATION capability. > > > The simulation comes at elaboration time when the function is > > evaluated. > > > I use this ALL the time... > > > A simple example: Use the sin() function in the IEEE real_math > > package > > > to intialized a constant integer array with a table of sine values, > > scaled > > > appropriately. > > > Then an indexed lookup into the constant array becomes a quantized > > Sine > > > function, > > > suitable for synthesis as a Numerical Controlled Oscillator (DDS). > > I do it > > > in a > > > fancy fashion, passing the integer vector to a ROM component with > > > pipelining... > > > I can do a 1024x16 (effective sine wave length & width) Sine function > > in an > > > Orca 4E2 > > > device at 225 MHz, and the Sine function is generated "on-the- fly" at > > > compile time. > > > If I want a longer or shorter sine wave, well, it's pretty trivial to > > change > > > the length parameter. > > > It beats all hell out of writing a C program to generate a ROM table. > > > Another example: I can generate CRC components with arbitrary > > polynomials, > > > using > > > a function call to compute the parity matrix at compile time. No > > need to > > > write a C function > > > to calculate this beforehand. The list of applications goes on and > > on... > > > Now if I could only convince the synthesis vendors to let me do File > > IO > > > during elaboration, > > > I'd be a very happy camper.... > > > John McCluskey
> > > > I'm sure he's trying to initialize it with something that depends > > on a > > > > relatively complex function of an input attribute or generic. I've > > done > > > > it many times with synplicity, but synopsis... I dunno. This comes > > up > > > > from time to time in parameterized code, especially in arithmetic > > > > applications.
> > > > > Jonathan, > > > > > >Does anyone know how to make synopsys use a functions return > > > > > >value to initilise a constant > > > > > Why are you using a function to initialize your constant? > > > > > The value of a constant cannot be changed after it is created. > > > > > Are you trying to do a deferred constant declaration? > > > > > It would help if you posted the relevent part of the code. > > > > > Regards, > > > > > Fred Best > > > > > ----------------------------------------------------------- > > > > > Got questions? Get answers over the phone at Keen.com. > > > > > Up to 100 minutes free! > > > > > http://www.keen.com > > Sent via Deja.com http://www.deja.com/ > > Before you buy.
Sent via Deja.com http://www.deja.com/ Before you buy.
|
Mon, 20 Jan 2003 03:00:00 GMT |
|
|
ferg.. #10 / 11
|
Initialising a constant with a return value from a function
everything is okay..i've sorted it out....the problem was because i was using an integer with a range...and thats what your not allowed!
Quote:
> it's not the generics that are causing me problems...i need an array of > constant integers and want to generate this array using a quite complex > function during elaboration. ( just as you said before ) but as far as > i can see synopsys will only allow me to assign integers to constants > during elaboration! why you can use arrays on integers is behond me.. > you would have thought that this would be perfectly legal..but nope > it's not!!!. and now i'm off to write some C to generate the arrays > and the i'm going to have to copy and paste!!!!!!! > Jonthan
> > In the past (I can't speak for the present), Synopsys did not support > > generic parameters other than integers. > > I have haven't looked at it lately... Perhaps I should revisit... > > John McCluskey
> > > John, are you synopsys to initaise a array of constant > integer...this > > > what i NEED to do...
> > > > Ray is absolutely correct. Many people don't realize this, > > > > but the ability to initialize a constant with a function call > implies > > > > that a synthesys tool must also include SIMULATION capability. > > > > The simulation comes at elaboration time when the function is > > > evaluated. > > > > I use this ALL the time... > > > > A simple example: Use the sin() function in the IEEE real_math > > > package > > > > to intialized a constant integer array with a table of sine > values, > > > scaled > > > > appropriately. > > > > Then an indexed lookup into the constant array becomes a quantized > > > Sine > > > > function, > > > > suitable for synthesis as a Numerical Controlled Oscillator (DDS). > > > I do it > > > > in a > > > > fancy fashion, passing the integer vector to a ROM component with > > > > pipelining... > > > > I can do a 1024x16 (effective sine wave length & width) Sine > function > > > in an > > > > Orca 4E2 > > > > device at 225 MHz, and the Sine function is generated "on-the- > fly" at > > > > compile time. > > > > If I want a longer or shorter sine wave, well, it's pretty > trivial to > > > change > > > > the length parameter. > > > > It beats all hell out of writing a C program to generate a ROM > table. > > > > Another example: I can generate CRC components with arbitrary > > > polynomials, > > > > using > > > > a function call to compute the parity matrix at compile time. No > > > need to > > > > write a C function > > > > to calculate this beforehand. The list of applications goes on > and > > > on... > > > > Now if I could only convince the synthesis vendors to let me do > File > > > IO > > > > during elaboration, > > > > I'd be a very happy camper.... > > > > John McCluskey
> > > > > I'm sure he's trying to initialize it with something that > depends > > > on a > > > > > relatively complex function of an input attribute or generic. > I've > > > done > > > > > it many times with synplicity, but synopsis... I dunno. This > comes > > > up > > > > > from time to time in parameterized code, especially in > arithmetic > > > > > applications.
> > > > > > Jonathan, > > > > > > >Does anyone know how to make synopsys use a functions return > > > > > > >value to initilise a constant > > > > > > Why are you using a function to initialize your constant? > > > > > > The value of a constant cannot be changed after it is created. > > > > > > Are you trying to do a deferred constant declaration? > > > > > > It would help if you posted the relevent part of the code. > > > > > > Regards, > > > > > > Fred Best > > > > > > ----------------------------------------------------------- > > > > > > Got questions? Get answers over the phone at Keen.com. > > > > > > Up to 100 minutes free! > > > > > > http://www.keen.com > > > Sent via Deja.com http://www.deja.com/ > > > Before you buy. > Sent via Deja.com http://www.deja.com/ > Before you buy.
Sent via Deja.com http://www.deja.com/ Before you buy.
|
Tue, 21 Jan 2003 03:00:00 GMT |
|
|
Christian Mautn #11 / 11
|
Initialising a constant with a return value from a function
[...] Quote: >Now if I could only convince the synthesis vendors to let me do File IO >during elaboration, >I'd be a very happy camper....
Wholeheartedly agreed. At the moment I have the problem to implement a register that holds the firmware release number, and that way I would have a possibility to import the CVS release tag and initialise a register with this value. It's sometimes hard to program in VHDL if you are used to the expressiveness of Perl... chm. --
mail.com - Vienna/Austria/Europe
|
Tue, 21 Jan 2003 03:00:00 GMT |
|
|
|