2 | | 'sysgen2opb' is a MATLAB script which converts a model built in Xilinx System Generator into an OPB-compliant peripheral for use with the embedded PowerPCs. The script replaces all the model's gateways in/out with memory mapped registers. It also creates the necessary address decode logic and a C header file with the resulting register map. |
3 | | |
4 | | 'sysgenGWSM2opb' is a similar script to 'sysgen2opb'. This script includes Shared Memory support by using Dual Port RAM's. |
| 2 | 'sysgen2opb' is a MATLAB script which converts a model built in Xilinx System Generator into an OPB-compliant peripheral for use with the embedded PowerPCs. The script replaces all the model's gateways in/out with memory mapped registers. It also creates the necessary address decode logic and a C header file with the resulting register map. |
| 3 | It has two options to run: |
| 4 | 1. Original Script - This script is exactly what is described on the above. |
| 5 | 1. Shared Memory Extension Script - This script is the Original Script with the Shared Memory extension. The Shared Memory support requires the usage of Dual Port RAM's. |
12 | | 1. Make sure MATLAB's current working directory is the folder containing your model, the sysgen2opb script and skeleton model. Run the script on the MATLAB command line like `sysgen2opb('yourModelName', hex2dec('yourBaseAddress'), 'newPrefix')`. |
13 | | 1. Replace `yourModelName` with your Simulink model's name without the `.mdl` extension. |
14 | | 1. Replace `yourBaseAddress` with a 32-bit memory address in hexidecimal notation. `FF100000` is usually a safe choice. |
15 | | 1. Replace `newPrefix` with a string which will replace the `"no_reg"` prefix attached to unconverted gateways. Use a blank string (`''`) to simply strip the `"no_reg_"` prefix. |
| 13 | 1. Make sure MATLAB's current working directory is the folder containing your model, the sysgen2opb script and skeleton model. Run the script on the MATLAB command line like `sysgen2opb('yourModelName', hex2dec('yourBaseAddress'), 'yourSelection', 'newPrefix')`. |
| 14 | 1. Replace 'yourModelName' with your Simulink model's name without the `.mdl` extension. |
| 15 | 1. Replace 'yourBaseAddress' with a 32-bit memory address in hexidecimal notation. `FF100000` is usually a safe choice. |
| 16 | 1. Replace 'yourSelection' with one of the following: |
| 17 | 1. 'orig' which will run the Original Script |
| 18 | 1. 'sm' which will run the Shared Memory Extension Script |
| 19 | 1. Replace 'newPrefix' with a string which will replace the `"no_reg"` prefix attached to unconverted gateways. Use a blank string (`''`) to simply strip the `"no_reg_"` prefix. |
17 | | == Using sysgenGWSM2opb == |
18 | | 1. This script is supported for System Generator version 8.1 |
19 | | 1. Copy the conversion script (''sysgenGWSM2opb.m'') and its required skelton peripheral model (''skeleton_periph_model8GWSM.mdl'') to the same directory as your model. |
20 | | 1. Make sure MATLAB's current working directory is the folder containing your model, the sysgenGWSM2opb script and skeleton model. Run the script on the MATLAB command line like `sysgenGWSM2opb('yourModelName', hex2dec('yourBaseAddress'), 'newPrefix')`. |
21 | | 1. Replace `yourModelName` with your Simulink model's name without the `.mdl` extension. |
22 | | 1. Replace `yourBaseAddress` with a 32-bit memory address in hexidecimal notation. `FF100000` is usually a safe choice. |
23 | | 1. Replace `newPrefix` with a string which will replace the `"no_reg"` prefix attached to unconverted gateways. Use a blank string (`''`) to simply strip the `"no_reg_"` prefix. |