asmicon: move slot time to timing settings
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Sun, 18 Mar 2012 13:57:31 +0000 (14:57 +0100)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Sun, 18 Mar 2012 13:57:31 +0000 (14:57 +0100)
milkymist/asmicon/__init__.py
top.py

index db68776f19df50a2e56cd6cc95f4e4e811942d39..376d450c262dec331abfcc3d087ba475467b6a04 100644 (file)
@@ -20,14 +20,15 @@ class GeomSettings:
                self.mux_a = max(row_a, col_a)
 
 class TimingSettings:
-       def __init__(self, tRP, tRCD, tREFI, tRFC):
+       def __init__(self, tRP, tRCD, tREFI, tRFC, slot_time):
                self.tRP = tRP
                self.tRCD = tRCD
                self.tREFI = tREFI
                self.tRFC = tRFC
+               self.slot_time = slot_time
 
 class ASMIcon:
-       def __init__(self, phy_settings, geom_settings, timing_settings, time=0):
+       def __init__(self, phy_settings, geom_settings, timing_settings):
                self.phy_settings = phy_settings
                self.geom_settings = geom_settings
                self.timing_settings = timing_settings
@@ -41,7 +42,7 @@ class ASMIcon:
                self.address_align = log2_int(burst_length)
                aw = self.geom_settings.bank_a + self.geom_settings.row_a + self.geom_settings.col_a - self.address_align
                dw = self.phy_settings.dfi_d*self.phy_settings.nphases
-               self.hub = asmibus.Hub(aw, dw, time)
+               self.hub = asmibus.Hub(aw, dw, self.timing_settings.slot_time)
        
        def finalize(self):
                if self.finalized:
diff --git a/top.py b/top.py
index 9c6edbd4b3c05952939c7f8f5eab3302c043dbe5..2cdf56b0b3e9839f9740411a90cc700fb4afde4f 100644 (file)
--- a/top.py
+++ b/top.py
@@ -34,7 +34,8 @@ sdram_timing = asmicon.TimingSettings(
        tRP=ns(15),
        tRCD=ns(15),
        tREFI=ns(7800, False),
-       tRFC=ns(70)
+       tRFC=ns(70),
+       slot_time=16
 )
 
 def ddrphy_clocking(crg, phy):
@@ -52,7 +53,7 @@ def get():
        #
        # ASMI
        #
-       asmicon0 = asmicon.ASMIcon(sdram_phy, sdram_geom, sdram_timing, 16)
+       asmicon0 = asmicon.ASMIcon(sdram_phy, sdram_geom, sdram_timing)
        asmiport_wb = asmicon0.hub.get_port()
        asmicon0.finalize()