Luận Văn Tốt Nghiệp Về Thiết Kế RISC-V và Tích Hợp Khối Bảo Mật Trên FPGA

Khóa luận trình bày việc hiện thực hóa kiến trúc RISC-V trên FPGA với khối bảo mật tích hợp, mang lại giải pháp tối ưu cho hệ thống.

Trường đại học

National University Ho Chi Minh City

Chuyên ngành

Computer Engineering

Người đăng

Ẩn danh

Thể loại

graduation thesis

2023

98
17
1

Phí lưu trữ

35 Point

Mục lục chi tiết

1. CHƯƠNG 1: Overview of the processor

1.1. Processor architecture. Overview of the processor

1.2. Comparison of CISC and RISC

1.3. Advanced Encryption Standard (AES)

1.4. AES encryption and decryption process

2. CHƯƠNG 2: RISC-V PROCESSOR DESIGN

2.1. Overview of processor design

2.2. Functional blocks in the processor

2.2.1. Instruction Memory block

2.2.2. Program Counter block

2.2.3. Control Unit block

2.2.4. Register File block

2.2.5. Register File Floating-Point block

2.2.6. Sign Extend block

2.2.7. Data Memory Processing block

2.2.8. Forwarding Unit block

3. CHƯƠNG 3: DESIGN SYSTEM STRUCTURE

3.1. Overview about the protocol

3.2. Detailed signals of AXI Protocol in the thesis

3.3. Visual simulation of write and read channel

3.4. Implementation of the advanced encryption standard (AES)

3.5. An Overview of the Hardware Structure of AES-128

3.6. Packaging of AES-128 with AXI4 protocol

3.7. Overview of designing architecture

3.8. Design on Vivado

3.8.1. IPs of Xilinx used in Block design

3.8.2. Memory Interface Generator IP (MIG 7 Series)

3.8.3. Central Direct Memory Access IP (CDMA)

3.8.4. AXI Bram Controller

4. CHƯƠNG 4: SIMULATION AND DESIGN REVIEW

4.1. Test scenario model

4.2. Summary results of implementation and design evaluation

4.2.1. Summary result of implementation of the RISC-V processor without the D extension

4.2.2. Summary result of implementation of the RISC-V processor with the D extension

4.2.3. Summary result of implementation of the AES-128

4.2.4. Summary result of implementation of block design

5. CHƯƠNG 5: CONCLUSION AND DEVELOPMENT

5.1. Accumulated expectations

5.2. Remaining problems

ACKNOWLEDGEMENT

ABSTRACT

OPENING

LIST OF FIGURES

LIST OF TABLES

LIST OF ABBREVIATIONS

Tóm tắt

I. Tổng Quan Về Luận Văn Tốt Nghiệp RISC V và FPGA

Luận văn tốt nghiệp này tập trung vào việc thiết kế và tích hợp hệ thống RISC-V với khối bảo mật trên FPGA. RISC-V là một kiến trúc vi xử lý mở, mang lại nhiều cơ hội cho việc phát triển phần cứng. FPGA (Field Programmable Gate Array) cho phép người dùng tùy chỉnh phần cứng theo nhu cầu cụ thể. Sự kết hợp giữa RISC-V và FPGA không chỉ giúp tối ưu hóa hiệu suất mà còn nâng cao tính bảo mật cho các ứng dụng IoT.

1.1. Khái Niệm Về RISC V và FPGA

RISC-V là một kiến trúc vi xử lý mở, cho phép tùy chỉnh và mở rộng. FPGA là một loại mạch tích hợp có thể lập trình lại, cho phép thiết kế phần cứng linh hoạt.

1.2. Tầm Quan Trọng Của Bảo Mật Trong Hệ Thống

Bảo mật thông tin là một yếu tố quan trọng trong thiết kế hệ thống. Việc tích hợp khối bảo mật vào RISC-V trên FPGA giúp bảo vệ dữ liệu và ngăn chặn các cuộc tấn công.

II. Thách Thức Trong Thiết Kế RISC V Trên FPGA

Thiết kế RISC-V trên FPGA đối mặt với nhiều thách thức, bao gồm việc tối ưu hóa hiệu suất và đảm bảo tính bảo mật. Các vấn đề như tiêu thụ năng lượng, tốc độ xử lý và khả năng mở rộng là những yếu tố cần được xem xét kỹ lưỡng.

2.1. Vấn Đề Tiêu Thụ Năng Lượng

Tiêu thụ năng lượng là một yếu tố quan trọng trong thiết kế vi xử lý. Cần có các giải pháp để giảm thiểu năng lượng tiêu thụ mà vẫn đảm bảo hiệu suất.

2.2. Tốc Độ Xử Lý và Hiệu Suất

Tốc độ xử lý của RISC-V trên FPGA cần được tối ưu hóa để đáp ứng yêu cầu của các ứng dụng thực tế. Việc sử dụng pipelining và các kỹ thuật tối ưu khác là cần thiết.

III. Phương Pháp Thiết Kế RISC V và Khối Bảo Mật

Phương pháp thiết kế RISC-V bao gồm việc xác định các khối chức năng cần thiết và tích hợp chúng vào FPGA. Việc sử dụng các công cụ như Vivado giúp đơn giản hóa quá trình thiết kế và mô phỏng.

3.1. Thiết Kế Khối Chức Năng RISC V

Khối chức năng của RISC-V bao gồm ALU, bộ nhớ và các khối điều khiển. Mỗi khối cần được thiết kế để hoạt động hiệu quả trong môi trường FPGA.

3.2. Tích Hợp Khối Bảo Mật

Khối bảo mật cần được tích hợp một cách chặt chẽ với RISC-V để đảm bảo an toàn cho dữ liệu. Việc sử dụng AES-128 là một trong những giải pháp bảo mật hiệu quả.

IV. Ứng Dụng Thực Tiễn Của Hệ Thống RISC V Trên FPGA

Hệ thống RISC-V tích hợp khối bảo mật trên FPGA có nhiều ứng dụng thực tiễn trong lĩnh vực IoT và bảo mật thông tin. Các ứng dụng này không chỉ giúp nâng cao hiệu suất mà còn đảm bảo an toàn cho dữ liệu.

4.1. Ứng Dụng Trong IoT

Hệ thống RISC-V có thể được sử dụng trong các thiết bị IoT, giúp tối ưu hóa hiệu suất và bảo mật thông tin trong quá trình truyền tải dữ liệu.

4.2. Bảo Mật Thông Tin

Việc tích hợp khối bảo mật giúp bảo vệ dữ liệu khỏi các cuộc tấn công và đảm bảo tính toàn vẹn của thông tin trong các ứng dụng nhạy cảm.

V. Kết Luận và Tương Lai Của RISC V Trên FPGA

Luận văn đã trình bày những khía cạnh quan trọng trong việc thiết kế và tích hợp RISC-V với khối bảo mật trên FPGA. Tương lai của công nghệ này hứa hẹn sẽ mang lại nhiều cơ hội mới trong lĩnh vực vi xử lý và bảo mật thông tin.

5.1. Triển Vọng Phát Triển

Công nghệ RISC-V đang phát triển mạnh mẽ và có tiềm năng lớn trong việc cải thiện hiệu suất và bảo mật cho các hệ thống vi xử lý.

5.2. Thách Thức Cần Đối Mặt

Mặc dù có nhiều cơ hội, nhưng việc đảm bảo an toàn và hiệu suất vẫn là những thách thức lớn cần được giải quyết trong tương lai.

10/07/2025
Khóa luận tốt nghiệp khoa học máy tính hiện thực risc v trên fpga tích hợp thêm khối bảo mật

Trích đoạn nội dung tài liệu

NATIONAL UNIVERSITY HO CHI MINH CITY UNIVERSITY OF INFORMATION TECHNOLOGY FACULTY OF COMPUTER ENGINEERING HUYNH LE ANH BAO - 19521241 TRAN HUU CHAU- 19521279 GRADUATION THESIS IMPLEMENT RISC-V AND INTEGRATE WITH SECURITY BLOCK ON FPGA COMPUTER ENGINEERING ENGINEER THESIS ADVISOR NGUYEN MINH SON HO CHI MINH, 2023 ACKNOWLEDGEMENT I would like to express my deepest gratitude and appreciation to the following individuals and organizations who have contributed to the successful completion of my graduation thesis. First and foremost, I am immensely grateful to my thesis advisor, PhD. Nguyen Minh Son, for his unwavering guidance, expertise, and invaluable support throughout this research journey. The insightful feedback, constructive criticism, and dedication have been instrumental in shaping the outcome of this thesis.

I would like to extend my sincere appreciation to the members of the thesis evaluation committee, The thesis evaluation committees, for their time, expertise, and valuable input. Their thorough evaluation and constructive comments have significantly enriched the quality of this thesis. My heartfelt thanks go to my family and friends for their unwavering support, encouragement, and understanding throughout this challenging endeavor. Their constant belief in me has been a source of motivation and strength during moments of self-doubt.

Once again, I extend my sincere appreciation to all those who have contributed to the realization of this graduation thesis. Their support and contributions have been invaluable, and I am truly grateful for their presence in my academic journey. Ho Chi Minh, 2023 Student researcher Huynh Le Anh Bao Tran Huu Chau CONTENTS CHAPTER 1. Processor archif€CfUT€.

Overview of the DTOC€SSOT. Comparison of CISC and RISC. Advanced Encryption Standard (AES). AES encryption and decryption process — 28.

RISC-V PROCESSOR DESIGN. Overview of processor đ€SiET. Functional blocks in the DFOC€SSOT. Instruction Memory bÌOCĂ.

Program Counter blOCK. Control Unit blOcK. Register File bÏOCK. -- ¿5S St k2 HH H00 0 uy 28 2.

Register File Floating-Point bÌOCK. Sign Extend DIOCK. àccc tt tre 33 2. Data Memory Processing BÌloCK.

Forwarding Unit block. DESIGN SYSTEM STRUCTURE. Overview about the protocol. Detailed signals of AXI Protocol in the thesis.

Visual simulation of write and read channel. Implementation of the advanced encryption standard (AES). An Overview of the Hardware Structure of AES-128. Packaging of AES-128 with AXI4 protocol.

Overview of designing archit€CtUTE.ccece ese eescseseseseeeescsessesesescseseeeseseessesneseseseeseees 46 3. Design on ViVAdO. Ips of Xilinx used in Block design. Memory Interface Generator IP (MIG 7 Series).

Central Direct Memory Access IP (CDMA). AXI Bram Controller P. SIMULATION AND DESIGN REVIEW. Test scenario ImOdel.-- ¿+ + St *SE*kEkề E112 211 rrrrườ51 4.

Summary results of implementation and design evaluation. Summary result of implementation of the RISC-V processor without the D extension. Summary result of implementation of the RISC-V processor with the D extension. Summary result of implementation of the AES-128.

Summary result of implementation of block design. TH HH gu 82 CHAPTER 5. CONCLUSION AND DEVELOPMENT. Accumulated eXP€Ti€TC€S.

Remaining proble1ms.- 5 + 1t TT HT ngư85 LIST OF FIGURES Figure 1.1: Google Pixel 6 SmartphOne.1: Execution stages in a DFOC€SSOT. ¿6 ¿St SE SEvskekrkrkrkrrrrrree 24 Figure 2.3: Program Counter BloCK.4: Control Unit ĐÏOCK. + - 5+ + xSk*v*‡EEk+kekEkEkreErrekekrkekrkrkrrrree 27 Figure 2.5: Register File bÏOCK.6: Register File Floating-Point bÌoCK.8: Sign Extend bÌOCĂ.c¿- 5c St SH 11121 1101011101001 10110 ri.11: Data Memory bÌOCĂ.--- - - ¿+5 ++5+s+c++++e+xexererexseexeeereex-ee DD Figure 2.12: Forwarding Unit block. ---¿-¿-«5¿+5+5++++++xese+zxexsevsex+ 36 Figure 3.2: General architecture of the AXI4 protocol.3: A read transaction of the prOtOCOl.----- +-+5+5++<+c+sec++x+x+evsse+ 40 Figure 3.4: A write transaction of the protocol.

cesses + ++x+xexexervrkekerrrre 40 Figure 3.5: Simulate read channels AXI4 of prOC€SSO.6: Simulate write channels AXI4 of pTOC€SSOT.8: AES-128 after packaging.9: System arChif€CfUTC.10: System design on ViVadO.--- cc: sec tt 47 Figure 3.11: Memory Interface Generator ÍP.13: Bram Controller and Block Memory Generator ÏP.- - -- 6 tt 3 BE ng HH gi49 Figure 3.15: System Cache ÏP. ¿+ + +12EEx kề H112 111 TH HH hư50 Figure 4.1: Test scenario I1Oel.--¿- - - ¿56+ £‡E+E‡E‡kEk#EEEEkkEErkrrkrkrkereree 51 Figure 4.2: Request from CPU through Read Address Channel.3: Receive data through Read Channel.4: CPU receives data from AXI4 BŨS.5: Executing process in CPU (1).6: Write data on AXI4 BUS. es esceseseseeseesesesesseseseessneneseseeeenenes 57 Figure 4.7: Executing process in CPU (2).--¿-¿ ¿5c + St +‡Evstekerrrrrerree 58 Figure 4.8: Executing process in CPU (3).9: Executing process in CPU (A).10: : Executing process in CPU (5).11 : Integer Regfile after finishing the loop in SUB1.12: Data memory after finishing the loop in SUB1 .13: Floating point Regfile after finishing SUB2.14: Data memory after finishing SUB2.16: The data of AES COFE. - -- 5c 5 SE E2 2 EEk2EErrrgrrey 68 Figure 4.17: The progress inside AES Core.

¿St srkeekeererrerred 68 Figure 4.18: The encode result of the online tOOl.19: Compare results of the simulation and the online tool.20: The data of cipher_text_in in the AES register file.21: The data of plain_text_out in integer register file .22: The result of online software †OOÌ.23: Comparison of online tool and simulation result .24: The used resource of RISC-V processor at 150Mhz.25: Used resource of blocks in RISC-V prOCeSSOT.26: The clock rate of RISC-V processor .27: Timing analysis for RISC-V processol.28: Consumption of power of the RISC-V processor.29: The used resource of blocks in RISC-V processor with the D extension —.30: The used resources in RISC-V processor with the D extension.31: The clock rate of RISC-V processor with the D extension.32: Timing analysis of RISC-V processor with the D extension .33: Power consumption of RISC-V processor with the D extension.34: The used resources of AES-128 .35 :The resources of blocks in AES-128.-- - 5-5 S+cc+c+crercee 78 Figure 4.36 : AES CÏOCK TaẲ€.- Sàn HH 78 Figure 4.37 : Timing analysis for AES-128. 55c 5+5 Sc+c+rerererirrrererrrree 78 Figure 4.38 : Consumption of power of the AES-128.39 : The clocks used in the block design Figure 4.40 : Timing analysis for the block design.41 : The used resource of the block design .42 : The used resource of IP in the block design.43 : Consumption of power of the block design. eects 81 LIST OF TABLES Table 1. 6 Sàn HH HH hư 11 Table 1.

cece 6-6 5S cescsesesseecscseseeseseesssessseseneneaee 13 Table 1.c cece eeeeseseseeesesessessesesesesseseseesensneseseseeanes 14 Table 1.---- ¿5525522 StS*2E2E£ESEeEkkekerrkrkrkereree 14 Table 1.5: U-format 1nStTUC(IOT. -- + <5 SE E2*E*E*E‡EEE*kEkEEEEEEEkk ghê 14 Table 1.6: RV32ID instruction Set.2: Program Counter block’s signnaÌ. - -- ¿5-5 5+ sv+x+eexvxererxexsrrrrx 26 Table 2.3: Control Unit block’s sig1naÌs.- - ¿6-5 S‡ESk+k‡EEEekerkrkekerrrek 28 Table 2.4: Register File block’s signnaÏÌS.--- - + ¿5-5 S2 £St+x+EeEekerrkrkererre 29 Table 2.5: Register Floating-Point block’s signnaÏs.-- - - 5+ 5sc++x+cscvser+ 30 Table 2.6: Signals of the Comparator DÏOCK.7: Signals of the Sign Extend block.8: Signals of the ALU bloek.----- --s-+-++c+c+sececzxsesceeeeecec-ee 2Ö Table 2.9: Convention of ALU_OP bit code.10: Signals of the FPU DIOCK.----¿¿-+5¿55+5++++s+xese+zxexseexee+ 35 Table 2.11: Signals of the Data Memory Processing block.12: Forwarding Unit block’s signal.1: Signals in AXI4 bus.-- 5c + SE SE k2 E1 1111 1111010121 111010101 gu. ¿s5 ++t + *tE+t+vE+EeeeEetxrxeerrsrrxeerrrrrrrrrsxrr 56 Table 6:10 10006.4: Finding 2 numbers GCD in Assembly.

5+ xxx 3E ng ngư 61 Table 4. - -- - + S+ +3 *Evt+eE+Erveexetrrxerrrrrrxeerrrrsrrrrsrer 62 Table 4.8: Performing (+-*/) floating point numbers in Assembly.9: Comparing division results between IEEE754 caculator and Risc-V core Table 4.10: Comparing table of the thesis course with other works. 82 LIST OF ABBREVIATIONS Abbreviation Full form IP Intellectual Property AXI Advanced eXtensible Interface Complex Instruction Set CISC Computer Reduced Instruction Set RISC Computer ARM Advanced RISC Machines RAM Random Access Memory CPU Central Processing Unit FBGA Field Programmable Gate Array ALU Arithmetic Logic Unit RTL Register Transfer Level AES Advanced Encryption Standard GRADUATION THESIS COMPUTER ENGINEERING ABSTRACT The thesis topic consists of three main contents revolving around the research on designing a RISC-V processor and packaging the processor into an IP following the AXI4 protocol. The first content aims to investigate the design of a RISC-V processor with D extension.

The processor comprises one ALU block for processing integer-related instructions (signed and unsigned) and a FPU block for calculating floating point numbers. The second content of the thesis focuses on packaging the processor. Most IPs in the Vivado software communicate with each other through the AXI4 or AXI3 bus. In this thesis, the RISC-V processor will be packaged according to the AXI protocol.

Subsequently, the RISC-V processor will be connected to other IPs in the Vivado Block Design, establishing the interconnection between the two contents. In the Block Design, RISC-V processor plays the role of a Master, requesting data reads from Slaves through the AXI4 bus, performing computations, and storing the results in the SDRAM. Additionally, it can send the results back to Slaves. The third content of the thesis focuses on implementing System Cache IP, which will help reduce the execution time, and Advanced Encryption Standard (AES), which will help encrypt the data.

The system will be implemented on Vivado 2021.2, use Verilog HDL, on Virtex-7 board, operate at 150MHz without the D extension and operate at 50MHz with the D extension. GRADUATION THESIS COMPUTER ENGINEERING OPENING The year 2021 has witnessed significant advancements in the field of the Internet of Things (loT), where connected devices have become pervasive in our daily lives. Simultaneously, the adoption of the RISC-V instruction set architecture (ISA) has gained momentum, revolutionizing the hardware landscape with its open- source nature. However, amidst this rapid expansion and innovation, the crucial aspect of hardware security in loT deployments has come into focus.

As IoT continues to grow and interconnect billions of devices, concerns about privacy, data integrity, and security vulnerabilities have escalated. The diverse range of interconnected devices, often with limited resources and varying security measures, poses challenges for ensuring robust hardware security. Threats such as unauthorized access, data breaches, device tampering, and malicious attacks present real risks that demand comprehensive security solutions. In parallel, the emergence of the RISC-V ISA as an alternative to proprietary architectures has introduced both opportunities and challenges in terms of hardware security.

While RISC-V's open nature encourages innovation, customization, and transparency, it also requires careful consideration of security measures to address potential vulnerabilities. The group proposes to design the integrated security system on the Vivado software toolset version 2021.2 from Xilinx, using the Virtex-7 board. The desired operating frequency of the system is 100MHz and the results can be displayed in the shortest possible time (100MHz). The thesis focuses on three main objectives.

The first objective is to design a RISC-V processor with an extension for double floating point, aiming to increase the number of instructions that can be processed in the processor pipeline. The second objective is to try implement AES-128 for encrypting. The third objective is to refine the RISC-V processor into a Master capable of communicating with other Slaves through the AX14 bus. GRADUATION THESIS COMPUTER ENGINEERING CHAPTER 1.

Overview of the processor With the advent of remarkable technological advancements, processors have emerged and undergone rapid development over time. Prominent chip manufacturers, such as Intel, Apple, AMD, Qualcomm, MediaTek, and others, have introduced their own branded processors that have gained widespread commercialization. A processor, also known as a central processing unit (CPU), is an electronic computer component constructed using ultra-small transistors integrated onto a compact area. While the CPU is the most well-known processor component, various other components in a computer also possess their own processors.

For instance, graphics cards feature dedicated processors. Prior to the introduction of processors, CPUs were built using separate small-scale integrated circuits, each containing approximately a dozen transistors. The first processing chips emerged in the early 1970s and were primarily utilized for electronic computing or algorithms involving binary-coded decimal (BCD) numbers. Subsequently, 4-bit and 8-bit processors were introduced.

One of the most significant advancements was the introduction of the MC68000 (68K) chip in 1979, which offered a large memory space, high speed, and reasonable cost, becoming an iconic CPU design. The BELLMAC-32A chip from AT&T Bell was the world's first 32-bit processor featuring a complete 32-bit data path, bus structure, and 32-bit address.

Nội dung được bảo vệ bản quyền — Tải xuống đầy đủ

Tài liệu "Luận Văn Tốt Nghiệp: Thiết Kế và Tích Hợp RISC-V với Khối Bảo Mật trên FPGA" mang đến cái nhìn sâu sắc về việc thiết kế và tích hợp kiến trúc RISC-V với các khối bảo mật trên FPGA. Luận văn không chỉ trình bày các phương pháp thiết kế mà còn nhấn mạnh tầm quan trọng của bảo mật trong các hệ thống vi xử lý hiện đại. Độc giả sẽ được khám phá cách mà RISC-V có thể được tối ưu hóa để đáp ứng các yêu cầu bảo mật, từ đó nâng cao hiệu suất và độ tin cậy của hệ thống.

Để mở rộng kiến thức về chủ đề này, bạn có thể tham khảo thêm các tài liệu liên quan như Khóa luận tốt nghiệp kỹ thuật máy tính mô phỏng và hiện thực hệ thống soc với risc v 32 bit cpu trên fpga, nơi bạn sẽ tìm thấy thông tin về việc mô phỏng hệ thống SoC với CPU RISC-V. Ngoài ra, tài liệu Khóa luận tốt nghiệp kỹ thuật máy tính thiết kế vật lý bộ vi xử lý risc v hỗ trợ branch prediction sẽ giúp bạn hiểu rõ hơn về thiết kế bộ vi xử lý RISC-V với tính năng dự đoán nhánh. Cuối cùng, bạn cũng có thể tìm hiểu về Khóa luận tốt nghiệp kỹ thuật máy tính thiết kế bộ xử lý risc v hỗ trợ chế độ giám sát, tài liệu này sẽ cung cấp cái nhìn sâu sắc về chế độ giám sát trong thiết kế RISC-V. Những tài liệu này sẽ giúp bạn mở rộng hiểu biết và khám phá thêm nhiều khía cạnh thú vị trong lĩnh vực thiết kế vi xử lý.