<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def quartus_add_interface_port(self, buff: List[str], intfName: str, signal, logicName: str, packager: "IpCorePackager"):
 """ Add subinterface to Quartus interface :param buff: line buffer for output :param intfName: name of top interface :param signal: subinterface to create port for :param logicName: name of port in Quartus """

        d = signal._direction
        if d == INTF_DIRECTION.MASTER:
            dir_ = "Output"
        elif d == INTF_DIRECTION.SLAVE:
            dir_ = "Input"
        else:
            raise ValueError(d)

        _, width, _ = packager.getTypeWidth(packager.getInterfaceType(signal), do_eval=True)

        buff.append("add_interface_port %s %s %s %s %s" % (
            intfName,
            packager.getInterfacePhysicalName(signal),
            logicName,
            dir_,
            width
        ))