forked from Github_Repos/cvw
Modified makefiles to generate function address to name mappings for modelsim.
This commit is contained in:
parent
f055441ecf
commit
143bdaa288
@ -6,8 +6,10 @@ sources=$(cmbase)/core_main.c $(cmbase)/core_list_join.c $(cmbase)/coremark.h \
|
|||||||
$(PORT_DIR)/core_portme.h $(PORT_DIR)/core_portme.c $(PORT_DIR)/core_portme.mak \
|
$(PORT_DIR)/core_portme.h $(PORT_DIR)/core_portme.c $(PORT_DIR)/core_portme.mak \
|
||||||
$(PORT_DIR)/crt.S $(PORT_DIR)/encoding.h $(PORT_DIR)/util.h $(PORT_DIR)/syscalls.c
|
$(PORT_DIR)/crt.S $(PORT_DIR)/encoding.h $(PORT_DIR)/util.h $(PORT_DIR)/syscalls.c
|
||||||
|
|
||||||
work/coremark.bare.riscv.memfile: work/coremark.bare.riscv
|
work/coremark.bare.riscv.elf.memfile: work/coremark.bare.riscv
|
||||||
|
riscv64-unknown-elf-objdump -D $< > $<.elf.objdump
|
||||||
riscv64-unknown-elf-elf2hex --bit-width 64 --input $< --output $@
|
riscv64-unknown-elf-elf2hex --bit-width 64 --input $< --output $@
|
||||||
|
extractFunctionRadix.sh $<.elf.objdump
|
||||||
|
|
||||||
work/coremark.bare.riscv.objdump: work/coremark.bare.riscv
|
work/coremark.bare.riscv.objdump: work/coremark.bare.riscv
|
||||||
riscv64-unknown-elf-objdump -D work/coremark.bare.riscv > work/coremark.bare.riscv.objdump
|
riscv64-unknown-elf-objdump -D work/coremark.bare.riscv > work/coremark.bare.riscv.objdump
|
||||||
|
@ -14,18 +14,21 @@ make all:
|
|||||||
make -C ../../tests/imperas-riscv-tests
|
make -C ../../tests/imperas-riscv-tests
|
||||||
make -C ../../tests/imperas-riscv-tests XLEN=64
|
make -C ../../tests/imperas-riscv-tests XLEN=64
|
||||||
cd ../../tests/imperas-riscv-tests; exe2memfile.pl work/*/*.elf
|
cd ../../tests/imperas-riscv-tests; exe2memfile.pl work/*/*.elf
|
||||||
|
cd ../../tests/imperas-riscv-tests; extractFunctionRadix.sh work/*/*.elf
|
||||||
|
|
||||||
|
|
||||||
# Build riscv-arch-test 64 and 32-bit versions
|
# Build riscv-arch-test 64 and 32-bit versions
|
||||||
make -C ../../addins/riscv-arch-test
|
make -C ../../addins/riscv-arch-test
|
||||||
make -C ../../addins/riscv-arch-test XLEN=32
|
make -C ../../addins/riscv-arch-test XLEN=32
|
||||||
cd ../../addins/riscv-arch-test; elf2hex.sh
|
cd ../../addins/riscv-arch-test; elf2hex.sh
|
||||||
|
cd ../../addins/riscv-arch-test; extractFunctionRadix.sh work/*/*/*.elf
|
||||||
# extractFunctionRadix. ***
|
# extractFunctionRadix. ***
|
||||||
|
|
||||||
# Build wally-riscv-arch-test
|
# Build wally-riscv-arch-test
|
||||||
make -C ../../tests/wally-riscv-arch-test/
|
make -C ../../tests/wally-riscv-arch-test/
|
||||||
make -C ../../tests/wally-riscv-arch-test/ XLEN=32
|
make -C ../../tests/wally-riscv-arch-test/ XLEN=32
|
||||||
cd ../../tests/wally-riscv-arch-test; elf2hex.sh
|
cd ../../tests/wally-riscv-arch-test; elf2hex.sh
|
||||||
|
cd ../../tests/wally-riscv-arch-test; extractFunctionRadix.sh work/*/*/*.elf
|
||||||
# ***extractFunctionRadix
|
# ***extractFunctionRadix
|
||||||
|
|
||||||
# Only compile Imperas tests if they are installed locally.
|
# Only compile Imperas tests if they are installed locally.
|
||||||
|
@ -164,20 +164,11 @@ module FunctionName(reset, clk, ProgramAddrMapFile, ProgramLabelMapFile);
|
|||||||
end
|
end
|
||||||
|
|
||||||
logic OrReducedAdr, AnyUnknown;
|
logic OrReducedAdr, AnyUnknown;
|
||||||
|
|
||||||
|
|
||||||
assign OrReducedAdr = |ProgramAddrIndex;
|
assign OrReducedAdr = |ProgramAddrIndex;
|
||||||
assign AnyUnknown = (OrReducedAdr === 1'bx) ? 1'b1 : 1'b0;
|
assign AnyUnknown = (OrReducedAdr === 1'bx) ? 1'b1 : 1'b0;
|
||||||
initial ProgramAddrIndexQ = '0;
|
|
||||||
initial ProgramAddrIndex = '0;
|
initial ProgramAddrIndex = '0;
|
||||||
always @(posedge clk) begin
|
|
||||||
if(reset)
|
|
||||||
ProgramAddrIndexQ <= '0;
|
|
||||||
if(AnyUnknown == 1'b0)
|
|
||||||
ProgramAddrIndexQ <= ProgramAddrIndex;
|
|
||||||
end
|
|
||||||
|
|
||||||
assign FunctionName = ProgramLabelMapMemory[AnyUnknown ? ProgramAddrIndexQ : ProgramAddrIndex];
|
assign FunctionName = AnyUnknown ? "Unknown!" : ProgramLabelMapMemory[ProgramAddrIndex];
|
||||||
|
|
||||||
|
|
||||||
endmodule // function_radix
|
endmodule // function_radix
|
Loading…
Reference in New Issue
Block a user