www.coware.com

6

Using the SPB-I Simulator


Introduction

The Signal Processing Worksystem (SPW) has a set of tools for executing simulations of signal-processing systems designed and built with BDE. The SPW simulator is called the Simulation Program Builder (SPB).

There are two forms of SPB, called SPB-Interpreted (SPB-I) and SPB-Compiled (SPB-C). SPB-I works like an interpretive computer language, without any precompiling of the program code. SPB-C works by creating, compiling, and running a C program for each simulation run. Operation of the SPB-C simulator is covered in Chapter 8, "Using the SPB-C Simulator."

The current chapter shows you how to invoke and use the SPB-I simulator. The chapter is divided into the following sections:

Do the Notch Filter Simulation first. The remaining tutorial sections are independent of each other, so you can do them in any order or do just the ones that interest you now and postpone the others until later.

Notch Filter Simulation

In this section, you simulate the notch filter test system that you built in Chapter 3, yourlib/notchtest.system. A test signal that you created in Chapter 4, yourlib/noisy.sig, is used as an input signal.

Load the Design

  1. In the File Manager, click on the BDE icon to open a new BDE design window.
  2. In the design window, execute the following command:
  3. File-Open 
    
  4. In the File Open dialog box, enable the Logical Name option.
  5. Double-click on your library name, the cell name "notchtest," and the view name "system."
  6. BDE displays your test system, yourlib/notchtest.system.

Invoke the Simulation Manager

  1. In the design window, execute the following command:
  2. Tools-Simulation Manager 
     

    This displays the Simulation Manager as shown in Figure 6-1.

Figure 6-1  Simulation Manager

The Simulation Manager is the tool used to initiate and manage SPB simulation runs. It contains a set of tabbed pages labeled Simulation, Parameters, Probes, and so on. The Simulation page is displayed initially.

  1. In the Number of Samples field, enter the value 10000.
  2. Verify that the Simulation Manager fields and options are set as follows:
    • Design: yourlib/notchtest.system
    • Configuration: config/bde.default
    • Engine: SPB-I
    • Create and Run buttons on
    • Debug button off
    • Number of Samples: 10000
    • Noise Seed: 1

Save the Toolrun

Before you can run a simulation, you must save the simulation environment into a "toolrun" design file. The simulator writes the simulation results directly in the toolrun.

  1. In the Simulation Manager, execute the following command:
  2. File-Save As 
     

    This displays the File Save As dialog box as shown in Figure 6-2, with the New Logical Name field filled in by default with yourlib/notchtest.toolrun.

  3. Click on the OK button.
  4. The name of the toolrun is displayed at the top of the Simulation Manager window.

Figure 6-2  Simulation Manager File Save As Dialog Box

Run the Simulation

  1. In the Simulation Control area, click on the Start button.
  2. The simulator generates a hierarchical netlist from the BDE design, flattens the hierarchy, schedules the code for each block, creates a simulation program, and executes the program.

  3. Watch the status line and the system message area for information on the simulation run.
  4. After program execution begins, the percentage completion bar in the status line changes to green (from left to right) to show the progress of the simulation.

    Allow the simulation to run to completion.

  5. Check the system message area for error messages.
  6. In case of an error, click on the Errors button. This displays detailed error information in a "browser" (text viewer) window. A typical error detected at this point would be a mistyped input file name in the Source block or a nonexistent library name specified in the Sink block.

Note: When you run a simulation, the Simulation Manager immediately stores the simulation output signals in the current toolrun. Therefore, if you want to run a simulation and retain the previous simulation results, you must save the toolrun under a new name before you start the simulation.

View the Simulation Results

  1. In the Tool Launch area, click on the SigCalc button.
  2. SigCalc displays the simulation Files Preview dialog box, which lists the simulation input and output signals.

  3. In the simulation Files Preview dialog box, click on the OK button.
  4. The simulator displays the input signal and output signal, yourlib/noisy.sig and yourlib/test_out.sig.

  5. Set the value in the Win Size field to 2000 if it is not already set to that value.
  6. Compare your output signal with the one shown in Figure 6-3.

Figure 6-3  Notch Filter Simulation Results

The 60-Hz sine wave component should be quickly attenuated within the first 500 data points. If not, display your filter block diagram, yourlib/notch60.detail, in a design window and check for errors such as mistyped coefficient values, incorrect connections, or missing connections. Correct any errors, save the design, and run the simulation again until you get the results shown in the figure.

When you are done, turn the SigCalc window into an icon using the appropriate window manager command.

Using the Debugger

The SPB-I simulator has a debugger that operates very much like a computer program debugger. It lets you interactively start, stop, and single-step through the simulation. You can set breakpoints that stop the simulation each time the code associated with a particular block instance is executed.

Prepare for Debugging

  1. If you have not already done so, display the notch60 test system, yourlib/notchtest.system, in a BDE design window.
  2. To provide more room on the workstation screen, resize the BDE design window to a smaller size and then execute the following command:
  3. View-Zoom To Fit 
     

    Figure 6-4 shows what your resized design window might look like.

Figure 6-4  Resized Design Window

  1. Double-click on the notch60 block to display the block's detail model in a context window.
  2. If you have not already done so, invoke the Simulation Manager from the design window.
  3. Verify that the toolrun name in the title bar of the Simulation Manger window is yourlib/notchtest.toolrun. If necessary, change it to that name with the File-Open command.

Invoke the Interactive Simulation Debugger

  1. In the Simulation page of the Simulation Manager, toggle on the Debug option.
  2. Verify that the Simulation Manager fields and options are set as follows:
    • Design: yourlib/notchtest.system
    • Configuration: config/bde.default
    • Engine: SPB-I
    • Create, Run, and Debug buttons on
    • Samples: 10000
    • Noise Seed: 1
  3. Click on the Start button.
  4. After a brief delay, the simulator displays the debugger window, shown in Figure 6-5.

Figure 6-5  Simulation Debugger Window

  1. Wait until the Interactive Simulation Commands window (the scrollable text window) shows a prompt (>).
  2. The prompt is an indicator that the debugger is ready to accept a command. At this point, the simulator has created the simulation program and has executed the block initialization steps, but has not begun processing data samples.

  3. To provide more room on the workstation screen, turn the Simulation Manager window into an icon.

Single-Step Through the Simulation

  1. In the Interactive Simulation debugger window, click on the Step button.
  2. Note: The Scheduler is guaranteed to generate an accurate schedule for your system. However, the Scheduler will not necessarily generate the same schedule as the one used as an example in this tutorial.

    The simulator executes the program code for the first block scheduled for execution and then stops the simulation at that point. It highlights the associated block in the BDE design window, and depending on the schedule generated, it may appear as shown in Figure 6-6. If it does not, then you can continue stepping until the source block is highlighted.

Figure 6-6  Simulation Highlight in Design Window

The Interactive Simulation Commands window displays a message line that looks like this:

Instance:[2] Name=basicsource Iteration=0

This line shows the block instance number, the name of the block code module ("basicsource" for the basic/source.symbol block), and the simulation iteration number.

Note: You might see a different instance number for this block. BDE assigns instance numbers based on the order in which you add the blocks to the design.

  1. Click on the Print button.
  2. The Interactive Simulation Commands window displays the current status of each input pin and output pin of the current block. For example, for the "x" output, it says the following:

    Output Port: "x"
    Number of Readers: 3
    Tokens Available: 0

    The name of the output port is "x," the number of "readers" is 3 (the number of block inputs connected to this output port in the flattened design), and the number of tokens is 0 (the number of data samples accumulated internally in the block for this output port).

  3. Click on the Step button again.
  4. The simulator executes the code associated with the next block scheduled for execution in the simulation program, which is a block in the notch60 context window. The simulator highlights the hierarchical notch60 block instance in the design window. It also highlights the leaf-level block in the context window as shown in Figure 6-7.

Figure 6-7  Simulation Highlight in Context Window

Note: The block highlighted in your context window might not be the same as the one shown highlighted in the figure, depending on the order in which you added the blocks.

The Interactive Simulation Commands window displays a message line that might look like this:

Instance:[1.8] Name=basicdly_ro Iteration=0

The instance number is hierarchical. The notation "1.8" means local instance number 8 of hierarchical block instance number 1. The name "basicdly_ro" means the Run Output code of the basic/dly.symbol block is being executed.

  1. Click on the Step button repeatedly a few times and watch the block execution sequence in the context window.
  2. Continue single-stepping through the simulation until the Unit Delay block that was first highlighted is highlighted a second time.
  3. You might find the following report in the Interactive Simulation Commands window:

    Instance:[1.8] Name=basicdly_ri Iteration=0

    The name "sbpdly_ri" indicates that the Run Input section of the block is being executed. The Unit Delay block is scheduled for execution twice in each simulation iteration: once for the Run Output section and again for the Run Input section.

  4. Continue single-stepping through the simulation until the Source block is highlighted again.
  5. The first iteration (number 0) has been completed and you are now starting Iteration number 1.

Specify Breakpoints

To specify a breakpoint, you select the block where you want the breakpoint to occur and then click on a command button in the debugger. After you set a breakpoint, execution of the simulation stops when the simulator reaches the code associated with the specified block.

  1. In the design window, select the Source block.

Note: You might not see the ordinary selection highlight color because of the block is already highlighted in red by the debugger.

  1. In the debugger window, click on the Breakpoints tab.
  2. In the Breakpoints page, click on the Attach button.
  3. In the context window, select the 3-Input Adder block.
  4. In the Breakpoints page, click on the Attach button again.
  5. Each time you click on the Attach button, the Breakpoints page is updated with a new breakpoint, as shown in Figure 6-8. Each breakpoint has its own Enable/Disable toggle button, a description field (which you can modify), and an instance location field.

Figure 6-8  Breakpoints Page

Run and Stop at Breakpoints

  1. In the debugger window, click on the Run tab.
  2. Click on the Cont button.
  3. The simulation stops immediately at the Source block because it is a breakpoint. The Start button changes to Cont.

  4. Click on the Cont button.
  5. The simulation runs continuously until it reaches the next breakpoint, which is the 3-Input Adder block.

    You should see a message similar to the following:

    Break at:1.12
    Instance:[1.12] Name=basicsum3 Iteration=1 ReqId=1

    The "ReqId" number is the Request Identification breakpoint number, which identifies the breakpoint that caused the simulation to stop. This number is 0 for the Source block breakpoint and 1 for the 3-Input Adder block breakpoint.

  6. Click on the Cont button again.
  7. The simulation runs continuously until it reaches the next breakpoint, which is the Source block again. The iteration number is advanced by one.

  8. Click on the Cont button several times.
  9. The simulation stops at the two breakpoints, alternating between the 3-Input Adder block and the Source block. The iteration number advances each time the simulation stops at the Source block.

Disable One Breakpoint

  1. Click on the Breakpoints tab.
  2. Toggle off the button for BREAKPT_2 (the 3-Input Adder block breakpoint).
  3. Click on the Run tab.
  4. Click on the Cont button several times.
  5. Now the simulation stops only at the Source block. The iteration number is advanced with each click on the Cont button.

Tracing

  1. Toggle on the Tracing button in the debugger window.
  2. Click on the Cont button.
  3. The debugger rapidly highlights the blocks in succession as it executes the code for one simulation iteration. The simulation stops at the Source block.

  4. Click on the Cont button a few more times and watch the debugger trace through successive simulation iterations.

Run Without Breakpoints

  1. Click on the Breakpoints tab.
  2. Toggle off the button for BREAKPT_1 (the Source block breakpoint) so that both breakpoints are disabled.
  3. Click on the Run tab.
  4. Click on the Cont button.
  5. The debugger traces through the simulation without stopping. The Cont button changes to a Pause button.

  6. After a few seconds, click on the Pause button.
  7. The simulation stops at an arbitrary point in the simulation.

Note: Simulation tracing might continue for a little while after you click on the Pause button because the debugger continues to display its buffered tracing information.

  1. Click on the Cont and Pause buttons a few times to start and stop the simulation.
  2. Toggle off the Tracing button.
  3. Again, click on the Cont and Pause buttons a few times to start and stop the simulation.
  4. This time, with tracing disabled, the simulation runs much faster, as shown by the iteration number reported in the Interactive Simulation Commands window.

End the Debugging Session

  1. Continue to click on the Cont and Pause buttons until you see the following message:
  2. Instance:[] Iteration=11903

    This is an indicator that the Source block has run out of data and the simulation is no longer advancing. You have reached the end of the simulation.

    Note: The debugger ignores the entry in the Number of Samples field of the Simulation Manager. A debugging session runs until terminated by the user.

  3. In the Interactive Simulation debugger window, execute the following command:
  4. File-Save 
     

    This saves the current breakpoint settings into the toolrun. The next time you start the debugger, the breakpoints will be present in the Breakpoints page (with their Enable/Disable buttons toggled off).

  5. In the Interactive Simulation debugger window, execute the following command:
  6. File-Exit 
     

    This closes the debugger window.

  7. Close the context window.
  8. Turn the Simulation Manager icon back into a window.
  9. In the Simulation Manager window, click on the SigCalc button.
  10. In the simulation Files Preview dialog box, click on the OK button.
  11. The simulation results from the debugging session are displayed. The output signal length is 11,903 points.

  12. Turn the SigCalc window into an icon.

Using Probes

A probe is a block that the Simulation Manager adds to a design temporarily for the purpose of recording or monitoring a signal. Using a probe does not affect the original design file. Instead, the Simulation Manager inserts the probe into the netlist generated for the simulation run. Probes are useful because you can monitor any signal without changing the original design.

Prepare for Using Probes

  1. If you have not already done so, display the notch60 test system, yourlib/notchtest.system, in a BDE design window.
  2. Double-click on the notch60 block to display its context window.
  3. If you have not already done so, invoke the Simulation Manager from the design window.
  4. Verify that the toolrun name in the title bar of the Simulation Manger window is yourlib/notchtest.toolrun. If necessary, change it to that name with the File-Open command.
  5. Verify that the Simulation Manager fields and options are set as follows:
    • Design: yourlib/notchtest.system
    • Configuration: config/bde.default
    • Engine: SPB-I
    • Create and Run buttons on
    • Debug button off
    • Samples: 10000
    • Noise Seed: 1
  6. In the Simulation Manager, click on the Probes tab to display the Probes page, as shown in Figure 6-9.
Figure 6-9  Empty Probes Page

Add Probes

  1. In the context window containing the notch filter detail model, select the junction dot at the output of the left Unit Delay block. This is the point labeled "first probe point" in Figure 6-10.
Figure 6-10  Probe Points in Context Window

  1. In the Probes page of the Simulation Manager, click on the Attach button.
  2. The Simulation Manager attaches a probe to the selected point and updates the Probes page.

  3. In the context window, select the junction dot at the output of the other Unit Delay block (the point marked "second probe point" in Figure 6-10).
  4. In the Probes page of the Simulation Manager, click on the Attach button a second time.

The Simulation Manager attaches another probe as shown in Figure 6-11 and updates the Probes page as shown in Figure 6-12.

Figure 6-11  Added Probes in Context Window

Figure 6-12  Probes Page with Two Probes

For each probe, the Probes page provides the following options and information fields:

Note: The hierarchical instance numbers and pin names that you see in the "Locations" column of your Probes page might be different from the ones shown in the previous figure. The block instance numbers depend on the order in which the blocks were added to the design.

For this tutorial procedure, you use the default probe settings.

Save the Toolrun

  1. In the Simulation Manager, execute the following command:
  2. File-Save As 
    
  3. In the dialog box, enter the following new toolrun name:
  4. yourlib/notchtest.toolrun_probe

  5. Click on the OK button.
  6. The probe information is stored in the new toolrun (yourlib/notchtest.toolrun_probe). If you invoke the same toolrun later, you will see the same probes in the design.

Run the Simulation

  1. In the Simulation Control area of the Simulation Manager window, click on the Start button.
  2. Allow the simulation to run to completion.
  3. In the Tool Launch area, click on the SigCalc button.
  4. SigCalc displays the simulation Files Preview dialog box.

    Note: You might need scroll to the left to see the source and sink signals because their file names are much shorter than the probe names.

  5. Click on the OK button.
  6. SigCalc displays not only the signal produced by the Source block and the signal recorded by the regular Sink block, but also the two signals recorded by the two probes, as shown in Figure 6-13.

Figure 6-13  Probe Signals

Delete a Probe

  1. For the last probe entry (PROBE_1), click on the empty space between the probe type ("probes/srd.probe") and the Options ... button.
  2. The whole probe entry is selected and highlighted with a rectangle.

  3. In the Probes page, click on the Delete button.
  4. The Simulation Manager deletes the probe from the context window, leaving only the first probe, PROBE_0. It also deletes the probe entry from the Probes page.

Specify the Signal File Name

By default, the signals recorded by probes are stored in the toolrun. To have a probe store a signal into a conventional signal file, you need to specify the signal file name.

  1. Click on the Options ... button at the end of the PROBE_0 entry in the Probes page.
  2. This displays the Modify Probe dialog box shown in Figure 6-14.

Figure 6-14  Modify Probes Dialog Box

The default file path is an empty string.

  1. In the file_path field, enter the following signal file name:
  2. yourlib/probe0

  3. Click on the OK button.
  4. Click on the Start button and allow the simulation to run to completion.
  5. Click on the SigCalc button.
  6. SigCalc displays the simulation Files Preview dialog box.

  7. Click on the OK button.
  8. This time there is only one probe signal displayed, yourlib/probe0.sig.

Toolrun Contents

A toolrun contains two types of information:

By default, each probe has its output file name set to an empty string. Therefore, the default storage location for probe-recorded signals is in the toolrun.

The simulation setup information is saved in a toolrun only when you execute a File-Save or File-Save As command. However, simulation output signals are saved immediately upon execution of the simulation.

Close the Simulation Manager

In order to retain the two probes previously saved in the toolrun, do not save the current simulation setup. Instead, close the Simulation Manager with the File-Exit command without saving.

Turn the SigCalc window into an icon in preparation for the next tutorial procedure.

Overriding Parameters

The Simulation Manager lets you override parameter settings in a block diagram temporarily without affecting the original design. For example, you might want to see the effects of rounding the coefficient values in the notch60 filter design. Instead of copying and modifying the design, you can simply override the parameter values temporarily in the Simulation Manager.

Prepare for Overriding Parameters

  1. If you have not already done so, display the notch60 test system, yourlib/notchtest.system, in a BDE design window.
  2. Double-click on the notch60 block to display its context window.
  3. If you have not already done so, invoke the Simulation Manager from the design window.
  4. Verify that the toolrun name in the title bar of the Simulation Manger window is yourlib/notchtest.toolrun. If necessary, change it to that name with the File-Open command.
  5. Verify that the Simulation Manager fields and options are set as follows:
    • Design: yourlib/notchtest.system
    • Configuration: config/bde.default
    • Engine: SPB-I
    • Create and Run buttons on
    • Debug button off
    • Samples: 10000
    • Noise Seed: 1

Override the Parameters

  1. Click on the Parameters tab to display the Parameters page, as shown in Figure 6-15.
Figure 6-15  Empty Parameters Page

  1. In the context window, Change the Affinity to Parameter and select the two parameters shown in Figure 6-16. (Hold down the Control key to allow multiple selection.)
Figure 6-16  Parameters to Override

  1. In the Parameters page, click on the Scan button.
  2. The Simulation Manager scans the selected parameters and lists them in the Parameters page. Each entry in the list shows the parameter name (including the hierarchical instance numbers in the path to the parameter) and current parameter setting, as shown in Figure 6-17.

Figure 6-17  Parameters Page with Scanned Parameters

To override a parameter, you only need to modify the value displayed in the text input field. (The buttons to the right of this field are for "sweeping" parameters.)

  1. In the Parameters page, change the two parameter settings in the list from 0.997137 to 0.997.

Save a New Toolrun

In order to retain your original simulation results, you need to save the simulation setup information into a new toolrun.

  1. In the Simulation Manager, execute the following command:
  2. File-Save As 
    
  3. In the dialog box, enter the following new toolrun name into the New Logical Name field:
  4. yourlib/notchtest.toolrun_over

  5. Click on the OK button.
  6. The new toolrun name is displayed in the title bar of the Simulation Manager window.

Run the Simulation

  1. In the Simulation Control area, click on the Start button.
  2. The Simulation Manager runs the simulation using the specified override values for the two parameters.

  3. Allow the simulation to run to completion.
  4. In the Tool Launch area, click on the Notes button.
  5. The Notes dialog box shows the override values and hierarchical instance numbers of the affected parameters.

  6. Click on the Dismiss button in the Notes dialog box.

View the Simulation Results

  1. In the Tool Launch area, click on the SigCalc button.
  2. SigCalc displays the simulation Files Preview dialog box.

  3. Click on the OK button.
  4. SigCalc displays the new simulation results, as shown in Figure 6-18. You can see that with the two rounded coefficient values, the output signal still contains some of the 60-Hz sine wave component.

  5. Close the Simulation Manager window and BDE windows.
  6. Turn the SigCalc window into an icon in preparation for the next tutorial procedure.
Figure 6-18  Simulation Results with Parameter Overrides

Sweeping Parameters

The Simulation Manager can automatically run multiple simulations of the same system using a specified set of parameter values. This capability is called parameter "sweeping" because the simulator traverses a specified range of parameter values.

If the desired parameter settings are equally spaced, you can specify a base value, an increment value, and the total number of values to use. Otherwise, you specify the parameter values by listing them explicitly.

In the following example, you use a pre-existing demonstration system and run an automated sequence of 10 simulations.

Load the System Design

  1. In an empty design window, execute the following command:
  2. File-Open 
    
  3. In the File Open dialog box, select the following logical grouping:
  4. >Iterate Example>BPSK Bit Error Rate

  5. Click on the OK button to display the block diagram.

This system design calculates the Bit Error Rate of a communications channel. The Bit Error Rate depends on two parameters that you vary: "snr" (signal-to-noise ratio in dB) and "time" (timing sensitivity, a fractional value between 0 and 1).

Modify the Output File Name

The demonstration model has a Sink block with its file name parameter set to 'demo_out/iterate'. This parameter must be changed so that each successive simulation run does not overwrite the previous results.

  1. In the design window, double-click on the Library/File parameter of the sink block, as shown in the following figure.
Figure 6-19  Sink Block's Library/File Parameter

  1. In the Parameter Properties dialog box, change the parameter setting from 'demo_out/iterate' to an empty string, which is just a pair of apostrophe characters ('').
  2. Click on the OK button.

When the Library/File (path) parameter of a Sink block is set to an empty string, the Simulation Manager stores the output file in the toolrun rather than in a standard SigCalc file. For a sequence of runs in a parameter sweep, the Simulation Manager stores the output file in a separate subdirectory for each run.

Note: It is not necessary to save the modified BDE model in order to simulate it. The Simulation Manager uses the modified model in the BDE design window, when available, rather than the model stored on disk.

Prepare for Parameter Sweeping

  1. Invoke the Simulation Manager from the design window.
  2. In the Number of Samples field of the Simulation Manager, enter the value 1.
  3. This simulation produces one output sample, which is the Bit Error Rate. Therefore, the simulation only has to run for one sample.

  4. Verify that the Simulation Manager fields and options are set as follows:
    • Design: spb_demo/iterate.system
    • Configuration: config/bde.default
    • Engine: SPB-I
    • Create and Run buttons on
    • Debug button off
    • Samples: 1
    • Noise Seed: 1

Specify the Parameters

  1. Click on the Parameters tab to display the Parameters page.
  2. In the BDE design window, select the two parameters indicated in Figure 6-20. (Hold down the Control key to allow multiple selection.) These are the parameters:
    • the "snr" parameter, labeled "Signal To Noise Ratio (dB):"
    • the "time" parameter, labeled "Timing sensitivity (0,1):"
Figure 6-20  SNR and Time Parameters

  1. In the Parameters page of the Simulation Manager, click on the Scan button.
  2. The Simulation Manager scans the block diagram for selected parameters and lists them in the Parameters page as shown in Figure 6-21.

Figure 6-21  Scanned Parameters

For each selected parameter, the list shows the parameter name and the original parameter setting. There is also a button to control the parameter override mode, which can be set to Value(s), Sweep, or Script.

Specify the Parameter Sweep Values

  1. For the "snr" parameter, replace the default value of 12 with the two values 12.0 and 14.0, separated by a space.
  2. Leave the parameter override mode button set to Value(s).

  3. For the "time" parameter, change the override mode button to Sweep.
  4. This changes the parameter specification line to show three fields, labeled #Vals, Base, and Inc, into which you enter the number of values, base, and increment for the parameter sweep.

  5. Fill in the three fields as follows:
  6. #Vals: 5 Base: 0.4 Inc: 0.05

    The Parameters page should now be filled in as shown in Figure 6-22.

Figure 6-22  Parameter Override Setup

Save the Toolrun

Before you can run a simulation, you need to save the simulation context into a new toolrun.

  1. In the Simulation Manager, execute the following command:
  2. File-Save As 
    
  3. In the dialog box, enter the following new toolrun name into the New Logical Name field:
  4. yourlib/iterate.toolrun

  5. Click on the OK button.
  6. The new toolrun name is displayed in the title bar of the Simulation Manager window.

Note: The spb_demo library is write-protected, so you cannot use it for storing your toolrun.

Run the Simulations

  1. In the Simulation Control area, click on the Start button.
  2. Allow the sequence of simulation runs to be completed.

The Simulation Manager runs multiple simulations covering all combinations of the specified parameter settings, for a total of 10 simulation runs. It stores the output signal produced by each simulation run in a different directory of the toolrun.

The parameter settings are summarized in Table 6-1.

Table 6-1  Simulation Run Parameter Settings

Figure 2-1
Run Number
snr
time
1
12.0
0.40
2
14.0
0.40
3
12.0
0.45
4
14.0
0.45
5
12.0
0.50
6
14.0
0.50
7
12.0
0.55
8
14.0
0.55
9
12.0
0.60
10
14.0
0.60

The Simulation Manager reports on the progress of the simulation in the system message area. The completion bar shows the fraction of all 10 simulations completed. In other words, the completion bar is half green when five simulation runs have been completed.

Display the Results for Individual Runs

  1. In the Simulation Manager window, click on the Results tab to display the Results page, as shown in Figure 6-23.
Figure 6-23  Results Page

  1. In the Results page, move the Run Number slider slowly from the left end to the right end.
  2. As you move the slider, the run number changes from 1 to 10 and the "snr" and "time" buttons are automatically updated to show the parameter settings for each run.

  3. With the Run Number set to 10, click on the SigCalc button.
  4. SigCalc displays the simulation Files Preview dialog box.

  5. Click on the OK button.
  6. SigCalc displays the output signal from run number 10. The signal contains only one data point, which is the calculated Bit Error Rate (BER). The Value field of the signal display frame shows the value of that data point. The signal comment field shows the parameter settings used for that run.

  7. Move the Run Number slider left one step (to run number 9).
  8. Click on the SigCalc button again.
  9. In the simulation Files Preview dialog box, click on the OK button.
  10. SigCalc displays the results of run number 9.

Plot the Results

A Signal Calculator macro, called "Estimators/BER_plot.tcl," obtains the last data point from each signal in a set of output files generated by a parameter sweep, and then plots those values as a function of an iterated parameter. The value obtained from each output signal is the "dependent variable" or "Y" quantity that depends on a parameter setting. The parameter that is iterated is the "independent variable" or "X" quantity that you vary in the Parameters page.

  1. In SigCalc, execute the following command:
  2. Tools-Macro-Execute 
     

    This displays the Macro Execute dialog box.

  3. In the Macro Execute dialog box, find the library name Estimators and double-click on it.
  4. Double-click on the macro name BER_plot.tcl.
  5. This starts execution of the macro, which displays the dialog box shown in Figure 6-24.

Figure 6-24  Initial BER_plot Dialog Box

  1. In the Toolrun Directory name field, type the name of your toolrun, yourlib/iterate.toolrun, ending with the Return key.
  2. This displays the new dialog box shown in Figure 6-25.

Figure 6-25  Enter BER Data Dialog Box

  1. In the Specify Independent X-Axis field, enable the Time button.
  2. Click on the OK button.

SigCalc plots the output file values as a function of the time parameter values in an X-versus-Y plot, as shown in Figure 6-26.

Figure 6-26  Results in X vs Y Plot

Edit the Plot Characteristics

To more clearly display the plot data, perform the following editing steps in the XvsY plot window:

  1. Execute the Edit-Plot Line Style command.
  2. Set the Point Shape field to "Diamond". (Use the down-arrow button next to the field to make the change.)
  3. Click on the Apply button.
  4. Set the Edit Plot Line field to "snr=14.000000".
  5. Set the Line Pattern field to Solid and then click on the OK button.
  6. Execute the Edit-Axes command.
  7. In the dialog box, click on the Y Axis tab.
  8. Toggle on the Logarithmic button.
  9. Click on the OK button.
  10. The resulting logarithmic plot is shown in the following figure. The lowest BER occurs with snr=14 and time=0.5.

  11. Close the X vs Y plot window, Simulation Manager window, sigCalc window, and BDE design window.
Figure 6-27  Modified X vs Y Plot


CoWare
CoWare's Web Site
Phone: 1-888-269-2738
CoWare Customer Support