Creating HDL Text Modules, страница 47

    path to the directory that you have

    specified in the Output Directory field

    of the Co-Simulation Wizard for Simulink

 window.

2. Click the Add Folder button and browse

    for Output Directory.

    Then, click OK.

3. Choose the Save option and close the

    Set Path window by pressing the Close

    button

13.9 Simulation with MATLAB
- using simulation black boxes

The Aldec Blockset library is available inside the Simulink library browser.

  Start Simulink.

   Choose the Simulink icon         from MATLAB's

   main toolbar to open the Simulink Library Browser

   window.

   In the left pane of the Simulink Library

   Browser window, the ALDEC Blockset

   library is displayed.

   The right pane displays all black-boxes that

   have been created by using

   the Co-Simulation Wizard for Simulink

13.10 Simulation with MATLAB
- MATLAB simulation Model

User can use  black-boxes from the ALDEC Blockset library and other MATLAB simulation libraries to create own simulation Model

 


13.11 Co-Simulation between
Active-HDL and MATLAB

1. All symbols from the Aldec Blockset library are simulated with  

    Active-HDL simulator.

2. Run simulation from MATLAB in automatic way create inside

    Active-HDL all required processes to run co-simulation with used

    simulation black-boxes.

3. User can review results in MATLAB as also inside Active-HDL    

    waveform.

    NOTE:

     Waveform is created in automated way when “Add signals to Waveform” option

       inside the Co-Simulation Wizard for Simulink has been selected

13.12 Co-Simulation between Active-HDL and MATLAB

After press  Start Simulation button  from the Simulink toolbar,

co-simulation process will be started.

 


13.13 Simulation with MATLAB
- view simulation results

User can review simulation results inside MATLAB as also inside the Active-HDL waveform

13.14 Example of use – Active-HDL design

Open MATLAB_Example workspace

This workspace contain Modulator design

The design contains the following resource files:

1. abs.vhd

      VHDL equivalent model of the Simulink Abs block.

2. mult.vhd, mult1.vhd  

      VHDL equivalent model of the Simulink Product block.

3. sign.vhd

      VHDL equivalent model of the Simulink Sign block.

4. Modulation.mdl         

      Simulink models

13.15 Design Example
– Co-Simulation Wizard for Simulink

1. Compile all files inside design

2. Use Co-Simulation Wizard for Simulink and create simulation

    black-box symbols and MATLAB library

NOTE:

Next slide describe all required parameters which need to be set inside the Co-Simulation Wizard for Simulink

13.16 Design Example
- Co-Simulation Wizard for Simulink

Please specify all required parameters for listed below modules

with using Co-Simulation Wizard for Simulink:

Black-Box Sample Period = 1/20

Active-HDL CoSim block Sample Period = 1/20

For SIGN block set:

Port In1: Cast = sign, Number of Bits = 31, Fractional Part = 24, Quantization = truncate, Overflow = saturate

Port Out1: Cast = sign, Number of Bits = 2, Fractional Part = 0, Quantization = truncate, Overflow = saturate

For MULT block set:

Port Sin_wav1: Cast = unsign, Number of Bits = 16, Fractional Part = 9, Quantization = truncate, Overflow = saturate

Port Sin_wav2: Cast = sign, Number of Bits = 16, Fractional Part = 15, Quantization = truncate, Overflow = saturate

Port Out1: Cast = sign, Number of Bits = 31, Fractional Part = 24, Quantization = truncate, Overflow = saturate

For MULT1 block set:

Port I_abs: Cast = unsign, Number of Bits = 31, Fractional Part = 24, Quantization = truncate, Overflow = saturate

Port I_sig: Cast = sign, Number of Bits = 2, Fractional Part = 0, Quantization = truncate, Overflow = saturate

Port Out1: Cast = sign, Number of Bits = 31, Fractional Part = 24, Quantization = truncate, Overflow = saturate

For ABS block set:

Port In1: Cast = sign, Number of Bits = 31, Fractional Part = 24, Quantization = truncate, Overflow = saturate