This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

compiling c code for simulation

Hi All,


This question is related to running processor based tests in simulation for an SoC.

Currently, we have a bunch of tests written in assembly. However, we would like to write further tests in C and not in assembly.

The example Makefile we have got only runs assembler on .s file and then eventually creates hex file.

Below is the snapshot of the make commands through dry-run. 

echo " [ASM ] ../c_code/tests/aarch64/spi_interrupt_timer/spi_interrupt_timer.s"
aarch64-none-linux-gnu-as -march=armv8-a ../c_code/tests/aarch64/spi_interrupt_timer/spi_interrupt_timer.s -o ../c_code/tests/aarch64/spi_interrupt_timer/spi_interrupt_timer.o
echo " [ASM ] ../c_code/tests/aarch64/shared/isr_irq.s"
aarch64-none-linux-gnu-as -march=armv8-a -I../c_code/tests/common/shared ../c_code/tests/aarch64/shared/isr_irq.s -o ../c_code/tests/aarch64/shared/isr_irq.o
echo " [ASM ] ../c_code/tests/aarch64/shared/bootcode.s"
aarch64-none-linux-gnu-as -march=armv8-a -I../c_code/tests/common/shared ../c_code/tests/aarch64/shared/bootcode.s -o ../c_code/tests/aarch64/shared/bootcode.o
echo " [ASM ] ../c_code/tests/aarch64/shared/stackheap.s"
aarch64-none-linux-gnu-as -march=armv8-a -I../c_code/tests/common/shared ../c_code/tests/aarch64/shared/stackheap.s -o ../c_code/tests/aarch64/shared/stackheap.o
echo " [ASM ] ../c_code/tests/aarch64/shared/vectors.s"
aarch64-none-linux-gnu-as -march=armv8-a -I../c_code/tests/common/shared ../c_code/tests/aarch64/shared/vectors.s -o ../c_code/tests/aarch64/shared/vectors.o
echo " [ASM ] ../c_code/tests/aarch64/shared/isr_fiq.s"
aarch64-none-linux-gnu-as -march=armv8-a -I../c_code/tests/common/shared ../c_code/tests/aarch64/shared/isr_fiq.s -o ../c_code/tests/aarch64/shared/isr_fiq.o
echo " [ASM ] ../c_code/tests/aarch64/shared/pagetables.s"
aarch64-none-linux-gnu-as -march=armv8-a -I../c_code/tests/common/shared ../c_code/tests/aarch64/shared/pagetables.s -o ../c_code/tests/aarch64/shared/pagetables.o
echo " [ASM ] ../c_code/tests/aarch64/gic_shared/gic_config.s"
aarch64-none-linux-gnu-as -march=armv8-a -I../c_code/tests/common/shared ../c_code/tests/aarch64/gic_shared/gic_config.s -o ../c_code/tests/aarch64/gic_shared/gic_config.o
echo " [LINK] ../c_code/tests/aarch64/spi_interrupt_timer/spi_interrupt_timer.o"
aarch64-none-linux-gnu-ld -T ../c_code/tests/link_asm_aarch64.ld ../c_code/tests/aarch64/spi_interrupt_timer/spi_interrupt_timer.o ../c_code/tests/aarch64/shared/isr_irq.o ../c_code/tests/aarch64/shared/bootcode.o ../c_code/tests/aarch64/shared/stackheap.o ../c_code/tests/aarch64/shared/vectors.o ../c_code/tests/aarch64/shared/isr_fiq.o ../c_code/tests/aarch64/shared/pagetables.o ../c_code/tests/aarch64/gic_shared/gic_config.o -o ../c_code/tests/aarch64/spi_interrupt_timer/spi_interrupt_timer.elf
echo " [BIN ] ../c_code/tests/aarch64/spi_interrupt_timer/spi_interrupt_timer.elf"
aarch64-none-linux-gnu-objcopy -O binary ../c_code/tests/aarch64/spi_interrupt_timer/spi_interrupt_timer.elf ../c_code/tests/aarch64/spi_interrupt_timer/spi_interrupt_timer.bin
echo " [HEX ] ../c_code/tests/aarch64/spi_interrupt_timer/spi_interrupt_timer.bin"
../c_code/shared/tools/bin/bin2vhx.pl --width=128 ../c_code/tests/aarch64/spi_interrupt_timer/spi_interrupt_timer.bin ../c_code/tests/aarch64/spi_interrupt_timer/spi_interrupt_timer.vhx
cp ../c_code/tests/aarch64/spi_interrupt_timer/spi_interrupt_timer.vhx rom.vhx

Can you let me know how to compile C code that I can load to the boot rom and run simulation?