diff --git a/src/test/cpp/custom/custom_csr/build/custom_csr.asm b/src/test/cpp/custom/custom_csr/build/custom_csr.asm index 75f34a9..67956bc 100644 --- a/src/test/cpp/custom/custom_csr/build/custom_csr.asm +++ b/src/test/cpp/custom/custom_csr/build/custom_csr.asm @@ -9,36 +9,34 @@ Disassembly of section .crt_section: 4: b04020f3 csrr ra,mhpmcounter4 8: b0402173 csrr sp,mhpmcounter4 c: b04021f3 csrr gp,mhpmcounter4 - 10: 00208093 addi ra,ra,2 - 14: 00110113 addi sp,sp,1 - 18: 02309e63 bne ra,gp,54 - 1c: 02311c63 bne sp,gp,54 - 20: 00200e13 li t3,2 - 24: 005dc0b7 lui ra,0x5dc - 28: 98a08093 addi ra,ra,-1654 # 5db98a - 2c: b0409073 csrw mhpmcounter4,ra - 30: b0402173 csrr sp,mhpmcounter4 - 34: 02209063 bne ra,sp,54 - 38: 00300e13 li t3,3 - 3c: b05020f3 csrr ra,mhpmcounter5 - 40: b0502173 csrr sp,mhpmcounter5 - 44: b05021f3 csrr gp,mhpmcounter5 - 48: 0020d663 ble sp,ra,54 - 4c: 00315463 ble gp,sp,54 - 50: 0100006f j 60 + 10: 02114e63 blt sp,ra,4c + 14: 0221cc63 blt gp,sp,4c + 18: 00200e13 li t3,2 + 1c: 005dc0b7 lui ra,0x5dc + 20: 98a08093 addi ra,ra,-1654 # 5db98a + 24: b0409073 csrw mhpmcounter4,ra + 28: b0402173 csrr sp,mhpmcounter4 + 2c: 02114063 blt sp,ra,4c + 30: 00300e13 li t3,3 + 34: b05020f3 csrr ra,mhpmcounter5 + 38: b0502173 csrr sp,mhpmcounter5 + 3c: b05021f3 csrr gp,mhpmcounter5 + 40: 0020d663 ble sp,ra,4c + 44: 00315463 ble gp,sp,4c + 48: 0100006f j 58 -00000054 : - 54: f0100137 lui sp,0xf0100 - 58: f2410113 addi sp,sp,-220 # f00fff24 - 5c: 01c12023 sw t3,0(sp) +0000004c : + 4c: f0100137 lui sp,0xf0100 + 50: f2410113 addi sp,sp,-220 # f00fff24 + 54: 01c12023 sw t3,0(sp) -00000060 : - 60: f0100137 lui sp,0xf0100 - 64: f2010113 addi sp,sp,-224 # f00fff20 - 68: 00012023 sw zero,0(sp) +00000058 : + 58: f0100137 lui sp,0xf0100 + 5c: f2010113 addi sp,sp,-224 # f00fff20 + 60: 00012023 sw zero,0(sp) + 64: 00000013 nop + 68: 00000013 nop 6c: 00000013 nop 70: 00000013 nop 74: 00000013 nop 78: 00000013 nop - 7c: 00000013 nop - 80: 00000013 nop diff --git a/src/test/cpp/custom/custom_csr/build/custom_csr.elf b/src/test/cpp/custom/custom_csr/build/custom_csr.elf index 71499ba..207dadf 100755 Binary files a/src/test/cpp/custom/custom_csr/build/custom_csr.elf and b/src/test/cpp/custom/custom_csr/build/custom_csr.elf differ diff --git a/src/test/cpp/custom/custom_csr/build/custom_csr.hex b/src/test/cpp/custom/custom_csr/build/custom_csr.hex index 6249a34..d2f4954 100644 --- a/src/test/cpp/custom/custom_csr/build/custom_csr.hex +++ b/src/test/cpp/custom/custom_csr/build/custom_csr.hex @@ -1,10 +1,9 @@ :10000000130E1000F32040B0732140B0F32140B034 -:100010009380200013011100639E3002631C3102A3 -:10002000130E2000B7C05D009380A098739040B07D -:10003000732140B063902002130E3000F32050B0C3 -:10004000732150B0F32150B063D6200063543100C7 -:100050006F000001370110F0130141F22320C101AC -:10006000370110F0130101F22320010013000000FA -:100070001300000013000000130000001300000034 -:040080001300000069 +:10001000634E110263CC2102130E2000B7C05D00B5 +:100020009380A098739040B0732140B06340110258 +:10003000130E3000F32050B0732150B0F32150B0B4 +:1000400063D62000635431006F000001370110F0C7 +:10005000130141F22320C101370110F0130101F215 +:100060002320010013000000130000001300000013 +:0C0070001300000013000000130000004B :00000001FF diff --git a/src/test/cpp/custom/custom_csr/build/custom_csr.map b/src/test/cpp/custom/custom_csr/build/custom_csr.map index 4fcd019..d9ece69 100644 --- a/src/test/cpp/custom/custom_csr/build/custom_csr.map +++ b/src/test/cpp/custom/custom_csr/build/custom_csr.map @@ -16,15 +16,15 @@ END GROUP LOAD /opt/riscv/bin/../lib/gcc/riscv64-unknown-elf/7.1.1/rv32i/ilp32/libgcc.a 0x0000000000000000 . = 0x0 -.crt_section 0x0000000000000000 0x84 +.crt_section 0x0000000000000000 0x7c 0x0000000000000000 . = ALIGN (0x4) *crt.o(.text) - .text 0x0000000000000000 0x84 build/src/crt.o + .text 0x0000000000000000 0x7c build/src/crt.o 0x0000000000000000 _start OUTPUT(build/custom_csr.elf elf32-littleriscv) -.data 0x0000000000000084 0x0 - .data 0x0000000000000084 0x0 build/src/crt.o +.data 0x000000000000007c 0x0 + .data 0x000000000000007c 0x0 build/src/crt.o -.bss 0x0000000000000084 0x0 - .bss 0x0000000000000084 0x0 build/src/crt.o +.bss 0x000000000000007c 0x0 + .bss 0x000000000000007c 0x0 build/src/crt.o diff --git a/src/test/cpp/custom/custom_csr/build/custom_csr.v b/src/test/cpp/custom/custom_csr/build/custom_csr.v index 047524e..0e434cb 100755 --- a/src/test/cpp/custom/custom_csr/build/custom_csr.v +++ b/src/test/cpp/custom/custom_csr/build/custom_csr.v @@ -1,10 +1,9 @@ @00000000 13 0E 10 00 F3 20 40 B0 73 21 40 B0 F3 21 40 B0 -93 80 20 00 13 01 11 00 63 9E 30 02 63 1C 31 02 -13 0E 20 00 B7 C0 5D 00 93 80 A0 98 73 90 40 B0 -73 21 40 B0 63 90 20 02 13 0E 30 00 F3 20 50 B0 -73 21 50 B0 F3 21 50 B0 63 D6 20 00 63 54 31 00 -6F 00 00 01 37 01 10 F0 13 01 41 F2 23 20 C1 01 -37 01 10 F0 13 01 01 F2 23 20 01 00 13 00 00 00 -13 00 00 00 13 00 00 00 13 00 00 00 13 00 00 00 -13 00 00 00 +63 4E 11 02 63 CC 21 02 13 0E 20 00 B7 C0 5D 00 +93 80 A0 98 73 90 40 B0 73 21 40 B0 63 40 11 02 +13 0E 30 00 F3 20 50 B0 73 21 50 B0 F3 21 50 B0 +63 D6 20 00 63 54 31 00 6F 00 00 01 37 01 10 F0 +13 01 41 F2 23 20 C1 01 37 01 10 F0 13 01 01 F2 +23 20 01 00 13 00 00 00 13 00 00 00 13 00 00 00 +13 00 00 00 13 00 00 00 13 00 00 00 diff --git a/src/test/cpp/custom/custom_csr/src/crt.S b/src/test/cpp/custom/custom_csr/src/crt.S index 16494a2..6f211c3 100644 --- a/src/test/cpp/custom/custom_csr/src/crt.S +++ b/src/test/cpp/custom/custom_csr/src/crt.S @@ -6,10 +6,8 @@ _start: csrr x1, 0xB04 csrr x2, 0xB04 csrr x3, 0xB04 - add x1, x1, 2 - add x2, x2, 1 - bne x1, x3, fail - bne x2, x3, fail + blt x2, x1, fail + blt x3, x2, fail //Test 2 @@ -17,7 +15,7 @@ _start: li x1, 6142346 csrw 0xB04, x1 csrr x2, 0xB04 - bne x1, x2, fail + blt x2, x1, fail //Test 3