Naming Ports

Top  Previous  Next

If you look at driver.c by double-clicking its name in the Diamond source view, you see that it uses two named ports.

DriverPorts

Delete the two lines with INPUT_PORT and OUTPUT_PORT as we are going to get the IDE to manage them for us.

 

We now need to define those ports. Double-click the driver task in the Diamond source view to bring up information about the task.

NameDriverPorts

Driver has one input port and one output port, just as we requested when we created it, but they are currently unnamed. If you forgot to specify input and output ports you can create them now by clicking the Add buttons.

 

Select output port 0 by clicking 0, unnamed in the list of output ports and then click Edit. Give it the name upc_out. Repeat this process to name the input port upc_in.

PortsNamed

Repeat this process to delete the port definitions from upc.c and rename the ports of the upc task to be driver_out and driver_in.