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

Subversion Repositories i650

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

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 21 eightycc
   // Adder input muxes
119
   //-----------------------------------------------------------------------------
120
   wire [0:6] aa_entry_a, ab_entry_b;
121
 
122
   //-----------------------------------------------------------------------------
123 15 eightycc
   // Accumulator
124
   //-----------------------------------------------------------------------------
125
   wire [0:6] ac_early_out, ac_ontime_out, ac_ped_out;
126 20 eightycc
 
127
   //-----------------------------------------------------------------------------
128 21 eightycc
   // Address register
129
   //-----------------------------------------------------------------------------
130
   wire [0:6] ar_addr_th, ar_addr_h, ar_addr_t, ar_addr_u;
131
   wire ar_dynamic_addr_hit, ar_addr_no_800x, ar_addr_8000, ar_addr_8001,
132
        ar_addr_8002, ar_addr_8003, ar_addr_8002_8003, ar_invalid_addr;
133
 
134
   //-----------------------------------------------------------------------------
135 20 eightycc
   // Distributor
136
   //-----------------------------------------------------------------------------
137
   wire [0:6] ds_early_out, ds_ontime_out;
138
   wire ds_back_sig;
139 15 eightycc
 
140
   //-----------------------------------------------------------------------------
141 18 eightycc
   // Register validity checking
142
   //-----------------------------------------------------------------------------
143
   wire ck_error_stop, ck_acc_check_light, ck_prog_check_light,
144
        ck_dist_check_light;
145
 
146
   //-----------------------------------------------------------------------------
147 12 eightycc
   // General storage
148
   //-----------------------------------------------------------------------------
149 13 eightycc
   wire [0:4] gs_out;
150
   wire gs_double_write, gs_no_write;
151
 
152 12 eightycc
   //-----------------------------------------------------------------------------
153 21 eightycc
   // Opcode register
154
   //-----------------------------------------------------------------------------
155
   wire [0:6] op_opreg_t, op_opreg_u;
156
   wire op_ri_addr_reg;
157
 
158
   //-----------------------------------------------------------------------------
159 12 eightycc
   // Operator controls
160
   //-----------------------------------------------------------------------------
161 15 eightycc
   wire [0:6] oc_data_out, oc_addr_out, oc_console_out, oc_display_digit;
162 21 eightycc
   wire oc_console_to_addr, oc_acc_ri_console;
163 13 eightycc
   wire [0:14] oc_gs_ram_addr;
164
   wire oc_read_gs, oc_write_gs;
165
   wire oc_pgm_start, oc_pgm_stop, oc_err_reset, oc_err_sense_reset;
166
   wire oc_run_control, oc_half_or_pgm_stop, oc_ri_storage, oc_ro_storage,
167
        oc_storage_control;
168
   wire oc_man_pgm_reset, oc_man_acc_reset, oc_set_8000, oc_reset_8000,
169 12 eightycc
        oc_hard_reset;
170 15 eightycc
   assign display_digit = oc_display_digit;
171
 
172 12 eightycc
   //-----------------------------------------------------------------------------
173 20 eightycc
   // Program step register
174
   //-----------------------------------------------------------------------------
175
   wire [0:6] ps_early_out, ps_ontime_out, ps_ped_out;
176
   wire ps_restart_sig;
177 21 eightycc
 
178
   //-----------------------------------------------------------------------------
179
   // Storage select
180
   //-----------------------------------------------------------------------------
181
   wire [0:6] ss_selected_out;
182 20 eightycc
 
183
   //-----------------------------------------------------------------------------
184 12 eightycc
   // Translators
185
   //-----------------------------------------------------------------------------
186 13 eightycc
   wire tr_gs_write;
187
   wire [0:4] tr_gs_in;
188 21 eightycc
   wire [0:6] tr_gs_out;
189 12 eightycc
 
190 21 eightycc
   add_in_a aa (
191
    .acc_early_out(ac_early_out),
192
    .acc_ontime_out(ac_ontime_out),
193
    .prog_step_early_out(ps_early_out),
194
    .select_storage_out(ss_selected_out),
195
    .addr_u(ar_addr_u),
196
    .acc_true_add_gate(1'b0),
197
    .acc_compl_add_gate(1'b0),
198
    .left_shift_gate(1'b0),
199
    .prog_step_add_gate(1'b0),
200
    .shift_num_gate(1'b0),
201
    .select_stor_add_gate(1'b0),
202
    .adder_entry_a(aa_entry_a)
203
    );
204
 
205
   add_in_b ab (
206
    .dist_early_out(ds_early_out),
207
    .dist_ontime_out(ds_ontime_out),
208
    .special_int_entry(10'd0),
209
    .ontime_dist_add_gate_tlu(1'b0),
210
    .dist_compl_add_gate(1'b0),
211
    .upper_lower_check(1'b0),
212
    .dist_blank_gate(1'b0),
213
    .early_dist_zero_entry(1'b0),
214
    .dist_true_add_gate(1'b0),
215
    .adder_entry_b(ab_entry_b)
216
    );
217
 
218 15 eightycc
   accumulator ac (
219 21 eightycc
    .rst(oc_hard_reset),
220 15 eightycc
    .ap(ap),
221
    .bp(bp),
222 18 eightycc
    .dp(dp),
223
    .dx(dx),
224 15 eightycc
    .d1(d1),
225
    .d2(d2),
226 21 eightycc
    .d10(d10),
227 15 eightycc
    .dxu(dxu),
228
    .d0u(d0u),
229
    .wu(wu),
230
    .wl(wl),
231
    .adder_out(`biq_0),
232 21 eightycc
    .console_out(oc_console_out),
233 15 eightycc
    .acc_regen_gate(1'b1),
234
    .right_shift_gate(1'b0),
235 21 eightycc
    .acc_ri_gate(1'b0),
236
    .acc_ri_console(oc_acc_ri_console),
237 15 eightycc
    .zero_shift_count(1'b0),
238
    .man_acc_reset(oc_man_acc_reset),
239 21 eightycc
    .reset_op(1'b0),
240 15 eightycc
    .early_idx(early_idx),
241
    .ontime_idx(ontime_idx),
242
    .early_out(ac_early_out),
243
    .ontime_out(ac_ontime_out),
244
    .ped_out(ac_ped_out)
245
    );
246
 
247 21 eightycc
   addr_reg ar (
248 18 eightycc
    .rst(rst),
249 21 eightycc
    .ap(ap),
250 18 eightycc
    .bp(bp),
251 21 eightycc
    .dx(dx),
252
    .d1(d1),
253
    .d2(d2),
254
    .d3(d3),
255
    .d4(d4),
256
    .d5(d5),
257
    .d6(d6),
258
    .d7(d7),
259
    .d8(d8),
260
    .d9(d9),
261
    .w0(w0),
262
    .w1(w1),
263
    .w2(w2),
264
    .w3(w3),
265
    .w4(w4),
266
    .w5(w5),
267
    .w6(w6),
268
    .w7(w7),
269
    .w8(w8),
270
    .w9(w9),
271
    .s0(s0),
272
    .s1(s1),
273
    .s2(s2),
274
    .s3(s3),
275
    .s4(s4),
276
    .error_reset(oc_err_reset),
277
    .restart_a(1'b0),
278
    .set_8000(oc_set_8000),
279
    .reset_8000(oc_reset_8000),
280
    .tlu_band_change(1'b0),
281
    .double_write(gs_double_write),
282
    .no_write(gs_no_write),
283
    .bs_to_gs(1'b0),
284
    .ri_gs(1'b0),
285
    .ps_reg_in(ps_ontime_out),
286
    .console_in(oc_addr_out),
287
    .ri_addr_reg(op_ri_addr_reg),
288
    .console_to_addr_reg(oc_console_to_addr),
289
    .addr_th(ar_addr_th),
290
    .addr_h(ar_addr_h),
291
    .addr_t(ar_addr_t),
292
    .addr_u(ar_addr_u),
293
    .dynamic_addr_hit(ar_dynamic_addr_hit),
294
    .addr_no_800x(ar_addr_no_800x),
295
    .addr_8000(ar_addr_8000),
296
    .addr_8001(ar_addr_8001),
297
    .addr_8002(ar_addr_8002),
298
    .addr_8003(ar_addr_8003),
299
    .addr_8002_8003(ar_addr_8002_8003),
300
    .invalid_addr(ar_invalid_addr)
301
    );
302
 
303
   checking ck (
304
    .rst(oc_hard_reset),
305
    .bp(bp),
306 18 eightycc
    .d1_dx(d1_dx),
307
    .acc_ontime(ac_ontime_out),
308 20 eightycc
    .prog_ontime(ps_ontime_out),
309
    .dist_ontime(ds_ontime_out),
310 18 eightycc
    .error_reset(oc_err_reset),
311
    .tlu_or_zero_check(1'b0),
312
    .error_stop(ck_error_stop),
313
    .acc_check_light(ck_acc_check_light),
314
    .prog_check_light(ck_prog_check_light),
315
    .dist_check_light(ck_dist_check_light)
316
    );
317
 
318 20 eightycc
   distributor ds (
319 21 eightycc
    .rst(oc_hard_reset),
320 20 eightycc
    .ap(ap),
321
    .cp(cp),
322
    .dp(dp),
323
    .dx(dx),
324
    .d0(d0),
325
    .d10(d10),
326 21 eightycc
    .selected_storage(ss_selected_out),
327 20 eightycc
    .ri_dist(1'd0),
328
    .acc_ontime(ac_ontime_out),
329
    .start_acc_dist_ri(1'd0),
330
    .end_acc_dist_ri(1'd0),
331
    .acc_dist_ri(1'd0),
332
    .man_acc_reset(oc_man_acc_reset),
333
    .early_idx(early_idx),
334
    .ontime_idx(ontime_idx),
335
    .ontime_out(ds_ontime_out),
336
    .early_out(ds_early_out),
337
    .dist_back_sig(ds_back_sig)
338
    );
339
 
340 13 eightycc
   gen_store gs (
341 12 eightycc
    .rst(oc_hard_reset),
342
    .ap(ap),
343
    .dp(dp),
344
    .write_gate(tr_gs_write),
345 21 eightycc
    .addr_th(ar_addr_th),
346
    .addr_h(ar_addr_h),
347
    .addr_t(ar_addr_t),
348 12 eightycc
    .dynamic_addr(digit_idx),
349
    .gs_in(tr_gs_in),
350
    .console_ram_addr(oc_gs_ram_addr),
351
    .console_read_gs(oc_read_gs),
352 13 eightycc
    .console_write_gs(oc_write_gs),
353 12 eightycc
    .gs_out(gs_out),
354
    .double_write(gs_double_write),
355
    .no_write(gs_no_write)
356
    );
357
 
358 13 eightycc
   operator_ctl oc (
359 12 eightycc
    .rst(rst),
360
    .clk(clk),
361
    .ap(ap),
362
    .dp(dp),
363
    .dx(dx),
364
    .d0(d0),
365
    .d1(d1),
366
    .d2(d2),
367
    .d3(d3),
368
    .d4(d4),
369
    .d5(d5),
370 16 eightycc
    .d6(d6),
371
    .d9(d9),
372 12 eightycc
    .d10(d10),
373 16 eightycc
    .wu(wu),
374
    .wl(wl),
375 12 eightycc
    .hp(hp),
376
    .early_idx(early_idx),
377
    .ontime_idx(ontime_idx),
378
    .cmd_digit_in(cmd_digit_in),
379
    .io_buffer_in(io_buffer_in),
380 21 eightycc
    .gs_in(tr_gs_out),
381 15 eightycc
    .acc_ontime(ac_ontime_out),
382 20 eightycc
    .dist_ontime(ds_ontime_out),
383
    .prog_ontime(ps_ontime_out),
384 12 eightycc
    .command(command),
385
    .data_out(oc_data_out),
386
    .addr_out(oc_addr_out),
387
    .console_out(oc_console_out),
388 15 eightycc
    .display_digit(oc_display_digit),
389 21 eightycc
    .console_to_addr(oc_console_to_addr),
390
    .acc_ri_console(oc_acc_ri_console),
391 12 eightycc
    .gs_ram_addr(oc_gs_ram_addr),
392 13 eightycc
    .read_gs(oc_read_gs),
393
    .write_gs(oc_write_gs),
394 12 eightycc
    .pgm_start(oc_pgm_start),
395
    .pgm_stop(oc_pgm_stop),
396
    .err_reset(oc_err_reset),
397
    .err_sense_reset(oc_err_sense_reset),
398
    .run_control(oc_run_control),
399
    .half_or_pgm_stop(oc_half_or_pgm_stop),
400
    .ri_storage(oc_ri_storage),
401
    .ro_storage(oc_ro_storage),
402
    .storage_control(oc_storage_control),
403
    .man_pgm_reset(oc_man_pgm_reset),
404
    .man_acc_reset(oc_man_acc_reset),
405
    .set_8000(oc_set_8000),
406
    .reset_8000(oc_reset_8000),
407
    .hard_reset(oc_hard_reset),
408
    .cmd_digit_out(cmd_digit_out),
409
    .busy(busy),
410
    .digit_ready(digit_ready),
411
    .punch_card(punch_card),
412
    .read_card(read_card),
413
    .card_digit_ready(card_digit_ready)
414
    );
415
 
416 21 eightycc
   op_reg op (
417
    .rst(oc_hard_reset),
418
    .cp(cp),
419
    .d0(d0),
420
    .d9(d9),
421
    .d10(d10),
422
    .d1_d5(d1_d5),
423
    .d5_dx(d5_dx),
424
    .restart_a(1'b0),
425
    .restart_b(1'b0),
426
    .d_alt(1'b0),
427
    .i_alt(1'b0),
428
    .tlu_band_change(1'b0),
429
    .man_prog_reset(oc_man_pgm_reset),
430
    .prog_step_ped(ps_ped_out),
431
    .opreg_t(op_opreg_t),
432
    .opreg_u(op_opreg_u),
433
    .ri_addr_reg(op_ri_addr_reg)
434
    );
435
 
436 20 eightycc
   prog_step ps (
437 21 eightycc
    .rst(oc_hard_reset),
438 20 eightycc
    .ap(ap),
439
    .dp(dp),
440
    .dx(dx),
441
    .d0(d0),
442
    .d10(d10),
443
    .early_idx(early_idx),
444
    .ontime_idx(ontime_idx),
445
    .man_prog_reset(oc_man_pgm_reset),
446
    .rips(1'b0),
447
    .adder_out(7'b0),
448
    .sel_store_out(7'b0),
449
    .prog_ped_regen(1'b1),
450
    .prog_add(1'b0),
451
    .early_out(ps_early_out),
452
    .ontime_out(ps_ontime_out),
453
    .ped_out(ps_ped_out),
454
    .prog_restart_sig(ps_restart_sig)
455
    );
456
 
457 21 eightycc
   store_select ss (
458
    .d0(d0),
459
    .d1_dx(d1_dx),
460
    .addr_no_800x(ar_addr_no_800x),
461
    .addr_8000(ar_addr_8000),
462
    .addr_8001(ar_addr_8001),
463
    .addr_8002_8003(ar_addr_8002_8003),
464
    .addr_hot_8000(1'b0),
465
    .acc_ontime(ac_ontime_out),
466
    .dist_ontime(ds_ontime_out),
467
    .gs_out(tr_gs_out),
468
    .console_switches(oc_data_out),
469
    .acc_plus(1'b0),
470
    .acc_minus(1'b0),
471
    .selected_out(ss_selected_out)
472
    );
473
 
474 13 eightycc
    translators tr (
475 12 eightycc
    .dist_early_out(`biq_blank),
476
    .bs_out(`biq_blank),
477
    .console_out(oc_console_out),
478
    .ri_gs(1'b0),
479
    .ri_bs(1'b0),
480
    .ri_console(oc_write_gs),
481 21 eightycc
    .n800x(ar_addr_no_800x),
482
    .console_read_gs(oc_read_gs),
483 12 eightycc
    .gs_out(gs_out),
484
    .gs_write(tr_gs_write),
485
    .gs_in(tr_gs_in),
486 21 eightycc
    .gs_biq_out(tr_gs_out)
487 12 eightycc
    );
488
 
489
endmodule

powered by: WebSVN 2.1.0

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