Search in sources :

Example 1 with VHDLEntity

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

the class VHDLCreator method printNodeBuiltIn.

private void printNodeBuiltIn(HDLNodeBuildIn node) throws HDLException, IOException, HGSEvalException {
    VHDLEntity entity = library.getEntity(node);
    String hdlEntityName = entity.print(out, node);
    node.setHdlEntityName(hdlEntityName);
}
Also used : VHDLEntity(de.neemann.digital.hdl.vhdl2.entities.VHDLEntity)

Example 2 with VHDLEntity

use of de.neemann.digital.hdl.vhdl2.entities.VHDLEntity 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

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