- Hadamard Chip ! (using only RTL synthesis with VASY)

This commit is contained in:
Ludovic Jacomme 2004-05-23 19:15:04 +00:00
parent 4e85503524
commit 1948d1b467
12 changed files with 17251 additions and 0 deletions

View File

@ -0,0 +1,7 @@
calcul C
compteur C
hadamard_model C
ram C
rom C
sequenceur C

View File

@ -0,0 +1,368 @@
# /*------------------------------------------------------------\
# | |
# | File : Makefile |
# | |
# | Author : Jacomme Ludovic |
# | |
# \------------------------------------------------------------*/
# /*------------------------------------------------------------\
# | |
# | Cells |
# | |
# \------------------------------------------------------------*/
# /*------------------------------------------------------------\
# | |
# | Binary |
# | |
# \------------------------------------------------------------*/
ALLIANCE_BIN = $(ALLIANCE_TOP)/bin
VASY = $(ALLIANCE_BIN)/vasy
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
SPI_MODEL = $(ALLIANCE_TOP)/etc/spimodel.cfg
METAL_LEVEL = 6
# /*------------------------------------------------------------\
# | |
# | 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_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_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_NAMEDNODES="true"; export MBK_SPI_NAMEDNODES; \
MBK_SPI_MODEL=$(SPI_MODEL); export MBK_SPI_MODEL; \
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 = 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_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 : hadamard_er.al
# /*------------------------------------------------------------\
# | |
# | Vasy |
# | |
# \------------------------------------------------------------*/
hadamard.vst calcul.vbe ram.vbe rom.vbe compteur.vbe sequenceur.vbe hadamard_model.vbe : hadamard.vhdl
$(ENV_VASY); $(VASY) -a -B -o -p -I vhdl -H hadamard
# /*------------------------------------------------------------\
# | |
# | Asimut |
# | |
# \------------------------------------------------------------*/
res_vasy_1.pat : hadamard.vst calcul.vbe ram.vbe rom.vbe \
compteur.vbe sequenceur.vbe hadamard_model.vbe
$(ENV_ASIMUT_VASY); $(ASIMUT) hadamard hadamard_1 res_vasy_1
res_synth_1.pat : hadamard.vst calcul.vst ram.vst rom.vst \
compteur.vst sequenceur.vst hadamard_model.vst
$(ENV_ASIMUT_SYNTH); $(ASIMUT) -zd hadamard hadamard_1 res_synth_1
# /*------------------------------------------------------------\
# | |
# | Boom |
# | |
# \------------------------------------------------------------*/
boom.done : calcul_o.vbe ram_o.vbe rom_o.vbe compteur_o.vbe \
sequenceur_o.vbe hadamard_model_o.vbe
@$(TOUCH) boom.done
calcul_o.vbe : calcul.vbe res_vasy_1.pat
$(ENV_BOOM); $(BOOM) -VP calcul calcul_o
ram_o.vbe : ram.vbe res_vasy_1.pat
$(ENV_BOOM); $(BOOM) -VP ram ram_o
rom_o.vbe : rom.vbe res_vasy_1.pat
$(ENV_BOOM); $(BOOM) -VP rom rom_o
compteur_o.vbe : compteur.vbe res_vasy_1.pat
$(ENV_BOOM); $(BOOM) -VP compteur compteur_o
sequenceur_o.vbe : sequenceur.vbe res_vasy_1.pat
$(ENV_BOOM); $(BOOM) -VP sequenceur sequenceur_o
hadamard_model_o.vbe : hadamard_model.vbe res_vasy_1.pat
$(ENV_BOOM); $(BOOM) -VP hadamard_model hadamard_model_o
# /*------------------------------------------------------------\
# | |
# | Boog |
# | |
# \------------------------------------------------------------*/
boog.done : calcul_o.vst ram_o.vst rom_o.vst compteur_o.vst \
sequenceur_o.vst hadamard_model_o.vst
@$(TOUCH) boog.done
calcul_o.vst : calcul_o.vbe
$(ENV_BOOG); $(BOOG) calcul_o
ram_o.vst : ram_o.vbe
$(ENV_BOOG); $(BOOG) ram_o
rom_o.vst : rom_o.vbe
$(ENV_BOOG); $(BOOG) rom_o
compteur_o.vst : compteur_o.vbe
$(ENV_BOOG); $(BOOG) compteur_o
sequenceur_o.vst : sequenceur_o.vbe
$(ENV_BOOG); $(BOOG) sequenceur_o
hadamard_model_o.vst : hadamard_model_o.vbe
$(ENV_BOOG); $(BOOG) hadamard_model_o
# /*------------------------------------------------------------\
# | |
# | Loon |
# | |
# \------------------------------------------------------------*/
loon.done : calcul.vst ram.vst rom.vst compteur.vst \
sequenceur.vst hadamard_model.vst
@$(TOUCH) loon.done
calcul.vst : calcul_o.vst
$(ENV_LOON); $(LOON) calcul_o calcul
ram.vst : ram_o.vst
$(ENV_LOON); $(LOON) ram_o ram
rom.vst : rom_o.vst
$(ENV_LOON); $(LOON) rom_o rom
compteur.vst : compteur_o.vst
$(ENV_LOON); $(LOON) compteur_o compteur
sequenceur.vst : sequenceur_o.vst
$(ENV_LOON); $(LOON) sequenceur_o sequenceur
hadamard_model.vst : hadamard_model_o.vst
$(ENV_LOON); $(LOON) hadamard_model_o hadamard_model
# /*------------------------------------------------------------\
# | |
# | OCP |
# | |
# \------------------------------------------------------------*/
hadamard_p.ap : res_synth_1.pat
$(ENV_OCP); $(OCP) -v -ioc hadamard -margin 0.4 -gnuplot hadamard hadamard_p
# /*------------------------------------------------------------\
# | |
# | OCR |
# | |
# \------------------------------------------------------------*/
hadamard.ap : hadamard_p.ap hadamard.vst
$(ENV_OCR); $(OCR) -v -l $(METAL_LEVEL) -L hadamard -P hadamard_p -O hadamard
#
# /*------------------------------------------------------------\
# | |
# | NERO |
# | |
# \------------------------------------------------------------*/
hadamard_nero.ap : hadamard_p.ap hadamard.vst
$(ENV_OCR); $(NERO) -V -$(METAL_LEVEL) -p hadamard_p hadamard hadamard
# /*------------------------------------------------------------\
# | |
# | Cougar |
# | |
# \------------------------------------------------------------*/
hadamard_e.al : hadamard.ap
$(ENV_COUGAR); $(COUGAR) -v -ac hadamard hadamard_e
hadamard_et.al : hadamard.ap
$(ENV_COUGAR); $(COUGAR) -v -t -ac hadamard hadamard_et
hadamard_e.spi : hadamard.ap hadamard_e.al
$(ENV_COUGAR_SPI); $(COUGAR) -v -ac hadamard hadamard_e
hadamard_et.spi : hadamard.ap hadamard_e.al
$(ENV_COUGAR_SPI); $(COUGAR) -v -t -ac hadamard hadamard_et
hadamard_er.al : hadamard.cif
$(ENV_COUGAR); $(COUGAR) -v -r -t hadamard hadamard_er
# /*------------------------------------------------------------\
# | |
# | Lvx |
# | |
# \------------------------------------------------------------*/
lvx.done : hadamard.vst hadamard_e.al
$(ENV_LVX); $(LVX) vst al hadamard hadamard_e -f
$(TOUCH) lvx.done
# /*------------------------------------------------------------\
# | |
# | Druc |
# | |
# \------------------------------------------------------------*/
druc.done : lvx.done hadamard.ap
$(ENV_DRUC); $(DRUC) hadamard
$(TOUCH) druc.done
# /*------------------------------------------------------------\
# | |
# | S2R |
# | |
# \------------------------------------------------------------*/
hadamard.cif : druc.done
$(ENV_S2R); $(S2R) -v -t hadamard
# /*------------------------------------------------------------\
# | |
# | TOOLS |
# | |
# \------------------------------------------------------------*/
graal: hadamard.ap
$(ENV_S2R); $(GRAAL) -l hadamard
xsch: hadamard.vst
$(ENV_LOON); $(XSCH) -l hadamard
xscht: hadamard_et.al
$(ENV_COUGAR); $(XSCH) -l hadamard_et
xpat: res_synth_1.pat
$(ENV_ASIMUT_SYNTH); $(XPAT) -l res_synth_1
dreal: hadamard.cif
$(ENV_S2R); $(DREAL) -l hadamard
# /*------------------------------------------------------------\
# | |
# | Clean |
# | |
# \------------------------------------------------------------*/
realclean : clean
clean :
$(RM) -f *.vst *.vbe *.boom *.done *.xsc *.al *.ap *.gpl *.gds \
*.log *.drc *.cif *.fin *.dat *.out hadamard_e.spi res_synth_1.pat \
res_vasy_1.pat

View File

@ -0,0 +1,106 @@
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity calcul is
port (
ramout : in std_logic_vector( 7 downto 0);
hadout : out std_logic_vector(13 downto 0);
ope : in std_logic;
hph : in std_logic;
vaccu : in std_logic;
clraccu : in std_logic;
vbreg : in std_logic;
vhadout : in std_logic;
c2i : in std_logic;
reset : in std_logic;
ck : in std_logic);
end calcul;
architecture behavioral of calcul is
type pile is array (0 to 7) of std_logic_vector (13 downto 0);
signal op : std_logic_vector(13 downto 0);
signal mux : std_logic_vector(13 downto 0);
signal alu : std_logic_vector(13 downto 0);
signal re : std_logic_vector(13 downto 0);
signal rhadout : std_logic_vector(13 downto 0);
signal accu : std_logic_vector(13 downto 0);
signal breg : pile ;
begin
-- le multiplexeur d'abord --
-- *********************** --
mux <= breg (7) when hph='0' else "000000"&ramout;
-- calcul alu --
-- ********** --
op(13 downto 0) <= "11111111111111" when ope='1' else
"00000000000000";
re(0) <= (accu(0) xor ope) and mux(0);
re(13 downto 1) <= (mux(12 downto 0) and re(12 downto 0) )
or ( ( accu(12 downto 0) xor op(12 downto 0))
and ( mux(12 downto 0) or re(12 downto 0)) );
alu <= accu xor mux xor (re(13 downto 1) & '0');
-- accumulateur --
-- ************ --
process (ck)
begin
if (ck='1' and ck'event ) then
if (clraccu='1') then accu <= (others =>'0');
elsif (vaccu='1')
then accu <= alu;
else accu <= accu;
end if;
end if;
end process;
-- registre de sortie --
-- ****************** --
process (ck)
begin
if (ck='1' and ck'event ) then
if (reset='1') then rhadout <= (others =>'0');
elsif (vhadout='1')
then rhadout <= accu;
else rhadout <= rhadout;
end if;
end if;
end process;
hadout <= rhadout;
-- banc de regsitres a decalage --
-- **************************** --
process (ck)
begin
if (ck='1' and ck'event)
then
if (c2i='1')
then
if (vbreg='1')
then breg(0) <= alu;
else breg(0) <= breg(7);
end if;
breg (1 to 7) <= breg (0 to 6);
end if;
end if;
end process;
end behavioral;

View File

@ -0,0 +1,50 @@
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_arith.ALL;
use IEEE.STD_LOGIC_unsigned.ALL;
entity compteur is
port ( c1i : in std_logic;
c2i : in std_logic;
loi : in std_logic;
c1 : out std_logic_vector (2 downto 0) ;
c2 : out std_logic_vector (2 downto 0) ;
lo : out std_logic_vector (2 downto 0) ;
reset : in std_logic;
ck : in std_logic );
end compteur;
architecture behavioral of compteur is
signal rc1 : integer range 0 to 7;
signal rc2 : integer range 0 to 7;
signal rlo : integer range 0 to 7;
begin
process (ck)
begin
if (ck='1' and ck'event) then
if (reset='1') then rc1<=0; rc2<=0; rlo<=0;
else
if c1i='1' then rc1 <= (rc1 + 1) mod 8;
else rc1 <= rc1;
end if;
if c2i='1' then rc2 <= (rc2 + 1) mod 8;
else rc2 <= rc2;
end if;
if loi='1' then rlo <= (rlo + 1) mod 8;
else rlo <= rlo;
end if;
end if;
end if;
end process;
c1 <= (conv_std_logic_vector(rc1,c1'length));
c2 <= (conv_std_logic_vector (rc2,c2'length));
lo <= (conv_std_logic_vector (rlo,lo'length));
end behavioral;

View File

@ -0,0 +1,36 @@
TOP ( # IOs are ordered from left to right
(IOPIN ck.0 );
(IOPIN empty.0 );
(IOPIN full.0 );
(IOPIN reset.0 );
(IOPIN data(7).0 );
(IOPIN data(6).0 );
(IOPIN data(5).0 );
(IOPIN data(4).0 );
(IOPIN data(3).0 );
(IOPIN data(2).0 );
(IOPIN data(1).0 );
(IOPIN data(0).0 );
)
BOTTOM ( # IOs are ordered from left to right
(IOPIN hadout(13).0 );
(IOPIN hadout(12).0 );
(IOPIN hadout(11).0 );
(IOPIN hadout(10).0 );
(IOPIN hadout(9).0 );
(IOPIN hadout(8).0 );
(IOPIN hadout(7).0 );
(IOPIN hadout(6).0 );
(IOPIN hadout(5).0 );
(IOPIN hadout(4).0 );
(IOPIN hadout(3).0 );
(IOPIN hadout(2).0 );
(IOPIN hadout(1).0 );
(IOPIN hadout(0).0 );
(IOPIN s_read.0 );
(IOPIN s_write.0 );
)
IGNORE ( # IOs are ignored(not placed) by IO Placer
)

View File

@ -0,0 +1,159 @@
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity hadamard is
port ( ck : in std_logic;
data : in std_logic_vector (7 downto 0);
empty : in std_logic;
full : in std_logic;
reset : in std_logic;
hadout : out std_logic_vector (13 downto 0);
s_read : out std_logic;
s_write : out std_logic );
end hadamard;
architecture schematic of hadamard is
signal ramout : std_logic_vector(7 downto 0);
signal ope : std_logic;
signal hph : std_logic;
signal vaccu : std_logic;
signal clraccu : std_logic;
signal vbreg : std_logic;
signal vhadout : std_logic;
signal c1 : std_logic_vector(2 downto 0);
signal c2 : std_logic_vector(2 downto 0);
signal c1c2 : std_logic_vector(5 downto 0);
signal lo : std_logic_vector(2 downto 0);
signal loi : std_logic;
signal c2i : std_logic;
signal c1i : std_logic;
signal readout : std_logic;
signal nreadout : std_logic;
signal nck : std_logic;
component calcul
port( ramout : in std_logic_vector ( 7 downto 0);
hadout : out std_logic_vector (13 downto 0);
ope : in std_logic;
hph : in std_logic;
vaccu : in std_logic;
clraccu : in std_logic;
vbreg : in std_logic;
vhadout : in std_logic;
c2i : in std_logic;
reset : in std_logic;
ck : in std_logic );
end component;
component sequenceur
port( c1 : in std_logic_vector (2 downto 0);
c2 : in std_logic_vector (2 downto 0);
lo : in std_logic_vector (2 downto 0);
ck : in std_logic;
empty : in std_logic;
full : in std_logic;
reset : in std_logic;
c1i : out std_logic;
c2i : out std_logic;
loi : out std_logic;
clraccu : out std_logic;
hph : out std_logic;
s_read : out std_logic;
vaccu : out std_logic;
vbreg : out std_logic;
vhadout : out std_logic;
s_write : out std_logic );
end component;
component compteur
port( c1i : in std_logic;
c2i : in std_logic;
loi : in std_logic;
c1 : out std_logic_vector (2 downto 0);
c2 : out std_logic_vector (2 downto 0);
lo : out std_logic_vector (2 downto 0) ;
reset : in std_logic;
ck : in std_logic );
end component;
component rom
port( c1 : in std_logic_vector (2 downto 0);
c2 : in std_logic_vector (2 downto 0);
hph : in std_logic;
lo : in std_logic_vector (2 downto 0);
ope : out std_logic );
end component;
component ram
port ( A : in std_logic_vector(5 downto 0);
CEB, WEB : in std_logic;
INN : in std_logic_vector(7 downto 0);
OUTT : out std_logic_vector(7 downto 0) );
end component;
begin
c1c2 <= c1&c2;
s_read <= readout;
nreadout <= not(readout);
nck <= not(ck);
e_ram : ram
port map( A => c1c2
, CEB => ck
, WEB => nreadout
, INN => data
, OUTT => ramout );
e_calcul : calcul
port map( ramout => ramout
, hadout => hadout
, ope => ope
, hph => hph
, vaccu => vaccu
, clraccu => clraccu
, vbreg => vbreg
, vhadout => vhadout
, c2i => c2i
, reset => reset
, ck => nck );
e_sequenceur : sequenceur
port map( c1 => c1
, c2 => c2
, lo => lo
, ck => nck
, empty => empty
, full => full
, reset => reset
, c1i => c1i
, c2i => c2i
, loi => loi
, clraccu => clraccu
, hph => hph
, s_read => readout
, vaccu => vaccu
, vbreg => vbreg
, vhadout => vhadout
, s_write => s_write );
e_rom : rom
port map( c1 => c1
, c2 => c2
, lo => lo
, hph => hph
, ope => ope );
e_compteur : compteur
port map( c1i => c1i
, c2i => c2i
, loi => loi
, c1 => c1
, c2 => c2
, lo => lo
, reset => reset
, ck => nck );
end schematic;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,39 @@
---------------------------------------------------------
---------------- Bank description ----------------
---------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_arith.ALL;
use IEEE.STD_LOGIC_unsigned.ALL;
--use IEEE.STD_LOGIC_signed.ALL;
ENTITY ram IS
port ( A : in std_logic_vector(5 downto 0);
CEB, WEB : in std_logic;
INN : in std_logic_vector(7 downto 0);
OUTT : out std_logic_vector(7 downto 0)
);
END ram;
ARCHITECTURE dataflow_view OF ram IS
SUBTYPE TYPE_WORD IS std_logic_vector(7 downto 0);
TYPE TYPE_RAM IS ARRAY(63 DOWNTO 0) OF TYPE_WORD;
SIGNAL memory : TYPE_RAM;
BEGIN
OUTT <= memory( CONV_INTEGER( A ) );
RAM_0 : PROCESS( CEB )
BEGIN
IF (CEB='1' AND CEB'EVENT )
THEN IF (WEB='0')
THEN memory( CONV_INTEGER( A ) ) <= INN;
END IF;
END IF;
END PROCESS RAM_0;
END dataflow_view;

View File

@ -0,0 +1,26 @@
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_unsigned.ALL;
use IEEE.STD_LOGIC_arith.ALL;
entity rom is
port ( c1 : in std_logic_vector (2 downto 0);
c2 : in std_logic_vector (2 downto 0);
hph : in std_logic;
lo : in std_logic_vector (2 downto 0);
ope : out std_logic );
end rom;
architecture behavioral of rom is
signal adr : std_logic_vector (5 downto 0);
constant rom_data : std_logic_vector(0 to 63) := "0000000000001111001111000011001101100110011010010101101001010101";
begin
adr <= c2(2 downto 0)&c1(2 downto 0) when hph='0' else
lo(2 downto 0)&c1(2 downto 0) ;
ope <= rom_data(conv_integer(Adr));
end behavioral;

View File

@ -0,0 +1,249 @@
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity sequenceur is
port ( c1 : in std_logic_vector (2 downto 0);
c2 : in std_logic_vector (2 downto 0);
lo : in std_logic_vector (2 downto 0);
ck : in std_logic;
empty : in std_logic;
full : in std_logic;
reset : in std_logic;
c1i : out std_logic;
c2i : out std_logic;
clraccu : out std_logic;
hph : out std_logic;
loi : out std_logic;
s_read : out std_logic;
vaccu : out std_logic;
vbreg : out std_logic;
vhadout : out std_logic;
s_write : out std_logic );
end sequenceur;
architecture behavioral of sequenceur is
type etat_type is (E0,E1,E2,E3,E4,E5,E6,E7,E8,E9,E10);
signal next_state,current_state : etat_type;
begin
process (current_state,reset,empty,full,c1,c2,lo)
begin
if (reset='1') then
next_state <= E0;
s_read <= '0';
s_write <= '0';
clraccu <= '1';
hph <= '0';
vhadout <= '0';
vaccu <= '0';
vbreg <= '0';
c1i <= '0';
c2i <= '0';
loi <= '0';
else
case current_state is
when E0 =>
next_state <= E1;
s_read <= '0';
s_write <= '0';
clraccu <= '1';
hph <= '0';
vhadout <= '0';
vaccu <= '0';
vbreg <= '0';
c1i <= '0';
c2i <= '0';
loi <= '0';
when E1 =>
if (empty = '1') then next_state <= E1;
else next_state <= E2;
end if;
s_read <= '1';
s_write <= '0';
clraccu <= '0';
hph <= '0';
vhadout <= '0';
vaccu <= '0';
vbreg <= '0';
c1i <= '0';
c2i <= '0';
loi <= '0';
when E2 =>
if (c2 = "111") then next_state <= E3;
else next_state <= E1;
end if;
s_read <= '0';
s_write <= '0';
clraccu <= '0';
hph <= '0';
vhadout <= '0';
vaccu <= '0';
vbreg <= '0';
c1i <= '0';
c2i <= '1';
loi <= '0';
when E3 =>
if (c1 = "111") then next_state <= E4;
else next_state <= E1;
end if;
s_read <= '0';
s_write <= '0';
clraccu <= '0';
hph <= '0';
vhadout <= '0';
vaccu <= '0';
vbreg <= '0';
c1i <= '1';
c2i <= '0';
loi <= '0';
when E4 =>
if (c1 = "110") then next_state <= E5;
else next_state <= E4;
end if;
s_read <= '0';
s_write <= '0';
clraccu <= '0';
hph <= '1';
vhadout <= '0';
vaccu <= '1';
vbreg <= '0';
c1i <= '1';
c2i <= '0';
loi <= '0';
when E5 =>
if ( c2 = "111" ) then next_state <= E6;
else next_state <= E4;
end if;
s_read <= '0';
s_write <= '0';
clraccu <= '1';
hph <= '1';
vhadout <= '0';
vaccu <= '0';
vbreg <= '1';
c1i <= '1';
c2i <= '1';
loi <= '0';
when E6 =>
if (c2 = "111") then next_state <= E7;
else next_state <= E6;
end if;
s_read <= '0';
s_write <= '0';
clraccu <= '0';
hph <= '0';
vhadout <= '0';
vaccu <= '1';
vbreg <= '0';
c1i <= '0';
c2i <= '1';
loi <= '0';
when E7 =>
next_state <= E8;
s_read <= '0';
s_write <= '0';
clraccu <= '0';
hph <= '0';
vhadout <= '1';
vaccu <= '0';
vbreg <= '0';
c1i <= '0';
c2i <= '0';
loi <= '0';
when E8 =>
if (full = '1') then next_state <= E8;
else next_state <= E9;
end if;
s_read <= '0';
s_write <= '1';
clraccu <= '1';
hph <= '0';
vhadout <= '0';
vaccu <= '0';
vbreg <= '0';
c1i <= '0';
c2i <= '0';
loi <= '0';
when E9 =>
if (c1 = "111") then next_state <= E10;
else next_state <= E6;
end if;
s_read <= '0';
s_write <= '0';
clraccu <= '1';
hph <= '0';
vhadout <= '0';
vaccu <= '0';
vbreg <= '0';
c1i <= '1';
c2i <= '0';
loi <= '0';
when E10 =>
if(lo = "111") then next_state <= E0;
else next_state <= E4;
end if;
s_read <= '0';
s_write <= '0';
clraccu <= '1';
hph <= '0';
vhadout <= '0';
vaccu <= '0';
vbreg <= '0';
c1i <= '0';
c2i <= '0';
loi <= '1';
end case;
end if;
end process;
process(ck)
begin
if (ck='1' and ck'event) then
current_state <= next_state;
end if;
end process;
end behavioral;