“Design and implementation in VHDL for FPGAs of a dual-lockstep pipeline RISC-V based architecture”

UFSC/CTC/PPGEEL, 2021/1

EEL 510389 – Digital Systems and Reconfigurable Devices

Prof. Eduardo Augusto Bezerra

The goal of the project is to design and implement a dual-lockstep architecture for fault detection. The architecture must be based on a RISC-V pipeline as described in Chapter 4 of the book: David A. Patterson, John L. Hennessy, “Computer Organization and Design RISC-V Edition: The Hardware Software Interface”, Morgan Kaufmann, 2017. The following requirements must be followed in the design and implementation of the architecture.

  • It must be described in VHDL, implementing the base integer instruction set, 32-bit (RV32), targeting FPGA synthesis.
  • The design should follow the basic block diagram shown in Slide 76 of Chapter_04-RISC-V.ppt.
  • It must be a 5 stages pipeline architecture (IF, ID, EX, MEM and WB) with, at least, data hazard basic functionalities also implemented in VHDL.
  • Any RISC-V implementation can be used as a template as, for instance, the HF-RISC implementation by Sergio Johann (GSE/PUCRS). In this case, extra hardware must be created in order to implement the additional pipeline stages and also the hazard management units.
  • Alternatively, the whole VHDL for the proposed architecture can be developed from scratch, but it is not recommended considering the available time.
  • The expected components are shown in Figure 1. The memories must store exactly the same programs, and the two RISC-V processors must read the instructions from the memories in a synchronised way. At each “step”, the results must be compared by the “Comparator” component. In case of an error, the RISC-V processors must be reset.
  • The Comparator component must be defined and designed by the students, as well as all its inputs and outputs, including their sizes. For instance, the students must define the level of detail the Comparator component will provide. It is expected that it provides at least the location of the detected error (memory address?).
  • The students must make changes in the RISC-V architecture in order to generate the “Lockstep-out” outputs. However, the proposed RISC-V must remain compatible with the RISC-V ISA standard in order to run binary code generated by commercial tools.
  • In order to test the VHDL design, each student must write three different assembly programs:
    • A “test program” that uses all the instructions (with no specific functionality);
    • A useful program that must have, at least, one data hazard situation (e.g. scalar product of vectors, …); and
    • A program with injected faults (in the instructions or data) in order to trigger the fault detection mechanism.
  • The programs must be written in assembly, and the binary code must be generated using the Ripes tool.
  • The architecture must run not only the three programs, but also the programs developed by the other students in the class.

Minimal instruction set to be implemented

(see RISC-V Reference Data Card, pg. 1656)

  • Load immediate / jumps
    • Load immediate – lui rd, imm
    • Jump and link – jal rd, offset
    • Jump and link register – jalr rd, rs1, offset
  • Branches
    • Branch on equal – beq rs1, rs2, offset
    • Branch on not equal – bne rs1, rs2, offset
    • Branch less than – blt rs1, rs2, offset
    • Branch greater than equal – bge rs1, rs2, offset
  • Loads
    • Load byte – lb rd, offset(rs1)
    • Load word – lw rd, offset(rs1)
  • Stores
    • Store byte – sb rs2, offset(rs1)
    • Store word – sw rs2, offset(rs1)
  • Register-immediate operations
    • Addition immediate – addi rd, rs1, imm
    • AND immediate – andi rd, rs1, imm
    • XOR immediate – xori rd, rs1, imm
    • OR immediate – ori rd, rs1, imm
  • Register-register operations
    • Addition – add rd, rs1, rs2
    • Subtract – sub rd, rs1, rs2
    • AND – and rd, rs1, rs2
    • XOR – xor rd, rs1, rs2
    • OR – or rd, rs1, rs2
    • Shift left logical – sll rd, rs1, rs2
    • Shift right logical – srl rd, rs1, rs2
    • Set less than – slt rd, rs1, rs2

2021-08-18-PF-RISC-V
Figure 1. Block diagram of the proposed dual-lockstep pipeline RISC-V-based architecture.

 

Research papers related to the proposed architecture:

 

  • Mong Tee Sim, Yanyan Zhuang, “A Dual Lockstep Processor System-on-a-Chip for Fast Error Recovery in Safety-Critical Applications”, IECON 2020 The 46th Annual Conference of the IEEE Industrial Electronics Society. https://doi.org/10.1109/IECON43393.2020.9255188
  • Ahmed Hanafi, Mohammed Karim, Abdelilah El Hammami, “Dual-Lockstep Microblaze-Based Embedded System For Error Detection and Recovery With Reconfiguration Technique”, 2015 Third World Conference on Complex Systems (WCCS). https://doi.org/10.1109/ICoCS.2015.7483287
  • Christian M. Fuchs, Nadia M. Murillo, Aske Plaat, Erik van der Kouwe, Daniel Harsono, and Peng Wang, “Software-Defined Dependable Computing for Spacecraft”, 2018 IEEE 23rd Pacific Rim International Symposium on Dependable Computing (PRDC). https://doi.org/10.1109/PRDC.2018.00043
  • Server Kasap, Eduardo Weber Wächter, Xiaojun Zhai, Shoaib Ehsan and Klaus D. McDonald-Maier, “Novel Lockstep-based Approach with Roll-back and Roll-forward Recovery to Mitigate Radiation-Induced Soft Errors”, 2020 IEEE Nordic Circuits and Systems Conference (NorCAS). https://doi.org/10.1109/NorCAS51424.2020.9265137
  • F. Abate, L. Sterpone, C. A. Lisboa, L. Carro, and M. Violante, “New Techniques for Improving the Performance of the Lockstep Architecture for SEEs Mitigation in FPGA Embedded Processors”, IEEE TRANSACTIONS ON NUCLEAR SCIENCE, VOL. 56, NO. 4, AUGUST 2009. https://doi.org/10.1109/TNS.2009.2013237
  • Santiago Sondon, Pablo Mandolesi, Favio Masson, Pedro Julián, Félix Palumbo, “A Dual Core Low Power Microcontroller with openMSP430 Architecture for High Reliability Lockstep Applications Using a 180 nm High Voltage Technology Node”, 2013 IEEE 4th Latin American Symposium on Circuits and Systems (LASCAS). https://doi.org/10.1109/LASCAS.2013.6519085
  • Ádria Barros de Oliveira, Lucas Antunes Tambara, Fernanda Lima Kastensmidt, “Applying Lockstep in Dual-Core ARM Cortex-A9 to Mitigate Radiation-induced Soft Errors”, 2017 IEEE 8th Latin American Symposium on Circuits & Systems (LASCAS). https://doi.org/10.1109/LASCAS.2017.7948063
  • Eduardo Weber Wächter, Server Kasap, Xiaojun Zhai, Shoaib Ehsan and Klaus McDonald-Maier, “Survey of Lockstep based Mitigation Techniques for Soft Errors in Embedded Systems”, 2019 11th Computer Science and Electronic Engineering (CEEC). https://doi.org/10.1109/CEEC47804.2019.8974333