mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Merge pull request #709 from slmnemo/main
Added ability to build linux testvectors directly using the makefile in the linux directory; UART outfile when performing a Linux boot test on the testbench
This commit is contained in:
commit
65fc8f6d51
@ -1 +1 @@
|
||||
Subproject commit 8a0cdceca9f0b91b81905eb8497f6586bf8d1c6b
|
||||
Subproject commit 8a52b016dbe1e2733cc168b9d6e5c93e39059d4d
|
@ -1,4 +1,3 @@
|
||||
RISCV := /opt/riscv
|
||||
#BUILDROOT := ${RISCV}/buildroot-test
|
||||
BUILDROOT := buildroot
|
||||
IMAGES := ${BUILDROOT}/output/images
|
||||
@ -32,6 +31,8 @@ OBJDUMPS := $(foreach name, $(OBJDUMPS), $(DIS)/$(name).objdump)
|
||||
|
||||
all: clean download Image disassemble install
|
||||
|
||||
all_nosudo: clean download Image disassemble install_nosudo
|
||||
|
||||
Image:
|
||||
bash -c "unset LD_LIBRARY_PATH; make -C $(BUILDROOT) --jobs;"
|
||||
$(MAKE) generate
|
||||
@ -40,6 +41,18 @@ install:
|
||||
sudo rm -rf $(RISCV)/$(BUILDROOT)
|
||||
sudo mv $(BUILDROOT) $(RISCV)/$(BUILDROOT)
|
||||
|
||||
install_nosudo:
|
||||
rm -rf $(RISCV)/$(BUILDROOT)
|
||||
mv $(BUILDROOT) $(RISCV)/$(BUILDROOT)
|
||||
|
||||
dumptvs:
|
||||
sudo mkdir -p $(RISCV)/linux-testvectors
|
||||
cd testvector-generation; sudo ./genInitMem.sh
|
||||
|
||||
dumptvs_nosudo:
|
||||
mkdir -p $(RISCV)/linux-testvectors
|
||||
cd testvector-generation; ./genInitMem.sh
|
||||
|
||||
# Temp rule for debugging
|
||||
test:
|
||||
echo $(shell find $(BUILDROOT)/output/build -maxdepth 2 -type d -regex ".*/linux-[0-9]+\.[0-9]+\.[0-9]+$$")
|
||||
|
@ -61,7 +61,7 @@ else:
|
||||
|
||||
def getBuildrootTC(boot):
|
||||
INSTR_LIMIT = 1000000 # multiple of 100000; 4M is interesting because it gets into the kernel and enabling VM
|
||||
MAX_EXPECTED = 246000000 # *** TODO: replace this with a search for the login prompt.
|
||||
MAX_EXPECTED = 591000000 # *** TODO: replace this with a search for the login prompt.
|
||||
if boot:
|
||||
name="buildrootboot"
|
||||
BRcmd="vsim > {} -c <<!\ndo wally.do buildroot buildroot-no-trace $RISCV 0 1 0\n!"
|
||||
|
@ -7,4 +7,4 @@ export OTHERFLAGS="+TRACE2LOG_ENABLE=1 +TRACE2LOG_AFTER=100"
|
||||
#export OTHERFLAGS="+TRACE2LOG_ENABLE=1 +TRACE2LOG_AFTER=10500000"
|
||||
#export OTHERFLAGS=""
|
||||
|
||||
vsim -do "do wally-linux-imperas.do buildroot buildroot $::env(RISCV) 0 0 0"
|
||||
vsim -c -do "do wally-linux-imperas.do buildroot buildroot $::env(RISCV) 0 0 0"
|
||||
|
@ -236,7 +236,7 @@ module testbench;
|
||||
logic ResetCntRst;
|
||||
logic CopyRAM;
|
||||
|
||||
string signame, memfilename, bootmemfilename, pathname;
|
||||
string signame, memfilename, bootmemfilename, uartoutfilename, pathname;
|
||||
integer begin_signature_addr, end_signature_addr, signature_size;
|
||||
|
||||
assign ResetThreshold = 3'd5;
|
||||
@ -328,6 +328,8 @@ module testbench;
|
||||
else if(TEST == "buildroot") begin
|
||||
memfilename = {RISCV_DIR, "/linux-testvectors/ram.bin"};
|
||||
bootmemfilename = {RISCV_DIR, "/linux-testvectors/bootmem.bin"};
|
||||
uartoutfilename = {"logs/",TEST,"_uart.out"};
|
||||
$system("rm ",uartoutfilename); // Delete existing UARToutfile
|
||||
end
|
||||
else memfilename = {pathname, tests[test], ".elf.memfile"};
|
||||
if (riscofTest) begin
|
||||
@ -568,6 +570,16 @@ module testbench;
|
||||
.clk(clk), .ProgramAddrMapFile(ProgramAddrMapFile), .ProgramLabelMapFile(ProgramLabelMapFile));
|
||||
end
|
||||
|
||||
// Append UART output to file for tests
|
||||
always @(posedge clk) begin
|
||||
if (TEST == "buildroot") begin
|
||||
if (~dut.uncore.uncore.uart.uart.MEMWb & dut.uncore.uncore.uart.uart.u.A == 3'b000 & ~dut.uncore.uncore.uart.uart.u.DLAB) begin
|
||||
memFile = $fopen(uartoutfilename, "ab");
|
||||
$fwrite(memFile, "%c", dut.uncore.uncore.uart.uart.u.Din);
|
||||
$fclose(memFile);
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
// Termination condition
|
||||
// terminate on a specific ECALL after li x3,1 for old Imperas tests, *** remove this when old imperas tests are removed
|
||||
|
Loading…
Reference in New Issue
Block a user