forked from openhwgroup/cvw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request openhwgroup#1021 from jordancarlin/gcc14
Update to GCC 14
- Loading branch information
Showing
36 changed files
with
590 additions
and
604 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,43 @@ | ||
CEXT := c | ||
CPPEXT := cpp | ||
AEXT := s | ||
SEXT := S | ||
SRCEXT := \([$(CEXT)$(AEXT)$(SEXT)]\|$(CPPEXT)\) | ||
#SRCS = $(wildcard *.S) | ||
#PROGS = $(patsubst %.S,%,$(SRCS)) | ||
SRCDIR = . | ||
SRCEXT = S | ||
# Disable builtin rules because they are a shorter (but incorrect) path that Make will use by default | ||
MAKEFLAGS += --no-builtin-rules | ||
SRCDIR := . | ||
SRCEXT := S | ||
AEXT := s | ||
OBJEXT := o | ||
EXEEXT := elf | ||
SOURCES ?= $(shell find $(SRCDIR) -type f -regex ".*\.$(SRCEXT)" | sort) | ||
OBJEXT = elf | ||
OBJECTS := $(SOURCES:.$(SEXT)=.$(OBJEXT)) | ||
ELFS := $(SOURCES:.$(SRCEXT)=.$(EXEEXT)) | ||
OBJDUMPS := $(addsuffix .objdump, $(ELFS)) | ||
MEMFILES := $(addsuffix .memfile, $(ELFS)) | ||
|
||
all: $(OBJECTS) | ||
all: $(OBJDUMPS) $(MEMFILES) | ||
|
||
# Create dissassembly | ||
%.elf.objdump: %.elf | ||
riscv64-unknown-elf-objdump -S -D $< > $@ | ||
extractFunctionRadix.sh $@ | ||
|
||
# Change many things if bit width isn't 64 | ||
%.elf: $(SRCDIR)/%.$(SEXT) WALLY-init-lib.h Makefile | ||
riscv64-unknown-elf-gcc -g -o $@ -march=rv64gqc_zfa_zba_zbb_zbc_zbs_zfh_zicboz_zicbop_zicbom_zbkb_zbkx_zknd_zkne_zknh -mabi=lp64 -mcmodel=medany \ | ||
-nostartfiles -T../../examples/link/link.ld $< | ||
riscv64-unknown-elf-objdump -S -D $@ > $@.objdump | ||
riscv64-unknown-elf-elf2hex --bit-width 64 --input $@ --output $@.memfile | ||
extractFunctionRadix.sh $@.objdump | ||
|
||
sim: %.elf | ||
# Create memfile | ||
%.elf.memfile: %.elf | ||
riscv64-unknown-elf-elf2hex --bit-width 64 --input $< --output $@ | ||
|
||
# Link object file to create executable | ||
.PRECIOUS: %.$(EXEEXT) | ||
%.$(EXEEXT): %.$(OBJEXT) | ||
riscv64-unknown-elf-gcc -g -o $@ -mcmodel=medany -nostartfiles -T../../examples/link/link.ld $*.o | ||
|
||
# Assemble into object files | ||
%.$(OBJEXT): %.$(AEXT) | ||
riscv64-unknown-elf-as -g -o $@ -march=rv64gqc_zfa_zba_zbb_zbc_zbs_zfh_zicboz_zicbop_zicbom_zbkb_zbkx_zknd_zkne_zknh -mabi=lp64 $< | ||
|
||
# Preprocess assembly files | ||
%.$(AEXT): %.$(SRCEXT) WALLY-init-lib.h | ||
riscv64-unknown-elf-gcc -E -g -o $@ $< | ||
|
||
sim: %.$(EXEEXT) | ||
spike +signature=%.signature.output +signature-granularity=8 %.elf | ||
diff --ignore-case %.signature.output %.reference_output || exit | ||
echo "Signature matches! Success!" | ||
|
||
clean: | ||
rm -f *.elf *.objdump *.signature.output *.addr *.lab *.memfile | ||
|
||
|
||
|
||
rm -f *.elf *.objdump *.signature.output *.addr *.lab *.memfile *.o *.s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,31 +4,31 @@ | |
# Written: [email protected] 18 April 2023 | ||
# | ||
# Purpose: Test Coverage for D$ | ||
# (For each way, trigger a CacheDataMem write enable while chip enable is low) | ||
# (For each way, trigger a CacheDataMem write enable while chip enable is low) | ||
# | ||
# A component of the CORE-V-WALLY configurable RISC-V project. | ||
# | ||
# | ||
# Copyright (C) 2021-23 Harvey Mudd College & Oklahoma State University | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 | ||
# | ||
# Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file | ||
# except in compliance with the License, or, at your option, the Apache License version 2.0. You | ||
# Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file | ||
# except in compliance with the License, or, at your option, the Apache License version 2.0. You | ||
# may obtain a copy of the License at | ||
# | ||
# https://solderpad.org/licenses/SHL-2.1/ | ||
# | ||
# Unless required by applicable law or agreed to in writing, any work distributed under the | ||
# License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
# either express or implied. See the License for the specific language governing permissions | ||
# Unless required by applicable law or agreed to in writing, any work distributed under the | ||
# License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
# either express or implied. See the License for the specific language governing permissions | ||
# and limitations under the License. | ||
################################################ | ||
|
||
import os | ||
|
||
test_name = "dcache1.S" | ||
dcache_num_ways = 4 | ||
dcache_way_size_in_bytes = 4096 | ||
dcache_way_size_in_bytes = 4096 | ||
# warning i$ line size is not currently parameterized. | ||
|
||
# arbitrary start location of where I send stores to. | ||
|
@@ -48,7 +48,7 @@ def wl(line="", comment=None, fname=test_name): | |
to_write = " " * indent + line + comment + "\n" | ||
f.write(to_write) | ||
|
||
|
||
def write_repro_instrs(): | ||
""" | ||
Assumes that the store location has been fetched to d$, and is in t0. | ||
|
@@ -72,7 +72,7 @@ def write_repro_instrs(): | |
wl(comment="This file is generated by dcache1.py (run that script manually)") | ||
wl('#include "WALLY-init-lib.h"') | ||
wl('main:') | ||
|
||
# excercise all 4 D$ ways. If they're not all full, it uses the first empty. | ||
# So we are sure all 4 ways are exercised. | ||
for i in range(dcache_num_ways): | ||
|
@@ -82,5 +82,5 @@ def write_repro_instrs(): | |
wl(comment=f"i$ boundary, way test #{i+1}") | ||
write_repro_instrs() | ||
mem_addr += dcache_way_size_in_bytes # so that we excercise a new D$ way. | ||
|
||
wl("j done") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,47 +4,47 @@ | |
// Written: [email protected] 18 April 2023 | ||
// | ||
// Purpose: Test Coverage for D$ | ||
// (for all 4 cache ways, trigger a FlushStage while SetDirtyWay=1) | ||
// (for all 4 cache ways, trigger a FlushStage while SetDirtyWay=1) | ||
// | ||
// A component of the CORE-V-WALLY configurable RISC-V project. | ||
// https://github.com/openhwgroup/cvw | ||
// | ||
// | ||
// Copyright (C) 2021-23 Harvey Mudd College & Oklahoma State University | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 | ||
// | ||
// Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file | ||
// except in compliance with the License, or, at your option, the Apache License version 2.0. You | ||
// Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file | ||
// except in compliance with the License, or, at your option, the Apache License version 2.0. You | ||
// may obtain a copy of the License at | ||
// | ||
// https://solderpad.org/licenses/SHL-2.1/ | ||
// | ||
// Unless required by applicable law or agreed to in writing, any work distributed under the | ||
// License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
// either express or implied. See the License for the specific language governing permissions | ||
// Unless required by applicable law or agreed to in writing, any work distributed under the | ||
// License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, | ||
// either express or implied. See the License for the specific language governing permissions | ||
// and limitations under the License. | ||
//////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#include "WALLY-init-lib.h" | ||
main: | ||
// way 0 | ||
// way 0 | ||
li t0, 0x80100770 | ||
sd zero, 0(t0) | ||
sd zero, 1(t0) | ||
|
||
// way 1 | ||
// way 1 | ||
li t0, 0x80101770 | ||
sd zero, 0(t0) | ||
sd zero, 1(t0) | ||
|
||
// way 2 | ||
// way 2 | ||
li t0, 0x80102770 | ||
sd zero, 0(t0) | ||
sd zero, 0(t0) | ||
sd zero, 1(t0) | ||
|
||
// way 3 | ||
li t0, 0x80103770 | ||
sd zero, 0(t0) | ||
sd zero, 1(t0) | ||
|
||
j done |
Oops, something went wrong.