forked from Firmware/Firmwares
		
	fix hello-world init
This commit is contained in:
		| @@ -2,14 +2,22 @@ | |||||||
| TARGET  = hello | TARGET  = hello | ||||||
| C_SRCS  = $(wildcard *.c)  | C_SRCS  = $(wildcard *.c)  | ||||||
| #HEADERS = $(wildcard *.h) | #HEADERS = $(wildcard *.h) | ||||||
| #CFLAGS += -O2  | CFLAGS += -g  | ||||||
|  |  | ||||||
| BOARD=freedom-e300-hifive1 | BOARD=freedom-e300-hifive1 | ||||||
| LINK_TARGET=flash | LINK_TARGET=flash | ||||||
| RISCV_ARCH:=rv32i | RISCV_ARCH:=rv32i | ||||||
| RISCV_ABI:=ilp32 | RISCV_ABI:=ilp32 | ||||||
| LDFLAGS := -Wl,--wrap=scanf -Wl,--wrap=printf -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) | LDFLAGS := -Wl,--wrap=scanf -Wl,--wrap=printf -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) -g | ||||||
|  |  | ||||||
|  | #TOOL_DIR?=/opt/shared/riscv/FreedomStudio/20180122/SiFive/riscv64-unknown-elf-gcc-20171231-x86_64-linux-centos6/bin | ||||||
|  | TOOL_DIR=/opt/shared/riscv/tools/Ubuntu/riscv64-unknown-elf-gcc-8.3.0-2020.04.1-x86_64-linux-ubuntu14/bin | ||||||
|  |  | ||||||
| TOOL_DIR?=/opt/shared/riscv/FreedomStudio/20180122/SiFive/riscv64-unknown-elf-gcc-20171231-x86_64-linux-centos6/bin |  | ||||||
| BSP_BASE = ./bsp | BSP_BASE = ./bsp | ||||||
| include $(BSP_BASE)/env/common.mk | include $(BSP_BASE)/env/common.mk | ||||||
|  |  | ||||||
|  | .PHONY: all | ||||||
|  | all: $(TARGET).dump | ||||||
|  |  | ||||||
|  | $(TARGET).dump: $(TARGET) | ||||||
|  | 	$(TOOL_DIR)/$(TRIPLET)-objdump -d -S -C $< > $@ | ||||||
							
								
								
									
										2
									
								
								hello-world/bsp/env/start.S
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								hello-world/bsp/env/start.S
									
									
									
									
										vendored
									
									
								
							| @@ -75,7 +75,7 @@ _start: | |||||||
| #else | #else | ||||||
| 	sd ra, 8(sp) | 	sd ra, 8(sp) | ||||||
| #endif | #endif | ||||||
|  |         call _init | ||||||
| 	/* argc = argv = 0 */ | 	/* argc = argv = 0 */ | ||||||
| 	li a0, 0 | 	li a0, 0 | ||||||
| 	li a1, 0 | 	li a1, 0 | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							| @@ -35,7 +35,8 @@ ref_sample_cnt = len(ref_data.split(",")) | |||||||
| # create cpp file | # create cpp file | ||||||
| f = open("../xspn_data.cpp", "w") | f = open("../xspn_data.cpp", "w") | ||||||
| cpp_file = "#include <array>\n" | cpp_file = "#include <array>\n" | ||||||
| cpp_file += "#include <cmath>\n\n" | cpp_file += "#include <cmath>\n" | ||||||
|  | cpp_file += "#include <bits/stdint-uintn.h>\n\n" | ||||||
| # The results in the outputdata.txt file are not directly what comes out of the PE but the natural logarithm of it. | # The results in the outputdata.txt file are not directly what comes out of the PE but the natural logarithm of it. | ||||||
| cpp_file += "constexpr auto ln2 = std::log(2);\n" | cpp_file += "constexpr auto ln2 = std::log(2);\n" | ||||||
| cpp_file += "std::array<uint8_t, " + str(input_sample_cnt) + "> input_data = {\n" + str(in_data) + "}; \n\n" | cpp_file += "std::array<uint8_t, " + str(input_sample_cnt) + "> input_data = {\n" + str(in_data) + "}; \n\n" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user