To demo this, a simple "logic.vhd" file is used that instantiates an AND, OR, or an Inverter, based on user input in the IP config GUI.
Depending on the configuration here, the IP ports are updated respectively.
This is to be used as a reference.
There are four source files attached to this answer record.
Please follow the steps below:
Note: This Answer Record should be used in conjunction with (UG1118) chapter 3.
Step 1: Add the HDL files from the zip as Design Sources in Vivado (Make sure that logic is set as Top):
The top level ports, and the entity for the logic HDL are shown below:
Step 2: Create the IP.
In Vivado, select Tools -> Create and Package IP -> Next.
Select Package your current project
Select where you want to save the IP to, and Include .xci files. Next, and Finish.
Step 3: Set Port dependencies.
In the HDL files in this tutorial, there is an AND, OR, and an Inverter. The AND and OR have two inputs, and one output.
However, the inverter has one input, and one output.
Here, we can use the port dependencies that will remove the second input if the inverter is selected.
To achieve this, go to Ports and Interfaces, and right click on the port you want.
to add the dependency, right click, and select Edit Port:
In the pop-up GUI, select Port Presence = Optional.
In the Driver value, set this to 0 (This is the value that will be set on the port if not used):
Next, we can set the parameter dependencies.
We only want to choose one logical feature at a time.
To achieve this, select the Customization Parameters, then select the parameter that you want to add the dependency on, and select Edit Parameter:
Under Editable, select Dependent.
This will enable you to add a TCL expression.
See below for an example. This will gray out the Logical_AND checkbox if both the Logical_OR and Logical_INV are set to false.
Also, set the Dependency to Yes, and use the same Tcl expression.
This will un-select the Logical_AND tick box if either the Logical_OR or Logical_INV is selected:
Select the Logical_OR and make the parameter dependent, and set the Dependency to Yes.
Use the expression below:
To test any changes, you can use the Customization GUI:
To create the IP, you can then select Review and Package -> Re-Package IP
|Name||File Size||File Type|