Forum Discussion

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

time in generic clause of entity for synthesis

Dear All,

is it possible to use generic of type 'time' in an entity declaration which is used for synthesis? I'd like to use time specification as top-entity generic parameter, which is in the sub-entity recalculated to integer and hence it is fully synthesizable (recalculation using e.g. 100 ns / 25 ns leads to integer right?).

This works great in simulation, however quartus refuses to instantiate block claiming that 's' does not exist:

entity top_entity is

generic (

DELAY_LINE_DEPTH : integer := 8; --! default FIFO used for BLR

RESET_PULSE_LENGTH : integer := 50; --! length of automatically generated reset

BCF_DEFAULT_THRESHOLD_VALUE : integer := 3700; --! default value of threshold loaded when register is reset

MAX6627_AUTORUN : time := 2s); --! autorun of max circuit

13 Replies

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

    I don't think it is synthesizable. You can still use integers but use them as values in us/ns instead of clock ticks. As long as you comment what time unit you are using it should be almost as understandable.

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

    no. the achievement would be to calculate various variables in unconstrained way. Imagine you have entity generating clock enable after X clock cycles. If your clock is a generic as well (so say you define XOSC_CLK : time := 25ns), then you can specify various time constants in the design in terms of time. In case of the clock enable generator you would say that you wish to generate clock enable every 100us, hence the generic input to this entity would be TICKS_WAIT : integer := 100 us / XOSC_CLK.

    In standard way this situation is solved using integers because apparently clock division does not work in quartus synthesis (besides the fact the division of two times results in integer and thus fully synthesizable unit). Then you have to pass as generic something like TICKS_WAIT : integer := 4000.

    While the definition of generic by time would bring you clear understanding what you're setting, number of ticks is in integer is not so clear.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Dear All,

    is it possible to use generic of type 'time' in an entity declaration which is used for synthesis? I'd like to use time specification as top-entity generic parameter, which is in the sub-entity recalculated to integer and hence it is fully synthesizable (recalculation using e.g. 100 ns / 25 ns leads to integer right?).

    This works great in simulation, however quartus refuses to instantiate block claiming that 's' does not exist:

    entity top_entity is

    generic (

    DELAY_LINE_DEPTH : integer := 8; --! default FIFO used for BLR

    RESET_PULSE_LENGTH : integer := 50; --! length of automatically generated reset

    BCF_DEFAULT_THRESHOLD_VALUE : integer := 3700; --! default value of threshold loaded when register is reset

    MAX6627_AUTORUN : time := 2s); --! autorun of max circuit

    --- Quote End ---

    Hi,

    I'm not a VHDL expert, but what would you like to achieve ? Should your design run for a certain time ?

    King regards

    GPK