- simple digicode

This commit is contained in:
Ludovic Jacomme 2004-05-23 20:17:25 +00:00
parent 7fe6201b21
commit 7e460d9628
4 changed files with 694 additions and 0 deletions

View File

@ -0,0 +1,318 @@
# /*------------------------------------------------------------\
# | |
# | File : Makefile |
# | |
# | Author : Jacomme Ludovic |
# | |
# \------------------------------------------------------------*/
# /*------------------------------------------------------------\
# | |
# | Cells |
# | |
# \------------------------------------------------------------*/
# /*------------------------------------------------------------\
# | |
# | Binary |
# | |
# \------------------------------------------------------------*/
ALLIANCE_BIN=$(ALLIANCE_TOP)/bin
SYF = $(ALLIANCE_BIN)/syf
ASIMUT = $(ALLIANCE_BIN)/asimut
BOOM = $(ALLIANCE_BIN)/boom
BOOG = $(ALLIANCE_BIN)/boog
LOON = $(ALLIANCE_BIN)/loon
OCP = $(ALLIANCE_BIN)/ocp
OCR = $(ALLIANCE_BIN)/ocr
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 = $(ALLIANCE_TOP)/cells/sxlib
RDS_TECHNO_SYMB = ../etc/techno-symb.rds
RDS_TECHNO = ../etc/techno-035.rds
METAL_LEVEL = 2
SPI_MODEL = $(ALLIANCE_TOP)/etc/spimodel.cfg
# /*------------------------------------------------------------\
# | |
# | Environement |
# | |
# \------------------------------------------------------------*/
ENV_SYF = 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_SYF = MBK_WORK_LIB=.; export MBK_WORK_LIB;\
MBK_CATAL_NAME=CATAL_ASIMUT_SYF; 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_OCR = 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 = 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); 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_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_NAMEDNODES="true"; export MBK_SPI_NAMEDNODES; \
RDS_TECHNO_NAME=$(RDS_TECHNO); 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); 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 : digi.cif
# /*------------------------------------------------------------\
# | |
# | Vasy |
# | |
# \------------------------------------------------------------*/
digi.vbe : digi.fsm
$(ENV_SYF); $(SYF) -Va digi digi
# /*------------------------------------------------------------\
# | |
# | Asimut |
# | |
# \------------------------------------------------------------*/
res_syf_1.pat : digi.vbe
$(ENV_ASIMUT_SYF); $(ASIMUT) -b digi digi res_syf_1
res_synth_1.pat : digi.vst
$(ENV_ASIMUT_SYNTH); $(ASIMUT) digi digi res_synth_1
# /*------------------------------------------------------------\
# | |
# | Boom |
# | |
# \------------------------------------------------------------*/
boom.done : digi_o.vbe
@$(TOUCH) boom.done
digi_o.vbe : digi.vbe res_syf_1.pat
$(ENV_BOOM); $(BOOM) -V digi digi_o
# /*------------------------------------------------------------\
# | |
# | Boog |
# | |
# \------------------------------------------------------------*/
boog.done : digi_o.vst
@$(TOUCH) boog.done
digi_o.vst : digi_o.vbe
$(ENV_BOOG); $(BOOG) digi_o
# /*------------------------------------------------------------\
# | |
# | Loon |
# | |
# \------------------------------------------------------------*/
loon.done : digi.vst
@$(TOUCH) loon.done
digi.vst : digi_o.vst
$(ENV_LOON); $(LOON) digi_o digi
# /*------------------------------------------------------------\
# | |
# | OCP |
# | |
# \------------------------------------------------------------*/
digi_p.ap : res_synth_1.pat digi.ioc
$(ENV_OCP); $(OCP) -v -gnuplot -ioc digi digi digi_p
# /*------------------------------------------------------------\
# | |
# | OCR |
# | |
# \------------------------------------------------------------*/
# digi.ap : digi_p.ap digi.vst
# $(ENV_OCR); $(OCR) -vv -l $(METAL_LEVEL) -L digi -P digi_p -O digi
# /*------------------------------------------------------------\
# | |
# | NERO |
# | |
# \------------------------------------------------------------*/
digi.ap : digi_p.ap digi.vst
$(ENV_OCR); $(NERO) -V -$(METAL_LEVEL) -p digi_p digi digi
# /*------------------------------------------------------------\
# | |
# | Cougar |
# | |
# \------------------------------------------------------------*/
digi_e.spi : digi.ap
$(ENV_COUGAR_SPI); $(COUGAR) -v -ac digi digi_e
digi_e.al : digi.ap
$(ENV_COUGAR); $(COUGAR) -v -ac digi digi_e
digi_et.al : digi.ap
$(ENV_COUGAR); $(COUGAR) -v -ac -t digi digi_et
digi_et.spi : digi.ap
$(ENV_COUGAR_SPI); $(COUGAR) -v -ac -t digi digi_et
digi_er.al : digi.cif
$(ENV_COUGAR); $(COUGAR) -v -r -t digi digi_er
# /*------------------------------------------------------------\
# | |
# | Lvx |
# | |
# \------------------------------------------------------------*/
lvx.done : digi.vst digi_e.al
$(ENV_LVX); $(LVX) vst al digi digi_e -f
$(TOUCH) lvx.done
# /*------------------------------------------------------------\
# | |
# | Druc |
# | |
# \------------------------------------------------------------*/
druc.done : lvx.done digi.ap
$(ENV_DRUC); $(DRUC) digi
$(TOUCH) druc.done
# /*------------------------------------------------------------\
# | |
# | S2R |
# | |
# \------------------------------------------------------------*/
digi.cif : druc.done
$(ENV_S2R); $(S2R) -v digi
# /*------------------------------------------------------------\
# | |
# | TOOLS |
# | |
# \------------------------------------------------------------*/
graal: digi.ap
$(ENV_S2R); $(GRAAL) -l digi
xsch: digi.vst
$(ENV_LOON); $(XSCH) -l digi
xscht: digi_et.al
$(ENV_COUGAR); $(XSCH) -l digi_et
xfsm: digi.fsm
$(ENV_SYF); $(XFSM) -l digi
xpat: res_synth_1.pat
$(ENV_ASIMUT_SYNTH); $(XPAT) -l res_synth_1
dreal: digi.cif
$(ENV_S2R); $(DREAL) -l digi -install
# /*------------------------------------------------------------\
# | |
# | Clean |
# | |
# \------------------------------------------------------------*/
realclean : clean
clean :
$(RM) -f *.vst digi_e.spi *.vbe res_*.pat *.boom *.done *.xsc *.gpl \
*.ap *.drc *.dat *.gds *.cif *.rep \
*.log *.out *.raw *.al

View File

@ -0,0 +1,154 @@
ENTITY circuit is
PORT
(
ck : in BIT;
jour : in BIT;
reset : in BIT;
vdd : in BIT;
vss : in BIT;
i : in BIT_VECTOR(3 DOWNTO 0);
porte : out BIT;
alarm : out BIT
);
END circuit;
ARCHITECTURE MOORE OF circuit is
TYPE ETAT_TYPE IS (E0, E1, E2, E3, E4, E5, EA);
SIGNAL EF, CS : ETAT_TYPE;
CONSTANT digit0 : BIT_VECTOR (3 DOWNTO 0) := B"1111" ; -- O
CONSTANT digit1 : BIT_VECTOR (3 DOWNTO 0) := B"0101" ; -- 5
CONSTANT digit2 : BIT_VECTOR (3 DOWNTO 0) := B"0011" ; -- 3
CONSTANT digit3 : BIT_VECTOR (3 DOWNTO 0) := B"1100" ; -- A
CONSTANT digit4 : BIT_VECTOR (3 DOWNTO 0) := B"0001" ; -- 1
CONSTANT digit5 : BIT_VECTOR (3 DOWNTO 0) := B"0111" ; -- 7
--PRAGMA CURRENT_STATE CS
--PRAGMA NEXT_STATE EF
--PRAGMA CLOCK ck
--PRAGMA FIRST_STATE E0
BEGIN
PROCESS ( CS, i)
BEGIN
IF ( reset = '1' )
THEN
EF <= E0;
porte <= '0';
alarm <= '0';
ELSE
CASE CS is
WHEN E0 =>
porte <= '0';
alarm <= '0';
IF ( i = digit0 )
THEN
IF ( jour = '1' )
THEN
EF <= E5;
ELSE
EF <= EA;
END IF;
ELSE
IF ( i = digit1 )
THEN
EF <= E1;
ELSE
IF ( jour = '1' )
THEN
EF <= E0;
ELSE
EF <= EA;
END IF;
END IF;
END IF;
WHEN E1 =>
porte <= '0';
alarm <= '0';
IF ( i = digit2 )
THEN
EF <= E2;
ELSE
IF ( jour = '1' )
THEN
EF <= E0;
ELSE
EF <= EA;
END IF;
END IF;
WHEN E2 =>
porte <= '0';
alarm <= '0';
IF ( i = digit3 )
THEN
EF <= E3;
ELSE
IF ( jour = '1' )
THEN
EF <= E0;
ELSE
EF <= EA;
END IF;
END IF;
WHEN E3 =>
porte <= '0';
alarm <= '0';
IF ( i = digit4 )
THEN
EF <= E4;
ELSE
IF ( jour = '1' )
THEN
EF <= E0;
ELSE
EF <= EA;
END IF;
END IF;
WHEN E4 =>
porte <= '0';
alarm <= '0';
IF ( i = digit5 )
THEN
EF <= E5;
ELSE
IF ( jour = '1' )
THEN
EF <= E0;
ELSE
EF <= EA;
END IF;
END IF;
WHEN E5 =>
porte <= '1';
alarm <= '0';
EF <= E5;
WHEN EA =>
porte <= '0';
alarm <= '1';
EF <= EA;
END CASE;
END IF;
END PROCESS;
PROCESS( ck )
BEGIN
IF ( ck = '1' AND NOT ck'STABLE )
THEN
CS <= EF;
END IF;
END PROCESS;
END MOORE;

View File

@ -0,0 +1,16 @@
TOP ( # IOs are ordered from left to right
(IOPIN ck.0 );
(IOPIN jour.0 );
(IOPIN reset.0 );
(IOPIN i(3).0 );
(IOPIN i(2).0 );
(IOPIN i(1).0 );
(IOPIN i(0).0 );
)
BOTTOM ( # IOs are ordered from left to right
(IOPIN porte.0 );
(IOPIN alarm.0 );
)
IGNORE ( # IOs are ignored(not placed) by IO Placer
)

View File

@ -0,0 +1,206 @@
--
-- Patterns for digicode
--
in ck B;
in jour B;
in reset B;
in i (3 downto 0) X;;
out porte B;
out alarm B;
begin
-- Pattern description :
-- c j r i p a
-- k o e o l
-- u s r a
-- r e t r
-- t e m
-- Reset
< 0ns>: 0 1 1 0 ?* ?* ;
<+100ns>: 0 1 1 0 ?* ?* ;
<+100ns>: 1 1 1 0 ?* ?0 ;
<+100ns>: 1 1 1 0 ?0 ?0 ;
-- Press f
<+100ns>: 0 1 0 f ?0 ?0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