@@ -31,9 +31,10 @@ def _make_custom(self):
3131 self .data ['device' ] = info ['device' ]
3232 self .data ['speed' ] = info ['speed' ]
3333 self .data ['package' ] = info ['package' ]
34+ self .data ['prange' ] = info ['prange' ]
3435
3536 def _prog_custom (self ):
36- raise NotImplementedError ('Libero programming not supported' )
37+ raise NotImplementedError ('Libero programming not supported yet ' )
3738
3839
3940# pylint: disable=duplicate-code
@@ -42,7 +43,7 @@ def get_info(part):
4243 """Get info about the FPGA part.
4344
4445 :param part: the FPGA part as specified by the tool
45- :returns: a dictionary with the keys family, device, speed and package
46+ :returns: a dict with the keys family, device, speed, package and prange
4647 """
4748 part = part .lower ()
4849 # Looking for the family
@@ -51,6 +52,7 @@ def get_info(part):
5152 r'm2s' : 'SmartFusion2' ,
5253 r'm2gl' : 'Igloo2' ,
5354 r'rt4g' : 'RTG4' ,
55+ r'mpfs' : 'PolarFireSoC' ,
5456 r'mpf' : 'PolarFire' ,
5557 r'a2f' : 'SmartFusion' ,
5658 r'afs' : 'Fusion' ,
@@ -65,10 +67,11 @@ def get_info(part):
6567 if re .match (key , part ):
6668 family = value
6769 break
68- # Looking for the device and package
70+ # Looking for the device, speed and package
6971 device = None
7072 speed = None
7173 package = None
74+ prange = None
7275 aux = part .split ('-' )
7376 if len (aux ) == 2 :
7477 device = aux [0 ]
@@ -86,7 +89,25 @@ def get_info(part):
8689 raise ValueError (
8790 'Part must be DEVICE-SPEED-PACKAGE or DEVICE-PACKAGE'
8891 )
92+ # Looking for a part_range
93+ pranges = {
94+ 'c' : 'COM' ,
95+ 'e' : 'EXT' ,
96+ 'i' : 'IND' ,
97+ 'm' : 'MIL' ,
98+ 't1' : 'TGrade1'
99+ }
100+ prange = 'COM'
101+ for suffix , name in pranges .items ():
102+ if package .endswith (suffix ):
103+ package = package [:- len (suffix )]
104+ prange = name
105+ break
89106 # Finish
90107 return {
91- 'family' : family , 'device' : device , 'speed' : speed , 'package' : package
108+ 'family' : family ,
109+ 'device' : device ,
110+ 'speed' : speed ,
111+ 'package' : package ,
112+ 'prange' : prange
92113 }
0 commit comments