aboutsummaryrefslogtreecommitdiffstats
path: root/techlibs/xilinx/brams_xc4v.txt
blob: 2301835ea7822de89c596f46e362f0ea54e8517f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Block RAMs for Virtex 4+.
# The corresponding mapping files are:
# - brams_xc3sda_map.v: Spartan 3A DSP, Spartan 6
# - brams_xc4v_map.v: Virtex 4
# - brams_xc5v_map.v: Virtex 5
# - brams_xc6v_map.v: Virtex 6, Series 7
# - brams_xcu_map.v: Ultrascale

ram block $__XILINX_BLOCKRAM_TDP_ {
	byte 9;
	ifdef HAS_SIZE_36 {
		option "MODE" "HALF" {
			abits 14;
			widths 1 2 4 9 18 per_port;
			cost 129;
		}
		option "MODE" "FULL" {
			abits 15;
			widths 1 2 4 9 18 36 per_port;
			cost 257;
		}
		ifdef HAS_CASCADE {
			option "MODE" "CASCADE" {
				abits 16;
				# hack to enforce same INIT layout as in the other modes
				widths 1 2 4 9 per_port;
				cost 513;
			}
		}
	} else {
		option "MODE" "FULL" {
			abits 14;
			widths 1 2 4 9 18 36 per_port;
			cost 129;
		}
		ifdef HAS_CASCADE {
			option "MODE" "CASCADE" {
				abits 15;
				widths 1 2 4 9 per_port;
				cost 257;
			}
		}
	}
	init any;
	port srsw "A" "B" {
		option "MODE" "HALF" {
			width mix;
		}
		option "MODE" "FULL" {
			width mix;
		}
		option "MODE" "CASCADE" {
			width mix 1;
		}
		ifdef HAS_ADDRCE {
			# TODO
			# addrce;
		}
		# Spartan 6 and Virtex 6 have a bug where READ_FIRST is not usable with asynchronous clocks.
		ifdef HAS_CONFLICT_BUG {
			option "HAS_RDFIRST" 1 {
				clock posedge "C";
			}
			option "HAS_RDFIRST" 0 {
				clock posedge;
			}
		} else {
			clock posedge;
		}
		clken;
		rdsrst any gated_clken;
		rdinit any;
		portoption "WRITE_MODE" "NO_CHANGE" {
			rdwr no_change;
			option "MODE" "CASCADE" {
				forbid;
			}
		}
		portoption "WRITE_MODE" "WRITE_FIRST" {
			ifdef HAS_SIZE_36 {
				rdwr new;
			} else {
				rdwr new_only;
			}
		}
		ifdef HAS_CONFLICT_BUG {
			option "HAS_RDFIRST" 1 {
				portoption "WRITE_MODE" "READ_FIRST" {
					rdwr old;
					wrtrans all old;
				}
			}
		} else {
			portoption "WRITE_MODE" "READ_FIRST" {
				rdwr old;
				wrtrans all old;
			}
		}
		optional_rw;
	}
}

ifdef HAS_SIZE_36 {
	ram block $__XILINX_BLOCKRAM_SDP_ {
		byte 9;
		option "MODE" "HALF" {
			abits 14;
			widths 1 2 4 9 18 36 per_port;
			cost 129;
		}
		option "MODE" "FULL" {
			abits 15;
			widths 1 2 4 9 18 36 72 per_port;
			cost 257;
		}
		init any;
		port sw "W" {
			ifndef HAS_MIXWIDTH_SDP {
				option "MODE" "HALF" width 36;
				option "MODE" "FULL" width 72;
			}
			ifdef HAS_ADDRCE {
				# TODO
				# addrce;
			}
			# Spartan 6 and Virtex 6 have a bug where READ_FIRST is not usable with asynchronous clocks.
			ifdef HAS_CONFLICT_BUG {
				option "WRITE_MODE" "READ_FIRST" {
					clock posedge "C";
				}
				option "WRITE_MODE" "WRITE_FIRST" {
					clock posedge;
				}
			} else {
				clock posedge;
			}
			clken;
			option "WRITE_MODE" "READ_FIRST" {
				wrtrans all old;
			}
			optional;
		}
		port sr "R" {
			ifndef HAS_MIXWIDTH_SDP {
				option "MODE" "HALF" width 36;
				option "MODE" "FULL" width 72;
			}
			ifdef HAS_ADDRCE {
				# TODO
				# addrce;
			}
			# Spartan 6 and Virtex 6 have a bug where READ_FIRST is not usable with asynchronous clocks.
			ifdef HAS_CONFLICT_BUG {
				option "WRITE_MODE" "READ_FIRST" {
					clock posedge "C";
				}
				option "WRITE_MODE" "WRITE_FIRST" {
					clock posedge;
				}
			} else {
				clock posedge;
			}
			clken;
			rdsrst any gated_clken;
			rdinit any;
			optional;
		}
	}
}