From aedeaf17b001eee7adce5f21dd071883f8fc1473 Mon Sep 17 00:00:00 2001 From: Ludovic Jacomme Date: Sun, 23 May 2004 18:51:00 +0000 Subject: [PATCH] - A square root 8 bits --- .../alliance-examples/sqrt8/CATAL_ASIMUT_VASY | 2 + .../alliance-examples/sqrt8/Makefile | 316 ++++++++++++++++++ .../alliance-examples/sqrt8/README | 18 + .../alliance-examples/sqrt8/sm.vhdl | 24 ++ .../alliance-examples/sqrt8/sqrt8.ioc | 19 ++ .../alliance-examples/sqrt8/sqrt8.pat | 25 ++ .../alliance-examples/sqrt8/sqrt8.vhdl | 60 ++++ 7 files changed, 464 insertions(+) create mode 100644 alliance/src/documentation/alliance-examples/sqrt8/CATAL_ASIMUT_VASY create mode 100644 alliance/src/documentation/alliance-examples/sqrt8/Makefile create mode 100644 alliance/src/documentation/alliance-examples/sqrt8/README create mode 100644 alliance/src/documentation/alliance-examples/sqrt8/sm.vhdl create mode 100644 alliance/src/documentation/alliance-examples/sqrt8/sqrt8.ioc create mode 100644 alliance/src/documentation/alliance-examples/sqrt8/sqrt8.pat create mode 100644 alliance/src/documentation/alliance-examples/sqrt8/sqrt8.vhdl diff --git a/alliance/src/documentation/alliance-examples/sqrt8/CATAL_ASIMUT_VASY b/alliance/src/documentation/alliance-examples/sqrt8/CATAL_ASIMUT_VASY new file mode 100644 index 00000000..4e1cd532 --- /dev/null +++ b/alliance/src/documentation/alliance-examples/sqrt8/CATAL_ASIMUT_VASY @@ -0,0 +1,2 @@ +sm C +sqrt8_model C diff --git a/alliance/src/documentation/alliance-examples/sqrt8/Makefile b/alliance/src/documentation/alliance-examples/sqrt8/Makefile new file mode 100644 index 00000000..f23617dc --- /dev/null +++ b/alliance/src/documentation/alliance-examples/sqrt8/Makefile @@ -0,0 +1,316 @@ +# /*------------------------------------------------------------\ +# | | +# | 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 +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 = 5 + +# /*------------------------------------------------------------\ +# | | +# | 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_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 : sqrt8.cif + +# /*------------------------------------------------------------\ +# | | +# | Vasy | +# | | +# \------------------------------------------------------------*/ + +sqrt8.vst sm.vbe sqrt8_model.vbe : sqrt8.vhdl + $(ENV_VASY); $(VASY) -a -B -o -p -I vhdl -H sqrt8 + +# /*------------------------------------------------------------\ +# | | +# | Asimut | +# | | +# \------------------------------------------------------------*/ + +res_vasy_1.pat : sqrt8.vst sm.vbe sqrt8_model.vbe + $(ENV_ASIMUT_VASY); $(ASIMUT) sqrt8 sqrt8 res_vasy_1 + +res_synth_1.pat : sqrt8.vst sm.vst sqrt8_model.vst + $(ENV_ASIMUT_SYNTH); $(ASIMUT) sqrt8 sqrt8 res_synth_1 + + +# /*------------------------------------------------------------\ +# | | +# | Boom | +# | | +# \------------------------------------------------------------*/ + +boom.done : sm_o.vbe sqrt8_model_o.vbe + @$(TOUCH) boom.done + +sm_o.vbe : sm.vbe res_vasy_1.pat + $(ENV_BOOM); $(BOOM) -VP sm sm_o + +sqrt8_model_o.vbe : sqrt8_model.vbe res_vasy_1.pat + $(ENV_BOOM); $(BOOM) -VP sqrt8_model sqrt8_model_o + +# /*------------------------------------------------------------\ +# | | +# | Boog | +# | | +# \------------------------------------------------------------*/ + +boog.done : sqrt8.vst sm_o.vst sqrt8_model_o.vst + @$(TOUCH) boog.done + +sm_o.vst : sm_o.vbe res_vasy_1.pat + $(ENV_BOOG); $(BOOG) sm_o + +sqrt8_model_o.vst : sqrt8_model_o.vbe + $(ENV_BOOG); $(BOOG) sqrt8_model_o + +# /*------------------------------------------------------------\ +# | | +# | Loon | +# | | +# \------------------------------------------------------------*/ + +loon.done : sqrt8.vst sm.vst sqrt8_model.vst + @$(TOUCH) loon.done + +sm.vst : sm_o.vst res_vasy_1.pat + $(ENV_LOON); $(LOON) sm_o sm + +sqrt8_model.vst : sqrt8_model_o.vst + $(ENV_LOON); $(LOON) sqrt8_model_o sqrt8_model + +# /*------------------------------------------------------------\ +# | | +# | OCP | +# | | +# \------------------------------------------------------------*/ + +sqrt8_p.ap : res_synth_1.pat + $(ENV_OCP); $(OCP) -v -ioc sqrt8 -gnuplot sqrt8 sqrt8_p + +# /*------------------------------------------------------------\ +# | | +# | NERO | +# | | +# \------------------------------------------------------------*/ + +sqrt8.ap : sqrt8_p.ap sqrt8.vst + $(ENV_NERO); $(NERO) -V -$(METAL_LEVEL) -p sqrt8_p sqrt8 sqrt8 + +# /*------------------------------------------------------------\ +# | | +# | Cougar | +# | | +# \------------------------------------------------------------*/ + +sqrt8_e.al : sqrt8.ap + $(ENV_COUGAR); $(COUGAR) -v -ac sqrt8 sqrt8_e + +sqrt8_et.al : sqrt8.ap + $(ENV_COUGAR); $(COUGAR) -v -t -ac sqrt8 sqrt8_et + +sqrt8_e.spi : sqrt8.ap sqrt8_e.al + $(ENV_COUGAR_SPI); $(COUGAR) -v -ac sqrt8 sqrt8_e + +sqrt8_et.spi : sqrt8.ap sqrt8_e.al + $(ENV_COUGAR_SPI); $(COUGAR) -v -t -ac sqrt8 sqrt8_et + +sqrt8_er.al : sqrt8.cif + $(ENV_COUGAR); $(COUGAR) -v -r -t sqrt8 sqrt8_er + +# /*------------------------------------------------------------\ +# | | +# | Lvx | +# | | +# \------------------------------------------------------------*/ + +lvx.done : sqrt8.vst sqrt8_e.al + $(ENV_LVX); $(LVX) vst al sqrt8 sqrt8_e -f + $(TOUCH) lvx.done + +# /*------------------------------------------------------------\ +# | | +# | Druc | +# | | +# \------------------------------------------------------------*/ + +druc.done : lvx.done sqrt8.ap + $(ENV_DRUC); $(DRUC) sqrt8 + $(TOUCH) druc.done + +# /*------------------------------------------------------------\ +# | | +# | S2R | +# | | +# \------------------------------------------------------------*/ + +sqrt8.cif : druc.done + $(ENV_S2R); $(S2R) -v -t sqrt8 + +# /*------------------------------------------------------------\ +# | | +# | TOOLS | +# | | +# \------------------------------------------------------------*/ + +graal: sqrt8.ap + $(ENV_S2R); $(GRAAL) -l sqrt8 + +xsch: sqrt8.vst + $(ENV_LOON); $(XSCH) -l sqrt8 + +xscht: sqrt8_et.al + $(ENV_COUGAR); $(XSCH) -l sqrt8_et + +xpat: res_synth_1.pat + $(ENV_ASIMUT_SYNTH); $(XPAT) -l res_synth_1 + +dreal: sqrt8.cif + $(ENV_S2R); $(DREAL) -l sqrt8 + +# /*------------------------------------------------------------\ +# | | +# | Clean | +# | | +# \------------------------------------------------------------*/ + +realclean : clean + +clean : + $(RM) -f *.vst *.vbe *.boom *.done *.xsc *.al *.ap *.gpl *.gds \ + *.log *.drc *.cif *.fin *.dat *.out sqrt8_e.spi res_synth_1.pat \ + res_vasy_1.pat + diff --git a/alliance/src/documentation/alliance-examples/sqrt8/README b/alliance/src/documentation/alliance-examples/sqrt8/README new file mode 100644 index 00000000..3ffd418f --- /dev/null +++ b/alliance/src/documentation/alliance-examples/sqrt8/README @@ -0,0 +1,18 @@ +# /*------------------------------------------------------------\ +# | | +# | File : README | +# | | +# | Author : Jacomme Ludovic | +# | | +# \------------------------------------------------------------*/ + +This directory contains the VHDL description of combinatorial 8 bits +sqrt chip and the associated stimuli file, and also a configuration file for IO +placement (used during the Place and Route step). + +The Makefile set environement variables properly and run Alliance tools, +following each step of the design flow from VHDL up to real layout in a + pseudo 0.35 techno. + +The environement variable ALLIANCE_TOP as to be set. + diff --git a/alliance/src/documentation/alliance-examples/sqrt8/sm.vhdl b/alliance/src/documentation/alliance-examples/sqrt8/sm.vhdl new file mode 100644 index 00000000..c5f90234 --- /dev/null +++ b/alliance/src/documentation/alliance-examples/sqrt8/sm.vhdl @@ -0,0 +1,24 @@ +library IEEE; +use IEEE.std_logic_1164.all; + +entity Sm is -- subtractor multiplexor + port ( x : in std_logic; + y : in std_logic; + b : in std_logic; + u : in std_logic; + d : out std_logic; + bo : out std_logic); +end Sm; + +architecture circuits of Sm is + signal t011, t111, t010, t001, t100, td : std_logic; +begin -- circuits of Sm + t011 <= (not x) and y and b; + t111 <= x and y and b; + t010 <= (not x) and y and (not b); + t001 <= (not x) and (not y) and b; + t100 <= x and (not y) and (not b); + bo <= t011 or t111 or t010 or t001; + td <= t100 or t001 or t010 or t111; + d <= td when u='1' else x; +end circuits; -- of Sm diff --git a/alliance/src/documentation/alliance-examples/sqrt8/sqrt8.ioc b/alliance/src/documentation/alliance-examples/sqrt8/sqrt8.ioc new file mode 100644 index 00000000..3ac70c8c --- /dev/null +++ b/alliance/src/documentation/alliance-examples/sqrt8/sqrt8.ioc @@ -0,0 +1,19 @@ + +TOP ( # IOs are ordered from left to right + (IOPIN p(7).0 ); + (IOPIN p(6).0 ); + (IOPIN p(5).0 ); + (IOPIN p(4).0 ); + (IOPIN p(3).0 ); + (IOPIN p(2).0 ); + (IOPIN p(1).0 ); + (IOPIN p(0).0 ); +) +BOTTOM ( # IOs are ordered from left to right + (IOPIN u(3).0 ); + (IOPIN u(2).0 ); + (IOPIN u(1).0 ); + (IOPIN u(0).0 ); +) +IGNORE ( # IOs are ignored(not placed) by IO Placer +) diff --git a/alliance/src/documentation/alliance-examples/sqrt8/sqrt8.pat b/alliance/src/documentation/alliance-examples/sqrt8/sqrt8.pat new file mode 100644 index 00000000..328a523d --- /dev/null +++ b/alliance/src/documentation/alliance-examples/sqrt8/sqrt8.pat @@ -0,0 +1,25 @@ + +in P (7 downto 0) X;;; +out U (3 downto 0) X;;; +in vss B;; +in vdd B;; + +begin + +-- Pattern description : +-- P U V V +-- P U V V +-- P U V V +-- P U V V +-- P U V V + +< +50ns>: 04 ?* 0 1; +< +50ns>: 04 ?* 0 1; +< +50ns>: 10 ?* 0 1; +< +50ns>: 10 ?* 0 1; +< +50ns>: 20 ?* 0 1; +< +50ns>: 20 ?* 0 1; +< +50ns>: ff ?* 0 1; +< +50ns>: ff ?* 0 1; + +end; diff --git a/alliance/src/documentation/alliance-examples/sqrt8/sqrt8.vhdl b/alliance/src/documentation/alliance-examples/sqrt8/sqrt8.vhdl new file mode 100644 index 00000000..8c7227ff --- /dev/null +++ b/alliance/src/documentation/alliance-examples/sqrt8/sqrt8.vhdl @@ -0,0 +1,60 @@ +library IEEE; +use IEEE.std_logic_1164.all; + +entity sqrt8 is + port ( P : in std_logic_vector(7 downto 0); + U : out std_logic_vector(3 downto 0)); +end sqrt8; + +architecture circuits of sqrt8 is + +component Sm -- subtractor multiplexor + port ( x : in std_logic; + y : in std_logic; + b : in std_logic; + u : in std_logic; + d : out std_logic; + bo : out std_logic); +end component; + + signal zer : std_logic := '0'; + signal one : std_logic := '1'; + signal x00, XX01, x02, x03, x04, x05, u_0 : std_logic; + signal b00, b01, b02, b03, b04, b05 : std_logic; + signal x12, x13, x14, x15, x16, u_1 : std_logic; + signal b12, b13, b14, b15, b16 : std_logic; + signal x24, x25, x26, x27, u_2 : std_logic; + signal b24, b25, b26, b27 : std_logic; + signal x36, x37, u_3 : std_logic; + signal b36, b37 : std_logic; +begin -- circuits of sqrt8 + -- x y b u d bo + s36: Sm port map(P(6), one, zer, u_3, x36, b36); + s37: Sm port map(P(7), zer, b36, u_3, x37, b37); + + s24: Sm port map(P(4), one, zer, u_2, x24, b24); + s25: Sm port map(P(5), zer, b24, u_2, x25, b25); + s26: Sm port map(x36 , u_3, b25, u_2, x26, b26); + s27: Sm port map(x37 , zer, b26, zer, x27, b27); + + s12: Sm port map(P(2), one, zer, u_1, x12, b12); + s13: Sm port map(P(3), zer, b12, u_1, x13, b13); + s14: Sm port map(x24 , u_2, b13, u_1, x14, b14); + s15: Sm port map(x25 , u_3, b14, u_1, x15, b15); + s16: Sm port map(x26 , zer, b15, zer, x16, b16); + + s00: Sm port map(P(0), one, zer, zer, x00, b00); + s01: Sm port map(P(1), zer, b00, zer, XX01, b01); + s02: Sm port map(x12 , u_1, b01, zer, x02, b02); + s03: Sm port map(x13 , u_2, b02, zer, x03, b03); + s04: Sm port map(x14 , u_3, b03, zer, x04, b04); + s05: Sm port map(x15 , zer, b04, zer, x05, b05); + u_0 <= not b05; + u_1 <= not b16; + u_2 <= not b27; + u_3 <= not b37; + U(0) <= u_0; + U(1) <= u_1; + U(2) <= u_2; + U(3) <= u_3; +end circuits; -- of sqrt8