RISC-V processor model

220 views
Skip to first unread message

Pavani Tripathi

unread,
Aug 12, 2016, 12:58:48 AM8/12/16
to RISC-V ISA Dev
Hello Everyone,

As part of a project I am developing a RISC-V processor model. I have been able to successfully create RV32IM model. But I am facing one problem. If I try to build a file using riscv64-unknown-rlf-gcc with -m32 -Wa,-march=RV32IMA -std=gnu99 -msoft-float these flags I am getting "unimp" instructions in the dump file (created using riscv64-unknown-elf-objdump). For reference I am attaching the dump file that I get. It would be really helpful if anyone could help me out in figuring out why I am getting "unimp" instructions ASAP. Thanks. 
bitcnts.out

Clifford Wolf

unread,
Aug 12, 2016, 8:06:18 AM8/12/16
to Pavani Tripathi, RISC-V ISA Dev
On Thu, Aug 11, 2016 at 09:58:47PM -0700, Pavani Tripathi wrote:
> [..] I am getting "unimp" instructions in the dump file (created using
> riscv64-unknown-elf-objdump). For reference I am attaching the dump file
> that I get. It would be really helpful if anyone could help me out in
> figuring out why I am getting "unimp" instructions ASAP. Thanks.

those aren't instructions. this is data. when the code is executed this
data will be read using memory load instruction. it will never be executed
as instruction words.

Pavani Tripathi

unread,
Aug 12, 2016, 1:19:41 PM8/12/16
to RISC-V ISA Dev, pavan...@iiitd.ac.in
But "unimp" is also there under the function <pBitCntFunc.3356>. Also, when I try to load a file during execution the elf file does not seem to be able to read and fetch the data from the file that I am providing as an input. What could be the possible reason for that?

Clifford Wolf

unread,
Aug 15, 2016, 4:22:43 PM8/15/16
to Pavani Tripathi, RISC-V ISA Dev
Hi,

On Fri, Aug 12, 2016 at 10:19:41AM -0700, Pavani Tripathi wrote:
> But "unimp" is also there under the function <pBitCntFunc.3356>. [...]

<pBitCntFunc.3356> is _not_ a function!

here is the snippet for <pBitCntFunc.3356> from your bitcnts.out:

...

00020300 <pBitCntFunc.3356>:
20300: 010c addi a1,sp,128
20302: 0000 unimp
20304: 0164 addi s1,sp,140
20306: 0000 unimp
20308: 0524 addi s1,sp,648
2030a: 0000 unimp
2030c: 0258 addi a4,sp,260
2030e: 0000 unimp
20310: 03a4 addi s1,sp,456
20312: 0000 unimp
20314: 043c addi a5,sp,520
20316: 0000 unimp
20318: 0834 addi a3,sp,24
2031a: 0000 unimp

0002031c <text.3357>:
...

obviously thats not a function. there are so many things here that make it
obvious. but for starters: it does not end on a 'ret' statement.

Also, it is only used in this code:

68c: fdc42703 lw a4,-36(s0)
690: 00271713 slli a4,a4,0x2
694: 30078793 addi a5,a5,768 # 20300 <pBitCntFunc.3356>
698: 00f707b3 add a5,a4,a5
69c: 0007a783 lw a5,0(a5)

Which obviously is a load from the data stored at <pBitCntFunc.3356>.

regards,
- clifford

Reply all
Reply to author
Forward
0 new messages