Update virtual memory tests and move to separate folder

This commit is contained in:
Thomas Fleming 2021-03-30 22:18:29 -04:00
parent 7c3963547d
commit 7f7cc73dd3
2 changed files with 19 additions and 8 deletions

View File

@ -40,6 +40,15 @@ module testbench();
string InstrFName, InstrDName, InstrEName, InstrMName, InstrWName; string InstrFName, InstrDName, InstrEName, InstrMName, InstrWName;
//logic [31:0] InstrW; //logic [31:0] InstrW;
logic [`XLEN-1:0] meminit; logic [`XLEN-1:0] meminit;
string tests32mmu[] = '{
"rv32mmu/WALLY-VIRTUALMEMORY", "5000"
};
string tests64mmu[] = '{
"rv64mmu/WALLY-VIRTUALMEMORY", "5000"
};
string tests64a[] = '{ string tests64a[] = '{
"rv64a/WALLY-AMO", "2110", "rv64a/WALLY-AMO", "2110",
"rv64a/WALLY-LRSC", "2110" "rv64a/WALLY-LRSC", "2110"
@ -338,13 +347,14 @@ string tests32i[] = {
initial initial
if (`XLEN == 64) begin // RV64 if (`XLEN == 64) begin // RV64
if(TESTSBP) begin if(TESTSBP) begin
tests = testsBP64; tests = testsBP64;
end else begin end else begin
tests = {tests64i}; tests = {tests64i};
if (`C_SUPPORTED) tests = {tests, tests64ic}; if (`C_SUPPORTED) tests = {tests, tests64ic};
else tests = {tests, tests64iNOc}; else tests = {tests, tests64iNOc};
if (`M_SUPPORTED) tests = {tests, tests64m}; if (`M_SUPPORTED) tests = {tests, tests64m};
if (`A_SUPPORTED) tests = {tests, tests64a}; if (`A_SUPPORTED) tests = {tests, tests64a};
//if (`MEM_VIRTMEM) tests = {tests, tests64mmu};
end end
// tests = {tests64a, tests}; // tests = {tests64a, tests};
end else begin // RV32 end else begin // RV32
@ -354,6 +364,7 @@ string tests32i[] = {
else tests = {tests, tests32iNOc}; else tests = {tests, tests32iNOc};
if (`M_SUPPORTED % 2 == 1) tests = {tests, tests32m}; if (`M_SUPPORTED % 2 == 1) tests = {tests, tests32m};
if (`A_SUPPORTED) tests = {tests, tests32a}; if (`A_SUPPORTED) tests = {tests, tests32a};
//if (`MEM_VIRTMEM) tests = {tests32mmu, tests};
end end
string signame, memfilename; string signame, memfilename;

View File

@ -198,14 +198,14 @@ rv32 = Architecture(32)
rv64 = Architecture(64) rv64 = Architecture(64)
if __name__ == "__main__": if __name__ == "__main__":
arch = rv64 arch = rv32
pgdir = PageTable("page_directory", next_ppn(), arch) pgdir = PageTable("page_directory", next_ppn(), arch)
# Directly map the first 20 pages of RAM # Directly map the first 20 pages of RAM
for page in range(20): for page in range(20):
vaddr = 0x80000000 + (arch.PGSIZE * page) vaddr = 0x80000000 + (arch.PGSIZE * page)
paddr = 0x80000000 + (arch.PGSIZE * page) paddr = 0x80000000 + (arch.PGSIZE * page)
pgdir.add_mapping(vaddr, paddr, PTE_R | PTE_W | PTE_U | PTE_X | PTE_V) pgdir.add_mapping(vaddr, paddr, PTE_D | PTE_A | PTE_R | PTE_W | PTE_U | PTE_X | PTE_V)
""" """
supervisor_pgdir = PageTable("sdir", next_ppn(), rv64) supervisor_pgdir = PageTable("sdir", next_ppn(), rv64)
supervisor_pgdir.add_mapping(0x80000000, 0x80000000, PTE_R | PTE_W | PTE_X) supervisor_pgdir.add_mapping(0x80000000, 0x80000000, PTE_R | PTE_W | PTE_X)