0% found this document useful (0 votes)
41 views5 pages

Beginning FPGA Programming - Partie53

The document discusses simulating and programming an FPGA design for a light sensor tripwire. It provides instructions on compiling and simulating the design in ModelSim, including how to add signals to the wave window and generate scripts to force signals. It then discusses programming the compiled light_sensor.sof file to the FPGA board using the Quartus Prime programmer, making sure the correct programmer is selected and starting programming once the desired file is chosen.

Uploaded by

ali alilou
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views5 pages

Beginning FPGA Programming - Partie53

The document discusses simulating and programming an FPGA design for a light sensor tripwire. It provides instructions on compiling and simulating the design in ModelSim, including how to add signals to the wave window and generate scripts to force signals. It then discusses programming the compiled light_sensor.sof file to the FPGA board using the Quartus Prime programmer, making sure the correct programmer is selected and starting programming once the desired file is chosen.

Uploaded by

ali alilou
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Chapter 12 ■ Light Sensors: Turning a Laser Pointer into a Hi-Tech Tripwire

Figure 12-38.  Compilation result

Now you have all of the files in the project and you can start simulating the design one block at a
time. You need to make sure the project is compiled and the Project Navigator shows the Hierarchy as in
Figure 12-38 before you move to the simulation section.
Let me show you a trick to generate a TCL script in ModelSim.
We need to open the ModelSim (click Tools ➤ Run Simulation Tools ➤ RTL Simulation) and start the
simulation using the following script in the Transcript window or right-click the light_sensor_counter_led
and click Simulate (Figure 12-39).

vsim work.light_sensor_counter_led

256
Chapter 12 ■ Light Sensors: Turning a Laser Pointer into a Hi-Tech Tripwire

Figure 12-39.  Start simulation from ModelSim GUI interface

After you run the script or click the simulate selection, the light_sensor_counter_led simulation is
started. You can add all of the design signals to the wave window by right-clicking the target instance in the
sim window and selecting Add Wave (Figure 12-40).

Figure 12-40.  How to add wave from the ModelSim GUI interface

257
Chapter 12 ■ Light Sensors: Turning a Laser Pointer into a Hi-Tech Tripwire

The second tip is how to generate a script to force a signal or generate a clock. Right-click the target
signal and select Clock… or Force… A small window will pop up a for defining a clock or forcing a signal.
After you click OK (Figure 12-41), the script will be generated in the transcript window (Figure 12-42) and
you only need to copy it and use it later.

Figure 12-41.  Use ModelSim Wave window to generate script

Figure 12-42.  Transcript window generates the script for create a clock signal

12.6.5 Program the Tripwire Design to the FPGA

Step 1: Open the Quartus Prime programmer window from the Tools menu (Figure 12-43) or click
from the toolbar. If the BeMicro Max10 board is connected and the USB-Blaster II device driver has been
installed successfully on your computer (Figure 12-44), you can go to step 2. If your programmer is shown as
in Figure 45, you need to plug in your BeMicro Max10 FPGA board. Before you can go to step 2, you need to
follow the steps in Figure 12-45.

258
Chapter 12 ■ Light Sensors: Turning a Laser Pointer into a Hi-Tech Tripwire

Figure 12-43.  Open programmer in Quartus Prime

Figure 12-44.  Programmer with the correct programmer setting

259
Chapter 12 ■ Light Sensors: Turning a Laser Pointer into a Hi-Tech Tripwire

Figure 12-45.  Programmer setting for a new USB-Blaster programmer

Step 2: You can point to the newly created configuration file by clicking the Add File button and
selecting the light_sensor.sof file under the output_files directory (Figure 12-46).

Figure 12-46.   Select file light_sensor.sof

Step 3: Make sure the Program/Configure check box is ticked and click the Start button (Figure 12-47).
The Progress bar will go to 100% and turn green. This means the programming process has finished. Now
you should try to use the laser pointer to point to the photo resistor and then put something in between to
check out the design.

260

You might also like