Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

dfi: split phase description

  • Loading branch information...
commit f5ddd33e7ead91d798c48b90b158ca6b64c39615 1 parent 1d33c61
EnjoyDigital authored July 10, 2013 sbourdeauducq committed July 10, 2013

Showing 1 changed file with 16 additions and 4 deletions. Show diff stats Hide diff stats

  1. 20  migen/bus/dfi.py
20  migen/bus/dfi.py
... ...
@@ -1,7 +1,7 @@
1 1
 from migen.fhdl.std import *
2 2
 from migen.genlib.record import *
3 3
 
4  
-def phase_description(a, ba, d):
  4
+def phase_cmd_description(a, ba):
5 5
 	return [
6 6
 		("address",			a,		DIR_M_TO_S),	
7 7
 		("bank",			ba,		DIR_M_TO_S),
@@ -9,17 +9,29 @@ def phase_description(a, ba, d):
9 9
 		("cke",				1,		DIR_M_TO_S),
10 10
 		("cs_n",			1,		DIR_M_TO_S),
11 11
 		("ras_n",			1,		DIR_M_TO_S),
12  
-		("we_n",			1,		DIR_M_TO_S),
13  
-		
  12
+		("we_n",			1,		DIR_M_TO_S)
  13
+	]
  14
+
  15
+def phase_wrdata_description(d):
  16
+	return [
14 17
 		("wrdata",			d,		DIR_M_TO_S),
15 18
 		("wrdata_en",		1,		DIR_M_TO_S),
16 19
 		("wrdata_mask",		d//8,	DIR_M_TO_S),
17  
-		
  20
+	]
  21
+
  22
+def phase_rddata_description(d):
  23
+	return [
18 24
 		("rddata_en",		1,		DIR_M_TO_S),
19 25
 		("rddata",			d,		DIR_S_TO_M),
20 26
 		("rddata_valid",	1,		DIR_S_TO_M)
21 27
 	]
22 28
 
  29
+def phase_description(a, ba, d):
  30
+	r = phase_cmd_description(a, ba)
  31
+	r += phase_wrdata_description(d)
  32
+	r += phase_rddata_description(d)
  33
+	return r
  34
+
23 35
 class Interface(Record):
24 36
 	def __init__(self, a, ba, d, nphases=1):
25 37
 		layout = [("p"+str(i), phase_description(a, ba, d)) for i in range(nphases)]

0 notes on commit f5ddd33

Please sign in to comment.
Something went wrong with that request. Please try again.