An FPGA Based Multi-Functional Signal Generator Using SOPC Design Methodology
An FPGA Based Multi-Functional Signal Generator Using SOPC Design Methodology
Abstract—This paper presents an FPGA based miniature, multi- modules necessary to the system, such as DDS, memory,
functional signal generator with digital controller inside to adapt keyboard and display controller are all embedded to an FPGA
applications such as wireless sensor network (WSN) and software chip by HDL design. Nios II’s Avalon bus main port
define radio (SDR) system. To reduce design complexity and (instruction and data control port) is then connected with
decrease development time, this work adopts a novel SOPC peripherals such as high-speed D/A converter, function choose
design methodology, which means using embedded soft-core
microprocessor Nios II and EDA tool Quartus II to accomplish
button and LCD display module. This connection is via
design process. Nios II is a configurable and optimizable soft-core Avalon bus. In this way, the system realized is flexible,
CPU which is embedded in FPGA. Using characteristics of Nios scalable, extensible, upgradable and has online programmable
II, we put together every logical units that system needs and function.
implant them into a single FPGA chip. Then uses the Avalon bus
to connect with Nios II's Avalon bus main port (instruction and II. OVERALL SYSTEM ARCHITECTURE
data control port) with function choose keys, LED display units
and other peripheral equipment. Realize a signal generator The proposed system of multi-functional signal generator
system that is flexible to reduce, extend, with low power can output various waveform, with frequency ranging from
consumption, and has System on Programmable Chip (SOPC) 1Hz to 20MHz. The system is composed by two parts: FPGA
function which means the system’s software and hardware is hardware design and software design based on hardware. The
online programmable and reconfigurable. The system design whole digital part of the design is implemented by an FPGA
process uses SOPC design methodology.
chip. The buttons, LED display and high-speed D/A
Keywords—SOPC, FPGA, signal generator, Nios II, Quartus II converters are peripherals and are ready-made on FPGA
development board.
I. INTRODUCTION Figure 1 below shows the overall architecture of the
A multi-functional signal generator is a device that can proposed system.
output various types of signals, such as sine wave, saw-tooth
Inside the FPGA, Nios II soft-core CPU performs as
wave, square wave, triangle wave, trapezoidal wave and so on.
controlling core, and DDS IP module as achievement core for
It can also digitally control the slope, gradient, width of the
waveform generation functions. At the same time, other IP
waveform, and has FM & PM functions. As modern electronic
cores are added, such as debug module, UART (Universal
devices become smaller and smaller, while their functions
more and more complex, the multiple-functional signal
generator is designed toward the directions of high integration, FPGA
high reliability and low power consumption. These trends in Debug
Nios II
signal generator design are to cope with applications in rapid Soft-core Module
developing fields such as WSN and SDR. Nowadays, there are
two different ways to implement such kind of signal generator:
one way is using Direct Digital Synthesizer (DDS) ASIC and Button Avalon
FPGA for control, plus high-speed D/A converter. This Key Bus
method is expensive, though with good performance. The
other way is using DDS designed by Hardware Description
Language (HDL) or related soft IP core, plus waveform data 7- PIO
storage memory and MCU to control. In this way, the DDS is segment DAC
LED
implemented by downloading the design to an FPGA chip. display മ 1 ㌫㔏⽪മ
These methods can change traditional design flow in RS232 Figure 1
electronic systems by reducing separation of modules, DAC5651
improve speed, accuracy and reconfiguration. But there still DDS
have inflexible problems when adding peripheral devices such
as MCU or DDS chip, which make the system heterogeneous.
[1][2]
In order to design the fully digital multi-functional
generator as a true SOPC system, we choose the solution using Fig. 1 Proposed System Architecture
Nios II soft processor and Quartus II by Altera. In this design,
978-1-5090-2535-0/16
978-1-5090-2534-3 /16$31.00
$31.00©©2016
2016IEEE
IEEE 1257
DOI 10.1109/ICISCE.2016.269
Asynchronous Receiver & Transmitter) module used to logic. Users can customize appropriate SOPC system using
communicate with PC, seven-segment LED display decoding SOPC Builder’s wizard-style interface, according to system
and I/O module, and button control module. These IP cores design requirements. As a result, In SOPC design, we can add
can be designed into a single FPGA, making the system highly corresponding peripheral modules outside the CPU core while
integrated. still inside FPGA chip. The connection between peripheral and
In this design, FPGA hardware system is realized by Nios II core is via Avalon bus, thus do not need to modify on
VHDL language, parameterized macro-functional module PCB level. The detailed Nios II hardware design process is
provided by Altera, LPM functions and IP cores in DSP presented in Figure 2. This development process is used to
Builder. Subsystem blocks such as DDS module can also be customize proper CPU and peripheral device, and realize them
designed and synthesized by the above methods. According to via SOPC Builder in Quartus II.
Avalon bus connection specification, OPB (On chip Peripheral Figure 2 below shows the complete design process of
Bus) is added outside the DDS module, which are packaged Nios II application system using SOPC design methodology.
together into a customized IP core. This IP core is added in the
FPGA hardware system and generates digital control signals.
+DUGZDUH 'HYHORSPHQW 6RIWZDUH 'HYHORSPHQQW
The peripheral circuit contains keyboard, LCD display and Develop drivers or
high-speed D/A converter DAC5651. The peripheral circuit is Customized peripheral, subroutines for
used to accomplish control input and I/O display, transform instructions customized hardware
waveform data to analog waveform. Thus realizes a complete (Using SOPC Builder and
module
SOPC signal generator. Quartus II)
( Using SOPC Builder )
1258
that specifies the port connections between master and slave
components, and specifies the timing by which these
components communicate.
Boot Rom
Nios II Soft-
core
Avalon
Bus
Button_PIO
Memory (RAM,
7-segment LED Flash) Fig. 4 DDS Design Diagram
PIO
In Figure 4 above, there are 3 input ports. Port 1 is the
amplitude control word input; port 2 is phase control word
D/A
UART Convert input, and port 3 frequency control word input. These 3 inputs
(RS232 can control the amplitude, phase and frequency of the output
Interface) DDS waveform. The DDS module outputs the controllable
waveform by changing the control words in corresponding
input registers. In the peripheral sphere, I/O interface files are
DŽ generated through SOPC Builder. After that, the bus interface,
DŽ
DŽ
which works as a custom IP, is added outside DDS module
DŽ and successfully mounted to the system bus. The interface can
DŽ
realize communications between DDS module and Nios II,
Fig. 3 Specific Programmable Hardware System while doing Read/Write operations easily. Figure 5 presents
In this proposed system, Nios II core is 32-bit embedded the implementation process between user logic and DDS IP.
soft-core. Boot ROM is made up by embedded RAM block
M4K in FPGA and is used in system boot. GERMS Monitor DDS IP Core
program can be used to debug this module. Button_PIO is
used as PIO interfaces of buttons. 7-segment LED PIO is used DDS Function
IP Interface Files
Logic Module
as LED display interface. UART is a common serial port, and
SOPC system can use it to communicate with PC or other
devices. UART can also be used in Nios II system simulation
and debugging. The program memory is implemented using
SRAMs inside FPGA, and connects to Nios II CPU via LMB PIO
(Local Memory Bus), which realizes Read/Write access from
CPU. IP Interface Files UART
The system is also scalable. In case the RAM inside
FPGA is not enough, we can use Avalon tri-state Bus Bridge DDS Module
DDS IP Core
to connect external SRAM and Flash into the Nios II system.
Here, the SRAM in the system is similar to memory in PC,
while Flash memory similar to HDD. The DDS module is a Mounted on Avalon Bus
self-written IP core. All IP cores used in proposed system can
be customized using SOPC Builder, which means the
parameters of IP cores such as characteristics, storage capacity Fig. 5 DDS IP Implementation Process
and I/O mode can be determined in the options of SOPC
Builder’s software menu. All peripheral IP cores can be After the construction of hardware system using SOPC
connected to Nios II core through on-chip Avalon Bus. Builder, we choose generating SDK development program,
In the system, DDS module is designed by SOPC Builder VHDL system description and simulation files through
and Matlab / DSP Builder. After finishing the detailed design operations in SOPC Builder. Click “Generate” button, SOPC
of DDS module in Matlab/Simulink, DSP builder will Builder will automatically generate customized SOPC system.
automatically convert DDS block diagram to VHDL code. At the same time, HDL files used in Quartus II compilation
Figure 4 shows the detailed diagram of DDS module. are also generated. After that, the generated SOPC system is
transferred as a component in block diagram. The system is
compiled in Quartus II after its pins added and locked. Finally,
the compiled SOF file is programmed into FPGA chip via
JTAG port. At this point, the hardware development process
1259
of SOPC system based on Nios II is finished. The next work is module to send waveform data to high speed D/A converters.
to design software and debug it in the Nios II embedded Figure 7 below presents the flow diagram of the button
system established in FPGA. processing subroutine.
Finish
1260
case 0x000D; // SW2, output saw-tooth wave VI. CONCLUSIONS
In this paper, a highly integrated, multi-functional signal
generator system with digital controller inside is designed. The
system can output various signal waveform with frequency
Break; from 1Hz to 20MHz. The hardware of the system is
implemented on FPGA. In this system, Nios II processor
works as core, with customized DDS IP and necessary
peripheral modules. The main advantage of the proposed
system over traditional one is its hardware and software co-
case 0x000F˗ // no button pressed design using SOPC design methodology. The core
components of signal generator, such as DDS and memory
buttons =buttonsLast =0x000F˗ (waveform storage) are designed using VHDL or IP cores, and
Break; implemented on FPGA. Other functions such as the control of
external devices (such as button, display, DACs), choosing of
default: output waveform types and calculation of waveform
Break; } parameters are implemented via C programming. The program
runs on Nios II CPU inside FPGA and do not need MCUs to
} control FPGA.
// save the current button value to variable buttonsLast The proposed fully digital signal generator based on
SOPC has advantages of hardware re-configurable and
buttonsLast = buttons; }}
flexible, which makes the system design easy to modify and
consummate. The SOPC design methodology also provides a
novel approach to modern electronic system design.
The source file is first compiled in Nios SDK Shell
environment. After compilation passed, it can be downloaded
into FPGA chip. FPGA establishes hardware system based on VII. ACKNOWLEDGEMENT
configuration information, mapping source code into on-chip This work was financially supported by the natural
RAM, finally start Nios II softeare. science foundation of Zhejiang Province (ZJNSF), with
In software design of the system, the display program project number: Y105346.
module is used to display parameters of output waveform such
as frequency, duty cycle, gradient and so on. The display
module converts hexadecimal data into the format of BCD REFERENCES
code, and is then displayed in LEDs. [1] Song Pan, Jiye Huang, Guodong Wang, “Modern DSP Technology”
Xi’an Electronic Science & Technology University Press.
V. IMPLEMENTATION AND TEST [2] Puccinelli, D.; Haenggi, M., “Wireless sensor networks: applications
and challenges of ubiquitous sensing,” Circuits and Systems Magazine,
After download the compiled file into FPGA IEEE, Vol.5, Issue 3, 2005.
development board, we can see the real waveform generated [3] Ruan Yue, Tang Ying, “A water quality monitoring system based on
wireless sensor network and solar power supply”, IEEE International
from the FPGA based signal generator by connecting an Conference on Cyber technology in Automation, Control and Intelligent
oscilloscope to it. Note that AD/DA module is already in the systems, March 2011.
dev board so the digital signal generated by FPGA can be [4] Ruan Yue, Yao Wenji, “Design and Implementation of a SoC-based
transferred into analog waveform. Figure 8 shows the FPGA single chip radio transceiver,” The 7th International Conference on
Wireless Communications, Network and Mobile Computing, Sept 2011.
implementation of a sine-wave on an oscilloscope. [5] Tang Ying, Ruan Yue, “Research on a Novel Synchronization and
Detection Scheme used in Energy Detection UWB Receiver”, The 11th
IEEE International Symposium on Communications and Information
Technologies (ISCIT 2011), 2011.10. pp109-113.
[6] Altera Corporation: SOPC Builder DataSheet.2003. Available:
http://www.altera.ru/Disks/Altera%20Documentation%20Library/literat
ure/ds/ds_sopc.pdf.
[7] Altera Corporation: Nios II software developer's handbook. 2005.
Available: http://www.altera.com/literature/hb/nios2/n2sw_nii5v2.pdf.
1261