Floating Point Unit - multiplier block

prepared by P. Bakowski (designer G. Ramstein)

back to main text


note : non synthetisable


MULTIPLIER ENTITY


entity Multiplier_Nty is
port(Ck : in Bit; -- Horloge
Hldb : in Bit; -- Hold
Abort : in Bit; -- Abort
RF_MUSD2F : in Bit; -- Multiplier Instructed
RF_T5D2F : in Bit; -- MR register Read/Write
RF_MFOPD2F : in Bit_vector(7 downto 0); -- Code instruction
PS_TRUNC1F : in Bit; -- Mode arrondi 0=Plus pret, 1= Troncature
PS_RND321F : in Bit; -- Format 0/1= 40/32 bits
PS_SRCU1F : in Bit; -- Alternance Foreground/Background
MFX2F, MFY2F : in bit_vector(39 downto 0); -- operandes X et Y
MFR2F : out bit_vector(39 downto 0); -- resultat Stat2F : out bit_vector(1 to 5) --
MN, MI, MV, MU, MF );
end Multiplier_Nty;
-- MULTIPLIER ARCHITECTURE
use WORK.FLOAT40_pkg.all;
use WORK.bitvector_pkg.all;
use WORK.signvector_pkg.all;
architecture Multiplier_a of Multiplier_Nty is
signal Muphi1, Muphi2 : Bit;
begin
process(Ck)
variable Inste : bit_vector(7 downto 0); -- Instruction Pipeline a executer
variable Instructede : Bit; -- Pipeline a executer RF_MUSD2F
variable Transfere : Bit; -- RF_T5D2F
variable Trunc, Rnd32, Srcu : Bit;
variable mrf2, mrf1, mrf0 : bit_vector(31 downto 0); -- Foreground MR2,MR1,MR0, phase 1
variable mrb2, mrb1, mrb0 : bit_vector(31 downto 0); -- Background MR2,MR1,MR0, phase 1
variable temp2, temp1, temp0 : bit_vector(31 downto 0); -- Variables temporaires
variable X, Y, Rs0, Rs1, Rs2 : Fix_Typ;
variable XF, YF, RF : Float_Typ;
variable MN, MI, MV, MU, MF : Bit; -- Negatif, Invalide, Underflow, oVerflow, Flottant
begin
if Ck='1' then
Trunc:=PS_TRUNC1F; Rnd32:=PS_RND321F; Srcu:=PS_SRCU1F; X :=Fix_Typ(MFX2F(39 downto 8)); Y :=Fix_Typ(MFY2F(39 downto 8)); XF:=Float_Typ(MFX2F); YF:=Float_Typ(MFY2F);
if Rnd32='1' then
end if;
Inste:=RF_MFOPD2F; Transfere:=RF_T5D2F; Instructede:=RF_MUSD2F;
-- INSTRUCTION DE TRANSFERT
if Abort='0' and Instructede='1' and Transfere='1' then
if Inste(4)='0' then
else
--------------------------------- BACKGROUND -------------
end if;
else
-- ECRITURE MR
if (Inste(2) xor Srcu)='0' then
-- FOREGROUND
end if;
if Inste(1)='1' and Inste(0)='0' then
---- MR2 --------------
mrf2:=bit_vector(Y) and X"0000FFFF";
end if;
else
--------------------------------- BACKGROUND ---------------
if Inste(1)='0' and Inste(0)='0' then
---- MR0 --------------
mrb0:=bit_vector(Y);
end if;
if Inste(1)='0' and Inste(0)='1' then
---- MR1 --------------
mrb1:=bit_vector(Y);
end if;
if Inste(1)='1' and Inste(0)='0' then
---- MR2 --------------
mrb2:=bit_vector(Y) and X"0000FFFF"; end if; end if; end if; end if;
-- Transfert
-- INSTRUCTION DE TYPE CALCUL
if Abort='0' and Instructede='1' and Transfere='0' then
-- INSTRUCTIONS SUR LES REGISTRES MR
if Inste(7)='0' and inste(6)='0' and inste(5)='0' then
------------------ Clear MR ----------------
-- 00 010 xmx ---
if inste(4)='1' and inste(3)='0' then
end if;
-- end Clear ---------------------
-- Saturate MR --------------- 00 00m mmm ----
if inste(4)='0' then
-- fractionnaire
--- Underflow Flag ---
-- underflow
end if;
-- end saturate ---------------------
-- Round MR ------------------ 00 011 mmx ----
-- MULTIPLICATION FLOTTANT
-- MULTIPLICATION FIX
Mul(X,Y, Inste, temp0, temp1, temp2, MN, MI, MU, MV, MF);
end if;
-- Multiplication Fix
end if;
---instructions de calcul
Stat2F<=(MN, MI, MU, MV, MF);
end if; -- Ck
end process;
end Multiplier_a;


back to main text