Beginning FPGA Programming - Partie61
Beginning FPGA Programming - Partie61
13.5.3.2 i2c_slave.vhd Code
We downloaded this .vhdl IP file from github.com and we need to make the following change to this IP. All
of those that are sda and scl with a status of '1' need to change to have a status of 'H'. The following shows the
line number that needs to be changed. Line 50 and line 262 are added to the vhdl.
297
Chapter 13 ■ Temperature Sensors: Is It Hot in Here, or Is It Just Me?
298
Chapter 13 ■ Temperature Sensors: Is It Hot in Here, or Is It Just Me?
2.
Project ➤ Add / Remove Files in the project and add i2c_master.vhd,
uartTOi2c.vhd, and temperature_sensor_top.vhd files in the project.
3.
Add Altera PLL IP—pll_29p5M.vhd as shown in the FPGA IP—Altera PLL IP
section
4.
Set up simulation tool and test bench. Assignment ➤ Settings… ➤ EDA Tool
Settings / Simulation ➤ Select Compile test bench and click Test Benches…
(Figure 13-26)
299
Chapter 13 ■ Temperature Sensors: Is It Hot in Here, or Is It Just Me?
5.
Open the Test Benches window pop-up and click New… (Figure 13-27)
300
Chapter 13 ■ Temperature Sensors: Is It Hot in Here, or Is It Just Me?
6.
In the New Test Bench Settings window, please follow Figure 13-28 and click OK
and OK again. You will add two .vhd files under Create new test bench settings:
I2C_slave.vhd and tb_temp_sensor_top.vhd.
■■Note Only add the tb_temp_sensor_top.vhd under test bench settings but NOT the project file section.
7.
In the Compiler Setting ➤ VHDL Input, select VHDL 2008. Figure 13-29 shows
the setting.
301