Skip to content

Commit

Permalink
dfi: split phase description
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital authored and Sebastien Bourdeauducq committed Jul 10, 2013
1 parent 1d33c61 commit f5ddd33
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions migen/bus/dfi.py
@@ -1,25 +1,37 @@
from migen.fhdl.std import *
from migen.genlib.record import *

def phase_description(a, ba, d):
def phase_cmd_description(a, ba):
return [
("address", a, DIR_M_TO_S),
("bank", ba, DIR_M_TO_S),
("cas_n", 1, DIR_M_TO_S),
("cke", 1, DIR_M_TO_S),
("cs_n", 1, DIR_M_TO_S),
("ras_n", 1, DIR_M_TO_S),
("we_n", 1, DIR_M_TO_S),

("we_n", 1, DIR_M_TO_S)
]

def phase_wrdata_description(d):
return [
("wrdata", d, DIR_M_TO_S),
("wrdata_en", 1, DIR_M_TO_S),
("wrdata_mask", d//8, DIR_M_TO_S),

]

def phase_rddata_description(d):
return [
("rddata_en", 1, DIR_M_TO_S),
("rddata", d, DIR_S_TO_M),
("rddata_valid", 1, DIR_S_TO_M)
]

def phase_description(a, ba, d):
r = phase_cmd_description(a, ba)
r += phase_wrdata_description(d)
r += phase_rddata_description(d)
return r

class Interface(Record):
def __init__(self, a, ba, d, nphases=1):
layout = [("p"+str(i), phase_description(a, ba, d)) for i in range(nphases)]
Expand Down

0 comments on commit f5ddd33

Please sign in to comment.