Skip to content

First project: a sine wave generator

Generate a design, load it onto the FPGA and observe its output from Simulink on your computer.

Before you start

  • Complete installation and activation and check the prerequisites.
  • Prepare your target with the Rexys-provided PYNQ image and connect it over Ethernet.
  • Obtain the sine_generator example described on the sine generator page.
  • To measure a physical output, use a board with a supported analog output and suitable measurement equipment.

The original example was developed for Eclipse Z7. Select the target platform and physical I/O appropriate to your board; the same generated bitstream does not work on every board.

1. Open and understand the design

Open the sine_gen_v1 model. Its FPGA subsystem produces a sine wave; inputs control amplitude and frequency. One output feeds a DAQ channel for observation on your computer, and another feeds an analog output.

Read the model description and port table before changing parameters. Model amplitude values and physical voltage are not interchangeable: the AnalogOut block defines their mapping.

Use Creating a project to identify the atomic subsystem selected for HDL generation. The surrounding model is not all implemented on the FPGA.

2. Generate the FPGA design and software interface

Follow Generating the bitstream:

  1. Select the board's Toolbox target platform and Vivado workflow.
  2. Configure the reference design and map the subsystem ports.
  3. Set the target clock and model timing consistently with the example.
  4. Generate the IP core and the Simulink software interface.
  5. Build the bitstream.

Keep the matching .bit and .hwh files from the same build, together with the generated Simulink software interface. Keep these identifiable and separate from the source model.

3. Connect and load

Open the generated Simulink software interface. Follow Connecting your device to set the target address, connect, and load the matching hardware files.

Configure the DAQ and, if used, the analog output mapping and voltage range. Enable the intended analog output before measuring it.

4. Observe and adjust

Run the generated software interface and inspect the DAQ scope. You should see a periodic waveform. Change the amplitude or frequency control and check that the displayed signal responds. An oscilloscope on the configured analog output provides a separate physical measurement.

If the result differs from the example, first check the target clock, model timing, DAQ settings and output scaling. See Troubleshooting for checks by stage.

Next steps