1 |
4 |
aloy.amber |
library ieee;
|
2 |
|
|
use ieee.std_logic_1164.all;
|
3 |
|
|
use ieee.numeric_std.all;
|
4 |
|
|
--use work.fpmult_comp.all;
|
5 |
|
|
use work.fpmult_stage0_comp.all;
|
6 |
|
|
use work.fpmult_stageN_comp.all;
|
7 |
|
|
use work.fpmult_stage23_comp.all;
|
8 |
|
|
|
9 |
|
|
entity fpmult is
|
10 |
|
|
port(
|
11 |
|
|
clk:in std_logic;
|
12 |
|
|
|
13 |
|
|
a:in std_logic_vector(31 downto 0);
|
14 |
|
|
b:in std_logic_vector(31 downto 0);
|
15 |
|
|
p:out std_logic_vector(31 downto 0);
|
16 |
|
|
|
17 |
|
|
p_s00:out std_logic_vector(23 downto 1);
|
18 |
|
|
p_s01:out std_logic_vector(25 downto 1);
|
19 |
|
|
p_s02:out std_logic_vector(26 downto 2);
|
20 |
|
|
p_s03:out std_logic_vector(27 downto 3);
|
21 |
|
|
p_s04:out std_logic_vector(28 downto 4);
|
22 |
|
|
p_s05:out std_logic_vector(29 downto 5);
|
23 |
|
|
p_s06:out std_logic_vector(30 downto 6);
|
24 |
|
|
p_s07:out std_logic_vector(31 downto 7);
|
25 |
|
|
p_s08:out std_logic_vector(32 downto 8);
|
26 |
|
|
p_s09:out std_logic_vector(33 downto 9);
|
27 |
|
|
p_s10:out std_logic_vector(34 downto 10);
|
28 |
|
|
p_s11:out std_logic_vector(35 downto 11);
|
29 |
|
|
p_s12:out std_logic_vector(36 downto 12);
|
30 |
|
|
p_s13:out std_logic_vector(37 downto 13);
|
31 |
|
|
p_s14:out std_logic_vector(38 downto 14);
|
32 |
|
|
p_s15:out std_logic_vector(39 downto 15);
|
33 |
|
|
p_s16:out std_logic_vector(40 downto 16);
|
34 |
|
|
p_s17:out std_logic_vector(41 downto 17);
|
35 |
|
|
p_s18:out std_logic_vector(42 downto 18);
|
36 |
|
|
p_s19:out std_logic_vector(43 downto 19);
|
37 |
|
|
p_s20:out std_logic_vector(44 downto 20);
|
38 |
|
|
p_s21:out std_logic_vector(45 downto 21);
|
39 |
|
|
p_s22:out std_logic_vector(46 downto 22)
|
40 |
|
|
);
|
41 |
|
|
end;
|
42 |
|
|
|
43 |
|
|
architecture structural of fpmult is
|
44 |
|
|
signal fpmult_stage0_in:fpmult_stage0_in_type;
|
45 |
|
|
signal fpmult_stage0_out:fpmult_stage0_out_type;
|
46 |
|
|
signal fpmult_stage23_in:fpmult_stage23_in_type;
|
47 |
|
|
signal fpmult_stage23_out:fpmult_stage23_out_type;
|
48 |
|
|
type fpmult_stageN_in_array_type is array(23 downto 1) of fpmult_stageN_in_type;
|
49 |
|
|
type fpmult_stageN_out_array_type is array(22 downto 1) of fpmult_stageN_out_type;
|
50 |
|
|
signal fpmult_stageN_in_array:fpmult_stageN_in_array_type;
|
51 |
|
|
signal fpmult_stageN_out_array:fpmult_stageN_out_array_type;
|
52 |
|
|
begin
|
53 |
|
|
fpmult_stage0_in.a<=a;
|
54 |
|
|
fpmult_stage0_in.b<=b;
|
55 |
|
|
|
56 |
|
|
stage0:fpmult_stage0 port map(clk,fpmult_stage0_in,fpmult_stage0_out);
|
57 |
|
|
|
58 |
5 |
aloy.amber |
fpmult_stageN_in_array(1)<=fpmult_stage0_out;
|
59 |
4 |
aloy.amber |
|
60 |
|
|
pipeline:for N in 22 downto 1 generate
|
61 |
|
|
stageN:fpmult_stageN generic map(N) port map(clk,fpmult_stageN_in_array(N),fpmult_stageN_out_array(N));
|
62 |
|
|
fpmult_stageN_in_array(N+1)<=fpmult_stageN_out_array(N);
|
63 |
|
|
end generate pipeline;
|
64 |
|
|
|
65 |
5 |
aloy.amber |
fpmult_stage23_in<=fpmult_stageN_out_array(22);
|
66 |
4 |
aloy.amber |
|
67 |
|
|
stage23:fpmult_stage23 port map(clk,fpmult_stage23_in,fpmult_stage23_out);
|
68 |
|
|
|
69 |
|
|
p<=fpmult_stage23_out.p;
|
70 |
|
|
|
71 |
|
|
p_s00<=std_logic_vector(fpmult_stage0_out.p_mantissa(23 downto 1));
|
72 |
|
|
p_s01<=std_logic_vector(fpmult_stageN_out_array(1).p_mantissa(25 downto 1));
|
73 |
|
|
p_s02<=std_logic_vector(fpmult_stageN_out_array(2).p_mantissa(26 downto 2));
|
74 |
|
|
p_s03<=std_logic_vector(fpmult_stageN_out_array(3).p_mantissa(27 downto 3));
|
75 |
|
|
p_s04<=std_logic_vector(fpmult_stageN_out_array(4).p_mantissa(28 downto 4));
|
76 |
|
|
p_s05<=std_logic_vector(fpmult_stageN_out_array(5).p_mantissa(29 downto 5));
|
77 |
|
|
p_s06<=std_logic_vector(fpmult_stageN_out_array(6).p_mantissa(30 downto 6));
|
78 |
|
|
p_s07<=std_logic_vector(fpmult_stageN_out_array(7).p_mantissa(31 downto 7));
|
79 |
|
|
p_s08<=std_logic_vector(fpmult_stageN_out_array(8).p_mantissa(32 downto 8));
|
80 |
|
|
p_s09<=std_logic_vector(fpmult_stageN_out_array(9).p_mantissa(33 downto 9));
|
81 |
|
|
p_s10<=std_logic_vector(fpmult_stageN_out_array(10).p_mantissa(34 downto 10));
|
82 |
|
|
p_s11<=std_logic_vector(fpmult_stageN_out_array(11).p_mantissa(35 downto 11));
|
83 |
|
|
p_s12<=std_logic_vector(fpmult_stageN_out_array(12).p_mantissa(36 downto 12));
|
84 |
|
|
p_s13<=std_logic_vector(fpmult_stageN_out_array(13).p_mantissa(37 downto 13));
|
85 |
|
|
p_s14<=std_logic_vector(fpmult_stageN_out_array(14).p_mantissa(38 downto 14));
|
86 |
|
|
p_s15<=std_logic_vector(fpmult_stageN_out_array(15).p_mantissa(39 downto 15));
|
87 |
|
|
p_s16<=std_logic_vector(fpmult_stageN_out_array(16).p_mantissa(40 downto 16));
|
88 |
|
|
p_s17<=std_logic_vector(fpmult_stageN_out_array(17).p_mantissa(41 downto 17));
|
89 |
|
|
p_s18<=std_logic_vector(fpmult_stageN_out_array(18).p_mantissa(42 downto 18));
|
90 |
|
|
p_s19<=std_logic_vector(fpmult_stageN_out_array(19).p_mantissa(43 downto 19));
|
91 |
|
|
p_s20<=std_logic_vector(fpmult_stageN_out_array(20).p_mantissa(44 downto 20));
|
92 |
|
|
p_s21<=std_logic_vector(fpmult_stageN_out_array(21).p_mantissa(45 downto 21));
|
93 |
|
|
p_s22<=std_logic_vector(fpmult_stageN_out_array(22).p_mantissa(46 downto 22));
|
94 |
|
|
end;
|