wiki:sysgen2opb

Version 85 (modified by elliotng, 17 years ago) (diff)

--

sysgen2opb Peripheral Conversion Tool

'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 From/To Registers with memory mapped registers. It also creates the necessary address decode logic and a C header file with the resulting register map.

Alternatively, if an addressable dual-port storage block is used within a System Generator model, the storage element may be mapped directly into the OPB memory space. This functionality, termed the Shared Memory Extension, permits higher throughput when accessing shared storage elements. This extension can be turned on/off. This extension requires the usage of Dual Port RAM's.

The latest copy of this tool is available in the repository.

A copy of Xilinx's OPB Export tool is needed to use the models generated by sysgen2opb.

Using sysgen2opb

  1. The script is only supported for use with Xilinx System Generator 8.1 and 8.2.
  2. Copy the conversion script (sysgen2opb.m) and its required skelton peripheral model (skeleton_periph_model.mdl) to the same directory as your model.
  3. 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', 'yourSMChoice')
    1. Replace 'yourModelName' with your Simulink model's name without the .mdl extension.
    2. Replace 'yourSMChoice' with one of the following:
      1. 'smon' which will turn on the Shared Memory Extension Script
      2. 'smoff' which will turn off the Shared Memory Extension Script

  1. Additional Options
    1. If you want to run the original script that utilizes From/To Registers with no shared memory extension, run: sysgen2opb('yourModelName')

Current Limitations

  • The script (sysgen2opb.m) and skeleton peripheral model (skeleton_periph_model.mdl) must in the same directory as the model you wish to convert.
  • The model you're converting must contain at least one From Register and one To Register.
  • The base address and memory size of the resulting OPB peripheral cannot be changed dynamically in XPS. These parameters must be entered manually in XPS and locked before autogenerating addresses for other peripherals.
  • All gateways which become registers must be clocked at the system sample period.
  • Any sources driving gateways which are converted to registers will remain in the model. Functionally this is fine; they're just clutter.
  • Every register created by the script will have a unique address on a 4-byte boundary (i.e. addr[1:0]=2'b0 for all).
  • Every register will be read/write. Read/write-only must be enforced by software.
  • From the script, we can have at most 1024 From/To Registers. However, with some limitation in one of the tools, we can only use 450 Gateways. A check is implemented to make sure that we have less than/equal 450 From/To Registers.
  • The memory interface blocks created by the script will be placed in the middle of the top-level of the model, probably underneath existing subsystems. Connectivity won't be changed, but you'll have to clean things up by hand.
  • Any Boolean type connected to a Gateway Out needs to be cast to a UFix1_0 before being connected to the Gateway Out.
  • Path to output register must contain synchronous path.

General Guidelines