From 0994d03b28c7363d3d04b19c0e257dac55cab88c Mon Sep 17 00:00:00 2001 From: Thomas Fleming Date: Tue, 30 Mar 2021 22:18:29 -0400 Subject: [PATCH] Update virtual memory tests and move to separate folder --- .../testbench/testbench-imperas.sv | 23 ++++++++++++++----- .../testgen/virtual_memory_util.py | 4 ++-- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/wally-pipelined/testbench/testbench-imperas.sv b/wally-pipelined/testbench/testbench-imperas.sv index 2f6f0efb..f50f700c 100644 --- a/wally-pipelined/testbench/testbench-imperas.sv +++ b/wally-pipelined/testbench/testbench-imperas.sv @@ -40,6 +40,15 @@ module testbench(); string InstrFName, InstrDName, InstrEName, InstrMName, InstrWName; //logic [31:0] InstrW; logic [`XLEN-1:0] meminit; + + string tests32mmu[] = '{ + "rv32mmu/WALLY-VIRTUALMEMORY", "5000" + }; + + string tests64mmu[] = '{ + "rv64mmu/WALLY-VIRTUALMEMORY", "5000" + }; + string tests64a[] = '{ "rv64a/WALLY-AMO", "2110", "rv64a/WALLY-LRSC", "2110" @@ -338,13 +347,14 @@ string tests32i[] = { initial if (`XLEN == 64) begin // RV64 if(TESTSBP) begin - tests = testsBP64; + tests = testsBP64; end else begin - tests = {tests64i}; - if (`C_SUPPORTED) tests = {tests, tests64ic}; - else tests = {tests, tests64iNOc}; - if (`M_SUPPORTED) tests = {tests, tests64m}; - if (`A_SUPPORTED) tests = {tests, tests64a}; + tests = {tests64i}; + if (`C_SUPPORTED) tests = {tests, tests64ic}; + else tests = {tests, tests64iNOc}; + if (`M_SUPPORTED) tests = {tests, tests64m}; + if (`A_SUPPORTED) tests = {tests, tests64a}; + //if (`MEM_VIRTMEM) tests = {tests, tests64mmu}; end // tests = {tests64a, tests}; end else begin // RV32 @@ -354,6 +364,7 @@ string tests32i[] = { else tests = {tests, tests32iNOc}; if (`M_SUPPORTED % 2 == 1) tests = {tests, tests32m}; if (`A_SUPPORTED) tests = {tests, tests32a}; + //if (`MEM_VIRTMEM) tests = {tests32mmu, tests}; end string signame, memfilename; diff --git a/wally-pipelined/testgen/virtual_memory_util.py b/wally-pipelined/testgen/virtual_memory_util.py index 86db339b..758e0faf 100644 --- a/wally-pipelined/testgen/virtual_memory_util.py +++ b/wally-pipelined/testgen/virtual_memory_util.py @@ -198,14 +198,14 @@ rv32 = Architecture(32) rv64 = Architecture(64) if __name__ == "__main__": - arch = rv64 + arch = rv32 pgdir = PageTable("page_directory", next_ppn(), arch) # Directly map the first 20 pages of RAM for page in range(20): vaddr = 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.add_mapping(0x80000000, 0x80000000, PTE_R | PTE_W | PTE_X)