Search in sources :

Example 1 with VHDLTemplate

use of de.neemann.digital.hdl.vhdl2.entities.VHDLTemplate in project Digital by hneemann.

the class VHDLLibrary method getEntity.

/**
 * Gets the entity of the given node
 *
 * @param node the node
 * @return the entity
 * @throws HDLException HDLException
 */
public VHDLEntity getEntity(HDLNode node) throws HDLException {
    String elementName = node.getElementName();
    VHDLEntity e = map.get(elementName);
    if (e == null) {
        try {
            e = new VHDLTemplate(elementName);
            map.put(elementName, e);
        } catch (IOException ex) {
            ex.printStackTrace();
            LOGGER.info("could not load '" + VHDLTemplate.neededFileName(elementName) + "'");
        }
    }
    if (e == null)
        throw new HDLException(Lang.get("err_vhdlNoEntity_N", elementName));
    return e;
}
Also used : VHDLEntity(de.neemann.digital.hdl.vhdl2.entities.VHDLEntity) HDLException(de.neemann.digital.hdl.model2.HDLException) IOException(java.io.IOException) VHDLTemplate(de.neemann.digital.hdl.vhdl2.entities.VHDLTemplate)

Aggregations

HDLException (de.neemann.digital.hdl.model2.HDLException)1 VHDLEntity (de.neemann.digital.hdl.vhdl2.entities.VHDLEntity)1 VHDLTemplate (de.neemann.digital.hdl.vhdl2.entities.VHDLTemplate)1 IOException (java.io.IOException)1