Answers Database


Foundation Simulator: How to assign a value to a bus using Formulas


Record #1623

Product Family: Software

Product Line: Aldec

Product Part: Foundation Logic Simulator

Product Version: 1.19

Problem Title:
Foundation Simulator: How to assign a value to a bus using Formulas


Problem Description:
To assign a value to a bus in the Foundation Simulator, you
may apply a Formula to the bus.

The value you wish to assign should be placed in brackets, []
and the value is in Hex. If you specify a value of [4], and
assign is to an 8-bit bus, the upper 4 bits of the bus will
be driven to 0.

Up to 16 Formulas can be defined as "Formula LEDs". These
formulas are accessed through the Stimulator Selection
Window. Formula LEDs are always applied starting at time
0ns.

Additional Formulas can be defined in the Formula Editor, and
are accessed through the Formula Insert and Formula Replace
dialogs. These Formulas can be applied to the bus starting
at any simulation time, and can be concatenated to create
longer Formulas.


Solution 1:

To define a Formula LED and assign it to a bus, follow this
procedure:

1. Open up the Stimulator Selection Window (Stimulator->
    Add Stimulators).

2. Click on the Formula... button.

3. Select a Stimulator by double-clicking on it. It will
    now show the Selected Stimulator in the upper-right field.

4. Enter the formula in the Formula field.

    For example, to assign a constant value of 4, the
    following Formula would be used:
       [4]

    To assign incrementing values to the bus, which increment
    every 20ns, use this formula:
       [1]20[2]20[3]20

    For more information on proper Formula syntax, please
    refer to the Foundation Online Documentation.

5. After you have typed in the Formula, click 'Assign
    Formula'. The Formula will now show up in the 'Defined
    Assignments' list.

6. Now, to assign this formula to the bus, select the Bus in
    the Waveform Viewer, and then click on the appropriate
    Form button in the Stimulator Selection box. For example,
    if you assigned the Formula as Stimulator F1, then click
    on the 2nd square from the right on the Form: line in the
    Stimulator Selection box.



Solution 2:

To define a Formula and assign it to a bus using the Formula Editor, follow this procedure:

1. Select Waveform -> Formula -> Edit. This opens the
    Formula Editor.

2. Enter the formula in the 'Enter New Formula' field.

    For example, to assign a constant value of 4, the
    following Formula would be used:
       [4]

    To assign incrementing values to the bus, which increment
    every 20ns, use this formula:
       [1]20[2]20[3]20

    For more information on proper Formula syntax, please
    refer to the Foundation Online Documentation.

3. After you have typed in the Formula, click Add. The
    Formula will now show up in the 'Available Formulas' list.

4. To assign this Formula to a bus, click in the Waveform
    Viewer to specify both the bus and the time you want the
    Formula to apply to. Then select Waveform -> Formula ->
    Insert. Select the Formula and click OK.

5. To concatenate Formulas, click in the Waveform Viewer at
    the end of the first Formula and insert another formula.

    For example, to repeat the incrementing Formula shown
    above, first click in the Waveform Viewer at time 0ns
    (next to the bus you want to assign the Formula to).
    Insert the Formula, which defines the bus from time 0ns up
    to time 60ns.

    Now click on the end of the Formula and insert the same
    Formula again. Now the bus increments from 1 to 3, then
    repeats.





End of Record #1623 - Last Modified: 04/18/97 12:06

For the latest news, design tips, and patch information on the Xilinx design environment, check out the Technical Tips!