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

Subversion Repositories i650

[/] [i650/] [trunk/] [rtl/] [accumulator.v] - Blame information for rev 15

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

Line No. Rev Author Line
1 14 eightycc
`timescale 1ns / 1ps
2
//////////////////////////////////////////////////////////////////////////////////
3
// IBM 650 Reconstruction in Verilog (i650)
4
// 
5
// This file is part of the IBM 650 Reconstruction in Verilog (i650) project
6
// http:////www.opencores.org/project,i650
7
//
8
// Description: 650 accumulator register.
9
// 
10
// Additional Comments: See US 2959351, Fig. 64.
11
//
12
// Copyright (c) 2015 Robert Abeles
13
//
14
// This source file is free software; you can redistribute it
15
// and/or modify it under the terms of the GNU Lesser General
16
// Public License as published by the Free Software Foundation;
17
// either version 2.1 of the License, or (at your option) any
18
// later version.
19
//
20
// This source is distributed in the hope that it will be
21
// useful, but WITHOUT ANY WARRANTY; without even the implied
22
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
23
// PURPOSE.  See the GNU Lesser General Public License for more
24
// details.
25
//
26
// You should have received a copy of the GNU Lesser General
27
// Public License along with this source; if not, download it
28
// from http://www.opencores.org/lgpl.shtml
29
//////////////////////////////////////////////////////////////////////////////////
30
`include "defines.v"
31
 
32
module accumulator (
33
   input rst,
34
   input ap, bp, dp,
35 15 eightycc
   input d1, d2, d10,
36
   input dxu, d0u,
37 14 eightycc
   input wu, wl,
38
   input [0:6] adder_out,
39
   input acc_regen_gate, right_shift_gate, acc_ri_gate,
40
         zero_shift_count, man_acc_reset, reset_op_latch,
41
   input [0:3] early_idx, ontime_idx,
42
   output reg [0:6] early_out, ontime_out, ped_out
43
   );
44
 
45
   //-----------------------------------------------------------------------------
46
   // The accumulator occupies 22 locations of a 32x7bit RAM. 
47
   //-----------------------------------------------------------------------------
48
   reg [0:6] digits [0:31];
49
 
50
   wire [0:4] acc_early_idx  = {(d10? ~wu : wu), early_idx};
51
   wire [0:4] acc_ontime_idx = {wu, ontime_idx};
52
 
53
   //-----------------------------------------------------------------------------
54
   // A -- Read into early_out from RAM
55
   //      Read into ontime_out
56
   //-----------------------------------------------------------------------------
57
   wire acc_reset =  reset_op_latch | man_acc_reset
58 15 eightycc
                   | (zero_shift_count & wl & (d1 | d2));
59 14 eightycc
   always @(posedge ap) begin
60
      if (rst) begin
61
         early_out  <= `biq_blank;
62
         ontime_out <= `biq_blank;
63
      end else begin
64
         early_out  <= reset_op_latch? `biq_0
65
                     : digits[acc_early_idx];
66
         ontime_out <= (acc_reset | d0u | dxu)? `biq_0 : early_out;
67
      end
68
   end;
69
 
70
   //-----------------------------------------------------------------------------
71
   // B -- Read into ped_out
72
   //-----------------------------------------------------------------------------
73
   always @(posedge bp) begin
74
      if (rst) begin
75
         ped_out <= `biq_blank;
76
      end else begin
77
         ped_out <= right_shift_gate? early_out
78
                  : acc_ri_gate?      adder_out
79
                  : acc_regen_gate?   ontime_out
80
                  : `biq_blank;
81
      end
82
   end;
83
 
84
   //-----------------------------------------------------------------------------
85
   // D -- Write ped_out into RAM
86
   //-----------------------------------------------------------------------------
87
   always @(posedge dp) begin
88
      digits[acc_ontime_idx] <= ped_out;
89
   end;
90
 
91
endmodule

powered by: WebSVN 2.1.0

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