forked from Github_Repos/cvw
		
	Merge branch 'bit-manip' of github.com:kipmacsaigoren/cvw into bit-manip
This commit is contained in:
		
						commit
						fb415c3f92
					
				
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@ -112,3 +112,5 @@ sim/results-error/
 | 
			
		||||
sim/test1.rep
 | 
			
		||||
sim/vsim.log
 | 
			
		||||
tests/coverage/*.S
 | 
			
		||||
tests/coverage/*.elf
 | 
			
		||||
*.elf.memfile
 | 
			
		||||
@ -1,13 +1,27 @@
 | 
			
		||||
SRCS = $(wildcard *.S)
 | 
			
		||||
PROGS = $(patsubst %.S,%,$(SRCS))
 | 
			
		||||
CEXT		:= c
 | 
			
		||||
CPPEXT		:= cpp
 | 
			
		||||
AEXT		:= s
 | 
			
		||||
SEXT		:= S
 | 
			
		||||
SRCEXT 		:= \([$(CEXT)$(AEXT)$(SEXT)]\|$(CPPEXT)\)
 | 
			
		||||
#SRCS = $(wildcard *.S)
 | 
			
		||||
#PROGS = $(patsubst %.S,%,$(SRCS))
 | 
			
		||||
SRCDIR = .
 | 
			
		||||
SRCEXT = S
 | 
			
		||||
SOURCES		?= $(shell find $(SRCDIR) -type f -regex ".*\.$(SRCEXT)" | sort)
 | 
			
		||||
OBJEXT = elf
 | 
			
		||||
OBJECTS		:= $(SOURCES:.$(SEXT)=.$(OBJEXT))
 | 
			
		||||
 | 
			
		||||
all: $(PROGS)
 | 
			
		||||
all: $(OBJECTS)
 | 
			
		||||
 | 
			
		||||
%: %.S WALLY-init-lib.h Makefile
 | 
			
		||||
%.elf.objdump: %.elf
 | 
			
		||||
 | 
			
		||||
%.elf: $(SRCDIR)/%.$(SEXT) WALLY-init-lib.h Makefile
 | 
			
		||||
	echo $@
 | 
			
		||||
	riscv64-unknown-elf-gcc -g -o $@.elf -march=rv64gc -mabi=lp64 -mcmodel=medany \
 | 
			
		||||
	    -nostartfiles -T../../examples/link/link.ld $@.S 
 | 
			
		||||
	riscv64-unknown-elf-objdump -D $@.elf > $@.objdump
 | 
			
		||||
	riscv64-unknown-elf-gcc -g -o $@ -march=rv64gc -mabi=lp64 -mcmodel=medany \
 | 
			
		||||
	    -nostartfiles -T../../examples/link/link.ld $<
 | 
			
		||||
	riscv64-unknown-elf-objdump -D $@ > $@.objdump
 | 
			
		||||
	riscv64-unknown-elf-elf2hex --bit-width $(if $(findstring rv64,$*),64,32) --input $@ --output $@.memfile
 | 
			
		||||
	extractFunctionRadix.sh $@.objdump
 | 
			
		||||
    
 | 
			
		||||
sim: %.elf
 | 
			
		||||
	spike +signature=%.signature.output +signature-granularity=8 %.elf
 | 
			
		||||
 | 
			
		||||
@ -33,16 +33,4 @@ main:
 | 
			
		||||
    .word 0x00000000 // illegal instruction
 | 
			
		||||
 | 
			
		||||
    j done
 | 
			
		||||
/*
 | 
			
		||||
main:
 | 
			
		||||
    # Change to user mode
 | 
			
		||||
    li a0, 0            # a0 = 0: argument to enter user mode
 | 
			
		||||
    ecall               # System call to enter user mode
 | 
			
		||||
 | 
			
		||||
    # Wait for timer interrupts
 | 
			
		||||
    li t0, 0x1000       # loop counter start value
 | 
			
		||||
loop: 
 | 
			
		||||
    addi t0, t0, -1     # decrement counter
 | 
			
		||||
    bne t0, zero, loop  # and repeat until zero
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user