Merge pull request #698 from ross144/main

fixed cachehit logger bug.
This commit is contained in:
David Harris 2024-03-28 11:41:50 -07:00 committed by GitHub
commit 957a618f68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 61 additions and 2 deletions

View File

@ -153,7 +153,7 @@ module loggers import cvw::*; #(parameter cvw_t P,
end end
string AccessTypeString, HitMissString; string AccessTypeString, HitMissString;
always @(*) begin always @(*) begin
HitMissString = dut.core.ifu.bus.icache.icache.CacheHit ? "H" : HitMissString = dut.core.ifu.bus.icache.icache.Hit ? "H" :
dut.core.ifu.bus.icache.icache.vict.cacheLRU.AllValid ? "E" : "M"; dut.core.ifu.bus.icache.icache.vict.cacheLRU.AllValid ? "E" : "M";
end end
always @(posedge clk) begin always @(posedge clk) begin
@ -178,7 +178,7 @@ module loggers import cvw::*; #(parameter cvw_t P,
flop #(1) ResetDReg(clk, reset, resetD); flop #(1) ResetDReg(clk, reset, resetD);
assign resetEdge = ~reset & resetD; assign resetEdge = ~reset & resetD;
always @(*) begin always @(*) begin
HitMissString = dut.core.lsu.bus.dcache.dcache.CacheHit ? "H" : HitMissString = dut.core.lsu.bus.dcache.dcache.Hit ? "H" :
(!dut.core.lsu.bus.dcache.dcache.vict.cacheLRU.AllValid) ? "M" : (!dut.core.lsu.bus.dcache.dcache.vict.cacheLRU.AllValid) ? "M" :
dut.core.lsu.bus.dcache.dcache.LineDirty ? "D" : "E"; dut.core.lsu.bus.dcache.dcache.LineDirty ? "D" : "E";
AccessTypeString = dut.core.lsu.bus.dcache.FlushDCache ? "F" : AccessTypeString = dut.core.lsu.bus.dcache.FlushDCache ? "F" :

View File

@ -0,0 +1,19 @@
TARGETDIR := lpddr_test
TARGET := $(TARGETDIR)/$(TARGETDIR).elf
ROOT := ..
LIBRARY_DIRS := ${ROOT}/crt0
LIBRARY_FILES := crt0
MARCH :=-march=rv64imfdczicbom
MABI :=-mabi=lp64d
LINKER := ${ROOT}/linker8000-0000.x
LINK_FLAGS :=$(MARCH) $(MABI) -nostartfiles -Wl,-Map=$(TARGET).map
CFLAGS =$(MARCH) $(MABI) -Wa,-alhs -Wa,-L -mcmodel=medany -mstrict-align -O2
CC=riscv64-unknown-elf-gcc
DA=riscv64-unknown-elf-objdump -d
include $(ROOT)/makefile.inc

View File

@ -0,0 +1,5 @@
#ifndef __header
#define __header
void lpddr_test();
#endif

View File

@ -0,0 +1,29 @@
.section .text
.globl lpddr_test
.type lpddr_test, @function
lpddr_test:
li t1, 0x90000000
addi t5, t1, 0
li t2, 0xAABBCCDD00112233
li t3, 10
li t4, 0
loop_write:
beq t4, t3, done_write
sd t2, 0(t5)
addi t5, t5, 8
addi t4, t4, 1
j loop_write
done_write:
li t4, 0
addi t5, t1, 0
loop_read:
beq t4, t3, done_read
ld t6, 0(t5)
addi t5, t5, 8
addi t4, t4, 1
j loop_read
done_read:
ret

View File

@ -0,0 +1,6 @@
#include "header.h"
int main(){
lpddr_test();
return 0;
}