OpenCores
URL https://opencores.org/ocsvn/fpuvhdl/fpuvhdl/trunk

Subversion Repositories fpuvhdl

[/] [fpuvhdl/] [trunk/] [fpuvhdl/] [multiplier/] [fpmul_stage4_struct.vhd] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 gmarcus
-- VHDL Entity HAVOC.FPmul_stage4.interface
2
--
3
-- Created by
4
-- Guillermo Marcus, gmarcus@ieee.org
5
-- using Mentor Graphics FPGA Advantage tools.
6
--
7
-- Visit "http://fpga.mty.itesm.mx" for more info.
8
--
9
-- 2003-2004. V1.0
10
--
11
 
12
LIBRARY ieee;
13
USE ieee.std_logic_1164.all;
14
USE ieee.std_logic_arith.all;
15
 
16
ENTITY FPmul_stage4 IS
17
   PORT(
18
      EXP_neg       : IN     std_logic;
19
      EXP_out_round : IN     std_logic_vector (7 DOWNTO 0);
20
      EXP_pos       : IN     std_logic;
21
      SIGN_out      : IN     std_logic;
22
      SIG_out_round : IN     std_logic_vector (27 DOWNTO 0);
23
      clk           : IN     std_logic;
24
      isINF_tab     : IN     std_logic;
25
      isNaN         : IN     std_logic;
26
      isZ_tab       : IN     std_logic;
27
      FP_Z          : OUT    std_logic_vector (31 DOWNTO 0)
28
   );
29
 
30
-- Declarations
31
 
32
END FPmul_stage4 ;
33
 
34
--
35
-- VHDL Architecture HAVOC.FPmul_stage4.struct
36
--
37
-- Created by
38
-- Guillermo Marcus, gmarcus@ieee.org
39
-- using Mentor Graphics FPGA Advantage tools.
40
--
41
-- Visit "http://fpga.mty.itesm.mx" for more info.
42
--
43
-- Copyright 2003-2004. V1.0
44
--
45
 
46
 
47
LIBRARY ieee;
48
USE ieee.std_logic_1164.all;
49
USE ieee.std_logic_arith.all;
50
 
51
ARCHITECTURE struct OF FPmul_stage4 IS
52
 
53
   -- Architecture declarations
54
 
55
   -- Internal signal declarations
56
   SIGNAL EXP_out       : std_logic_vector(7 DOWNTO 0);
57
   SIGNAL FP            : std_logic_vector(31 DOWNTO 0);
58
   SIGNAL SIG_isZ       : std_logic;
59
   SIGNAL SIG_out       : std_logic_vector(22 DOWNTO 0);
60
   SIGNAL SIG_out_norm2 : std_logic_vector(27 DOWNTO 0);
61
   SIGNAL isINF         : std_logic;
62
   SIGNAL isZ           : std_logic;
63
 
64
 
65
   -- Component Declarations
66
   COMPONENT FPnormalize
67
   GENERIC (
68
      SIG_width : integer := 28
69
   );
70
   PORT (
71
      SIG_in  : IN     std_logic_vector (SIG_width-1 DOWNTO 0);
72
      EXP_in  : IN     std_logic_vector (7 DOWNTO 0);
73
      SIG_out : OUT    std_logic_vector (SIG_width-1 DOWNTO 0);
74
      EXP_out : OUT    std_logic_vector (7 DOWNTO 0)
75
   );
76
   END COMPONENT;
77
   COMPONENT PackFP
78
   PORT (
79
      SIGN  : IN     std_logic ;
80
      EXP   : IN     std_logic_vector (7 DOWNTO 0);
81
      SIG   : IN     std_logic_vector (22 DOWNTO 0);
82
      isNaN : IN     std_logic ;
83
      isINF : IN     std_logic ;
84
      isZ   : IN     std_logic ;
85
      FP    : OUT    std_logic_vector (31 DOWNTO 0)
86
   );
87
   END COMPONENT;
88
 
89
   -- Optional embedded configurations
90
   -- pragma synthesis_off
91 4 gmarcus
   FOR ALL : FPnormalize USE ENTITY work.FPnormalize;
92
   FOR ALL : PackFP USE ENTITY work.PackFP;
93 3 gmarcus
   -- pragma synthesis_on
94
 
95
 
96
BEGIN
97
   -- Architecture concurrent statements
98
   -- HDL Embedded Text Block 1 trim
99
   -- trim 1 
100
   SIG_out <= SIG_out_norm2(25 DOWNTO 3);
101
 
102
   -- HDL Embedded Text Block 2 zero
103
   -- zero 2
104
   SIG_isZ <= '1' WHEN ((SIG_out_norm2(26 DOWNTO 3)=X"000000") OR
105
   (EXP_neg='1' AND EXP_out(7)='1')) ELSE '0';
106
 
107
   -- HDL Embedded Text Block 3 isINF_logic
108
   -- isINF_logic 3
109
   PROCESS(isZ,isINF_tab, EXP_pos, EXP_out)
110
   BEGIN
111
      IF isZ='0' THEN
112
         IF isINF_tab='1' THEN
113
            isINF <= '1';
114
         ELSIF EXP_out=X"FF" THEN
115
           isINF <='1';
116
         ELSIF ((EXP_pos='1') AND (EXP_out(7)='0'))  THEN
117
           isINF <='1';
118
         ELSE
119
           isINF <= '0';
120
         END IF;
121
      ELSE
122
          isINF <= '0';
123
      END IF;
124
   END PROCESS;
125
 
126
   -- HDL Embedded Text Block 4 latch
127
   -- latch 4
128
   PROCESS(clk)
129
   BEGIN
130
      IF RISING_EDGE(clk) THEN
131
         FP_Z <= FP;
132
      END IF;
133
   END PROCESS;
134
 
135
 
136
   -- ModuleWare code(v1.1) for instance 'I2' of 'or'
137
   isZ <= SIG_isZ OR isZ_tab;
138
 
139
   -- Instance port mappings.
140
   I1 : FPnormalize
141
      GENERIC MAP (
142
         SIG_width => 28
143
      )
144
      PORT MAP (
145
         SIG_in  => SIG_out_round,
146
         EXP_in  => EXP_out_round,
147
         SIG_out => SIG_out_norm2,
148
         EXP_out => EXP_out
149
      );
150
   I3 : PackFP
151
      PORT MAP (
152
         SIGN  => SIGN_out,
153
         EXP   => EXP_out,
154
         SIG   => SIG_out,
155
         isNaN => isNaN,
156
         isINF => isINF,
157
         isZ   => isZ,
158
         FP    => FP
159
      );
160
 
161
END struct;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.