wujian100 仿真路径报错

wujian100 陈希里 ⋅ 于 2020-07-15 10:00:15 ⋅ 最后回复由 陈希里 2020-07-15 19:59:16 ⋅ 316 阅读

在wujian100仿真时,环境:linux 已经更改了setup.cshsetup.sh 以及export和路径的设置 ,之后source成功,开始仿真:输入命令:

../tools/run_case -sim_tool iverilog …/case/timer/timer_test.c

遇到报错:

riscv64-unknown-elf-gcc: error trying to exec :'路径':: execv: Exec format error
回复数量: 25
  • 小强
    2020-07-15 10:03:31

    你输入的命令不对,正确的命令如下:

    ../tools/run_case -sim_tool iverilog  ../case/timer/timer_test.c

    注意目标路径是两个点号,不是省略号

  • 陈希里
    2020-07-15 10:05:39

    @小强 你好,谢谢回答,我把你给的命令复制下来执行,还是报同样的错误

  • 小强
    2020-07-15 10:07:13

    @陈希里 请贴一下完整的截图看一下

  • 陈希里
    2020-07-15 10:08:44

    file

  • 陈希里
    2020-07-15 10:10:14

    @小强 您好,贴图放在上面了

  • 小强
    2020-07-15 10:13:15

    请确保进入到 workdir 目录下运行仿真

  • 陈希里
    2020-07-15 10:18:10

    @小强 您好,我清空了workdir,将仿真转至workdir下面运行,还是报错

    file

  • 小强
    2020-07-15 10:22:52

    请问你安装了 make 工具了吗?输入以下命令

    make -v

    然后截图看一下

  • 陈希里
    2020-07-15 10:26:46

    @小强 您好,

    file

  • 小强
    2020-07-15 10:43:36

    请贴一下你的 setup.sh 脚本,以及 workdir 目录下生成的 Makefile 文件看一下

  • 陈希里
    2020-07-15 10:49:26

    @小强 setup.sh

    Copyright (c) 2019 Alibaba Group Holding Limited

    #

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    #

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    #

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. set VCS path setenv VCS_HOME set path=($VCS_HOME/linux/bin $path) set VCS license setenv SNPSLMD_LICENSE_FILE

    export iverilog_path=(/usr/bin)
    export gtkwave_path=(/usr/bin)
    export path=($iverilog_path:$path)
    export path=($gtkwave_path:$path)

    set tools path

    export TOOL_PATH='/home/chenwei/Documents/wujian100_open/riscv64-elf'
    export wujian100_open_PATH='/home/chenwei/Documents/wujian100_open'

  • 陈希里
    2020-07-15 10:50:08

    @小强 makefile

    Copyright (c) 2019 Alibaba Group Holding Limited

    #

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    #

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    #

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. the compiler toolset setting

    TOOL_EXTENSION = ${TOOL_PATH}/bin/riscv64-unknown-elf-
    CC = ${TOOL_EXTENSION}gcc
    AS = ${TOOL_EXTENSION}as
    LINK = ${TOOL_EXTENSION}ld
    OBJDUMP = ${TOOL_EXTENSION}objdump
    OBJCOPY = ${TOOL_EXTENSION}objcopy

    CONVERT =../tools/Srec2vmem

    CONVERT =../tools/Srec2vmem.py

    SSRC = $(wildcard .S)
    sSRC = $(wildcard
    .s)
    CSRC = $(wildcard *.c)

    OBJECTS = $(SSRC:%.S=%.o) $(sSRC:%.s=%.o) $(CSRC:%.c=%.o)

    DEFSYM = $(shell echo ${CPU} | sed 's/(e9[0-9]{2}).*/\1/')
    CPU_M = $(shell echo ${CPU} | sed '/m/p')

    ifeq ($(findstring e902m, ${CPU_M}), e902m)
    CFLAGS = -march=rv32emcxcki -mabi=ilp32e
    LDFLAGS = -march=rv32emc -mabi=ilp32e
    else
    CFLAGS = -march=rv32ecxcki -mabi=ilp32e
    LDFLAGS = -march=rv32ec -mabi=ilp32e
    endif

    CFLAGS +=-D${DEFSYM} -Wa,--defsym=${DEFSYM}=1
    ifeq ($(findstring yes, ${SIZE}), yes)
    CFLAGS += -Os
    else
    CFLAGS += -O3 -funroll-all-loops -fgcse-sm -finline-limit=500 -fno-schedule-insns -ffunction-sections -fdata-sections
    endif

    LINKFLAGS = -Tlinker.lcf -nostartfiles

    LINKLIBS += $(LDFLAGS) -lc -lgcc

    OBJDUMPFLAGS = -S -Mnumeric

    HEXFLAGS = -O srec

    %.o : %.c
    ${CC} -c ${CFLAGS} -o $@ $<

    %.o : %.s
    ${CC} -c ${CFLAGS} -o $@ $<

    %.o : %.S
    ${CC} -c ${CFLAGS} -o $@ $<

    ${FILE}.elf : ${OBJECTS} linker.lcf
    ${CC} ${LINKFLAGS} ${LINKLIBS} ${OBJECTS} -o $@ -lm

    ${FILE}.obj : ${FILE}.elf
    ${OBJDUMP} ${OBJDUMPFLAGS} $< > $@

    ${FILE}.hex : ${FILE}.elf
    ${OBJCOPY} ${HEXFLAGS} $< $@

    %.pat : %.hex
    rm -f *.pat

    ${CONVERT} $< test.pat

    ${CONVERT} -i $< -o test.pat

    -------------------------------------------------------------------- target setting

    .PHONY :all
    all : ${FILE}.pat ${FILE}.hex ${FILE}.elf ${FILE}.obj

    --------------------------------------------------------------------- clean some medium code and .pat

    .PHONY :clean
    clean:
    rm -rf .o .pat .elf .obj *.hex

  • 小强
    2020-07-15 11:01:21

    请进入这个目录,ls 一下,截图看一下

    /home/chenwei/Documents/wujian100_open/riscv64-elf
  • 陈希里
    2020-07-15 11:05:18
  • 小强
    2020-07-15 11:50:46

    请在 workdir 目录下执行一下这个命令,看看会不会有报错:workdir 下之前生成的文件暂时不用清除

    ../riscv64-elf/riscv64-unknown-elf/bin/as -o a.o crt0.s 

    如果没报错,看当前目录下是不是生成了一个 a.o 文件,打开文件看一下是否有东西。如果有东西的话说明你的工具链应该是没有问题的,不应该出现这样的错误,是不是还有什么地方有遗漏,或者是路径设置还是有问题?

  • 陈希里
    2020-07-15 11:59:55

    @小强 没有报错,但是没有a.o文件
    chenwei@chenwei-virtual-machine:~/Documents/wujian100_open/workdir$ ../riscv64-elf/riscv64-unknown-elf/bin/as -o a.o
    crt0.s
    chenwei@chenwei-virtual-machine:~/Documents/wujian100_open/workdir$ ls
    config.h getc.c ltostr.c putchar.c vfprintf.c
    crt0.s getchar.c Makefile puts.c
    v_printf.c
    datatype.h isinf.c minilibc_stdio.h run_case.report vprintf.c
    dtostr.c isnan.c printf.c snprintf.c vsnprintf.c
    fprintf.c linker.lcf printf.h sprintf.c vsprintf.c
    fputc.c
    lltostr.c putc.c timer_test.c vtimer.h

  • 陈希里
    2020-07-15 12:03:00

    @小强 是不是我得重新安装一下工具链

  • 小强
    2020-07-15 12:04:30

    嗯嗯,这样来看,你的工具链可能是有问题的,你重新安装一下试试

  • 陈希里
    2020-07-15 13:41:58

    @小强 我重新安装了,还是不行,我是将riscv64-elf_x86_64这个文件直接解压在window下面,然后复制到window与ubuntu的共享文件夹,在ubuntu里面从,共享文件夹复制到wujian100_open下面,会不会是共享文件夹的原因

  • 小强
    2020-07-15 13:44:26

    @陈希里 这样可能会有问题,请把压缩包复制到 Ubuntu 下,在 ubuntu 系统里解压。

  • YX MOD
    2020-07-15 14:09:44

    @陈希里
    配置环境的时候按照文档流程来,不要改动文件夹的目录结构不要修改项目内文件夹的名称;还不行的话建议加个QQ远程操作一下。
    谢谢!

  • 陈希里
    2020-07-15 14:37:59

    已解决,谢谢各位前辈,大佬的帮助,非常感谢

  • Edwin
    2020-07-15 19:18:51

    最后是什么原因?

  • 小强
    2020-07-15 19:42:07

    @Edwin 主要就是她的工具链是在 Windows 下解压的,在共享到 Ubuntu 下不能正常使用,后面就是 python 脚本的执行环境需要指定为 python3

  • 陈希里
    2020-07-15 19:59:16

    嗯嗯,是的

暂无评论~~
  • 请注意单词拼写,以及中英文排版,参考此页
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`, 更多语法请见这里 Markdown 语法
  • 支持表情,使用方法请见 Emoji 自动补全来咯,可用的 Emoji 请见 :metal: :point_right: Emoji 列表 :star: :sparkles:
  • 上传图片, 支持拖拽和剪切板黏贴上传, 格式限制 - jpg, png, gif
  • 发布框支持本地存储功能,会在内容变更时保存,「提交」按钮点击时清空
Ctrl+Enter