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

Subversion Repositories i650

[/] [i650/] [trunk/] [rtl/] [toplev.v] - Blame information for rev 18

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

Line No. Rev Author Line
1 12 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: Top level.
9
// 
10
// Additional Comments: See US 2959351, Fig. 53, 54 and 55. Additional index
11
//  counters provided to address general storage and register RAMs.
12
//
13
// Copyright (c) 2015 Robert Abeles
14
//
15
// This source file is free software; you can redistribute it
16
// and/or modify it under the terms of the GNU Lesser General
17
// Public License as published by the Free Software Foundation;
18
// either version 2.1 of the License, or (at your option) any
19
// later version.
20
//
21
// This source is distributed in the hope that it will be
22
// useful, but WITHOUT ANY WARRANTY; without even the implied
23
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
24
// PURPOSE.  See the GNU Lesser General Public License for more
25
// details.
26
//
27
// You should have received a copy of the GNU Lesser General
28
// Public License along with this source; if not, download it
29
// from http://www.opencores.org/lgpl.shtml
30
//////////////////////////////////////////////////////////////////////////////////
31
`include "defines.v"
32
 
33
module toplev (
34
      input clk,
35
      input rst,
36
 
37 13 eightycc
      input [0:6] cmd_digit_in, io_buffer_in,
38
      input [0:5] command,
39 12 eightycc
 
40 15 eightycc
      output [0:6] cmd_digit_out, display_digit,
41 13 eightycc
      output busy, digit_ready, punch_card, read_card, card_digit_ready,
42 15 eightycc
      output digit_sync, word_upper,
43
      output [0:3] digit_ctr
44 12 eightycc
  );
45
 
46 13 eightycc
   wire ap, bp, cp, dp;
47
   wire dx, d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10,
48
        d1_d5, d5_dx, d5_d10, d1_dx, d5_d9, d10_d1_d5,
49
        dxl, dxu, d0l, d0u, d1l, d1u, d2l, d10u;
50
   wire w0, w1, w2, w3, w4, w5, w6, w7, w8, w9,
51
        wl, wu, ewl;
52
   wire s0, s1, s2, s3, s4, hp;
53
   wire [0:9] digit_idx;
54
   wire [0:3] early_idx, ontime_idx;
55
 
56 15 eightycc
   assign digit_sync = bp;
57
   assign digit_ctr = ontime_idx;
58
   assign word_upper = wu;
59 13 eightycc
 
60
   timing tm (
61 12 eightycc
    .clk(clk),
62
    .rst(rst),
63
    .ap(ap),
64
    .bp(bp),
65
    .cp(cp),
66
    .dp(dp),
67
    .dx(dx),
68
    .d0(d0),
69
    .d1(d1),
70
    .d2(d2),
71
    .d3(d3),
72
    .d4(d4),
73
    .d5(d5),
74
    .d6(d6),
75
    .d7(d7),
76
    .d8(d8),
77
    .d9(d9),
78
    .d10(d10),
79
    .d1_d5(d1_d5),
80
    .d5_dx(d5_dx),
81
    .d5_d10(d5_d10),
82
    .d1_dx(d1_dx),
83
    .d5_d9(d5_d9),
84
    .d10_d1_d5(d10_d1_d5),
85
    .dxl(dxl),
86
    .dxu(dxu),
87
    .d0l(d0l),
88
    .d0u(d0u),
89
    .d1l(d1l),
90
    .d1u(d1u),
91
    .d2l(d2l),
92
    .d10u(d10u),
93
    .w0(w0),
94
    .w1(w1),
95
    .w2(w2),
96
    .w3(w3),
97
    .w4(w4),
98
    .w5(w5),
99
    .w6(w6),
100
    .w7(w7),
101
    .w8(w8),
102
    .w9(w9),
103
    .wl(wl),
104
    .wu(wu),
105
    .ewl(ewl),
106
    .s0(s0),
107
    .s1(s1),
108
    .s2(s2),
109
    .s3(s3),
110
    .s4(s4),
111
    .hp(hp),
112
    .digit_idx(digit_idx),
113
    .early_idx(early_idx),
114
    .ontime_idx(ontime_idx)
115
   );
116 13 eightycc
 
117 12 eightycc
   //-----------------------------------------------------------------------------
118 15 eightycc
   // Accumulator
119
   //-----------------------------------------------------------------------------
120
   wire [0:6] ac_early_out, ac_ontime_out, ac_ped_out;
121
 
122
   //-----------------------------------------------------------------------------
123 18 eightycc
   // Register validity checking
124
   //-----------------------------------------------------------------------------
125
   wire ck_error_stop, ck_acc_check_light, ck_prog_check_light,
126
        ck_dist_check_light;
127
 
128
   //-----------------------------------------------------------------------------
129 12 eightycc
   // General storage
130
   //-----------------------------------------------------------------------------
131 13 eightycc
   wire [0:4] gs_out;
132
   wire gs_double_write, gs_no_write;
133
 
134 12 eightycc
   //-----------------------------------------------------------------------------
135
   // Operator controls
136
   //-----------------------------------------------------------------------------
137 15 eightycc
   wire [0:6] oc_data_out, oc_addr_out, oc_console_out, oc_display_digit;
138 13 eightycc
   wire oc_console_to_addr;
139
   wire [0:14] oc_gs_ram_addr;
140
   wire oc_read_gs, oc_write_gs;
141
   wire oc_pgm_start, oc_pgm_stop, oc_err_reset, oc_err_sense_reset;
142
   wire oc_run_control, oc_half_or_pgm_stop, oc_ri_storage, oc_ro_storage,
143
        oc_storage_control;
144
   wire oc_man_pgm_reset, oc_man_acc_reset, oc_set_8000, oc_reset_8000,
145 12 eightycc
        oc_hard_reset;
146 15 eightycc
   assign display_digit = oc_display_digit;
147
 
148 12 eightycc
   //-----------------------------------------------------------------------------
149
   // Translators
150
   //-----------------------------------------------------------------------------
151 13 eightycc
   wire tr_gs_write;
152
   wire [0:4] tr_gs_in;
153
   wire [0:6] tr_select_out;
154 12 eightycc
 
155 15 eightycc
   accumulator ac (
156
    .rst(rst),
157
    .ap(ap),
158
    .bp(bp),
159 18 eightycc
    .dp(dp),
160
    .dx(dx),
161 15 eightycc
    .d1(d1),
162
    .d2(d2),
163
    .d10(d10),
164
    .dxu(dxu),
165
    .d0u(d0u),
166
    .wu(wu),
167
    .wl(wl),
168
    .adder_out(`biq_0),
169
    .acc_regen_gate(1'b1),
170
    .right_shift_gate(1'b0),
171
    .acc_ri_gate(1'b0),
172
    .zero_shift_count(1'b0),
173
    .man_acc_reset(oc_man_acc_reset),
174
    .reset_op_latch(1'b0),
175
    .early_idx(early_idx),
176
    .ontime_idx(ontime_idx),
177
    .early_out(ac_early_out),
178
    .ontime_out(ac_ontime_out),
179
    .ped_out(ac_ped_out)
180
    );
181
 
182 18 eightycc
   checking ck (
183
    .rst(rst),
184
    .bp(bp),
185
    .d1_dx(d1_dx),
186
    .acc_ontime(ac_ontime_out),
187
    .prog_ontime(7'b0),
188
    .dist_ontime(7'b0),
189
    .error_reset(oc_err_reset),
190
    .tlu_or_zero_check(1'b0),
191
    .error_stop(ck_error_stop),
192
    .acc_check_light(ck_acc_check_light),
193
    .prog_check_light(ck_prog_check_light),
194
    .dist_check_light(ck_dist_check_light)
195
    );
196
 
197 13 eightycc
   gen_store gs (
198 12 eightycc
    .rst(oc_hard_reset),
199
    .ap(ap),
200
    .dp(dp),
201
    .write_gate(tr_gs_write),
202
    .addr_th(`biq_blank),
203
    .addr_h(`biq_blank),
204
    .addr_t(`biq_blank),
205
    .dynamic_addr(digit_idx),
206
    .gs_in(tr_gs_in),
207
    .console_ram_addr(oc_gs_ram_addr),
208
    .console_read_gs(oc_read_gs),
209 13 eightycc
    .console_write_gs(oc_write_gs),
210 12 eightycc
    .gs_out(gs_out),
211
    .double_write(gs_double_write),
212
    .no_write(gs_no_write)
213
    );
214
 
215 13 eightycc
   operator_ctl oc (
216 12 eightycc
    .rst(rst),
217
    .clk(clk),
218
    .ap(ap),
219
    .dp(dp),
220
    .dx(dx),
221
    .d0(d0),
222
    .d1(d1),
223
    .d2(d2),
224
    .d3(d3),
225
    .d4(d4),
226
    .d5(d5),
227 16 eightycc
    .d6(d6),
228
    .d9(d9),
229 12 eightycc
    .d10(d10),
230 16 eightycc
    .wu(wu),
231
    .wl(wl),
232 12 eightycc
    .hp(hp),
233
    .early_idx(early_idx),
234
    .ontime_idx(ontime_idx),
235
    .cmd_digit_in(cmd_digit_in),
236
    .io_buffer_in(io_buffer_in),
237
    .gs_in(tr_select_out),
238 15 eightycc
    .acc_ontime(ac_ontime_out),
239
    .dist_ontime(`biq_blank),
240
    .prog_ontime(`biq_blank),
241 12 eightycc
    .command(command),
242
    .data_out(oc_data_out),
243
    .addr_out(oc_addr_out),
244
    .console_out(oc_console_out),
245 15 eightycc
    .display_digit(oc_display_digit),
246 12 eightycc
    .console_to_addr(oc_console_to_addr),
247
    .gs_ram_addr(oc_gs_ram_addr),
248 13 eightycc
    .read_gs(oc_read_gs),
249
    .write_gs(oc_write_gs),
250 12 eightycc
    .pgm_start(oc_pgm_start),
251
    .pgm_stop(oc_pgm_stop),
252
    .err_reset(oc_err_reset),
253
    .err_sense_reset(oc_err_sense_reset),
254
    .run_control(oc_run_control),
255
    .half_or_pgm_stop(oc_half_or_pgm_stop),
256
    .ri_storage(oc_ri_storage),
257
    .ro_storage(oc_ro_storage),
258
    .storage_control(oc_storage_control),
259
    .man_pgm_reset(oc_man_pgm_reset),
260
    .man_acc_reset(oc_man_acc_reset),
261
    .set_8000(oc_set_8000),
262
    .reset_8000(oc_reset_8000),
263
    .hard_reset(oc_hard_reset),
264
    .cmd_digit_out(cmd_digit_out),
265
    .busy(busy),
266
    .digit_ready(digit_ready),
267
    .punch_card(punch_card),
268
    .read_card(read_card),
269
    .card_digit_ready(card_digit_ready)
270
    );
271
 
272 13 eightycc
    translators tr (
273 12 eightycc
    .dist_early_out(`biq_blank),
274
    .bs_out(`biq_blank),
275
    .console_out(oc_console_out),
276
    .ri_gs(1'b0),
277
    .ri_bs(1'b0),
278
    .ri_console(oc_write_gs),
279
    .n800x(1'b1),
280
    .gs_out(gs_out),
281
    .gs_write(tr_gs_write),
282
    .gs_in(tr_gs_in),
283
    .select_out(tr_select_out)
284
    );
285
 
286
endmodule

powered by: WebSVN 2.1.0

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