Introduction
Hello, my name is Nami, and I am gradually getting used to the world of electronic circuits. My name is Nami, and I am gradually getting used to the world of electronic circuits.
Recently, I've been working on some assignments given by my seniors, while dealing with customers little by little.
Last time, I wrote an article about Quartus® Prime, an Intel® FPGA development tool (former Altera FPGA development tool), and its useful features.
In this article, I will discuss how Quartus Prime can be useful for designing logic circuits.
This time, I would like to write about an episode in which I made a mistake when I first used IP (Intellectual Property), which is useful for designing logic circuits.
One day, my senior gave me an assignment to familiarize myself with the kit and HDL (hardware language).
Tompu said, "Let's make a circuit to make a blinking LED, and change the blinking speed of the LED by switching the clock frequency from 1MHz, 50MHz, to 150MHz each time a button is pressed.
I "Are there any conditions?
Tompu, senior "Let's use an IP called ALTCLKCTRL to switch the clock.
I "So the day to use IP has finally come!
What is IP?
To begin with, IP is a "pre-designed functional circuit block" that has a dedicated function by itself. In this article, I will use PLL as an example.
PLL is a circuit that can change (divide, multiply) the frequency of an input clock.
Please refer to this article for more information about PLL.
About Buffers".
It is very difficult and time-consuming to write this from scratch in HDL....
IP is there to solve such problems.
Intel® FPGAs have an IP called ALTPLL that has a PLL function.
Using this IP, you can easily change the frequency by simply specifying the clock to be used.
Figure 1: IP Image
Not only PLLs, IPs with a wide variety of functions are available.
They are very useful!
For your reference, Tophu wrote an article about how to use IPs.
Let's try to use IP - I want to see the contents of IP.
At first, I thought, "If I use a lot of IPs, I can easily complete my tasks!
But the reality was not so sweet.
I failed many times due to my ignorance.
Before I tell you about this sad episode, let me explain about ALTCLKCTRL.
ALTCLKCTRL
ALTCLKCTRL is an IP used to switch the operating clock.
Figure 2: ALTCLKCTRL
The block is as shown in Figure 2, and the output clock signal is switched according to the status of "clkselect".
Table 1: clkselect
This time, the original frequency
・50 MHz
and the PLL output
・1 MHz
・150 MHz
I can switch between these three frequencies by inputting them to ALTCLKCTRL!
I still think it's easy to do!
Notes on Connecting to the Internet
So, at first, I made the connection without thinking about anything in particular (Figure 3).
Figure 3: Actual HDL description (when an error occurs)
However, when I compiled it...
Figure 4: Error message
Huh? Huh?
What is this error? (Figure 4)
Help says that there is an invalid signal on the input....
What does it mean that the clock signal is input but invalid...?
In such a case, there is only the User's Guide! As I read on, I found this item...
ALTCLKCTRL User's Guide is here.
「Connectivity Restrictions. This is it!」
I read further....
・Inputs from dedicated clock pins are inclk[0], inclk[1]
・Output clocks from the PLL must be input to inclk[2], inclk[3]
I didn't think there was such a restriction.
I did not think there was such a restriction. It was a blind spot.
( A note here! This is only on Cyclone V®, so the rules may be different depending on the device! )
Yes, it is true. I was inputting the clock output from the PLL into inclk[0 ], inclk[1]!
So that's what the error meant earlier.
So, I corrected the connection as shown in Figure 5.
Figure 5: Actual HDL description (after modification)
After the modification, the compilation was successfully completed!
The final result is the circuit shown in Figure 6.
With this circuit, I was able to switch the clock and change the blinking speed of the LED!
Figure 6: Circuit that can switch clocks
In the end
IP is very useful, but there are some limitations depending on the type of FPGA used.
You must read the user's guide carefully.
You should also be careful when using IP!
However, it is very useful if you know how to use it!
- IP can greatly reduce the man-hours required for circuit design since it already has its own functions.
- Since there are restrictions on connection, be sure to refer to the user's guide when using IP.
New Engineer's Blush Blog Article List