- new AMD2901 version using only RTL synthesis (VASY)

This commit is contained in:
Ludovic Jacomme 2004-05-23 19:00:16 +00:00
parent 42b008a67e
commit 9da0366585
4 changed files with 1779 additions and 0 deletions

View File

@ -0,0 +1,312 @@
# /*------------------------------------------------------------\
# | |
# | 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 = 4
# /*------------------------------------------------------------\
# | |
# | 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_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_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_SPI_MODEL=$(TOP)/etc/spimodel.cfg; export MBK_SPI_MODEL; \
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 : amd2901.cif
# /*------------------------------------------------------------\
# | |
# | Vasy |
# | |
# \------------------------------------------------------------*/
amd2901.vbe : amd2901.vhdl
$(ENV_VASY); $(VASY) -a -B -o -p -I vhdl amd2901
# /*------------------------------------------------------------\
# | |
# | Asimut |
# | |
# \------------------------------------------------------------*/
res_vasy_1.pat : amd2901.vbe
$(ENV_ASIMUT_VASY); $(ASIMUT) -b amd2901 amd2901 res_vasy_1
res_synth_1.pat : amd2901.vst
$(ENV_ASIMUT_SYNTH); $(ASIMUT) amd2901 amd2901 res_synth_1
# /*------------------------------------------------------------\
# | |
# | Boom |
# | |
# \------------------------------------------------------------*/
boom.done : amd2901_o.vbe
@$(TOUCH) boom.done
amd2901_o.vbe : amd2901.vbe amd2901.boom res_vasy_1.pat
$(ENV_BOOM); $(BOOM) -VP amd2901 amd2901_o
# /*------------------------------------------------------------\
# | |
# | Boog |
# | |
# \------------------------------------------------------------*/
boog.done : amd2901_o.vst
@$(TOUCH) boog.done
amd2901_o.vst : amd2901_o.vbe
$(ENV_BOOG); $(BOOG) amd2901_o
# /*------------------------------------------------------------\
# | |
# | Loon |
# | |
# \------------------------------------------------------------*/
loon.done : amd2901.vst
@$(TOUCH) loon.done
amd2901.vst : amd2901_o.vst
$(ENV_LOON); $(LOON) amd2901_o amd2901
# /*------------------------------------------------------------\
# | |
# | OCP |
# | |
# \------------------------------------------------------------*/
amd2901_p.ap : res_synth_1.pat
$(ENV_OCP); $(OCP) -v -gnuplot -margin 0.4 -ioc amd2901 amd2901 amd2901_p
# /*------------------------------------------------------------\
# | |
# | OCR |
# | |
# \------------------------------------------------------------*/
# amd2901.ap : amd2901_p.ap amd2901.vst
# $(ENV_OCR); $(OCR) -v -l $(METAL_LEVEL) -L amd2901 -P amd2901_p -O amd2901
amd2901.ap : amd2901_p.ap amd2901.vst
$(ENV_OCR); $(NERO) -v -$(METAL_LEVEL) -p amd2901_p amd2901 amd2901
# /*------------------------------------------------------------\
# | |
# | Cougar |
# | |
# \------------------------------------------------------------*/
amd2901_e.spi : amd2901.ap
$(ENV_COUGAR_SPI); $(COUGAR) -v -ac amd2901 amd2901_e
amd2901_e.al : amd2901.ap
$(ENV_COUGAR); $(COUGAR) -v -ac amd2901 amd2901_e
amd2901_et.al : amd2901.ap
$(ENV_COUGAR); $(COUGAR) -v -t -ac amd2901 amd2901_et
amd2901_et.spi : amd2901.ap
$(ENV_COUGAR_SPI); $(COUGAR) -v -t -ac amd2901 amd2901_et
amd2901_er.spi : amd2901.cif
$(ENV_COUGAR); $(COUGAR) -v -r -t amd2901 amd2901_er
# /*------------------------------------------------------------\
# | |
# | Lvx |
# | |
# \------------------------------------------------------------*/
lvx.done : amd2901.vst amd2901_e.spi amd2901_e.al
$(ENV_LVX); $(LVX) vst al amd2901 amd2901_e -f
$(TOUCH) lvx.done
# /*------------------------------------------------------------\
# | |
# | Druc |
# | |
# \------------------------------------------------------------*/
druc.done : lvx.done amd2901.ap
$(ENV_DRUC); $(DRUC) amd2901
$(TOUCH) druc.done
# /*------------------------------------------------------------\
# | |
# | S2R |
# | |
# \------------------------------------------------------------*/
amd2901.cif : druc.done
$(ENV_S2R); $(S2R) -v amd2901
# /*------------------------------------------------------------\
# | |
# | TOOLS |
# | |
# \------------------------------------------------------------*/
graal: amd2901.ap
$(ENV_S2R); $(GRAAL) -l amd2901
xsch: amd2901.vst
$(ENV_LOON); $(XSCH) -l amd2901
xscht: amd2901_et.al
$(ENV_COUGAR); $(XSCH) -l amd2901_et
xpat: res_synth_1.pat
$(ENV_ASIMUT_SYNTH); $(XPAT) -l res_synth_1
dreal: amd2901.cif
$(ENV_S2R); $(DREAL) -l amd2901
# /*------------------------------------------------------------\
# | |
# | Clean |
# | |
# \------------------------------------------------------------*/
realclean : clean
clean :
$(RM) -f *.vst *.vbe res_*.pat *.boom *.done *.xsc *.gpl \
*.ap *.drc *.dat *.gds blast.fin *.cif *.rep \
*.log *.out *.al

View File

@ -0,0 +1,59 @@
# Copyright (c) 1997 by Cadence. All rights reserved.
###################################################################
# 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 ck.0 );
(IOPIN i(8).0 );
(IOPIN i(7).0 );
(IOPIN i(6).0 );
(IOPIN i(5).0 );
(IOPIN i(4).0 );
(IOPIN i(3).0 );
(IOPIN i(2).0 );
(IOPIN i(1).0 );
(IOPIN i(0).0 );
(IOPIN r0_in.0 );
(IOPIN r0_out.0 );
(IOPIN r3_in.0 );
(IOPIN r3_out.0 );
(IOPIN d(3).0 );
(IOPIN d(2).0 );
(IOPIN d(1).0 );
(IOPIN d(0).0 );
(IOPIN cin.0 );
)
BOTTOM ( # IOs are ordered from left to right
(IOPIN ovr.0 );
(IOPIN zero.0 );
(IOPIN signe.0 );
(IOPIN np.0 );
(IOPIN ng.0 );
(IOPIN cout.0 );
(IOPIN y(3).0 );
(IOPIN y(2).0 );
(IOPIN y(1).0 );
(IOPIN y(0).0 );
(IOPIN q0_in.0 );
(IOPIN q0_out.0 );
(IOPIN q3_in.0 );
(IOPIN q3_out.0 );
(IOPIN a(3).0 );
(IOPIN a(2).0 );
(IOPIN a(1).0 );
(IOPIN a(0).0 );
(IOPIN b(3).0 );
(IOPIN b(2).0 );
(IOPIN b(1).0 );
(IOPIN b(0).0 );
)
IGNORE ( # IOs are ignored(not placed) by IO Placer
)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,278 @@
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_arith.ALL;
use IEEE.STD_LOGIC_unsigned.ALL;
-- AMD2901'sig_s behavioral description
-- Connector'sig_s declaration
--
ENTITY amd2901 IS
PORT (
ck : IN STD_LOGIC;
i : IN STD_LOGIC_VECTOR (8 DOWNTO 0);
a : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
b : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
d : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
r0_in : IN STD_LOGIC;
r0_out : OUT STD_LOGIC;
r3_in : IN STD_LOGIC;
r3_out : OUT STD_LOGIC;
q0_in : IN STD_LOGIC;
q0_out : OUT STD_LOGIC;
q3_in : IN STD_LOGIC;
q3_out : OUT STD_LOGIC;
ovr : OUT STD_LOGIC;
zero : OUT STD_LOGIC;
signe : OUT STD_LOGIC;
np : OUT STD_LOGIC;
ng : OUT STD_LOGIC;
cin : IN STD_LOGIC;
cout : OUT STD_LOGIC;
y : OUT STD_LOGIC_VECTOR (3 DOWNTO 0)
);
END amd2901;
--
ARCHITECTURE data_flow OF amd2901 IS
--
-- Internal registers
--
--
SIGNAL accu : STD_LOGIC_VECTOR (3 DOWNTO 0);
--
-- Internal signals
--
--
SIGNAL sig_r : STD_LOGIC_VECTOR (3 DOWNTO 0);
SIGNAL sig_s : STD_LOGIC_VECTOR (3 DOWNTO 0);
SIGNAL alu_out : STD_LOGIC_VECTOR (3 DOWNTO 0);
SIGNAL sumrs : STD_LOGIC_VECTOR (3 DOWNTO 0);
SIGNAL difrs : STD_LOGIC_VECTOR (3 DOWNTO 0);
SIGNAL difsr : STD_LOGIC_VECTOR (3 DOWNTO 0);
SIGNAL c_sumrs : STD_LOGIC_VECTOR (3 DOWNTO 0);
SIGNAL c_difrs : STD_LOGIC_VECTOR (3 DOWNTO 0);
SIGNAL c_difsr : STD_LOGIC_VECTOR (3 DOWNTO 0);
SIGNAL waccu : STD_LOGIC;
sIGNAL shift_n : STD_LOGIC;
SIGNAL shift_l : STD_LOGIC;
SIGNAL shift_r : STD_LOGIC;
SIGNAL sh_acc : STD_LOGIC_VECTOR (3 DOWNTO 0);
SIGNAL sh_ram : STD_LOGIC_VECTOR (3 DOWNTO 0);
SIGNAL wram : STD_LOGIC;
SIGNAL accu_in : STD_LOGIC_VECTOR ( 3 DOWNTO 0 ) ;
SIGNAL ra : STD_LOGIC_VECTOR ( 3 DOWNTO 0 ) ;
SIGNAL rb : STD_LOGIC_VECTOR ( 3 DOWNTO 0 ) ;
SUBTYPE TYPE_WORD IS std_logic_vector(3 downto 0);
TYPE TYPE_RAM IS ARRAY(15 DOWNTO 0) OF TYPE_WORD;
SIGNAL ram : TYPE_RAM;
BEGIN
ra <= ram( CONV_INTEGER( a ) );
rb <= ram( CONV_INTEGER( b ) );
PROCESS( ck )
BEGIN
IF (ck='1' AND ck'EVENT )
THEN IF (wram='1')
THEN ram( CONV_INTEGER( A ) ) <= sh_ram;
END IF;
END IF;
END PROCESS;
--
-- ALU-INPUT MULTIPLEXER
--
WITH i(2 DOWNTO 0) SELECT
sig_s <= ra WHEN "100",
ra WHEN "101",
rb WHEN "001",
rb WHEN "011",
NOT accu WHEN "000",
NOT accu WHEN "010",
NOT accu WHEN "110",
"0000" WHEN others;
--
--
WITH i(2 DOWNTO 0) SELECT
sig_r <= ra WHEN "000",
ra WHEN "001",
"0000" WHEN "010",
"0000" WHEN "011",
"0000" WHEN "100",
d WHEN others;
--
-- OUTPUT
--
WITH i(8 DOWNTO 6) SELECT
y <= ra WHEN "010",
alu_out when others;
--
-- Arithmetic and Logic Unit
--
-- sig_r+sig_s
--
c_sumrs <= (sig_r AND sig_s) OR (sig_r(3 DOWNTO 0) AND (c_sumrs(2 DOWNTO 0) & cin)) OR
(sig_s(3 DOWNTO 0) AND (c_sumrs(2 DOWNTO 0) & cin));
sumrs <= sig_s XOR (c_sumrs(2 DOWNTO 0) & cin) XOR sig_r;
--
-- sig_r-sig_s
--
difrs(3 DOWNTO 0) <= sig_r(3 DOWNTO 0) XOR
NOT sig_s(3 DOWNTO 0) XOR
(c_difrs(2 DOWNTO 0) & cin);
c_difrs(3 DOWNTO 0) <= (sig_r(3 DOWNTO 0) AND NOT sig_s(3 DOWNTO 0)) OR
(sig_r(3 DOWNTO 0) AND (c_difrs(2 DOWNTO 0) & cin)) OR
(NOT sig_s(3 DOWNTO 0) AND (c_difrs(2 DOWNTO 0) & cin));
--
-- sig_s-sig_r
--
difsr(3 DOWNTO 0) <= NOT sig_r(3 DOWNTO 0) XOR
sig_s(3 DOWNTO 0) XOR
(c_difsr(2 DOWNTO 0) & cin);
c_difsr(3 DOWNTO 0) <= (NOT sig_r(3 DOWNTO 0) AND sig_s(3 DOWNTO 0)) OR
(NOT sig_r(3 DOWNTO 0) AND (c_difsr(2 DOWNTO 0) & cin)) OR
(sig_s(3 DOWNTO 0) AND (c_difsr(2 DOWNTO 0) & cin));
--
-- P &G FLAGS
--
WITH i(5 DOWNTO 3) SELECT
ng <= NOT ((sig_r(3) AND sig_s(3)) OR ((sig_r(3) OR sig_s(3)) AND (sig_r(2) AND sig_s(2))) OR ((sig_r(3) OR sig_s(3)) AND (sig_r(2) OR sig_s(2)) AND (sig_r(1) AND sig_s(1))) OR ((sig_r(3) OR sig_s(3)) AND (sig_r(2) OR sig_s(2)) AND (sig_r(1) OR sig_s(1)) AND (sig_r(0) AND sig_s(0)))) WHEN "000",
NOT ((NOT sig_r(3) AND sig_s(3)) OR ((NOT sig_r(3) OR sig_s(3)) AND (NOT sig_r(2) AND sig_s(2))) OR ((NOT sig_r(3) OR sig_s(3)) AND (NOT sig_r(2) OR sig_s(2)) AND (NOT sig_r(1) AND sig_s(1))) OR ((NOT sig_r(3) OR sig_s(3)) AND (NOT sig_r(2) OR sig_s(2)) AND (NOT sig_r(1) OR sig_s(1)) AND (NOT sig_r(0) AND sig_s(0)))) WHEN "001",
NOT ((sig_r(3) AND NOT sig_s(3)) OR ((sig_r(3) OR NOT sig_s(3)) AND (sig_r(2) AND NOT sig_s(2))) OR ((sig_r(3) OR NOT sig_s(3)) AND (sig_r(2) OR NOT sig_s(2)) AND (sig_r(1) AND NOT sig_s(1))) OR ((sig_r(3) OR NOT sig_s(3)) AND (sig_r(2) OR NOT sig_s(2)) AND (sig_r(1) OR NOT sig_s(1)) AND (sig_r(0) AND NOT sig_s(0))))WHEN "010",
"1" WHEN OTHERS;
--
--
WITH i(5 DOWNTO 3) SELECT
np <= NOT ((sig_r(3) OR sig_s(3)) AND (sig_r(2) OR sig_s(2)) AND (sig_r(1) OR sig_s(1)) AND (sig_r(0) OR sig_s(0))) WHEN "000",
NOT ((NOT sig_r(3) OR sig_s(3)) AND (NOT sig_r(2) OR sig_s(2)) AND (NOT sig_r(1) OR sig_s(1)) AND (NOT sig_r(0) OR sig_s(0))) WHEN "001",
NOT ((sig_r(3) OR NOT sig_s(3)) AND (sig_r(2) OR NOT sig_s(2)) AND (sig_r(1) OR NOT sig_s(1)) AND (sig_r(0) OR NOT sig_s(0))) WHEN "010",
"1" WHEN OTHERS;
--
--
signe <= alu_out(3);
zero <= NOT (alu_out(3) OR alu_out(2) OR alu_out(1) OR alu_out(0));
--
--
WITH i(5 DOWNTO 3) SELECT
ovr <= c_sumrs(3) XOR c_sumrs(2) WHEN "000",
c_difsr(3) XOR c_difsr(2) WHEN "001",
c_difrs(3) XOR c_difrs(2) WHEN "010",
'0' WHEN OTHERS;
WITH i(5 DOWNTO 3) SELECT
alu_out <= sumrs WHEN "000",
difsr WHEN "001",
difrs WHEN "010",
sig_r OR sig_s WHEN "011",
sig_r AND sig_s WHEN "100",
NOT(sig_r) AND sig_s WHEN "101",
sig_r XOR sig_s WHEN "110",
NOT(sig_r XOR sig_s) WHEN others;
--
WITH i(5 DOWNTO 3) SELECT
cout <= c_sumrs(3) WHEN "000",
c_difsr(3) WHEN "001",
c_difrs(3) WHEN "010",
"0" WHEN OTHERS;
--
--
--
--
-- CONTROL SIGNALS
--
--
wram <= (i(8) OR i(7));
waccu <= NOT (i(6)) AND ((NOT i(7)) OR i(8));
shift_r <= i(8) AND (NOT i(7));
shift_l <= i(8) AND i(7);
shift_n <= NOT i(8);
--
--
-- SHIFTER ACCU
--
WITH i(8 DOWNTO 6) SELECT
sh_acc(3) <= alu_out(3) WHEN "000",
NOT accu(2) WHEN "110",
NOT accu(2) WHEN "111",
q3_in WHEN "100",
q3_in WHEN "101",
"0" WHEN OTHERS;
--
WITH i(8 DOWNTO 6) SELECT
sh_acc(2) <= alu_out(2) WHEN "000",
NOT accu(1) WHEN "110",
NOT accu(1) WHEN "111",
NOT accu(3) WHEN "100",
NOT accu(3) WHEN "101",
"0" WHEN OTHERS;
--
WITH i(8 DOWNTO 6) SELECT
sh_acc(1) <= alu_out(1) WHEN "000",
NOT accu(0) WHEN "110",
NOT accu(0) WHEN "111",
NOT accu(2) WHEN "100",
NOT accu(2) WHEN "101",
"0" WHEN OTHERS;
--
WITH i(8 DOWNTO 6) SELECT
sh_acc(0) <= alu_out(0) WHEN "000",
q0_in WHEN "110",
q0_in WHEN "111",
NOT accu(1) WHEN "100",
NOT accu(1) WHEN "101",
"0" WHEN OTHERS;
--
q3_out <= NOT accu(3);
q0_out <= NOT accu(0);
--
-- WRITING ACCU
--
accu_in(3 DOWNTO 0) <= sh_acc(3 DOWNTO 0);
process ( ck )
begin
if ( ck='1' and ck'event )
then if ( waccu='1') then accu <= accu_in;
end if;
end if;
end process;
--
-- SHIFTER - RAM
--
WITH shift_n & shift_l & shift_r SELECT
sh_ram(3) <= alu_out(3) WHEN "100",
alu_out(2) WHEN "010",
r3_in WHEN "001",
"0" WHEN OTHERS;
--
WITH shift_n & shift_l & shift_r SELECT
sh_ram(2) <= alu_out(2) WHEN "100",
alu_out(1) WHEN "010",
alu_out(3) WHEN "001",
"0" WHEN OTHERS;
--
WITH shift_n & shift_l & shift_r SELECT
sh_ram(1) <= alu_out(1) WHEN "100",
alu_out(0) WHEN "010",
alu_out(2) WHEN "001",
"0" WHEN OTHERS;
--
WITH shift_n & shift_l & shift_r SELECT
sh_ram(0) <= alu_out(0) WHEN "100",
r0_in WHEN "010",
alu_out(1) WHEN "001",
"0" WHEN OTHERS;
r3_out <= alu_out(3);
r0_out <= alu_out(0);
END data_flow;