-from nmigen import Cat, Memory, Module, Signal
+from nmigen import Cat, Memory, Module, Signal, Elaboratable
from nmigen.cli import main
from nmigen.cli import verilog, rtlil
-class MemorySet:
+
+class MemorySet(Elaboratable):
def __init__(self, data_size, tag_size, set_count, active):
self.active = active
input_size = tag_size + data_size # Size of the input data
m.d.comb += write_port.addr.eq(self.cset)
m.d.comb += write_port.data.eq(Cat(1, self.data_i, self.tag))
- return m
\ No newline at end of file
+ return m
import sys
sys.path.append("../src/ariane")
-from nmigen import Array, Cat, Memory, Module, Signal, Mux
+from nmigen import Array, Cat, Memory, Module, Signal, Mux, Elaboratable
from nmigen.compat.genlib import fsm
from nmigen.cli import main
from nmigen.cli import verilog, rtlil
SA_RD = "01" # read
SA_WR = "10" # write
-class SetAssociativeCache():
+
+class SetAssociativeCache(Elaboratable):
""" Set Associative Cache Memory
The purpose of this module is to generate a memory cache given the
+from nmigen import Signal, Module, Cat, Const, Elaboratable
from math import log2
-from nmigen import Signal, Module, Cat, Const
from ptw import TLBUpdate, PTE, ASID_WIDTH
-class PLRU:
+class PLRU(Elaboratable):
""" PLRU - Pseudo Least Recently Used Replacement
PLRU-tree indexing:
replace.append(~Cat(*en).bool())
m.d.comb += self.replace_en_o.eq(Cat(*replace))
- return m
\ No newline at end of file
+ return m