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

Subversion Repositories or1k_soc_on_altera_embedded_dev_kit

[/] [or1k_soc_on_altera_embedded_dev_kit/] [trunk/] [soc/] [rtl/] [or1200/] [rtl/] [verilog/] [or1200_gmultp2_32x32.v] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 xianfeng
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  Generic 32x32 multiplier                                    ////
4
////                                                              ////
5
////  This file is part of the OpenRISC 1200 project              ////
6
////  http://www.opencores.org/cores/or1k/                        ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  Generic 32x32 multiplier with pipeline stages.              ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////   - make it smaller and faster                               ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Damjan Lampret, lampret@opencores.org                 ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE.  See the GNU Lesser General Public License for more ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from http://www.opencores.org/lgpl.shtml                     ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44
// CVS Revision History
45
//
46
// $Log: or1200_gmultp2_32x32.v,v $
47
// Revision 1.2  2002/07/31 02:04:35  lampret
48
// MAC now follows software convention (signed multiply instead of unsigned).
49
//
50
// Revision 1.1  2002/01/03 08:16:15  lampret
51
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
52
//
53
// Revision 1.4  2001/12/04 05:02:35  lampret
54
// Added OR1200_GENERIC_MULTP2_32X32 and OR1200_ASIC_MULTP2_32X32
55
//
56
// Revision 1.3  2001/10/21 17:57:16  lampret
57
// Removed params from generic_XX.v. Added translate_off/on in sprs.v and id.v. Removed spr_addr from dc.v and ic.v. Fixed CR+LF.
58
//
59
// Revision 1.2  2001/10/14 13:12:09  lampret
60
// MP3 version.
61
//
62
// Revision 1.1.1.1  2001/10/06 10:18:36  igorm
63
// no message
64
//
65
// Revision 1.2  2001/08/09 13:39:33  lampret
66
// Major clean-up.
67
//
68
// Revision 1.1  2001/07/20 00:46:03  lampret
69
// Development version of RTL. Libraries are missing.
70
//
71
//
72
 
73
// synopsys translate_off
74
`include "timescale.v"
75
// synopsys translate_on
76
`include "or1200_defines.v"
77
 
78
// 32x32 multiplier, no input/output registers
79
// Registers inside Wallace trees every 8 full adder levels,
80
// with first pipeline after level 4
81
 
82
`ifdef OR1200_GENERIC_MULTP2_32X32
83
 
84
`define OR1200_W 32
85
`define OR1200_WW 64
86
 
87
module or1200_gmultp2_32x32 ( X, Y, CLK, RST, P );
88
 
89
input   [`OR1200_W-1:0]  X;
90
input   [`OR1200_W-1:0]  Y;
91
input           CLK;
92
input           RST;
93
output  [`OR1200_WW-1:0]  P;
94
 
95
reg     [`OR1200_WW-1:0]  p0;
96
reg     [`OR1200_WW-1:0]  p1;
97
integer                   xi;
98
integer                   yi;
99
 
100
//
101
// Conversion unsigned to signed
102
//
103
always @(X)
104
        xi <= X;
105
 
106
//
107
// Conversion unsigned to signed
108
//
109
always @(Y)
110
        yi <= Y;
111
 
112
//
113
// First multiply stage
114
//
115
always @(posedge CLK or posedge RST)
116
        if (RST)
117
                p0 <= `OR1200_WW'b0;
118
        else
119
                p0 <= #1 xi * yi;
120
 
121
//
122
// Second multiply stage
123
//
124
always @(posedge CLK or posedge RST)
125
        if (RST)
126
                p1 <= `OR1200_WW'b0;
127
        else
128
                p1 <= #1 p0;
129
 
130
assign P = p1;
131
 
132
endmodule
133
 
134
`endif

powered by: WebSVN 2.1.0

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