lasmicon: use namedtuple
This commit is contained in:
parent
e5737331ec
commit
8504313572
|
@ -1,3 +1,5 @@
|
||||||
|
from collections import namedtuple
|
||||||
|
|
||||||
from migen.fhdl.std import *
|
from migen.fhdl.std import *
|
||||||
from migen.bus import dfi, lasmibus
|
from migen.bus import dfi, lasmibus
|
||||||
|
|
||||||
|
@ -5,35 +7,15 @@ from milkymist.lasmicon.refresher import *
|
||||||
from milkymist.lasmicon.bankmachine import *
|
from milkymist.lasmicon.bankmachine import *
|
||||||
from milkymist.lasmicon.multiplexer import *
|
from milkymist.lasmicon.multiplexer import *
|
||||||
|
|
||||||
class PhySettings:
|
PhySettings = namedtuple("PhySettings", "dfi_d nphases rdphase wrphase")
|
||||||
def __init__(self, dfi_d, nphases, rdphase, wrphase):
|
|
||||||
self.dfi_d = dfi_d
|
|
||||||
self.nphases = nphases
|
|
||||||
self.rdphase = rdphase
|
|
||||||
self.wrphase = wrphase
|
|
||||||
|
|
||||||
class GeomSettings:
|
class GeomSettings(namedtuple("_GeomSettings", "bank_a row_a col_a")):
|
||||||
def __init__(self, bank_a, row_a, col_a):
|
def __init__(self, *args, **kwargs):
|
||||||
self.bank_a = bank_a
|
self.mux_a = max(self.row_a, self.col_a)
|
||||||
self.row_a = row_a
|
|
||||||
self.col_a = col_a
|
|
||||||
self.mux_a = max(row_a, col_a)
|
|
||||||
|
|
||||||
class TimingSettings:
|
TimingSettings = namedtuple("TimingSettings", "tRP tRCD tWR tWTR tREFI tRFC" \
|
||||||
def __init__(self, tRP, tRCD, tWR, tWTR, tREFI, tRFC, read_latency, write_latency, req_queue_size, read_time, write_time):
|
" read_latency write_latency" \
|
||||||
self.tRP = tRP
|
" req_queue_size read_time write_time")
|
||||||
self.tRCD = tRCD
|
|
||||||
self.tWR = tWR
|
|
||||||
self.tWTR = tWTR
|
|
||||||
self.tREFI = tREFI
|
|
||||||
self.tRFC = tRFC
|
|
||||||
|
|
||||||
self.read_latency = read_latency
|
|
||||||
self.write_latency = write_latency
|
|
||||||
|
|
||||||
self.req_queue_size = req_queue_size
|
|
||||||
self.read_time = read_time
|
|
||||||
self.write_time = write_time
|
|
||||||
|
|
||||||
class LASMIcon(Module):
|
class LASMIcon(Module):
|
||||||
def __init__(self, phy_settings, geom_settings, timing_settings):
|
def __init__(self, phy_settings, geom_settings, timing_settings):
|
||||||
|
|
Loading…
Reference in New Issue