Tutorial 2: Diseño de compuerta NAND
En este caso se realizará un proceso similar al del tutorial anterior para poder diseñar y simular una compuerta NAND.
1- En una carpeta nueva genere cree los archivos minand.vhdl,
minand.ioc y minand.pat con los
contenidos siguientes:
.VHDL:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_arith.ALL;
use IEEE.STD_LOGIC_unsigned.ALL;
-- Ejemplo con una compuerta básica, una nand
ENTITY Compuerta_miNAND IS
PORT(
entrada_a: IN BIT;
entrada_b: IN BIT;
salida: OUT BIT);
--Esta sería la definición de las entrada y salidas de la compuerta
END Compuerta_miNAND;
--Ahora se realiza el comportamiento de la compuerta
ARCHITECTURE comportamiento of Compuerta_miNAND is
BEGIN
salida<=not(entrada_a and entrada_b);
END comportamiento;
.ioc:
###################################################################
# In each of TOP()/BOTTOM()/LEFT()/RIGHT() section, there are #
# placed IOs. In the IGNORE() section, the IOs are ignored #
# by the IOPlacer. In every section, the IO syntax could be: #
# for pin: (IOPIN iopinName.0 ); #
# for pad: iopadName orientation ; #
# for space: SPACE value; #
# The capital words are keywords. orientation is not required. #
# The value is the space between the IO above and the IO below it.#
###################################################################
TOP ( # IOs are ordered from left to right
(IOPIN entrada_b.0 );
(IOPIN entrada_a.0 );
)
BOTTOM ( # IOs are ordered from left to right
(IOPIN salida.0 );
)
IGNORE ( # IOs are ignored(not placed) by IO Placer
)
.pat
-- terminales de la compuerta nand
in vdd B;;
in vss B;;
in entrada_a B;;
in entrada_b B;;
out salida B;;
begin
-- colocación de los patrones a evaluar, se coloca ?
-- para que el simulador coloque la salida
-- los intervalos de tiempo están en picosegundos en este caso.
-- v g i i o
-- d n n n u
-- d d A B t
<0 ps> comentario: 1 0 0 0 ?*;
<+1 ns> entrada_baja: 1 0 0 0 ?*;
<+1 ns> : 1 0 0 0 ?*;
<+1 ns>: 1 0 0 0 ?*;
<+1 ns> entrada_alta: 1 0 1 0 ?*;
<+1 ns>: 1 0 1 0 ?*;
<+1 ns> : 1 0 1 0 ?*;
<+1 ns>: 1 0 1 0 ?*;
<+1 ns> : 1 0 0 1 ?*;
<+1 ns>: 1 0 0 1 ?*;
<+1 ns> : 1 0 0 1 ?*;
<+1 ns>: 1 0 0 1 ?*;
<+1 ns> : 1 0 1 1 ?*;
<+1 ns>: 1 0 1 1 ?*;
<+1 ns> : 1 0 1 1 ?*;
<+1 ns>: 1 0 1 1 ?*;
end;
3- Crear el archivo Makefile:
# /*------------------------------------------------------------\
# | |
# | File : Makefile |
# | |
# | Author : Jacomme Ludovic |
# | Modificado por: MEF |
# \------------------------------------------------------------*/
# /*------------------------------------------------------------\
# | |
# | Cells |
# | |
# \------------------------------------------------------------*/
# /*------------------------------------------------------------\
# | |
# | Binary |
# | |
# \------------------------------------------------------------*/
include ../etc/alliance-env.mk
VASY = $(ALLIANCE_BIN)/vasy
ASIMUT = $(ALLIANCE_BIN)/asimut
BOOM = $(ALLIANCE_BIN)/boom
BOOG = $(ALLIANCE_BIN)/boog
LOON = $(ALLIANCE_BIN)/loon
OCP = $(ALLIANCE_BIN)/ocp
NERO = $(ALLIANCE_BIN)/nero
COUGAR = $(ALLIANCE_BIN)/cougar
LVX = $(ALLIANCE_BIN)/lvx
DRUC = $(ALLIANCE_BIN)/druc
S2R = $(ALLIANCE_BIN)/s2r
DREAL = $(ALLIANCE_BIN)/dreal
GRAAL = $(ALLIANCE_BIN)/graal
XSCH = $(ALLIANCE_BIN)/xsch
XPAT = $(ALLIANCE_BIN)/xpat
XFSM = $(ALLIANCE_BIN)/xfsm
TOUCH = touch
TARGET_LIB = $(CELLS_TOP)/sxlib
METAL_LEVEL = 2
# /*------------------------------------------------------------\
# | |
# | Environement |
# | |
# \------------------------------------------------------------*/
ENV_VASY = MBK_WORK_LIB=.; export MBK_WORK_LIB;\
MBK_CATAL_NAME=NO_CATAL; export MBK_CATAL_NAME
ENV_BOOM = MBK_WORK_LIB=.; export MBK_WORK_LIB;\
MBK_CATAL_NAME=CATAL; export MBK_CATAL_NAME
ENV_BOOG = MBK_WORK_LIB=.; export MBK_WORK_LIB; \
MBK_IN_LO=vst; export MBK_IN_LO; \
MBK_OUT_LO=vst; export MBK_OUT_LO; \
MBK_TARGET_LIB=$(TARGET_LIB); export MBK_TARGET_LIB; \
MBK_CATAL_NAME=CATAL; export MBK_CATAL_NAME
ENV_LOON = MBK_WORK_LIB=.; export MBK_WORK_LIB; \
MBK_IN_LO=vst; export MBK_IN_LO; \
MBK_OUT_LO=vst; export MBK_OUT_LO; \
MBK_TARGET_LIB=$(TARGET_LIB); export MBK_TARGET_LIB; \
MBK_CATA_LIB=$(TARGET_LIB); export MBK_CATA_LIB; \
MBK_CATAL_NAME=CATAL; export MBK_CATAL_NAME
ENV_ASIMUT_VASY = MBK_WORK_LIB=.; export MBK_WORK_LIB;\
MBK_CATAL_NAME=CATAL_ASIMUT_VASY; export MBK_CATAL_NAME;\
MBK_IN_LO=vst; export MBK_IN_LO;\
MBK_OUT_LO=vst; export MBK_OUT_LO
ENV_ASIMUT_SYNTH = MBK_WORK_LIB=.; export MBK_WORK_LIB;\
MBK_CATAL_NAME=CATAL; export MBK_CATAL_NAME;\
MBK_CATA_LIB=$(TARGET_LIB); export MBK_CATA_LIB; \
MBK_IN_LO=vst; export MBK_IN_LO;\
MBK_OUT_LO=vst; export MBK_OUT_LO
ENV_OCP = MBK_WORK_LIB=.; export MBK_WORK_LIB; \
MBK_IN_LO=vst; export MBK_IN_LO; \
MBK_OUT_LO=vst; export MBK_OUT_LO; \
MBK_CATA_LIB=$(TARGET_LIB); export MBK_CATA_LIB; \
MBK_IN_PH=ap; export MBK_IN_PH; \
MBK_OUT_PH=ap; export MBK_OUT_PH; \
MBK_CATAL_NAME=CATAL; export MBK_CATAL_NAME
ENV_NERO = MBK_WORK_LIB=.; export MBK_WORK_LIB; \
MBK_IN_LO=vst; export MBK_IN_LO; \
MBK_OUT_LO=vst; export MBK_OUT_LO; \
MBK_CATA_LIB=$(TARGET_LIB); export MBK_CATA_LIB; \
MBK_IN_PH=ap; export MBK_IN_PH; \
MBK_OUT_PH=ap; export MBK_OUT_PH; \
MBK_CATAL_NAME=CATAL; export MBK_CATAL_NAME
ENV_COUGAR_SPI = MBK_WORK_LIB=.; export MBK_WORK_LIB; \
MBK_IN_LO=spi; export MBK_IN_LO; \
MBK_OUT_LO=spi; export MBK_OUT_LO; \
MBK_SPI_MODEL=$(SPI_MODEL); export MBK_SPI_MODEL; \
MBK_SPI_ONE_NODE_NORC="true"; export MBK_SPI_ONE_NODE_NORC; \
MBK_SPI_NAMEDNODES="true"; export MBK_SPI_NAMEDNODES; \
RDS_TECHNO_NAME=$(RDS_TECHNO_REAL); export RDS_TECHNO_NAME; \
RDS_IN=cif; export RDS_IN; \
RDS_OUT=cif; export RDS_OUT; \
MBK_CATA_LIB=$(TARGET_LIB); export MBK_CATA_LIB; \
MBK_IN_PH=ap; export MBK_IN_PH; \
MBK_OUT_PH=ap; export MBK_OUT_PH; \
MBK_CATAL_NAME=CATAL; export MBK_CATAL_NAME
ENV_COUGAR = MBK_WORK_LIB=.; export MBK_WORK_LIB; \
MBK_IN_LO=al; export MBK_IN_LO; \
MBK_OUT_LO=al; export MBK_OUT_LO; \
RDS_TECHNO_NAME=$(RDS_TECHNO_REAL); export RDS_TECHNO_NAME; \
RDS_IN=cif; export RDS_IN; \
RDS_OUT=cif; export RDS_OUT; \
MBK_CATA_LIB=$(TARGET_LIB); export MBK_CATA_LIB; \
MBK_IN_PH=ap; export MBK_IN_PH; \
MBK_OUT_PH=ap; export MBK_OUT_PH; \
MBK_CATAL_NAME=CATAL; export MBK_CATAL_NAME
ENV_LVX = MBK_WORK_LIB=.; export MBK_WORK_LIB; \
MBK_IN_LO=vst; export MBK_IN_LO; \
MBK_OUT_LO=vst; export MBK_OUT_LO; \
MBK_CATA_LIB=$(TARGET_LIB); export MBK_CATA_LIB; \
MBK_CATAL_NAME=CATAL; export MBK_CATAL_NAME
ENV_DRUC = MBK_WORK_LIB=.; export MBK_WORK_LIB; \
RDS_TECHNO_NAME=$(RDS_TECHNO_SYMB); export RDS_TECHNO_NAME; \
MBK_IN_PH=ap; export MBK_IN_PH; \
MBK_OUT_PH=ap; export MBK_OUT_PH; \
MBK_CATA_LIB=$(TARGET_LIB); export MBK_CATA_LIB; \
MBK_CATAL_NAME=CATAL; export MBK_CATAL_NAME
ENV_S2R = MBK_WORK_LIB=.; export MBK_WORK_LIB; \
RDS_TECHNO_NAME=$(RDS_TECHNO_REAL); export RDS_TECHNO_NAME; \
RDS_IN=cif; export RDS_IN; \
RDS_OUT=cif; export RDS_OUT; \
MBK_IN_PH=ap; export MBK_IN_PH; \
MBK_OUT_PH=ap; export MBK_OUT_PH; \
MBK_CATA_LIB=$(TARGET_LIB); export MBK_CATA_LIB; \
MBK_CATAL_NAME=CATAL; export MBK_CATAL_NAME
all : minand.cif
# /*------------------------------------------------------------\
# | |
# | Vasy |
# | |
# \------------------------------------------------------------*/
minand.vbe : minand.vhdl
$(ENV_VASY); $(VASY) -a -B -o -p -I vhdl minand
# /*------------------------------------------------------------\
# | |
# | Asimut |
# | |
# \------------------------------------------------------------*/
res_vasy_1.pat : minand.vbe
$(ENV_ASIMUT_VASY); $(ASIMUT) -b minand minand res_vasy_1
res_synth_1.pat : minand.vst
$(ENV_ASIMUT_SYNTH); $(ASIMUT) minand minand res_synth_1
# /*------------------------------------------------------------\
# | |
# | Boom |
# | |
# \------------------------------------------------------------*/
boom.done : minand_o.vbe
@$(TOUCH) boom.done
minand_o.vbe : minand.vbe minand.boom res_vasy_1.pat
$(ENV_BOOM); $(BOOM) -VP minand minand_o
# /*------------------------------------------------------------\
# | |
# | Boog |
# | |
# \------------------------------------------------------------*/
boog.done : minand_o.vst
@$(TOUCH) boog.done
minand_o.vst : minand_o.vbe
$(ENV_BOOG); $(BOOG) minand_o
# /*------------------------------------------------------------\
# | |
# | Loon |
# | |
# \------------------------------------------------------------*/
loon.done : minand.vst
@$(TOUCH) loon.done
minand.vst : minand_o.vst
$(ENV_LOON); $(LOON) minand_o minand
# /*------------------------------------------------------------\
# | |
# | OCP |
# | |
# \------------------------------------------------------------*/
minand_p.ap : res_synth_1.pat
$(ENV_OCP); $(OCP) -v -gnuplot -ioc minand minand minand_p
# /*------------------------------------------------------------\
# | |
# | NERO |
# | |
# \------------------------------------------------------------*/
minand.ap : minand_p.ap minand.vst
$(ENV_NERO); $(NERO) -V -$(METAL_LEVEL) -p minand_p minand minand
# /*------------------------------------------------------------\
# | |
# | Cougar |
# | |
# \------------------------------------------------------------*/
minand_e.spi : minand.ap
$(ENV_COUGAR_SPI); $(COUGAR) -v -ac minand minand_e
minand_erc.spi : minand.ap
$(ENV_COUGAR_SPI); $(COUGAR) -v -ar minand minand_erc
minand_erc.al : minand.ap
$(ENV_COUGAR); $(COUGAR) -v -ar minand minand_erc
minand_e.al : minand.ap
$(ENV_COUGAR); $(COUGAR) -v -ac minand minand_e
minand_et.al : minand.ap
$(ENV_COUGAR); $(COUGAR) -v -ac -t minand minand_et
minand_et.spi : minand.ap
$(ENV_COUGAR_SPI); $(COUGAR) -v -ac -t minand minand_et
minand_er.al : minand.cif
$(ENV_COUGAR); $(COUGAR) -v -r -t minand minand_er
minand_real.al : minand.ap
$(ENV_COUGAR); $(ENV_S2R); $(COUGAR) -v -ac minand minand_real
minand_real_t.al : minand.ap
$(ENV_COUGAR); $(ENV_S2R); $(COUGAR) -v -t -ac minand minand_real_t
# /*------------------------------------------------------------\
# | |
# | Lvx |
# | |
# \------------------------------------------------------------*/
lvx.done : minand.vst minand_e.al minand_e.spi
$(ENV_LVX); $(LVX) vst al minand minand_e -f
$(TOUCH) lvx.done
# /*------------------------------------------------------------\
# | |
# | Druc |
# | |
# \------------------------------------------------------------*/
druc.done : lvx.done minand.ap
$(ENV_DRUC); $(DRUC) minand
$(TOUCH) druc.done
# /*------------------------------------------------------------\
# | |
# | S2R |
# | |
# \------------------------------------------------------------*/
minand.cif : druc.done
$(ENV_S2R); $(S2R) -v minand
# /*------------------------------------------------------------\
# | |
# | TOOLS |
# | |
# \------------------------------------------------------------*/
graal :
$(ENV_S2R); $(GRAAL)
graal_minand_p : minand_p.ap
$(ENV_S2R); $(GRAAL) -l minand_p
graal_minand : minand.ap
$(ENV_S2R); $(GRAAL) -l minand
xsch:
$(ENV_LOON); $(XSCH)
xsch_minand_o : minand.vst
$(ENV_LOON); $(XSCH) -l minand_o
xsch_minand : minand.vst
$(ENV_LOON); $(XSCH) -l minand
xsch_minand_e: minand_e.al
$(ENV_COUGAR); $(XSCH) -l minand_e
xsch_minand_et: minand_et.al
$(ENV_COUGAR); $(XSCH) -l minand_et
xpat:
$(ENV_ASIMUT_SYNTH); $(XPAT)
xpat_synth: res_synth_1.pat
$(ENV_ASIMUT_SYNTH); $(XPAT) -l res_synth_1
xpat_vasy : res_vasy_1.pat
$(ENV_ASIMUT_SYNTH); $(XPAT) -l res_vasy_1
dreal:
$(ENV_S2R); $(DREAL)
dreal_minand : minand.cif
$(ENV_S2R); $(DREAL) -l minand
# /*------------------------------------------------------------\
# | |
# | Clean |
# | |
# \------------------------------------------------------------*/
realclean : clean
clean :
$(RM) -f *.vst minand_e.spi minand_et.spi *.vbe res_*.pat *.boom *.done *.xsc *.gpl \
*.ap *.drc *.dat *.gds *.cif *.rep \
*.log *.out *.raw *.al
El cual es muy similar al archivo Makefile de la inversora, solo cambian los nombres de los archivos con los que se trabaja.
4- Ahora que se tienen los archivos ejecutar los pasos vistos en el tutorial 1 (pasos del 5 al 17) y no olvidar cargar las variables de entorno antes de correr los llamados a los comandos indicados en el tutorial anterior.
No hay comentarios:
Publicar un comentario