Skip to content

Instantly share code, notes, and snippets.

@gustavonmartins
Created May 2, 2021 22:49
Show Gist options
  • Save gustavonmartins/1f70071c4e02c7989bab4aff730f0743 to your computer and use it in GitHub Desktop.
Save gustavonmartins/1f70071c4e02c7989bab4aff730f0743 to your computer and use it in GitHub Desktop.
Verilgog :generate fie for readmemh
clang --target=riscv32 -march=rv32i test_instructions.s -c -o arquivo.o
llvm-objcopy -O ihex here.o here.hex
objcopy -O binary arquivo.o --only-section .text\* arquivo.bin
hexdump -ve '1/4 "%08x\n"' arquivo.bin > arquivo.mem
clang --target=riscv32 -march=rv32i test_instructions.s -c -o arquivo.o && llvm-objcopy -O binary arquivo.o --only-section .text\* arquivo.bin && hexdump -ve '1/4 "%08x\n"' arquivo.bin > arquivo.mem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment