Try   HackMD

Assignment2: RISC-V Toolchain

( Due: Oct 30, 2019 )

Requirements

  1. Following the instructions of Lab2: RISC-V RV32I[MA] emulator with ELF support, pick up two assembly programs from Assignment1: RISC-V Assembly and Instruction Pipeline and rewrite into C implementations which can execute with rv32emu.
    • You shall not pick up the program(s) submitted by youself already.
    • You may pick up the same topic as other students did, but you shall figure out something by your own.
  2. Disassemble the ELF files generated by C compiler and compare the assembly listing between handwritten and compiler optimized one.
    • You can modify the arguments specified by RV32I_CFLAGS to experiment. e.g. Change -O3 (optimized for speed) to -Os (optimized for size).
    • Describe your obserations and explain.
    • Function calls and ecall shall be taken into considerations.
  3. Check the results of emu-rv32i for the statistics of execution flow and explain the internal counters such as true_counter, true_counter (crucial for branch prediction), jump_counter, etc. Then, try to optimize the generated assembly. You shall read RISC-V Assembly Programmer's Manual carefully and modify Makefile in order to append new assembly targets.
  4. Write down your thoughts and progress in HackMD notes.
    • Example page: Do not modify this note.
    • Insert your HackMD notes and programs in the following table.
    • 2 entries as expected.

Fill in the table for your homework

Name (Chinese/English) Descriptions HackMD note Program (GitHub link)
張家銘 prime number Lab2: RISC-V RV32I[MA] emulator with ELF support link
張家銘 POW function Lab2: RISC-V RV32I[MA] emulator with ELF support link
戴宏諺 9*9 multiplication table Lab2: RISC-V RV32I[MA] emulator with ELF support github
戴宏諺 Recursive binary search Lab2: RISC-V RV32I[MA] emulator with ELF support github
黃瀚群 Bubble Sort Lab2: RISC-V RV32I[MA] emulator with ELF support
黃瀚群 Permutations(nCk) with recursion Lab2: RISC-V RV32I[MA] emulator with ELF support
潘家瑞 POW function Lab2: RISC-V RV32I[MA] emulator with ELF support Github
潘家瑞 Tower of Hanoi Lab2: RISC-V RV32I[MA] emulator with ELF support Github
周沛辰 Multiplier Lab2: RISC-V RV32I[MA] emulator with ELF support Link
周沛辰 Sort 1~5 With Bubble Sort Lab2: RISC-V RV32I[MA] emulator with ELF support Link
林家葦 Sum of First N Natural Numbers Lab2: RISC-V RV32I[MA] emulator with ELF support github
林家葦 Multiplier Lab2: RISC-V RV32I[MA] emulator with ELF support github
黃俞紘 9*9 multiplication table Lab2: RISC-V RV32I[MA] emulator with ELF support github
黃偉宸 Multiplier Lab2: RISC-V RV32I[MA] emulator with ELF support github
黃偉宸 bit reverse Lab2: RISC-V RV32I[MA] emulator with ELF support github
Soonmyun Jang Catalan number/Multiplier Lab2: RISC-V RV32I[MA] emulator with ELF support Link
林聖堯 Bit_reverse, Prime Number Assignment2: RISC-V Toolchain
王昱翔 bubble sort/binarySearch Lab2: RISC-V RV32I[MA] emulator with ELF support
黃俞紘 Hanoi Tower Lab2: RISC-V RV32I[MA] emulator with ELF support github
曾士峰 Lucas Number Lab2: RISC-V RV32I[MA] emulator with ELF support github
曾士峰 Fraction ! Lab2: RISC-V RV32I[MA] emulator with ELF support github