99from chipflow_lib import ChipFlowError
1010from chipflow_lib .platforms .utils import (
1111 _chipflow_schema_uri ,
12- _PinAnnotationModel ,
13- _PinAnnotation ,
12+ _IOAnnotationModel ,
13+ _IOAnnotation ,
1414 PIN_ANNOTATION_SCHEMA ,
1515 IOSignature ,
1616 _Side ,
@@ -36,24 +36,24 @@ def test_side_str(self):
3636 self .assertEqual (str (side ), side .name )
3737
3838 def test_pin_annotation_model (self ):
39- """Test _PinAnnotationModel class"""
39+ """Test _IOAnnotationModel class"""
4040 # Test initialization
41- model = _PinAnnotationModel (direction = io .Direction .Output , width = 32 , options = {"opt1" : "val1" })
41+ model = _IOAnnotationModel (direction = io .Direction .Output , width = 32 , options = {"opt1" : "val1" })
4242
4343 # Check properties
4444 self .assertEqual (model .direction , "o" )
4545 self .assertEqual (model .width , 32 )
4646 self .assertEqual (model .options , {"opt1" : "val1" })
4747
4848 # Test _annotation_schema class method
49- schema = _PinAnnotationModel ._annotation_schema ()
49+ schema = _IOAnnotationModel ._annotation_schema ()
5050 self .assertEqual (schema ["$schema" ], "https://json-schema.org/draft/2020-12/schema" )
5151 self .assertEqual (schema ["$id" ], PIN_ANNOTATION_SCHEMA )
5252
5353 def test_pin_annotation (self ):
54- """Test _PinAnnotation class"""
54+ """Test _IOAnnotation class"""
5555 # Test initialization
56- annotation = _PinAnnotation (direction = io .Direction .Input , width = 16 )
56+ annotation = _IOAnnotation (direction = io .Direction .Input , width = 16 )
5757
5858 # Check model
5959 self .assertEqual (annotation .model .direction , "i" )
@@ -103,26 +103,26 @@ def test_pin_signature_annotations(self):
103103 self .assertIsInstance (annotations , tuple )
104104 self .assertGreater (len (annotations ), 0 )
105105
106- # Find PinAnnotation in annotations
106+ # Find IOAnnotation in annotations
107107 pin_annotation = None
108108 for annotation in annotations :
109- if isinstance (annotation , _PinAnnotation ):
109+ if isinstance (annotation , _IOAnnotation ):
110110 pin_annotation = annotation
111111 break
112112
113- # Verify the PinAnnotation was found and has correct values
114- self .assertIsNotNone (pin_annotation , "PinAnnotation not found in annotations" )
113+ # Verify the IOAnnotation was found and has correct values
114+ self .assertIsNotNone (pin_annotation , "IOAnnotation not found in annotations" )
115115 self .assertEqual (pin_annotation .model .direction , "o" )
116116 self .assertEqual (pin_annotation .model .width , 8 )
117117 self .assertEqual (pin_annotation .model .options ["init" ], 42 )
118118
119119 # Call multiple times to ensure we don't get duplicate annotations
120120 annotations1 = sig .annotations (mock_obj )
121121 annotations2 = sig .annotations (mock_obj )
122- # Count PinAnnotations in each result
123- count1 = sum (1 for a in annotations1 if isinstance (a , _PinAnnotation ))
124- count2 = sum (1 for a in annotations2 if isinstance (a , _PinAnnotation ))
125- # Should have exactly one PinAnnotation in each result
122+ # Count IOAnnotations in each result
123+ count1 = sum (1 for a in annotations1 if isinstance (a , _IOAnnotation ))
124+ count2 = sum (1 for a in annotations2 if isinstance (a , _IOAnnotation ))
125+ # Should have exactly one IOAnnotation in each result
126126 self .assertEqual (count1 , 1 )
127127 self .assertEqual (count2 , 1 )
128128
0 commit comments