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

Subversion Repositories fpuvhdl

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

Go to most recent revision | 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
LIBRARY HAVOC;
52
 
53
ARCHITECTURE struct OF FPmul_stage4 IS
54
 
55
   -- Architecture declarations
56
 
57
   -- Internal signal declarations
58
   SIGNAL EXP_out       : std_logic_vector(7 DOWNTO 0);
59
   SIGNAL FP            : std_logic_vector(31 DOWNTO 0);
60
   SIGNAL SIG_isZ       : std_logic;
61
   SIGNAL SIG_out       : std_logic_vector(22 DOWNTO 0);
62
   SIGNAL SIG_out_norm2 : std_logic_vector(27 DOWNTO 0);
63
   SIGNAL isINF         : std_logic;
64
   SIGNAL isZ           : std_logic;
65
 
66
 
67
   -- Component Declarations
68
   COMPONENT FPnormalize
69
   GENERIC (
70
      SIG_width : integer := 28
71
   );
72
   PORT (
73
      SIG_in  : IN     std_logic_vector (SIG_width-1 DOWNTO 0);
74
      EXP_in  : IN     std_logic_vector (7 DOWNTO 0);
75
      SIG_out : OUT    std_logic_vector (SIG_width-1 DOWNTO 0);
76
      EXP_out : OUT    std_logic_vector (7 DOWNTO 0)
77
   );
78
   END COMPONENT;
79
   COMPONENT PackFP
80
   PORT (
81
      SIGN  : IN     std_logic ;
82
      EXP   : IN     std_logic_vector (7 DOWNTO 0);
83
      SIG   : IN     std_logic_vector (22 DOWNTO 0);
84
      isNaN : IN     std_logic ;
85
      isINF : IN     std_logic ;
86
      isZ   : IN     std_logic ;
87
      FP    : OUT    std_logic_vector (31 DOWNTO 0)
88
   );
89
   END COMPONENT;
90
 
91
   -- Optional embedded configurations
92
   -- pragma synthesis_off
93
   FOR ALL : FPnormalize USE ENTITY HAVOC.FPnormalize;
94
   FOR ALL : PackFP USE ENTITY HAVOC.PackFP;
95
   -- pragma synthesis_on
96
 
97
 
98
BEGIN
99
   -- Architecture concurrent statements
100
   -- HDL Embedded Text Block 1 trim
101
   -- trim 1 
102
   SIG_out <= SIG_out_norm2(25 DOWNTO 3);
103
 
104
   -- HDL Embedded Text Block 2 zero
105
   -- zero 2
106
   SIG_isZ <= '1' WHEN ((SIG_out_norm2(26 DOWNTO 3)=X"000000") OR
107
   (EXP_neg='1' AND EXP_out(7)='1')) ELSE '0';
108
 
109
   -- HDL Embedded Text Block 3 isINF_logic
110
   -- isINF_logic 3
111
   PROCESS(isZ,isINF_tab, EXP_pos, EXP_out)
112
   BEGIN
113
      IF isZ='0' THEN
114
         IF isINF_tab='1' THEN
115
            isINF <= '1';
116
         ELSIF EXP_out=X"FF" THEN
117
           isINF <='1';
118
         ELSIF ((EXP_pos='1') AND (EXP_out(7)='0'))  THEN
119
           isINF <='1';
120
         ELSE
121
           isINF <= '0';
122
         END IF;
123
      ELSE
124
          isINF <= '0';
125
      END IF;
126
   END PROCESS;
127
 
128
   -- HDL Embedded Text Block 4 latch
129
   -- latch 4
130
   PROCESS(clk)
131
   BEGIN
132
      IF RISING_EDGE(clk) THEN
133
         FP_Z <= FP;
134
      END IF;
135
   END PROCESS;
136
 
137
 
138
   -- ModuleWare code(v1.1) for instance 'I2' of 'or'
139
   isZ <= SIG_isZ OR isZ_tab;
140
 
141
   -- Instance port mappings.
142
   I1 : FPnormalize
143
      GENERIC MAP (
144
         SIG_width => 28
145
      )
146
      PORT MAP (
147
         SIG_in  => SIG_out_round,
148
         EXP_in  => EXP_out_round,
149
         SIG_out => SIG_out_norm2,
150
         EXP_out => EXP_out
151
      );
152
   I3 : PackFP
153
      PORT MAP (
154
         SIGN  => SIGN_out,
155
         EXP   => EXP_out,
156
         SIG   => SIG_out,
157
         isNaN => isNaN,
158
         isINF => isINF,
159
         isZ   => isZ,
160
         FP    => FP
161
      );
162
 
163
END struct;

powered by: WebSVN 2.1.0

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