wiki:sysgen2opb

Version 5 (modified by murphpo, 18 years ago) (diff)

--

sysgen2opb Peripheral Conversion Tool

This 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.

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

Using sysgen2opb

  1. Prepend "no_reg_" to a gateway's name to prevent its being converted to a register. These gateways will become top-level HDL ports in the exported peripheral.
  2. Copy the script (sysgen2opb.m) and skelton peripheral model (skeleton_periph_model.mdl) to the same directory as your model.
  3. More Steps Here
  4. Run sysgen2opb('yourModelName', hex2dec('yourBaseAddress')) in MATLAB. Replace yourModelName with your Simulink model's name without the .mdl extension. Replace yourBaseAddress with a 32-bit memory address in hexidecimal notation. FF100000 is usually a safe choice.

Current Limitations

  • The script (sysgen2opb.m) and skelton peripheral model (skeleton_periph_model.mdl) must in the same directory as the model you wish to convert.
  • The model you're converting must contian at least one Gateway In and one Gateway Out which will become registers.
  • Gateways in masked subsystems will not be converted, regardless of their name. Use ports to bring the gateways out of the masked subsystem before converting the model.
  • 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.