add Config Fetch interface and quick unit test
[soc.git] / src / soc / config / ifetch.py
1 """ConfigureableFetchUnit and ConfigMemoryPortInterface
2
3 allows the type of FetchUnit to be run-time selectable
4
5 this allows the same code to be used for both small unit tests
6 as well as larger ones and so on, without needing large amounts
7 of unnecessarily-duplicated code
8 """
9 from soc.experiment.imem import TestMemFetchUnit
10 #from soc.bus.test.test_minerva import TestSRAMBareFetchUnit
11
12
13 class ConfigFetchUnit:
14 def __init__(self, pspec):
15 fudict = {'testmem': TestMemFetchUnit,
16 #'test_bare_wb': TestSRAMBareFetchUnit,
17 #'test_cache_wb': TestCacheFetchUnit
18 }
19 fukls = fudict[pspec.imem_ifacetype]
20 self.fu = fukls(addr_wid=pspec.addr_wid, # address range
21 data_wid=pspec.reg_wid) # data bus width
22