@@ -58,28 +58,29 @@ def test_signature(self):
58
58
59
59
def test_signature_wrong (self ):
60
60
with self .assertRaisesRegex (TypeError ,
61
- "^`addr_width` must be a non-negative int , not -2$" ):
61
+ r"^Address width must be a non-negative integer , not -2$" ):
62
62
memory .WritePort .Signature (addr_width = - 2 , shape = 8 )
63
63
with self .assertRaisesRegex (TypeError ,
64
- "^Granularity must be a non-negative int or None, not -2$" ):
64
+ r "^Granularity must be a non-negative integer or None, not -2$" ):
65
65
memory .WritePort .Signature (addr_width = 4 , shape = 8 , granularity = - 2 )
66
66
with self .assertRaisesRegex (ValueError ,
67
- "^Granularity cannot be specified with signed shape$" ):
67
+ r "^Granularity cannot be specified for a memory with a signed shape$" ):
68
68
memory .WritePort .Signature (addr_width = 2 , shape = signed (8 ), granularity = 2 )
69
69
with self .assertRaisesRegex (TypeError ,
70
- "^Granularity can only be specified for plain unsigned `Shape` or `ArrayLayout`$" ):
70
+ r"^Granularity can only be specified for memories whose shape is unsigned or "
71
+ r"data.ArrayLayout$" ):
71
72
memory .WritePort .Signature (addr_width = 2 , shape = MyStruct , granularity = 2 )
72
73
with self .assertRaisesRegex (ValueError ,
73
- "^Granularity must be positive$" ):
74
+ r "^Granularity must be positive$" ):
74
75
memory .WritePort .Signature (addr_width = 2 , shape = 8 , granularity = 0 )
75
76
with self .assertRaisesRegex (ValueError ,
76
- "^Granularity must be positive$" ):
77
+ r "^Granularity must be positive$" ):
77
78
memory .WritePort .Signature (addr_width = 2 , shape = data .ArrayLayout (8 , 8 ), granularity = 0 )
78
79
with self .assertRaisesRegex (ValueError ,
79
- "^Granularity must divide data width$" ):
80
+ r "^Granularity must evenly divide data width$" ):
80
81
memory .WritePort .Signature (addr_width = 2 , shape = 8 , granularity = 3 )
81
82
with self .assertRaisesRegex (ValueError ,
82
- "^Granularity must divide data array length$" ):
83
+ r "^Granularity must evenly divide data array length$" ):
83
84
memory .WritePort .Signature (addr_width = 2 , shape = data .ArrayLayout (8 , 8 ), granularity = 3 )
84
85
85
86
def test_signature_eq (self ):
@@ -134,17 +135,17 @@ def test_constructor(self):
134
135
def test_constructor_wrong (self ):
135
136
signature = memory .ReadPort .Signature (shape = 8 , addr_width = 4 )
136
137
with self .assertRaisesRegex (TypeError ,
137
- r"^Expected ` WritePort.Signature` , not ReadPort.Signature\(.*\)$" ):
138
+ r"^Expected signature to be WritePort.Signature, not ReadPort.Signature\(.*\)$" ):
138
139
memory .WritePort (signature , memory = None , domain = "sync" )
139
140
signature = memory .WritePort .Signature (shape = 8 , addr_width = 4 , granularity = 2 )
140
141
with self .assertRaisesRegex (TypeError ,
141
- r"^Domain has to be a string, not None$" ):
142
+ r"^Domain must be a string, not None$" ):
142
143
memory .WritePort (signature , memory = None , domain = None )
143
144
with self .assertRaisesRegex (TypeError ,
144
- r"^Expected ` Memory` or ` None` , not 'a'$" ):
145
+ r"^Expected memory to be Memory or None, not 'a'$" ):
145
146
memory .WritePort (signature , memory = "a" , domain = "sync" )
146
147
with self .assertRaisesRegex (ValueError ,
147
- r"^Write port domain cannot be \"comb\" $" ):
148
+ r"^Write ports cannot be asynchronous $" ):
148
149
memory .WritePort (signature , memory = None , domain = "comb" )
149
150
signature = memory .WritePort .Signature (shape = 8 , addr_width = 4 )
150
151
m = memory .Memory (depth = 8 , shape = 8 , init = [])
@@ -186,7 +187,7 @@ def test_signature(self):
186
187
187
188
def test_signature_wrong (self ):
188
189
with self .assertRaisesRegex (TypeError ,
189
- "^`addr_width` must be a non-negative int , not -2$" ):
190
+ "^Address width must be a non-negative integer , not -2$" ):
190
191
memory .ReadPort .Signature (addr_width = - 2 , shape = 8 )
191
192
192
193
def test_signature_eq (self ):
@@ -245,14 +246,14 @@ def test_constructor(self):
245
246
def test_constructor_wrong (self ):
246
247
signature = memory .WritePort .Signature (shape = 8 , addr_width = 4 )
247
248
with self .assertRaisesRegex (TypeError ,
248
- r"^Expected ` ReadPort.Signature` , not WritePort.Signature\(.*\)$" ):
249
+ r"^Expected signature to be ReadPort.Signature, not WritePort.Signature\(.*\)$" ):
249
250
memory .ReadPort (signature , memory = None , domain = "sync" )
250
251
signature = memory .ReadPort .Signature (shape = 8 , addr_width = 4 )
251
252
with self .assertRaisesRegex (TypeError ,
252
- r"^Domain has to be a string, not None$" ):
253
+ r"^Domain must be a string, not None$" ):
253
254
memory .ReadPort (signature , memory = None , domain = None )
254
255
with self .assertRaisesRegex (TypeError ,
255
- r"^Expected ` Memory` or ` None` , not 'a'$" ):
256
+ r"^Expected memory to be Memory or None, not 'a'$" ):
256
257
memory .ReadPort (signature , memory = "a" , domain = "sync" )
257
258
signature = memory .ReadPort .Signature (shape = 8 , addr_width = 4 )
258
259
m = memory .Memory (depth = 8 , shape = 8 , init = [])
@@ -266,15 +267,15 @@ def test_constructor_wrong(self):
266
267
m = memory .Memory (depth = 16 , shape = 8 , init = [])
267
268
port = m .read_port ()
268
269
with self .assertRaisesRegex (TypeError ,
269
- r"^`transparent_for` must contain only ` WritePort` instances$" ):
270
+ r"^Transparency set must contain only WritePort instances$" ):
270
271
memory .ReadPort (signature , memory = m , domain = "sync" , transparent_for = [port ])
271
272
write_port = m .write_port ()
272
273
m2 = memory .Memory (depth = 16 , shape = 8 , init = [])
273
274
with self .assertRaisesRegex (ValueError ,
274
- r"^Transparent write ports must belong to the same memory$" ):
275
+ r"^Ports in transparency set must belong to the same memory$" ):
275
276
memory .ReadPort (signature , memory = m2 , domain = "sync" , transparent_for = [write_port ])
276
277
with self .assertRaisesRegex (ValueError ,
277
- r"^Transparent write ports must belong to the same domain$" ):
278
+ r"^Ports in transparency set must belong to the same domain$" ):
278
279
memory .ReadPort (signature , memory = m , domain = "other" , transparent_for = [write_port ])
279
280
280
281
0 commit comments