FPGARelated.com
Forums

Setting top level VHDL generics in XST

Started by rickman May 5, 2009
I am trying to use a generic at the top level of my code to define
which device family the code is being compiled to.  In XST there is a
property dialog that can attach a generic property to the synthesis
process.  I am using this and not finding that it works.

In the top level code, I assign a default value to the generic which
is what is being used.  Of course, I use the same default value at
every level of the code.  If I remove the default value for the
generic, the tool complains that there is *no* value assigned.  The
value set as the process property shows up in the Synthesis Report
except that in the property dialog box the generic value is enclosed
in double quotes and in the report the trailing quote is missing.
Removing the quotes does not work either.

Am I doing something wrong here?  Does this generic assignment
function work in XST?  Anyone else use it?

Rick
rickman a �crit :
> I am trying to use a generic at the top level of my code to define > which device family the code is being compiled to. In XST there is a > property dialog that can attach a generic property to the synthesis > process. I am using this and not finding that it works. > > In the top level code, I assign a default value to the generic which > is what is being used. Of course, I use the same default value at > every level of the code. If I remove the default value for the > generic, the tool complains that there is *no* value assigned. The > value set as the process property shows up in the Synthesis Report > except that in the property dialog box the generic value is enclosed > in double quotes and in the report the trailing quote is missing. > Removing the quotes does not work either. > > Am I doing something wrong here? Does this generic assignment > function work in XST? Anyone else use it?
Hi Rick Have a look at my last post (today, subject "ISE & VHDL : how to include time/date") At least in the tcl script there must be a space between final quotes. I don't know how you can fix this in the GUI though Nicolas
On May 5, 4:36=A0pm, Nicolas Matringe <nicolas.matri...@fre.fre> wrote:
> rickman a =E9crit : > > > > > I am trying to use a generic at the top level of my code to define > > which device family the code is being compiled to. =A0In XST there is a > > property dialog that can attach a generic property to the synthesis > > process. =A0I am using this and not finding that it works. > > > In the top level code, I assign a default value to the generic which > > is what is being used. =A0Of course, I use the same default value at > > every level of the code. =A0If I remove the default value for the > > generic, the tool complains that there is *no* value assigned. =A0The > > value set as the process property shows up in the Synthesis Report > > except that in the property dialog box the generic value is enclosed > > in double quotes and in the report the trailing quote is missing. > > Removing the quotes does not work either. > > > Am I doing something wrong here? =A0Does this generic assignment > > function work in XST? =A0Anyone else use it? > > Hi Rick > Have a look at my last post (today, subject "ISE & VHDL : how to include > time/date") > At least in the tcl script there must be a space between final quotes. I > don't know how you can fix this in the GUI though > > Nicolas
I tried it with the quotes, I tried with various combinations of spaces and quotes, I tried with no quotes. All gave the same results. The Generic is ignored. If I remove the default value of the top level generic an error says it has no value. This is what ISE says is being passed into the code. Generics, Parameters : { DEVICE_FAM=3D"FPGA_FAMILY_SPARTAN_3 } This is what is the top level module uses... Analyzing hierarchy for entity <Novus> in library <work> (architecture <rtl>) with generics. BYWTH =3D 9 DAWTH =3D 18 DEVICE_FAM =3D "fpga_family_lattice_xp" Notice that the ending quote is always missing in the value reported as passed into the top level. Rick
The parameter being set is an enumerated type.  Would that make a
difference?

Rick
Hi Rick,

I have had similar problems with the 'Generics, Parameters' under
'Synthesis Options'. I could get it to work in a simple example, but
synthesis did not react on the value for a more complex design.

But there is an alternative through the 'Other XST Command Line
Options', which is last line in the window with 'Generics,
Parameters'. You can then use the XST command line syntax, that
Jan Pech mentioned, thus '-generics {BIDIR=TRUE CHANNELS=1}'. That
worked for me.

Good luck,
Morten
How would the generics setting be done using xflow from a Makefile?
--
Svenn
On May 6, 2:48=A0pm, "M.Z." <mzdkm...@gmail.com> wrote:
> Hi Rick, > > I have had similar problems with the 'Generics, Parameters' under > 'Synthesis Options'. I could get it to work in a simple example, but > synthesis did not react on the value for a more complex design. > > But there is an alternative through the 'Other XST Command Line > Options', which is last line in the window with 'Generics, > Parameters'. You can then use the XST command line syntax, that > Jan Pech mentioned, thus '-generics {BIDIR=3DTRUE CHANNELS=3D1}'. That > worked for me. > > Good luck, > Morten
I had thought of that. But it doesn't work an better. Here is the error message I get when I try it. WARNING:Xst:2705 - Value 'FPGA_FAMILY_SPARTAN_3' is not a valid value WARNING:Xst:2312 - Ignoring definition of generic 'DEVICE_FAM' because of bad value provided The option lines I tried were -generics {DEVICE_FAM=3DFPGA_FAMILY_SPARTAN_3} and -generics{DEVICE_FAM=3DFPGA_FAMILY_SPARTAN_3} I also tried it with quotes and got this error message. ERROR:Xst - CheckCondition - Xst_HdlConst_Utility::ConvertIntegerToType : unable to adjust constant <"FPGA_FAMILY_SPARTAN_3"> (type array [1 to 21] of char) to type enum (fpga_family_spartan_3, fpga_family_lattice_xp, ). -generics {DEVICE_FAM=3D"FPGA_FAMILY_SPARTAN_3"} and -generics{DEVICE_FAM=3D"FPGA_FAMILY_SPARTAN_3"} I believe I also tried it with spaces around the =3D sign, but the manual clearly say not to leave spaces there. I am starting to think the problem is the use of an enumerated value rather than a string constant or a numerical constant. I changed it to an integer and it still does not work when using a constant name. But if an integer value is used, it works ok. It would seem that the generic input function in XST does not work with symbols, only values. Rick
rickman wrote:

> But if an integer value is used, it works ok. It would seem that the > generic input function in XST does not work with symbols, only > values.
The last time I tried this, many years ago on Mentor Leo, only integers worked for top generics. That is when I started using a package declaration above the top synthesis entity declaration. That way, I can use whatever I types I like. package foo_pkg is type template_t is (v_rst, a_rst, s_rst, so_rst); -- ... end package uart_pkg; use work.foo_pkg.all; entity foo is generic (template_g : template_t := v_rst); port ( clock : in std_ulogic; reset : in std_ulogic; ... -- Mike Treseler
"rickman" <gnuarm@gmail.com> wrote in message 
news:a87c5ee0-0dc1-4035-b8b6-9803b7ce1a75@g19g2000vbi.googlegroups.com...
On May 6, 2:48 pm, "M.Z." <mzdkm...@gmail.com> wrote:
> Hi Rick, > > I have had similar problems with the 'Generics, Parameters' under > 'Synthesis Options'. I could get it to work in a simple example, but > synthesis did not react on the value for a more complex design. > > But there is an alternative through the 'Other XST Command Line > Options', which is last line in the window with 'Generics, > Parameters'. You can then use the XST command line syntax, that > Jan Pech mentioned, thus '-generics {BIDIR=TRUE CHANNELS=1}'. That > worked for me. > > Good luck, > Morten
I had thought of that. But it doesn't work an better. Here is the error message I get when I try it. WARNING:Xst:2705 - Value 'FPGA_FAMILY_SPARTAN_3' is not a valid value WARNING:Xst:2312 - Ignoring definition of generic 'DEVICE_FAM' because of bad value provided The option lines I tried were -generics {DEVICE_FAM=FPGA_FAMILY_SPARTAN_3} and -generics{DEVICE_FAM=FPGA_FAMILY_SPARTAN_3} I also tried it with quotes and got this error message. ERROR:Xst - CheckCondition - Xst_HdlConst_Utility::ConvertIntegerToType : unable to adjust constant <"FPGA_FAMILY_SPARTAN_3"> (type array [1 to 21] of char) to type enum (fpga_family_spartan_3, fpga_family_lattice_xp, ). -generics {DEVICE_FAM="FPGA_FAMILY_SPARTAN_3"} and -generics{DEVICE_FAM="FPGA_FAMILY_SPARTAN_3"} I believe I also tried it with spaces around the = sign, but the manual clearly say not to leave spaces there. I am starting to think the problem is the use of an enumerated value rather than a string constant or a numerical constant. I changed it to an integer and it still does not work when using a constant name. But if an integer value is used, it works ok. It would seem that the generic input function in XST does not work with symbols, only values. ================ I think I saw something like that done in the LEON3 and GRLIB distribution. It might be worth a look.
On May 18, 9:48=A0am, "MikeWhy" <boat042-nos...@yahoo.com> wrote:

> I am starting to think the problem is the use of an enumerated value > rather than a string constant or a numerical constant. =A0I changed it > to an integer and it still does not work when using a constant name. > But if an integer value is used, it works ok. =A0It would seem that the > generic input function in XST does not work with symbols, only > values.
Just in case it hasn't been considered: In the XST user guide for 10.1 on page 338 to 340 the use of -generics is mentioned. -- Svenn