Merge pull request #307 from sergachev/master

change >512 B CSR memory exception to a warning
This commit is contained in:
enjoy-digital 2019-11-15 18:17:35 +01:00 committed by GitHub
commit 888fd55bd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -86,7 +86,7 @@ class SRAM(Module):
mem = Memory(data_width, mem_or_size//(data_width//8), init=init)
mem_size = int(mem.width*mem.depth/8)
if mem_size > 512:
raise ValueError("Memory too large to fit in CSR region ({} > 512 bytes)".format(mem_size))
print("WARNING: memory > 512 bytes in CSR region requires paged access".format(mem_size))
csrw_per_memw = (mem.width + data_width - 1)//data_width
word_bits = log2_int(csrw_per_memw)
page_bits = log2_int((mem.depth*csrw_per_memw + 511)//512, False)