VIP Development of SPI Controller For Open-Power Processor Based Fabless SoC
VIP Development of SPI Controller For Open-Power Processor Based Fabless SoC
ISSN No:-2456-2165
Abstract:- Since integrated circuit designs continuously data transmission method on the SPI bus. SPI devices operate
expanding, which makes the verification process more in full duplex mode by transmitting and receiving in this way.
difficult and time-consuming, effective verification of such The lines on the SPI bus are entirely one-way. Master generates
circuit designs is essential. As a result, a strong testbench the clock signal, which generally used to synchronize data
structure is required, one that includes major generic transfer. Data is transmitted from the master to the slave on the
verification components that are highly reusable and are master-output slave-input (MOSI) line and from the slave to the
simple to adapt to new designs. The UVM hierarchy is one master on the master-input slave-output(MISO) line. The
such design capable of realizing testbench architectures master selects each slave device using a separate select line.
with coverage-driven verification environments with CRT Over the SPI bus, data transfer rates range from almost 0 bits
(constrained Random Test). According to the verification per second to 1 MB per second. Typically, data is transferred
plan devised following a thorough review of the SPI in blocks of eight or sixteen bits. The serial clock synchronises
protocol requirements, the current effort is appropriately all data transport (SCLK). Each clock cycle transfers one bit of
concentrated on SPI One Master and Multi Slave protocol data. The values of the clock phase and polarity bits dictate four
verification using UVM. The UVM Testbench different clock modes for the SPI bus. When new data is to be
concentrates on generating random vectors that are sent to transferred onto the bus, the clock phase determines which
the SPI module or the DUT (Design Under Test). This clock edge to use, and the clock polarities establishes the
method aids in verifying the functionality of SPI by intensity of the clock idle state. Any hardware component with
making comparisons with the captured response received multiple operating modes will have a mechanism for choosing
via scoreboard. By using acceptable or appropriate test the value of these bits.
cases, Testbench also validates the functionality and
distinguishing characteristics of SPI, and at the conclusion Four logic signals are listed for the SPI bus:
of the test, it delivers a cumulative coverage report of the Serial Peripheral Interface Clock (SCLK)
design. Master-Output Slave-Input (MOSI).
Master-Input Slave-Output (MISO).
Keywords:- UVM, System Verilog, SPI Protocol, Questsim, Active low Slave Select (SS).
and EDA-playground mentor.
I. INTRODUCTION
IJISRT22DEC068 www.ijisrt.com 73
Volume 7, Issue 12, December – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
oriented programming is one of the most promising methods
The following are the main contributions of this paper:: for top - level functional verification for modern complex SOC
1. Become familiar with SPI sub-system architecture, UVM, systems. System Verilog provides a complete verification
and System Verilog. environment that includes metrics based on coverage, direct
2. Developing an AXI bus function model to enable closed- and limited random generation, and assertion-based
loop verification testing by serving as a connection between verification. Base class libraries created in System Verilog are
both the test bench and the SPI master device under test used by the Universal Verification Methodology (UVM), the
(DUT) and SPI slave model. most recent functional verification approach.The AVM from
3. Use UVM libraries, assertions, coverage, limited random Mentor, the OVM from Mentor & Cadence, the eRM from
stimuli, and System Verilog structures to create hierarchical Verisity, and the VMM-RAL from Synopsys are some of the
testbench components. older technique libraries on which UVM is built.Thanks to this
4. Verify data transmission by experimenting with different standardization, users can now create highly compatible,
character widths and data types. portable verification modules. The term "verification
components" refers to these modules. For whole systems,
One of the most often utilized serial protocols in a SoC is SPI modules, or protocols, they are encased and transformed into
since it operates at better bandwidth and throughput than other useable, flexible verification environments. These apps are
protocols like UART and I2C. Microcontrollers on the host built upon the extensive base class library. It offers hardware
side and slave devices are frequently made to interact more acceleration, emulation, assertion-based verification, coverage-
easily through the SPI Protocol. It is well-liked since it driven restricted random verification, and restricted random
operates with less control signals. The specific SPI core that verification. It emphasizes simulation.
was the focus of this study serves as a slave AXI compliant
device on the host side. Serial Shift Interface (SSI), Clock III. DESIGN OF SPI
Generator (CG), and AXI Connection (AXI) are the three
fundamental components of the SPI Master Core Controller. Combining a single Master with a single Slave is the simplest
The AXI interface that allows for changes to be made to the configuration for the Serial Peripheral Interface (SPI) [2].
five 32-bit registers of the SPI core controller. However, interaction between a single Master unit or module
and several Slave devices is possible i.e., with more than one
The serial Peripheral interface consists of serial clock signal Slave device. Any microcontroller device and accompanying
and slave select signal. Implementing a high-speed SPI peripherals can exchange information utilizes the SPI
Master/Slave between 900 and 1000 MHz is possible. When technology's high-speed, full-duplex, and synchronous
two slaves are present, for instance, the core can be built with communication bus protocol. But when it comes to verification,
more flexible SPI-bus control handling. the core's control System Verilog, which is regarded as a hardware description
register, which determines whether the SPI module runs in language(HDL), is used to implement the oops programming
master or slave mode, which is a key component, can be altered. language and provide a test environment for the SPI protocol.
The SPI status register provides information about running data Advanced SystemVerilog features aid in creating a prospective
transfer operations, including their state and whether they have verification environment, yet UVM implementation still
finished or not. One more crucial factor is the adaptability of enables a standardised verification technique (Universal
SPI Interface IPs built with a parameterization technique for VerificationMethodology).
different devices. Time Sharing Multiplex (TSM), an advanced
design method, in multi-master systems, is utilized to
automatically detect the master/slave devices. TSM is used to
fix communication issues between many devices. Verification
has been harder as a result of the current SoC's increased
complexity. The truth is that difficult SoC verification
consumes 70% of the time needed for product development.
IJISRT22DEC068 www.ijisrt.com 74
Volume 7, Issue 12, December – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
Serial Clock or master Clock (SCLK, SCK, or MK)
Slave Select pin (SS)/chip select pin(CS)
IJISRT22DEC068 www.ijisrt.com 75
Volume 7, Issue 12, December – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
without altering the source code was also highly encouraged
and advocated.
UVM COMPONENTS
Sequencer: The UVM sequencer is changed into a class called A sequence item is the first component of the UVM
a sequencer, which manages the response exchange between environment's architecture. Typically, uvm transaction or uvm
the sequence and the driver. Driver and Sequencer both use sequence item classes are expanded to create sequence item
TLM Interface to establish transaction communication. class objects. It is composed of all required information
exchange which can be either randomised or constrained to a
Driver: By extending the UVM driver, a driver is created. In specific boundary by using UVM structures. Sequences are
order for the sequencer and driver to communicate, the TLM created by extending uvm sequences to produce additional
port (seq_item_port) needs to be addressed. Driver sends data sequence components. To drive DUT pins, the driver receives
to DUT via interface connection. the created sequences. There are duties in the SPI master core
driver. The following sequence item must be obtained as the
Monitor: A passive type component, by modifying the UVM driver's initial action. Second, we control data transmission.
monitor class, the monitor class is produced. At the virtual Third, the sequence item is finished once the packet is written
interface level, it samples DUT signals and transforms signal- to the UVM analysis port. A fork...join call is used to run the
level actions into transaction-level operations. Monitor class, jobs concurrently. The design of the testbench entails the
drives DUT signals, but does not. creation of a monitor that keeps track of how the DUT interacts
with the testbench. When the protocols are broken, an error is
Agent: The UVM agent class is extended to create the Agent. reported after watching the pin level transaction at the DUT's
Driver, monitor, collector, and sequencer are some examples of outputs. These UVM components are all connected by the
the verification components that the agent incorporates or agent. On the scoreboard, the DUT's actual reaction is
groups. It is used to establish TLM connections between the contrasted with the expected response after predicting the
aforementioned components. The agent has an operational expected output of the DUT in the monitor. The env class
mode that can be either active or passive, and occasionally both. handles the creation and connection of the agent and
Scoreboard: This class accepts data from the monitor and scoreboard.
compares the numbers to what is expected. The reference
model generates the expected values; however, the driver class
can also be used to retrieve a copy.
IJISRT22DEC068 www.ijisrt.com 76
Volume 7, Issue 12, December – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
BUILD PHASE: The UVM testbench simulation starts with the
construction phase, which creates instances of each UVM
component.
EXTRACT PHASE: In this stage, to build final statistics, Fig7. Transcript Results
information is gathered from the DUT and the scoreboard.
Waveform results:
CHECK PHASE: It is used to verify that the DUT functioned The AXI bus function model is used by the SPI master and AXI
as expected and to spot any mistakes that may have happened bus function model to communicate. In terms of the AXI
while the test bench was being run. protocol, the read, write, and reset features of the architecture
are its key functions. The sclk signal, which is used to
REPORT PHASE: In the Report phase, simulation results are synchronize communications between the master and slave.
provided for the verification engineer to review. The control registers of the master and slave are both set up
ahead of the transfer. The send and receive signals' sampling
FINAL PHASE: It is used to perform any additional unfinished edges are specified by flags in the control register like tx
tasks that have not yet been handled by the test bench. negedge/rx posedge. These two flags ought to have distinct
values to one another because SPI write output and read input
both happen at the identical single buffer when using a shift
register approach. once each and every SPI register has been
set, the go flag of the control loop must be asserted in order for
the transfer to begin.The testbench makes use of the current
flag transfer to synchronize the watch each element of the
endless loop. Finally, the transaction in progress signal is
emitted, as seen in Figure, after 32 clock cycles, indicating that
the AXI interface can now collect the data.
VI. RESULTS
Transcript results
IJISRT22DEC068 www.ijisrt.com 77
Volume 7, Issue 12, December – 2022 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
[2]. S. Sutherland, S. Davidmann, and P. Flake, System
Verilog for Design: A Guide to Using System Verilog for
Hardware Design and Modeling, 2nd ed. Springer
Publishing Company, Incorporated, 2010.
[3]. IEEE Standard for Universal Verification Methodology
Language Reference Manual, 2017.
[4]. Design and Verification of Serial Peripheral Interface, by
M.Sandya, K.Rajasekhar, International Journal of
Engineering Trends and Technology- Volume3Issue4-
2012
[5]. IP Design of Universal Multiple Devices SPI Interface ,
by Tianxiang Liu , Yunfeng Wang.
VII. CONCLUSION AND FUTURESCOPE [6]. S. Simon, SPI Master Core Specification, pp 1-13,
www.opencores.org, 2004.
The results presented here are restricted to a single master and [7]. W. Ni and J. Zhang, “Research of reusability based on
slave, but if utilized for several slaves, the components can be UVM verification,” in 2015 IEEE 11th International
simply reused, as indicated by the structural model of the Conference on ASIC (ASICON), Nov 2015, pp. 1–4.
environment. System Verilog was employed in the project to [8]. K. Fathy and K. Salah, “An Efficient Scenario Based
build the verification environment for the SPI Interface. The Testing Methodology Using UVM,” in 2016 17th
objective was to obtain qualities like durability and International Workshop on Microprocessor and SOC
renewability. In order to allow for configuration based on need, Test and Verification (MTV), Dec 2016, pp. 57–60.
we built parameterized components. Reusability can be [9]. P. Rajashekar Reddy, P. Sreekanth, and K. Arun Kumar,
accomplished utilizing the flow provided in the paper, “Serial Peripheral Interface-Master Universal
according to outcomes analysis. Verification Component using UVM,” International
Journal of Advanced Scientific Technologies in
REFERENCES Engineering and Management Sciences, vol. 3, p. 27, 06
2017.
[1]. An introduction to i2c and SPI protocols ,by Frédéric [10]. R. Prasad and C. S. Rani, “UART IP CORE
Leens, IEEE Instrumentation & Measurement Magazine VERIFICATION BY USING UVM,” IRF International
February 2009. Conference, 15 2016.
IJISRT22DEC068 www.ijisrt.com 78