Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

how to read project parameters in sdc file

I want to use project parameters to manipulate the sdc file

This is what i tried:

I have in the qsf:
set_parameter -name x 5

I tried plain and simply to put in the sdc file:
if >2 { some usefull constraints }

When i run timequest and analyze the project i get what i want: the sdc file is read in correctly and the timing constraints are done.

However when i compile the project (using ofcourse the same sdc file and the simple compile project button) I get: "error: open project does not exist ... open an existing project,"... when the system starts fitting.

If i try to add the
open_project
command to add i get the friendly message that open_project is not a valid sdc command and will be skipped.

Can anybody help me out?

thx

Using Q9.1

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I'm going to give the response that nobody likes, but why have the parameter for the .sdc in the .qsf? Why not just put it into the SDC? I say that because I've seen many .sdc files with variables/parameters, and they all do it in the .sdc. Just want to make sure you're not hitting a wall trying something that's never been tried before. (To be honest, I didn't think parameters were even supposed to be readable from the .sdc, and impressed you made it as far as you did...)

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Because i want to have a single source parameter.

    --> parameter that changes code (top level entity generic)

    --> same parameter that changes timing constraints accordingly

    If i duplicate the parameter i risk generating code with setting a and do the timing analysis whit setting b.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I have not yet found a way to get Quartus project parameters from the SDC file. It's a feature that I would definitely like to see added.

    So as a workaround here is what I did.

    1 - Define a "project_settings.v" file that contains your top level macro definitions and parameters. This file should contain all parameters needed to control your project. Include this file from your top level.

    2 - From your SDC script, open the "project_settings.v" file and read your settings. Then generate your timing constraints based on those settings.

    So for example, I have a project that has 4 DDR3 controllers. The "project_settings.v" file determines which of those are actually enabled using "`define" statements. My project code knows whether or not to compile in each controller based on the macro setting. The timing script also reads the file and determines whether or not to perform timing analysis for each controller based off the settings in the file.

    Not the ideal solution but it works well enough for me.

    Jake
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Ok that was also my backup plan.

    I will problably parse the qsf though using regular tcl to extract the parameters (backwards compatible solution).

    Thx