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

Subversion Repositories aemb

[/] [aemb/] [trunk/] [rtl/] [verilog/] [aeMB2_mult.v] - Blame information for rev 134

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 134 sybreon
/* $Id: aeMB2_mult.v,v 1.4 2008-04-26 17:57:43 sybreon Exp $
2 118 sybreon
**
3
** AEMB2 EDK 6.2 COMPATIBLE CORE
4
** Copyright (C) 2004-2008 Shawn Tan <shawn.tan@aeste.net>
5
**
6
** This file is part of AEMB.
7
**
8
** AEMB is free software: you can redistribute it and/or modify it
9
** under the terms of the GNU Lesser General Public License as
10
** published by the Free Software Foundation, either version 3 of the
11
** License, or (at your option) any later version.
12
**
13
** AEMB is distributed in the hope that it will be useful, but WITHOUT
14
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
** or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
16
** Public License for more details.
17
**
18
** You should have received a copy of the GNU Lesser General Public
19
** License along with AEMB. If not, see <http:**www.gnu.org/licenses/>.
20
*/
21
/**
22
 * Two Cycle Multiplier Unit
23
 * @file aeMB2_mult.v
24
 
25
 * This implements a 2 cycle multipler to increase clock speed. The
26
   multiplier architecture is left to the synthesis tool. Modify this
27
   to instantiate specific multipliers.
28
 
29
 */
30
 
31
module aeMB2_mult (/*AUTOARG*/
32
   // Outputs
33
   mul_mx,
34
   // Inputs
35
   opa_of, opb_of, opc_of, gclk, grst, dena, gpha
36
   );
37
   parameter AEMB_MUL = 1; ///< implement multiplier  
38
 
39
   output [31:0] mul_mx;
40
 
41
   input [31:0]  opa_of;
42
   input [31:0]  opb_of;
43
   input [5:0]    opc_of;
44
 
45
   // SYS signals
46
   input         gclk,
47
                 grst,
48
                 dena,
49
                 gpha;
50
 
51
   /*AUTOREG*/
52 134 sybreon
 
53
   reg [31:0]     rOPA, rOPB;
54 120 sybreon
   reg [31:0]     rMUL0,
55
                 rMUL1;
56 118 sybreon
 
57
   always @(posedge gclk)
58
     if (grst) begin
59
        /*AUTORESET*/
60
        // Beginning of autoreset for uninitialized flops
61 120 sybreon
        rMUL0 <= 32'h0;
62
        rMUL1 <= 32'h0;
63 134 sybreon
        rOPA <= 32'h0;
64
        rOPB <= 32'h0;
65 118 sybreon
        // End of automatics
66
     end else if (dena) begin
67 134 sybreon
        //rMUL1 <= #1 rMUL0;
68
        rMUL1 <= #1 rMUL0; //rOPA * rOPB;       
69
        rMUL0 <= #1 (opa_of * opb_of);
70
        rOPA <= #1 opa_of;
71
        rOPB <= #1 opb_of;
72 118 sybreon
     end
73 120 sybreon
 
74
   assign        mul_mx = rMUL1;
75
 
76 118 sybreon
endmodule // aeMB2_mult
77
 
78 131 sybreon
/*
79
 $Log: not supported by cvs2svn $
80 134 sybreon
 Revision 1.3  2008/04/26 01:09:06  sybreon
81
 Passes basic tests. Minor documentation changes to make it compatible with iverilog pre-processor.
82
 
83 131 sybreon
 Revision 1.2  2008/04/20 16:34:32  sybreon
84
 Basic version with some features left out.
85
 
86
 Revision 1.1  2008/04/18 00:21:52  sybreon
87
 Initial import.
88
*/

powered by: WebSVN 2.1.0

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