DELAY (SimCode function)

www.kxcad.net Home > Electronic Index > Altium(Protel) Index


Your Ad Here

Syntax 1

DELAY <output> [<output> ...] = <delay>;

Syntax 2

DELAY <output> [<output> ...] =

  CASE (<conditional exp>) : <delay>

  CASE (<conditional exp>) : <delay>

  [CASE (<conditional exp>) : <delay> ...]

END;

Description

Sets propagation delay to specified outputs. The DELAY command is executed once for each pin listed and posts a propagation delay for each pin that has changed its level. The CASE option allows more than one <delay> to be specified. The <conditional exp> then determines which <delay> will be used. If a delay is set for a pin that has not changed then the pin will be flagged as NO-CHANGE and the delay will NOT be posted. The <delay> can be a real constant, a real variable or a real expression.

Parameters

<output>

-

Name of/variable index to the output pin.

<conditional exp>

-

Conditional expression that determines which delay is used.

<delay>

-

Propagation delay time to the output pin.

Example

DELAY Q1 Q2 Q3 Q4 = 10n;

DELAY Q QN =

  CASE (TRAN_LH) : tplh_val

  CASE (TRAN_HL) : tphl_val

END;

data = (E0_1 && (CHANGED(D0) || CHANGED(D1)));

DELAY Q1 Q0 =

  CASE (data && TRAN_LH) : tplh_D_Q

  CASE (data && TRAN_HL) : tphl_D_Q

  CASE (TRAN_LH) : tplh_E_Q

  CASE (TRAN_HL) : tphl_E_Q

END;

In this example, if data is nonzero and Q1 is changing from High to Low, the tphl_D_Q delay will be posted for Q1. Then, if Q0 is changing from Low to High, the tplh_D_Q delay will be posted for Q0.

Notes

The DELAY command must be executed exactly once for each output pin, that is, for each pin declared in the OUTPUTS statement which is NOT listed in the LOAD or NO_CHANGE statements. The order in which the delays are set is based on the order in which these pins are listed in the DELAY command (i.e. first pin listed is set first). Each <conditional exp> is evaluated in the order it is listed until one expression evaluates TRUE. When this occurs, the <delay> value associated with the TRUE expression is posted for the output being set. When using the CASE option, at least one <conditional exp> should evaluate as TRUE for each output pin listed. If no <conditional exp> evaluates to TRUE, the <delay> associated with the last CASE statement is posted.

In addition to the standard expression functions, the following terms apply ONLY to the output pin being set and can be used in the <conditional exp> :
 

TRAN_LH

low-to-high

TRAN_LX

low-to-other

TRAN_HL

high-to-low

TRAN_HX

high-to-other

TRAN_HZ

high-to-tristate

TRAN_XL

other-to-low

TRAN_XH

other-to-high

TRAN_LZ

low-to-tristate

TRAN_ZL

tristate-to-low

TRAN_ZH

tristate-to-high

TRAN_ZX

tristate-to-other

TRAN_XZ

other-to-tristate

TRAN_XX

other-to-different

 

If the <delay> value is less than or equal to 0.0 a run-time error message will be displayed. Output pins can be specified by using the output pin name or by an integer variable the contains the index of an output pin. Pin names and variables cannot be mixed in the same DELAY statement. References to outputs must be either all pin names or all variable names.

Your Ad Here