Design and Verification of Daisy Chain Serial Peripheral Interface Using System Verilog and Universal Verification Methodology
Design and Verification of Daisy Chain Serial Peripheral Interface Using System Verilog and Universal Verification Methodology
Corresponding Author:
Rajesh Thumma
Department of Electronics and Communication Engineering, Anurag University
Venkatapur, Narapally, Hyderabad, India
Email: [email protected]
1. INTRODUCTION
System on chip (SoC) architecture requires different components to develop an application. For the
communication and operation between these components, Interfaces are utilized. The communication speed
of the SoC depends on the types of interfaces. The speed rate of the serial peripheral interface (SPI) interface
is 1.1 Mbps. The interfaces are classified into two types, based on the data transmission. They are a serial
interface and a parallel interface.
According to the SoC component’s protocols, serial or parallel communication interfaces are
used [1]-[17]. The motorola semiconductors are the first developers of SPI. The SPI and inter-integrated
circuit (I2C) protocols are used [2] to transfer the data in sequential communication. These two protocols are
appropriate for interchanges between coordinated circuits and with onboard peripherals. The inter-integrated
circuit (I2C) transport utilizes two signals, a sequential clock signal (SCL) and a sequential information
signal SDA, to move information among numerous devices. When contrasted with I2C, SPI utilizes four signals
to move among various devices [3]-[25]. For intra chip communication, SPI is usually used. Both the master and
slave perform the dual role of transmitter and receiver in the SPI. The SPI master slave is designed from the initial
specifications to final system verification by using Verilog hardware description language (HDL) and achieved 71
to 75 megabytes second by implementing in Virtex-5 field programmable gate array (FPGA) [4]-[24]. Various SPI
design techniques are proposed and compared [5] their implementation with respect to chip selects lines.
However, the number of chip-select lines are increased in the SPI conventional method, while in the daisy
chain technique, the number of chip-select lines is reduced in implementation and easy to design [5]-[21].
The master-slave communication protocol is designed by assigning the priority to each slave by communicating
with the master based on the highest priority slave [6]-[23]. However, the design will consume less power and
utilization sources compared with the other complex design. The high-speed SPI [7] bus is designed in
vertex5 to control and handle two slaves at a time and compared with the existing architectures. However,
accessing multiple devices using a master-slave will be overcome by applying the standard Serial peripheral
interface [8] and single/master communication protocol. The SPI has been designed with five 32-bit registers
using a compatible wishbone interface [9], [10] for serial synchronous communication. In this, 100% of
functional code coverage achieved with up to 64-bits of full-duplex communication is verified.
The interfacing and monitoring of battery-operated electric vehicles [11], [12] is designed using
complementary metal-oxide-semiconductor (CMOS) to transfer the data rate upto 1 Mbps. System Verilog is
the most promising language to reduce the system-on-a-chip (SOC) verification and reusable components of
the complex SOC design. using system Verilog [21], various components are designed, implemented with
object-oriented programming [13], [14] and applied a random technique to find functional coverage.
However, universal verification methodology [15], [17], [18] will reduce the complexity, time, and rewriting
code by accessing the inbuilt classes. Using universal verification methodology (UVM), the SPI master-slave
is designed and verified the 100% functional coverage and code coverage [19], [20].
The SPI is the most used in various interfacing circuits like analog to digital converters (ADCs),
static random access memory (SRAM), sensors, digital to analog converters (DACs), shift registers and
others. SPI is a master, slave-based synchronous, full-duplex interface [5]-[17]. The data is synchronized from
the master or slave at the falling or rising edge of the clock [22]. Both slave and master can send information
(data) simultaneously. This article proposes a daisy chain technique to design an SPI Master-slave interface
using Verilog and verified with system Verilog and UVM. The simulation verification is performed in a model
sim and QuestaSim. The simulation results are obtained in Xilinx Vivado, and both the verification methods
covered 100% of functional coverage, code coverage. In section 2 covers basic information of the SPI theory,
dasiy chain method and operation. Section 3 covers designing a daisy chain SPI using Verilog and is verified
in system Verilog and UVM. Section 4 covers the simulation results of the proposed design Xilinx and
QuestaSim.
Design and verification of daisy chain serial peripheral interface using … (Rajesh Thumma)
170 ISSN: 1693-6930
In regular SPI mode, the number of chip-select lines is increased if the number of slaves increases.
Figure 1 shows the regular SPI mode of operation. Due to this, the input data received by the master from the
slaves are corrupted at MISO. Because of this daisy chain method is most preferable to overcome this problem.
The daisy chain method requires only one chip select line at master compared to the regular SPI mode. When
the chip-select line is active low, all the slaves are active, and the clock is initiated to all the slaves to transfer
the data from the master to the first slave through the MOSI.
The first slave’s output is shared with a second slave, the second slave with the third, and the last
slave output is shared with the master; this forms a daisy chain configuration. The primary serial peripheral
interface with a single master multiple slave configuration shows in Figure 1. The proposed daisy chain SPI
configuration shows in Figure 2.
Figure 1. SPI single master-multiple slave configuration [26] Figure 2. A daisy chain SPI: single
master-multiple slave configuration [26]
3. VERIFICATION
The daisy chain SPI is designed with Verilog and verified using the system Verilog and universal
verification methodology. The flow chart of the verification methodology is shown in Figure 3. The Verilog
code is compiled and finds the zero errors which create the elaborated design. After simulation of the design,
the following are observed by taking the register-transfer level (RTL) analysis: RTL schematic, physical
design, elaborated design, and power report. To implement in FPGA, the constraint files are written for
generating a bitstream and dumped in the FPGA board.
TELKOMNIKA Telecommun Comput El Control, Vol. 21, No. 1, February 2023: 168-177
TELKOMNIKA Telecommun Comput El Control 171
The data received from the driver and receiver will compare on the scoreboard and send to display.
The class_driver is added in the receiver; design under test (DUT) output values are added to packet 2 using a
virtual interface. The packet 1 data from the driver to the scoreboard and the packet 2 data from the receiver
to the scoreboard are compared and included in the coverage. Different random values are added to the inputs
using coverage groups, and coverage is added to the environment.
The functions of generator, driver, receiver, scoreboard and coverage are instantiated in the environment.
The environment is included in the test to perform the test for the environment. A daisy-chain SPI DUT is
developed with a single master and two slaves. A detailed code operation is written for master, slave 1, slave 2
and included in the DUT. Input and outputs are instantiated in the interface to access virtually. The test, DUT
and Interfaces are included in the top block. The top block generates the clock, reset, start signals. The system
Verilog verification environment is shown in Figure 4.
Figure 4. System Verilog verification architecture [9] Figure 5. Verification environment of universal
verification methodology [3]
Design and verification of daisy chain serial peripheral interface using … (Rajesh Thumma)
172 ISSN: 1693-6930
A typical system is formed with all these blocks to perform the verification. The UVM test benches
use the same structure [13]. Figure 5 represents the verification environment of the UVM. A test block is
used generally to control all the blocks of the UVM. The Top block controls all the blocks and sub-blocks of
the test bench. This implies that just by changing a couple of code lines, it is possible to add, eliminate and
abrogate blocks in the test bench and construct various conditions without reworking the entire test. To delineate
the benefit of this verification, need to add a monitor and a driver to the Verification, the environment changes
to the I2C from the serial communication SPI and vice versa.
The serial peripheral interface is widely used due to its advantages. In single master–single slave
SPI communication, there is no difficulty at master input slave output (MISO) to transfer the data compared
to the single master-multiple slave SPI. To solve the above-mentioned problem, different design techniques
are proposed by the different authors. They are interrupt enabled priority-based SPI, parameterization method
using time-sharing multiples technique, high-speed SPI and wishbone compliant SPI. Table 2 represents the
comparison of design techniques and their design or verification languages.
Table 2 compares various SPI design techniques designed using the Verilog, system Verilog (SV), and
UVM. All the SPI design techniques are designed with the Verilog, but few of them are designed with advanced
verification methodologies like SV and UVM. SPI master interface using system Verilog [13], SPI master-slave
core [9] are verified using SV and SPI master-slave core using UVM [3] is verified in UVM achieves the 100%
code coverage. The proposed daisy-chain SPI is designed using Verilog HDL, and a verification environment
is implemented using SV and UVM to achieve 100% code coverage.
TELKOMNIKA Telecommun Comput El Control, Vol. 21, No. 1, February 2023: 168-177
TELKOMNIKA Telecommun Comput El Control 173
Design and verification of daisy chain serial peripheral interface using … (Rajesh Thumma)
174 ISSN: 1693-6930
Figure 9. Synthesized device diagram Figure 10. Synthesized design showing top level schematic
TELKOMNIKA Telecommun Comput El Control, Vol. 21, No. 1, February 2023: 168-177
TELKOMNIKA Telecommun Comput El Control 175
Coverage groups are developed for inputs 𝑑_𝑖𝑛, 𝑑_𝑖𝑛_1, 𝑑_𝑖𝑛_2 with random values, and a 100%
functional coverage report is achieved. Figure 13 represents the coverage report of system Verilog using
QuestaSim 10.0b. The design is verified in universal verification methodology by developing a verification
environment.
In this, the inputs from monitor 1, outputs from monitor two are compared at the scoreboard. Here
the inputs are consider as 𝑑_𝑖𝑛 = 182, 𝑑_𝑖𝑛_1 = 138, 𝑑_𝑖𝑛_2 = 7, the outputs from the monitor 2 are
𝑑𝑜𝑢𝑡 = 7, 𝑑𝑜𝑢𝑡1 = 182, 𝑑𝑜𝑢𝑡2 = 138 are matched at the scoreboard according to the daisy-chain method.
Figure 14 represents the simulation and summary report of the UVM using QuestaSim 10.0b.
The covearge A, coverage B, coverage C are developed for the inputs with random values and
achieved a 100% functional coverage and code coverage. Figure 15 represents the coverage report of the
UVM. The functional and code coveage reports are execucted using QuestaSim.
Figure 14: Universal verification methodology output results using QuestaSim 10.0b
Design and verification of daisy chain serial peripheral interface using … (Rajesh Thumma)
176 ISSN: 1693-6930
5. CONCLUSION
In this paper, the daisy-chain SPI is designed using Verilog. The developed design is verified using SV
and UVM. The open-source design suite tool, ModelSim personal edition, was used to write the Verilog code,
which gives the simulation results. The verification environment of the SV and UVM is developed using the
QuestaSim tool. ModelSim and QuestaSim are Mentor Graphics products, which are used to implement the
necessary functional registers. Universal verification methodology verifies the design in the most effective way.
The daisy chain SPI functionality, operation, depiction of registers, pin and signals are discussed. Functional
verification contains the verification platform’s description using system Verilog for the design under the
daisy-chain SPI test. The created verification environment validates the functionality and operation of
configurable daisy-chain SPI. The verification environment developed for daisy-chain SPI protocol was
reusable and using which design can be verified successfully. by using this verification environment, we can
achieve 100% functional and assertion coverage. The designed daisy chain SPI from Verilog is implemented
in FPGA.
REFERENCES
[1] D. Roopesh and K. Siddesha, “RTL design and verification of SPI master-slave using UVM,” Computer Science, vol. 4, no. 8.
[Online]. Available: https://www.semanticscholar.org/paper/RTL-DESIGN-AND-VERIFICATION-OF-SPI-MASTER-SLAVE-
UVM-Roopesh-Siddesha/9db0eb90f17859812d50a677949ae2eff1730a09
[2] A. K. Shah, “High Speed SPI Slave Implementation in FPGA using Verilog HDL,” International Journal of Advanced Research
in Computer Engineering & Technology (IJARCET), vol. 4, no. 12, pp. 4365–4369, 2015. [Online] Available:
https://pdf4pro.com/amp/view/high-speed-spi-slave-implementation-in-fpga-using-1c923d.html
[3] K. V. A. Kumar and M. S. Krishna, “Design and Functional Verification of A SPI Master Slave Core using UVM,” International
Journal of Scientific Engineering and Technology Research (IJSETR), vol. 4, no. 51, pp. 11023–11030, 2015. [Online]. Available:
http://ijsetr.com/uploads/423651IJSETR8063-1902.pdf
[4] A. K. Oudjida, M. L. Berrandjia, A. Liacha, R. Tiar, K. Tahraoui and Y. N. Alhoumays, “Design and test of general-purpose SPI
Master/Slave IPs on OPB bus,” 2010 7th International Multi- Conference on Systems, Signals and Devices, 2010, pp. 1-6,
doi: 10.1109/SSD.2010.5585592.
[5] V. K. Verma, “Comparative Study of SPI Design Systems,” International Journal of Electrical, Electronics and Data Communication
(IJEEDC), vol. 7, no. 10, pp. 4-5, 2019. [Online]. Available: http://www.iraj.in/journal/journal_file/journal_pdf/1-605-15767465564-5.pdf
[6] Deepika and J. K. Murthy, “Interrupt Enabled Priority Based Master Slave Communication using SPI Protocol,” International
Journal of Innovative Technology and Exploring Engineering (IJITEE), vol. 9, no. 9, pp. 564–567, 2020,
doi: 10.35940/ijitee.i7649.079920.
[7] Anand N, G. Joseph, S. S. Oommen, and R. Dhanabal, “Design and implementation of a high speed Serial Peripheral Interface,” 2014
International Conference on Advances in Electrical Engineering (ICAEE), 2014, pp. 1-3, doi: 10.1109/ICAEE.2014.6838431.
[8] T. Liu and Y. Wang, “IP design of universal multiple devices SPI interface,” 2011 IEEE International Conference on Anti-
Counterfeiting, Security and Identification, 2011, pp. 169-172, doi: 10.1109/ASID.2011.5967443.
[9] K. Aditya, M. Sivakumar, F. Noorbasha, and T. P. Blessington, “Design and Functional Verification of A SPI Master Slave Core
Using System Verilog,” International Journal of Soft Computing and Engineering (IJSCE), vol. 2, no. 2, pp. 2231–2307, 2012.
[Online]. Available: https://silo.tips/download/design-and-functional-verification-of-a-spi-master-slave-core-using-system-veril
[10] Purushottam S. and Naveenkumar M., “Design and Verification of wishbone Compliant Serial Peripheral Interface,” International
Journal of Engineering Research & Technology (IJERT), NCESC - 2018 Conference Proceedings, 2018, vol. 6, no. 13, pp. 1-4.
[Online]. Available: https://www.ijert.org/research/design-and-verification-of-wishbone-compliant-serial-peripheral-interface-
IJERTCONV6IS13178.pdf
[11] X. Wang, H. Zhang, L. Zhang, J. Zhang and Y. Hao, “A daisy-chain SPI interface in a battery voltage monitoring IC for electric
vehicles,” 2014 12th IEEE International Conference on Solid-State and Integrated Circuit Technology (ICSICT), 2014, pp. 1-3,
doi: 10.1109/ICSICT.2014.7021462.
[12] Q. Zhang, Y. Yang, and C. Chai, “A high EMS daisy-chain SPI interface for battery monitor system,” Journal of Semiconductors,
vol. 38, no. 3, 2017, doi: 10.1088/1674-4926/38/3/035002.
[13] Z. Zhou, Z. Xie, X. Wang, and T. Wang, “Development of verification envioronment for SPI master interface using
SystemVerilog,” 2012 IEEE 11th International Conference on Signal Processing, 2012, pp. 2188-2192,
doi: 10.1109/ICoSP.2012.6492015.
[14] M. -K. You and G. -Y. Song, “SystemVerilog-based verification environment using SystemC custom hierarchical channel,” 2009
IEEE 8th International Conference on ASIC, 2009, pp. 1310-1313, doi: 10.1109/ASICON.2009.5351242.
[15] Rajesh C., Shivananda, Shanthi V. A., “Design and development of verification environment to verify spi master core using
UVM,” International Journal of Scientific Engineering and Technology (IJSET) pp. 601–603, 2015. [Online]. Available:
https://www.ijset.in/wp-content/uploads/2015/06/10.2348.ijset06150601.pdf
[16] M. Sekhar, “Design and Verification of Serial Peripheral Interface using OVM,” Ijecct.Org, vol. 2, no. 6, pp. 267–269, 2012.
[17] P. Kumar M. B. and Sreekantesha H. N., “Design and Verification of Serial Peripheral Interface Master Core Using Universal
Verification Methodology”, International Journal of Computer Sciences and Engineering, vol. 7, no. 14, pp. 7-11, 2019. [Online].
Available: https://www.ijcseonline.org/pdf_spl_paper_view.php?paper_id=1079&2-IACIT%20-%20152.pdf
[18] L. S. Kamireddy and L. Saiteja K., “UVM Based Reusable Verification IP for Wishbone Compliant SPI Master core,” arXiv,
2018. [Online]. Available: https://arxiv.org/pdf/1809.10845.pdf
[19] Shyamala S. C., Kalpana S., Manasa B., and Bindu L., “SIP Controller For Master Core Verification Using UVM”, International Journal
of Scientific Development and Research (IJSDR), vol. 1, no. 9, 2016. [Online]. Available: https://www.ijsdr.org/papers/IJSDR1609045.pdf
[20] A. Kulkarni and S. M. Sakthivel, “UVM methodology based functional Verification of SPI Protocol,” National Science,
Engineering and Technology Conference (NCSET) 2020, 2020, vol. 1716, doi: 10.1088/1742-6596/1716/1/012035.
[21] S. Choudhury, G. K. Singh, and R. M. Mehra, “Design and Verification Serial Peripheral Interface (SPI) Protocol for Low Power
Applications,” International Journal of Innovative Research in Science, Engineering and Technology (IJIRSET), vol. 3, no. 10,
2014, doi: 10.15680/IJIRSET.2014.0310048
TELKOMNIKA Telecommun Comput El Control, Vol. 21, No. 1, February 2023: 168-177
TELKOMNIKA Telecommun Comput El Control 177
[22] S. -L. Chen et al., “A Novel Low-Power Synchronous Preamble Data Line Chip Design for Oscillator Control Interface,”
Electronics, vol. 9, no. 9, doi: 10.3390/electronics9091509.
[23] Shushma N. and R. C. Biradar, “Design and Verification of SPI Protocol,” International Journal of Engineering Science and
Computing, vol. 9, no. 5, 2019. [Online] Available: https://ijesc.org/upload/13bdb8087a12b222cdfea635722ae159.
Design%20and%20Verification%20of%20SPI%20Protocol%20(1).pdf
[24] P. Polsani, V. Priyanka B., and Y. P. Sai, “Design & Verification of Serial Peripheral Interface (SPI) Protocol,” International
Journal of Recent Technology and Engineering (IJRTE), vol. 8 no. 6, pp. 793-796, 2020, doi: 10.35940/ijrte.F7356.038620.
[25] M. Sandya and K. Rajasekhar, “Design and Verification of Serial Peripheral Interface,” International Journal of Engineering
Trends and Technology (IJETT), vol. 3, no. 4, 2012. [Online]. Available: http://ijettjournal.org/volume-3/issue-4/IJETT-
V3I4P212.pdf
[26] P. Dhaker, “Introduction to SPI Interface,” Analog Dialogue, vol. 52, 2018. [Online]. Available:
https://www.analog.com/media/en/analog-dialogue/volume-52/number-3/introduction-to-spi-interface.pdf
BIOGRAPHIES OF AUTHORS
Design and verification of daisy chain serial peripheral interface using … (Rajesh Thumma)