/ coreblocks / cache / iface.py
iface.py
 1  from typing import Protocol
 2  
 3  from transactron import Method
 4  
 5  from amaranth_types import HasElaborate
 6  
 7  __all__ = ["CacheInterface", "CacheRefillerInterface"]
 8  
 9  
10  class CacheInterface(HasElaborate, Protocol):
11      """
12      Cache Interface.
13  
14      Parameters
15      ----------
16      issue_req : Method
17          A method that is used to issue a cache lookup request.
18      accept_res : Method
19          A method that is used to accept the result of a cache lookup request.
20      flush : Method
21          A method that is used to flush the whole cache.
22      """
23  
24      issue_req: Method
25      accept_res: Method
26      flush: Method
27  
28  
29  class CacheRefillerInterface(HasElaborate, Protocol):
30      """
31      Cache Refiller Interface.
32  
33      Parameters
34      ----------
35      start_refill : Method
36          A method that is used to start a refill for a given cache line.
37      accept_refill : Method
38          A method that is used to accept one fetch block from the requested cache line.
39      """
40  
41      start_refill: Method
42      accept_refill: Method