21.4.43 sd_replace_component
(Ask a Question)Description
This Tcl command replaces a SmartDesign instance component definition with a new component definition. This command is useful when the interface (port-list) of the component/module instantiated in a SmartDesign has changed. It can be used to replace any type of instance such as instances of other SmartDesign components, core components, HDL modules and HDL+ cores in a SmartDesign.
sd_replace_component -sd_name {smartdesign component name} \
                     -instance_name {instance name} \
                     -new_component_name {component name to be replaced}
                     -replace_all_instances {1|0}Arguments
| Parameter | Type | Description | 
|---|---|---|
sd_name  | string  | Specifies the name of the SmartDesign component. It is mandatory.  | 
instance_name  | string  | Specifies the name of the instance to be replaced with the new component definition. It is mandatory. The component can be a Core component/SmartDesign/HDL/HDL+.  | 
new_component_name  | string  | This argument is used to specify the new component name and it's corresponding file path. This is a mandatory argument. For the HDL modules we need you need to specify HDL module name. The component can be a Core/SmartDesign/HDL/HDL+ etc and the file path is the (CXF/HDL) file corresponding to the component. User must be specified as follows: {component_name%file_path%library%package}.  | 
| replace_all_instances | boolean  | Specifiy true or 1 to replace all the instances in the SmartDesign with the same component. Specify false or 0 to replace only mentioned instance. Default value is 1. This is an optional argument. | 
| Return Type | Description | 
|---|---|
| None | None | 
Error Codes
| Error Code | Description | 
|---|---|
None  | Required parameter 'sd_name' is missing.  | 
None  | Required parameter 'instance' is missing.  | 
None  | Required parameter 'new_component_name' is missing.  | 
None  | Instance 'instance_name' does not exist.  | 
None  | The component 'component_name' doesn't exist.  | 
None  | Parameter 'param_name' is not defined. Valid command formatting is 'sd_replace_component -sd_name "sd_name" -instance "instance" -new_component_name "new_component"'.  | 
Supported Families
| Supported Families | 
|---|
| PolarFire® | 
| PolarFire SoC | 
| RTG4™ | 
| SmartFusion® 2 | 
| IGLOO® 2 | 
Example
The following example replaces "sd_0" instance with "sd_1" module:
sd_replace_component -sd_name {mydesign} \
                     -instance {sd_0} \
                     -new_component_name {top%/exprj/hdl/sd_1.v}
                     -replace_all_instances 0