A Universal-Verification-Methodology-Based Testbench for the Coverage-Driven Functional Verification of an Instruction Cache Controller
Abstract
:1. Introduction
2. Function of Design and Verification Plan
2.1. Main Components of the I-Cache Controller
- CSR: Control and status register. The registers inside the CSR module are configured through the configuration bus to support related functions. The definition of the registers are shown in Table 1.
- MAF: miss addr file, which is also known as miss status handling register (MSHR). When a missing item occurs, the module saves the missing information, sends a request message to the L2 Cache, and waits for the L2 Cache to return the data. It contains four item units, and each item unit can save a missing message. It defines a pointer to control the switch of these four items. This module also populates the data it holds internally into the TAG module and the DATA module.
- TAG: The module consists of a tag storage unit and corresponding control logic. It fills the upper part of the address from the MAF into the tag storage, and completes the tag comparison when a fetch request arrives to determine whether the current access is a hit.
2.2. Main Functions of the I-Cache Controller
- The Cache size can be configured, including 0 kb, 4 kb, 8 kb, 16 kb, and 32 kb. The total storage space size is 32 kb. For example, when the Cache size is configured to 4 kb, the SRAM size is 28 kb.
- It supports freeze mode. The significance of the freeze mode is to protect the contents of the Cache under certain circumstances. If the Cache space is larger than 0 kb, no memory will be filled in the freeze mode even if a Cache loss occurs, which is normal when the freeze mode is disabled.
- It supports instruction prefetch. When the CPU initiates a fetch operation to the I-Cache (assuming the fetch address is addr), and the result of this operation is missing, the I-Cache sends a request to the L2 Cache, and the L2 Cache returns the data corresponding to the addr and the data of the addresses adjacent to the addr. The command prefetch improves the Cache system efficiency.
- It supports global and block invalidation operations. We can configure specific registers via configuration bus to complete the corresponding operation. If the Cache size is changed when the system is running, the global invalidation operation is triggered to avoid unnecessary errors.
2.3. Proposed Verification Plan
- Common work scenarios
- Random testcases are designed for simulation verification. In the simulation process, the scoreboard will conduct a real-time data comparison (the two data sources are respectively from the reference model and the monitor monitoring DUT data). If the comparison fails, the corresponding error information will be printed in the simulation log, and the wrong data packet and its corresponding id will be given in detail.
- (1)
- CPU sequential fetch: The Cache size and freeze mode are randomly configured. The fetch address increases in sequence. Since the controller supports instruction prefetch functionality, the instructions corresponding to two adjacent addresses are retrieved sequentially.
- (2)
- CPU branch fetch: The Cache size and freeze mode are randomly configured. Fetch refers to the process of increasing the address sequence. When a branch address suddenly appears, it can result in the occupation of more items.
- Special work scenarios
- (1)
- CPU access times out: The item will be automatically released, which will result in a miss on the next fetch. Under normal circumstances, the current item is released when it is accessed successfully.
- (2)
- L2 Cache returns data in an out-of-order manner: During a sequential branch fetch, the instruction Cache sends two consecutive requests to the L2 Cache. Depending on the situation in the L2 Cache, it may not return the requested data in the expected order.
- SVA check
3. UVM Verification Testbench
3.1. Architecture of the Verification Testbench
3.2. Extensibility of the Verification Testbench
3.3. Reusability of the Verification Testbench
4. Results and Discussion
4.1. Waveform Analysis
4.2. Coverage Analysis
- Code coverage
- Function coverage
- Assertion coverage
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Abbreviations
UVM | universal verification methodology |
EDA | electronic design automation |
SOC | system on chip |
FPGA | field programmable gate array |
OVM | open verification methodology |
SVA | system-Verilog assertion |
CPU | central processing unit |
MAF | miss address file |
MSHR | miss status handling registers |
OOP | object-oriented programming |
CDV | coverage-driven verification |
DUT | design under test |
RAL | register abstraction layer |
RTL | register transaction level |
TLM | transaction level modeling |
References
- Lyu, Y.; Qin, X.; Chen, M.; Mishra, P. Directed Test Generation for Validation of Cache Coherence Protocols. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 2019, 38, 163–176. [Google Scholar] [CrossRef]
- Zhang, R.; Yang, K.; Liu, Z.; Liu, T.; Cai, W.; Milor, L. A Comprehensive Framework for Analysis of Time-Dependent Performance-Reliability Degradation of SRAM Cache Memory. IEEE Trans. Very Large Scale Integr. VLSI Syst. 2021, 29, 857–870. [Google Scholar] [CrossRef]
- Biswal, B.P.; Singh, A.; Singh, B. Cache coherency controller verification IP using SystemVerilog Assertions (SVA) and Universal Verification Methodologies (UVM). In Proceedings of the 2017 11th International Conference on Intelligent Systems and Control (ISCO), Coimbatore, India, 5–6 January 2017; pp. 21–24. [Google Scholar]
- Zhou, S.; Geng, S.; Peng, X.; Zhang, M.; Chu, M.; Li, P.; Lu, H.; Zhu, R. The Design Of UVM Verification Platform Based on Data Comparison. In Proceedings of the 2020 4th International Conference on Electronic Information Technology and Computer Engineering, Xiamen, China, 22–24 October 2021; pp. 1080–1085. [Google Scholar]
- Kaur, G.; Arora, R.; Panchal, S.S. Implementation and Comparison of Direct mapped and 4-way Set Associative mapped Cache Controller in VHDL. In Proceedings of the 2021 8th International Conference on Signal Processing and Integrated Networks (SPIN), Noida, India, 26–27 August 2021; pp. 1018–1023. [Google Scholar]
- Omran, S.S.; Amory, I.A. Implementation of LRU Replacement Policy for Reconfigurable Cache Memory Using FPGA. In Proceedings of the 2018 International Conference on Advanced Science and Engineering (ICOASE), Kurdistan Region, Iraq, 9–11 October 2018; pp. 13–18. [Google Scholar]
- Ali, A.M.; Shalaby, A.; Saif, S.; Taher, M. A UVM-based Verification Approach for MIPI DSI Low-Level Protocol layer. In Proceedings of the 2022 International Conference on Microelectronics (ICM), Casablanca, Morocco, 4–7 December 2022; pp. 74–77. [Google Scholar]
- Wang, J.; Tan, N.; Zhou, Y.; Li, T.; Xia, J. A UVM Verification Platform for RISC-V SoC from Module to System Level. In Proceedings of the 2020 IEEE 5th International Conference on Integrated Circuits and Microsystems (ICICM), Nanjing, China, 23–25 October 2020; pp. 242–246. [Google Scholar]
- Anwar, M.W.; Rashid, M.; Azam, F.; Naeem, A.; Kashif, M.; Butt, W.H. A Unified Model-Based Framework for the Simplified Execution of Static and Dynamic Assertion-Based Verification. IEEE Access 2020, 8, 104407–104431. [Google Scholar] [CrossRef]
- Chen, P.; Yue, J.; Liao, X.; Jin, H. Trade-off between Hit Rate and Hit Latency for Optimizing DRAM Cache. IEEE Trans. Emerg. Top. Comput. 2018, 9, 55–64. [Google Scholar] [CrossRef]
- Choi, H.; Park, S. Learning Future Reference Patterns for Efficient Cache Replacement Decisions. IEEE Access 2022, 10, 25922–25934. [Google Scholar] [CrossRef]
- Jiang, L.; Zhang, X. Cache Replacement Strategy with Limited Service Capacity in Heterogeneous Networks. IEEE Access 2020, 8, 25509–25520. [Google Scholar] [CrossRef]
- Xiong, W.; Katzenbeisser, S.; Szefer, J. Leaking Information Through Cache LRU States in Commercial Processors and Secure Caches. IEEE Trans. Comput. 2021, 70, 511–523. [Google Scholar] [CrossRef]
- Desalphine, V.; Dashora, S.; Mali, L.; Suhas, K.; Raveendran, A.; Selvakumar, D. Novel Method for Verification and Performance Evaluation of a Non-Blocking Level-1 Instruction Cache designed for Out-of-Order RISC-V Superscaler Processor on FPGA. In Proceedings of the 2020 24th International Symposium on VLSI Design and Test (VDAT), Bhubaneswar, India, 23–25 July 2020; pp. 1–4. [Google Scholar]
- Kanhaiya, P.S.; Lau, C.; Hills, G.; Bishop, M.D.; Shulaker, M.M. Carbon Nanotube-Based CMOS SRAM: 1 kbit 6T SRAM Arrays and 10T SRAM Cells. IEEE Trans. Electron Devices 2019, 66, 5375–5380. [Google Scholar] [CrossRef]
- Ling, M.; Lin, Q.; Tan, K.; Shao, T.; Shen, S.; Yang, J. A Design of Timing Speculation SRAM-Based L1 Caches With PVT Autotracking under Near-Threshold Voltages. IEEE Trans. Very Large Scale Integr. VLSI Syst. 2021, 29, 2197–2209. [Google Scholar] [CrossRef]
- Hussien, A.; Mohamed, S.; Soliman, M.; Mostafa, H.; Salah, K.; Dessouky, M.; Mostafa, H. Development of a Generic and a Reconfigurable UVM-Based Verification Environment for SoC Buses. In Proceedings of the 2019 31st International Conference on Microelectronics (ICM), Cairo, Egypt, 15–18 December 2019; pp. 195–198. [Google Scholar]
- Massoud, E.; AbdelSalam, M.; Safar, M.; Watheq El-Kharashi, M. A Reusable UVM-SystemC Verification Environment for Simulation, Hardware Emulation, and FPGA Prototyping: Case Studies. In Proceedings of the 2022 International Conference on Microelectronics (ICM), Casablanca, Morocco, 4–7 December 2022; pp. 38–41. [Google Scholar]
- Wang, J.; Liu, J.; Wang, D.; Zhang, S.; Fan, X. MemUnison: A Racetrack-ReRAM-Combined Pipeline Architecture for Energy-Efficient in-Memory CNNs. IEEE Trans. Comput. 2022, 71, 3281–3294. [Google Scholar] [CrossRef]
- El-Ashry, S.; Adel, A. Efficient Methodology of Sampling UVM RAL during Simulation for SoC Functional Coverage. In Proceedings of the 2018 19th International Workshop on Microprocessor and SOC Test and Verification (MTV), Austin, TX, USA, 9–10 December 2018; pp. 61–66. [Google Scholar]
- Na, J.; Yang, J.; Gao, G. Reinforcing Transient Response of Adaptive Control Systems Using Modified Command and Reference Model. IEEE Trans. Aerosp. Electron. Syst. 2019, 56, 2005–2017. [Google Scholar] [CrossRef]
- Hosny, S. A Unified UVM Methodology For MPSoC Hardware/Software Functional Verification. In Proceedings of the 2022 11th International Conference on Modern Circuits and Systems Technologies (MOCAST), Bremen, Germany, 8–10 June 2022; pp. 1–5. [Google Scholar]
- Adel, A.; Saad, D.; El Mawgoed, M.A.; Sharshar, M.; Ahmed, Z.; Ibrahim, H.; Mostafa, H. Implementation and Functional Verification of RISC-V Core for Secure IoT Applications. In Proceedings of the 2021 International Conference on Microelectronics (ICM), Cairo, Egypt, 19–22 December 2021; pp. 254–257. [Google Scholar]
- Harshitha, N.B.; Kumar, Y.G.P.; Kurian, M.Z. An Introduction to Universal Verification Methodology for the digital design of Integrated circuits (IC’s): A Review. In Proceedings of the 2021 International Conference on Artificial Intelligence and Smart Systems (ICAIS), Tamil Nadu, India, 25–27 March 2021; pp. 1710–1713. [Google Scholar]
- Xu, C.; Ni, W.; Song, Y. UVM-based Functional Coverage Driven AXI4-Stream Verification. In Proceedings of the 2019 IEEE 13th International Conference on ASIC (ASICON), Chongqing, China, 29 October–1 November 2019; pp. 1–4. [Google Scholar]
- Liang, K.; Wu, J.; Ren, H.; Zhang, Z.; Tan, B. Design and Implementation of DSP Cache. In Proceedings of the 2021 IEEE 21st International Conference on Communication Technology (ICCT), Virtual, Montreal, QC, Canada, 14–23 June 2021; pp. 993–997. [Google Scholar]
- Tiejun, L.; Jianmin, Z.; Sikun, L. An FPGA-based Random Functional Verification Method for Cache. In Proceedings of the 2013 IEEE Eighth International Conference on Networking, Architecture and Storage, Xi’an, China, 17–19 July 2013; pp. 277–281. [Google Scholar]
- El-Ashry, S.; Khamis, M.; Ibrahim, H.; Shalaby, A.; Abdelsalam, M.; El-Kharashi, M.W. On Error Injection for NoC Platforms: A UVM-Based Generic Verification Environment. IEEE Trans. Comput.-Aided Des. Integr. Circuits Syst. 2020, 39, 1137–1150. [Google Scholar] [CrossRef]
Register | Function |
---|---|
REG_CFG | Configure Cache size |
REG_CC | Enable freeze mode |
REG_INV | Enable global invalidation |
REG_IBAR | Base addr of block invalidation |
REG_IWC | Word count of block invalidation |
Testcase Name | Description | State |
---|---|---|
tc_reg_rst | Verify that all registers return to their reset values after performing reset. | Pass |
tc_output_rst | Verify that all outputs return to their reset values after performing reset. | Pass |
tc_reg_sanity | Verify that all register read and write operations are normal. | Pass |
tc_fetch_sanity | Verify that fetch instruction path is unblocked and operational. | Pass |
tc_freeze_mode | Verify that the module functions correctly while in freeze mode. | Pass |
tc_global_invalid | Verify that global invalidation operation is normal. | Pass |
tc_block_invalid | Verify that block invalidation operation is normal. | Pass |
tc_seq_fetch | Verify that sequential-fetch operation is normal. | Pass |
tc_branch_fetch | Verify that branch-fetch operation is normal. | Pass |
tc_access_cache | Verify whether ‘hit cache’ operation is normal when accessing Cache. | Pass |
tc_access_sram | Verify whether ‘hit sram’ operation is normal when accessing sram. | Pass |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Liu, C.; Xu, X.; Chen, Z.; Wang, B. A Universal-Verification-Methodology-Based Testbench for the Coverage-Driven Functional Verification of an Instruction Cache Controller. Electronics 2023, 12, 3821. https://doi.org/10.3390/electronics12183821
Liu C, Xu X, Chen Z, Wang B. A Universal-Verification-Methodology-Based Testbench for the Coverage-Driven Functional Verification of an Instruction Cache Controller. Electronics. 2023; 12(18):3821. https://doi.org/10.3390/electronics12183821
Chicago/Turabian StyleLiu, Cong, Xinyu Xu, Zhenjiao Chen, and Binghao Wang. 2023. "A Universal-Verification-Methodology-Based Testbench for the Coverage-Driven Functional Verification of an Instruction Cache Controller" Electronics 12, no. 18: 3821. https://doi.org/10.3390/electronics12183821
APA StyleLiu, C., Xu, X., Chen, Z., & Wang, B. (2023). A Universal-Verification-Methodology-Based Testbench for the Coverage-Driven Functional Verification of an Instruction Cache Controller. Electronics, 12(18), 3821. https://doi.org/10.3390/electronics12183821