- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Is there any way to set values to parameter or generic in Verilog/VHDL RTL code with the Quartus II? I want to change the parameters inside megacore without modifting RTL code. ThanksLink Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the Assignment Editor, select "Parameters" near the bottom of the "Category" list. I think this will override parameters explicitly set in the RTL, but I don't remember for sure.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here's by far the most common usage of it, which is used when a piece of IP targets a specific RAM type and the end user wants to force it to a different type:
http://www.altera.com/support/kdb/solutions/rd02172004_713.html?gsa_pos=6&wt.oss_r=1&wt.oss=m4k%20m-ram- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Brad and Rysc,
I appreciate your answer. It looks work well. Regards- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Digging an old one up here.
Does anybody now how this translates to assignments in the qsf? I'm trying to change the value of a top level block VHDL generic in different build revisions. Thanks.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i've used VHDL packages for that (you could call in different packages with the .qsf or other build script)
however, here's the parameter in the .qsf: set_parameter -name my_param my_value- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes changing a package in the qsf would be an option but we potentially have many variations (based on the generic) of the same build and hence many qsfs. So what we are going to do is set up the project with a bash script that changes the single paramater setting in some tcl accordingly, and then runs the tcl to set up the project.
I've got a top level called "fred_top" with a generic called "width" which by default is 8. What I try and do is change that value by setting the following in the qsf but unfortunaletly it doesn't seem to work.set_parameter -name width 16 -to fred_top
Any ideas appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i will see if i can test the Quartus parameters instead of VHDL packages
if you're really stuck you could make the bash script generate the VHDL package on the fly based on the parametrization (same .vhd name so no changes to .qsf)- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Pancake,
This is some code I knocked up to test it...
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity fred is
generic ( frog : integer := 1 );
port (
in1 : in std_ulogic_vector (3 downto 0);
in2 : in std_ulogic_vector (3 downto 0);
sel : in std_ulogic_vector (3 downto 0);
out1 : out std_ulogic_vector (3 downto 0));
end fred;
architecture RTL of fred is
--
component mx_comp_1
port(
in1 : in std_ulogic;
in2 : in std_ulogic;
sel : in std_ulogic;
out1 : out std_ulogic);
end component;
--
component mx_comp_2
port(
in1 : in std_ulogic;
in2 : in std_ulogic;
sel : in std_ulogic;
out1 : out std_ulogic);
end component;
begin
GEN: for n in 3 downto 0 generate
COND1 : if (frog = 1) generate
mx1g : mx_comp_1
port map (
in1 => in1(n),
in2 => in2(n),
sel => sel(n),
out1 => out1(n)
);
end generate;
COND2 : if (frog = 2) generate
mx2g : mx_comp_2
port map (
in1 => in1(n),
in2 => in2(n),
sel => sel(n),
out1 => out1(n)
);
end generate;
end generate;
end RTL;
If you manually change the frog generic from 1 to 2 it changes which mx_comp is generated in Quartus, as you would expect. Nw to do this is the qsf I used... set_parameter -name frog 2 -to fred
In this case fred is the top level. It did not work. Now either I'm doing something wrong or it's simply not working. Thanks for your effort on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It work's exactly as suggested above:
--- Quote Start --- set_parameter -name my_param my_value --- Quote End --- Please consider, that in VHDL parameters can be only set for the top entity, not down the hierarchies. Thus the set_parameter tcl command doesn't need/understand an entity name here.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FvM brilliant, thanks.
It seems all I had to do is drop the -to option. Just using this works...set_parameter -name frog 2
Thanks.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page