@@ -43,14 +43,14 @@ def __init__( # pylint: disable=too-many-arguments
4343 pre_config = None ,
4444 post_check = None ,
4545 attributes = None ,
46- vhdl_configuration_name = None ,
46+ vhdl_config_name = None ,
4747 ):
4848 self .name = name
4949 self ._design_unit = design_unit
5050 self .generics = {} if generics is None else generics
5151 self .sim_options = {} if sim_options is None else sim_options
5252 self .attributes = {} if attributes is None else attributes
53- self .vhdl_configuration_name = vhdl_configuration_name
53+ self .vhdl_config_name = vhdl_config_name
5454
5555 self .tb_path = str (Path (design_unit .original_file_name ).parent )
5656
@@ -70,7 +70,7 @@ def copy(self):
7070 pre_config = self .pre_config ,
7171 post_check = self .post_check ,
7272 attributes = self .attributes .copy (),
73- vhdl_configuration_name = self .vhdl_configuration_name ,
73+ vhdl_config_name = self .vhdl_config_name ,
7474 )
7575
7676 @property
@@ -109,20 +109,20 @@ def set_attribute(self, name, value):
109109 else :
110110 raise AttributeException
111111
112- def set_vhdl_configuration_name (self , name ):
112+ def set_vhdl_config_name (self , name ):
113113 """
114114 Set VHDL configuration name
115115 """
116116 if self .generics :
117117 raise GenericAndVHDLConfigurationException ("Generics can't be used with VHDL configurations." )
118118
119- self .vhdl_configuration_name = name
119+ self .vhdl_config_name = name
120120
121121 def set_generic (self , name , value ):
122122 """
123123 Set generic
124124 """
125- if self .vhdl_configuration_name :
125+ if self .vhdl_config_name :
126126 raise GenericAndVHDLConfigurationException ("Generics can't be used with VHDL configurations." )
127127 if name not in self ._design_unit .generic_names :
128128 LOGGER .warning (
@@ -210,7 +210,10 @@ def get_configuration_dicts():
210210
211211 def set_attribute (self , name , value ):
212212 """
213- Set attribute
213+ Set attribute.
214+
215+ :param name: Attribute name.
216+ :param value: Attribute value.
214217 """
215218 self ._check_enabled ()
216219 for configs in self .get_configuration_dicts ():
@@ -219,7 +222,10 @@ def set_attribute(self, name, value):
219222
220223 def set_generic (self , name , value ):
221224 """
222- Set generic
225+ Set generic.
226+
227+ :param name: Generic name.
228+ :param value: Generic value.
223229 """
224230 self ._check_enabled ()
225231 for configs in self .get_configuration_dicts ():
@@ -228,8 +234,10 @@ def set_generic(self, name, value):
228234
229235 def set_sim_option (self , name , value , overwrite = True ):
230236 """
231- Set sim option
237+ Set simulation option
232238
239+ :param name: Simulation option name.
240+ :param value: Simulation option value.
233241 :param overwrite: To overwrite the option or append to the existing value
234242 """
235243 self ._check_enabled ()
@@ -243,6 +251,8 @@ def set_sim_option(self, name, value, overwrite=True):
243251 def set_pre_config (self , value ):
244252 """
245253 Set pre_config function
254+
255+ :param value: pre_config function.
246256 """
247257 self ._check_enabled ()
248258 for configs in self .get_configuration_dicts ():
@@ -252,6 +262,8 @@ def set_pre_config(self, value):
252262 def set_post_check (self , value ):
253263 """
254264 Set post_check function
265+
266+ :param value: post_check function.
255267 """
256268 self ._check_enabled ()
257269 for configs in self .get_configuration_dicts ():
@@ -266,10 +278,10 @@ def add_config( # pylint: disable=too-many-arguments, too-many-branches
266278 post_check = None ,
267279 sim_options = None ,
268280 attributes = None ,
269- vhdl_configuration_name = None ,
281+ vhdl_config_name = None ,
270282 ):
271283 """
272- Add a configuration copying unset fields from the default configuration:
284+ Add a configuration copying unset fields from the default configuration.
273285 """
274286 self ._check_enabled ()
275287
@@ -291,7 +303,7 @@ def add_config( # pylint: disable=too-many-arguments, too-many-branches
291303 config .post_check = post_check
292304
293305 if generics is not None :
294- if config .vhdl_configuration_name :
306+ if config .vhdl_config_name :
295307 raise GenericAndVHDLConfigurationException
296308 config .generics .update (generics )
297309
@@ -304,9 +316,22 @@ def add_config( # pylint: disable=too-many-arguments, too-many-branches
304316 raise AttributeException
305317 config .attributes .update (attributes )
306318
307- if vhdl_configuration_name is not None :
319+ if vhdl_config_name is not None :
308320 if config .generics :
309321 raise GenericAndVHDLConfigurationException
310- config .vhdl_configuration_name = vhdl_configuration_name
322+ config .vhdl_config_name = vhdl_config_name
311323
312324 configs [config .name ] = config
325+
326+ def delete_config (self , name ):
327+ """
328+ Delete a configuration.
329+ """
330+ found_config = False
331+ for configs in self .get_configuration_dicts ():
332+ if name in configs :
333+ found_config = True
334+ del configs [name ]
335+
336+ if not found_config :
337+ raise RuntimeError (f"Configuration name { name !s} not defined" )
0 commit comments