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

Subversion Repositories i650

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

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 20 eightycc
 
122
   //-----------------------------------------------------------------------------
123
   // Distributor
124
   //-----------------------------------------------------------------------------
125
   wire [0:6] ds_early_out, ds_ontime_out;
126
   wire ds_back_sig;
127 15 eightycc
 
128
   //-----------------------------------------------------------------------------
129 18 eightycc
   // Register validity checking
130
   //-----------------------------------------------------------------------------
131
   wire ck_error_stop, ck_acc_check_light, ck_prog_check_light,
132
        ck_dist_check_light;
133
 
134
   //-----------------------------------------------------------------------------
135 12 eightycc
   // General storage
136
   //-----------------------------------------------------------------------------
137 13 eightycc
   wire [0:4] gs_out;
138
   wire gs_double_write, gs_no_write;
139
 
140 12 eightycc
   //-----------------------------------------------------------------------------
141
   // Operator controls
142
   //-----------------------------------------------------------------------------
143 15 eightycc
   wire [0:6] oc_data_out, oc_addr_out, oc_console_out, oc_display_digit;
144 13 eightycc
   wire oc_console_to_addr;
145
   wire [0:14] oc_gs_ram_addr;
146
   wire oc_read_gs, oc_write_gs;
147
   wire oc_pgm_start, oc_pgm_stop, oc_err_reset, oc_err_sense_reset;
148
   wire oc_run_control, oc_half_or_pgm_stop, oc_ri_storage, oc_ro_storage,
149
        oc_storage_control;
150
   wire oc_man_pgm_reset, oc_man_acc_reset, oc_set_8000, oc_reset_8000,
151 12 eightycc
        oc_hard_reset;
152 15 eightycc
   assign display_digit = oc_display_digit;
153
 
154 12 eightycc
   //-----------------------------------------------------------------------------
155 20 eightycc
   // Program step register
156
   //-----------------------------------------------------------------------------
157
   wire [0:6] ps_early_out, ps_ontime_out, ps_ped_out;
158
   wire ps_restart_sig;
159
 
160
   //-----------------------------------------------------------------------------
161 12 eightycc
   // Translators
162
   //-----------------------------------------------------------------------------
163 13 eightycc
   wire tr_gs_write;
164
   wire [0:4] tr_gs_in;
165
   wire [0:6] tr_select_out;
166 12 eightycc
 
167 15 eightycc
   accumulator ac (
168
    .rst(rst),
169
    .ap(ap),
170
    .bp(bp),
171 18 eightycc
    .dp(dp),
172
    .dx(dx),
173 15 eightycc
    .d1(d1),
174
    .d2(d2),
175
    .dxu(dxu),
176
    .d0u(d0u),
177
    .wu(wu),
178
    .wl(wl),
179
    .adder_out(`biq_0),
180
    .acc_regen_gate(1'b1),
181
    .right_shift_gate(1'b0),
182
    .acc_ri_gate(1'b0),
183
    .zero_shift_count(1'b0),
184
    .man_acc_reset(oc_man_acc_reset),
185
    .reset_op_latch(1'b0),
186
    .early_idx(early_idx),
187
    .ontime_idx(ontime_idx),
188
    .early_out(ac_early_out),
189
    .ontime_out(ac_ontime_out),
190
    .ped_out(ac_ped_out)
191
    );
192
 
193 18 eightycc
   checking ck (
194
    .rst(rst),
195
    .bp(bp),
196
    .d1_dx(d1_dx),
197
    .acc_ontime(ac_ontime_out),
198 20 eightycc
    .prog_ontime(ps_ontime_out),
199
    .dist_ontime(ds_ontime_out),
200 18 eightycc
    .error_reset(oc_err_reset),
201
    .tlu_or_zero_check(1'b0),
202
    .error_stop(ck_error_stop),
203
    .acc_check_light(ck_acc_check_light),
204
    .prog_check_light(ck_prog_check_light),
205
    .dist_check_light(ck_dist_check_light)
206
    );
207
 
208 20 eightycc
   distributor ds (
209
    .rst(rst),
210
    .ap(ap),
211
    .cp(cp),
212
    .dp(dp),
213
    .dx(dx),
214
    .d0(d0),
215
    .d10(d10),
216
    .selected_storage(7'd0),
217
    .ri_dist(1'd0),
218
    .acc_ontime(ac_ontime_out),
219
    .start_acc_dist_ri(1'd0),
220
    .end_acc_dist_ri(1'd0),
221
    .acc_dist_ri(1'd0),
222
    .man_acc_reset(oc_man_acc_reset),
223
    .early_idx(early_idx),
224
    .ontime_idx(ontime_idx),
225
    .ontime_out(ds_ontime_out),
226
    .early_out(ds_early_out),
227
    .dist_back_sig(ds_back_sig)
228
    );
229
 
230 13 eightycc
   gen_store gs (
231 12 eightycc
    .rst(oc_hard_reset),
232
    .ap(ap),
233
    .dp(dp),
234
    .write_gate(tr_gs_write),
235
    .addr_th(`biq_blank),
236
    .addr_h(`biq_blank),
237
    .addr_t(`biq_blank),
238
    .dynamic_addr(digit_idx),
239
    .gs_in(tr_gs_in),
240
    .console_ram_addr(oc_gs_ram_addr),
241
    .console_read_gs(oc_read_gs),
242 13 eightycc
    .console_write_gs(oc_write_gs),
243 12 eightycc
    .gs_out(gs_out),
244
    .double_write(gs_double_write),
245
    .no_write(gs_no_write)
246
    );
247
 
248 13 eightycc
   operator_ctl oc (
249 12 eightycc
    .rst(rst),
250
    .clk(clk),
251
    .ap(ap),
252
    .dp(dp),
253
    .dx(dx),
254
    .d0(d0),
255
    .d1(d1),
256
    .d2(d2),
257
    .d3(d3),
258
    .d4(d4),
259
    .d5(d5),
260 16 eightycc
    .d6(d6),
261
    .d9(d9),
262 12 eightycc
    .d10(d10),
263 16 eightycc
    .wu(wu),
264
    .wl(wl),
265 12 eightycc
    .hp(hp),
266
    .early_idx(early_idx),
267
    .ontime_idx(ontime_idx),
268
    .cmd_digit_in(cmd_digit_in),
269
    .io_buffer_in(io_buffer_in),
270
    .gs_in(tr_select_out),
271 15 eightycc
    .acc_ontime(ac_ontime_out),
272 20 eightycc
    .dist_ontime(ds_ontime_out),
273
    .prog_ontime(ps_ontime_out),
274 12 eightycc
    .command(command),
275
    .data_out(oc_data_out),
276
    .addr_out(oc_addr_out),
277
    .console_out(oc_console_out),
278 15 eightycc
    .display_digit(oc_display_digit),
279 12 eightycc
    .console_to_addr(oc_console_to_addr),
280
    .gs_ram_addr(oc_gs_ram_addr),
281 13 eightycc
    .read_gs(oc_read_gs),
282
    .write_gs(oc_write_gs),
283 12 eightycc
    .pgm_start(oc_pgm_start),
284
    .pgm_stop(oc_pgm_stop),
285
    .err_reset(oc_err_reset),
286
    .err_sense_reset(oc_err_sense_reset),
287
    .run_control(oc_run_control),
288
    .half_or_pgm_stop(oc_half_or_pgm_stop),
289
    .ri_storage(oc_ri_storage),
290
    .ro_storage(oc_ro_storage),
291
    .storage_control(oc_storage_control),
292
    .man_pgm_reset(oc_man_pgm_reset),
293
    .man_acc_reset(oc_man_acc_reset),
294
    .set_8000(oc_set_8000),
295
    .reset_8000(oc_reset_8000),
296
    .hard_reset(oc_hard_reset),
297
    .cmd_digit_out(cmd_digit_out),
298
    .busy(busy),
299
    .digit_ready(digit_ready),
300
    .punch_card(punch_card),
301
    .read_card(read_card),
302
    .card_digit_ready(card_digit_ready)
303
    );
304
 
305 20 eightycc
   prog_step ps (
306
    .rst(rst),
307
    .ap(ap),
308
    .dp(dp),
309
    .dx(dx),
310
    .d0(d0),
311
    .d10(d10),
312
    .early_idx(early_idx),
313
    .ontime_idx(ontime_idx),
314
    .man_prog_reset(oc_man_pgm_reset),
315
    .rips(1'b0),
316
    .adder_out(7'b0),
317
    .sel_store_out(7'b0),
318
    .prog_ped_regen(1'b1),
319
    .prog_add(1'b0),
320
    .early_out(ps_early_out),
321
    .ontime_out(ps_ontime_out),
322
    .ped_out(ps_ped_out),
323
    .prog_restart_sig(ps_restart_sig)
324
    );
325
 
326 13 eightycc
    translators tr (
327 12 eightycc
    .dist_early_out(`biq_blank),
328
    .bs_out(`biq_blank),
329
    .console_out(oc_console_out),
330
    .ri_gs(1'b0),
331
    .ri_bs(1'b0),
332
    .ri_console(oc_write_gs),
333
    .n800x(1'b1),
334
    .gs_out(gs_out),
335
    .gs_write(tr_gs_write),
336
    .gs_in(tr_gs_in),
337
    .select_out(tr_select_out)
338
    );
339
 
340
endmodule

powered by: WebSVN 2.1.0

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