Forum Discussion

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

Verilog `ifdef equivalent in VHDL

Hi

I've just learned that in Verilog you can use an `ifdef statement that makes Quartus ignore the following code (until the next`endif)

you can define a macro in the qsf file (or through the GUI) to decide which parts of code to ignore.

is there an equivalent in VHDL? the closest tool I'm aware of is the "if generate" statement but it is a weaker tool since:

1) you can use it only in the architecture body

2) the synthesizer first makes sure that the code inside the statement is compilable. this is a problem if you wish to omit other sections in the code.

can anyone can enlighten me? I'm used to VHDL, but I this single feature will make me switch sides.:)

13 Replies

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

    --- Quote Start ---

    If I remember right, the technique has been mentioned in several threads before. The most simple option is to keep all optional pins in the port definition of a common top entity file.

    Use version dependent generate and if statements to access one or the other pin set. I'm using this method in several projects and don't see a problem with it.

    I agree, that it would be convenient to have a Verilog or C alike preprocessor with VHDL. But I didn't experience a situation where the respective problem couldn't be handled with VHDL means somwhow.

    --- Quote End ---

    How do you place multiple ports onto the same pin in PinPlanner ... you can't I'd think?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I'm assuming, that each of the different FPGAs has it's own Quartus revision and respective pin assignments.

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

    --- Quote Start ---

    Virtual pins actually consume an unconnected LE in gate level netlist, don't know why.

    --- Quote End ---

    I assume it has something to do with partitions. If you'll use your project as a partition in another project, that now virtual pin might become a constant driver.

    --- Quote Start ---

    In my opinion, all these points aren't a sufficient reason to change the design top to Verilog.

    --- Quote End ---

    I tend to agree, though I've never worked with Verilog, I'm quite happy with the VHDL capabilities. that's why I'm writing a small preprocessor in tcl to add to the pre flow script.

    --- Quote Start ---

    I'm assuming, that each of the different FPGAs has it's own Quartus revision and respective pin assignments.

    --- Quote End ---

    correct. I always assign pins in the qsf file, not in the VHDL code. I find it more readable, and reusable.