Line 54... |
Line 54... |
output reg busy, digit_ready,
|
output reg busy, digit_ready,
|
output reg punch_card, read_card, card_digit_ready
|
output reg punch_card, read_card, card_digit_ready
|
);
|
);
|
|
|
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
// Operator console switch settings
|
// Operator console switch settings and their control signals.
|
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
reg pgm_sw_stop, pgm_sw_run,
|
reg pgm_sw_stop, pgm_sw_run,
|
half_cycle_sw_run, half_cycle_sw_half,
|
half_cycle_sw_run, half_cycle_sw_half,
|
ctl_sw_addr_stop, ctl_sw_run, ctl_sw_manual,
|
ctl_sw_addr_stop, ctl_sw_run, ctl_sw_manual,
|
disp_sw_lacc, disp_sw_uacc, disp_sw_dist, disp_sw_pgm,
|
disp_sw_lacc, disp_sw_uacc, disp_sw_dist, disp_sw_pgm,
|
Line 70... |
Line 70... |
assign half_or_pgm_stop = half_cycle_sw_half | pgm_stop;
|
assign half_or_pgm_stop = half_cycle_sw_half | pgm_stop;
|
assign ri_storage = disp_sw_ri;
|
assign ri_storage = disp_sw_ri;
|
assign ro_storage = disp_sw_ro;
|
assign ro_storage = disp_sw_ro;
|
assign storage_control = run_control | disp_sw_ro;
|
assign storage_control = run_control | disp_sw_ro;
|
|
|
reg do_power_on_reset, do_reset_console, do_err_reset, do_err_sense_reset,
|
//-----------------------------------------------------------------------------
|
do_pgm_reset, do_acc_reset, do_hard_reset, do_clear_drum;
|
// Calculate the RAM address of the general storage word at address gs_addr_.
|
reg [0:5] state;
|
//-----------------------------------------------------------------------------
|
|
|
reg [0:6] gs_addr_th, gs_addr_h, gs_addr_t, gs_addr_u;
|
reg [0:6] gs_addr_th, gs_addr_h, gs_addr_t, gs_addr_u;
|
wire [0:14] gs_band_addr;
|
wire [0:14] gs_band_addr;
|
wire [0:9] gs_word_offset;
|
wire [0:9] gs_word_offset;
|
ram_band_addr rba(gs_addr_th, gs_addr_h, gs_addr_t, gs_band_addr);
|
ram_band_addr rba(gs_addr_th, gs_addr_h, gs_addr_t, gs_band_addr);
|
ram_word_offset rwo(gs_addr_t, gs_addr_u, gs_word_offset);
|
ram_word_offset rwo(gs_addr_t, gs_addr_u, gs_word_offset);
|
wire [0:14] gs_word_addr = gs_band_addr + gs_word_offset;
|
wire [0:14] gs_word_addr = gs_band_addr + gs_word_offset;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Operator console state machine
|
|
//-----------------------------------------------------------------------------
|
|
reg do_power_on_reset, do_reset_console, do_err_reset, do_err_sense_reset,
|
|
do_pgm_reset, do_acc_reset, do_hard_reset, do_clear_drum;
|
|
reg [0:5] state;
|
|
|
`define state_idle 6'd0
|
`define state_idle 6'd0
|
|
|
`define state_reset_console_1 6'd1
|
`define state_reset_console_1 6'd1
|
`define state_reset_console_2 6'd2
|
`define state_reset_console_2 6'd2
|
`define state_pgm_reset_1 6'd3
|
`define state_pgm_reset_1 6'd3
|
Line 112... |
Line 118... |
`define state_read_gs_1 6'd30
|
`define state_read_gs_1 6'd30
|
`define state_read_gs_2 6'd31
|
`define state_read_gs_2 6'd31
|
`define state_read_gs_3 6'd32
|
`define state_read_gs_3 6'd32
|
`define state_read_gs_4 6'd33
|
`define state_read_gs_4 6'd33
|
`define state_read_gs_5 6'd34
|
`define state_read_gs_5 6'd34
|
|
`define state_read_gs_6 6'd35
|
|
|
`define state_clear_drum_1 6'd50
|
`define state_clear_drum_1 6'd50
|
`define state_clear_drum_2 6'd51
|
`define state_clear_drum_2 6'd51
|
`define state_clear_drum_3 6'd52
|
`define state_clear_drum_3 6'd52
|
|
|
//-----------------------------------------------------------------------------
|
|
// Operator console state machine
|
|
//-----------------------------------------------------------------------------
|
|
always @(posedge clk) begin
|
always @(posedge clk) begin
|
if (rst) begin
|
if (rst) begin
|
console_to_addr <= 0;
|
console_to_addr <= 0;
|
pgm_start <= 0;
|
pgm_start <= 0;
|
pgm_stop <= 0;
|
pgm_stop <= 0;
|
Line 630... |
Line 634... |
|
|
// Read word from general storage
|
// Read word from general storage
|
// --> 4 digits address, little-endian
|
// --> 4 digits address, little-endian
|
// <-- 1 digit sign, 10 digits, little-endian
|
// <-- 1 digit sign, 10 digits, little-endian
|
// 0 : Ignore if CPU not stopped
|
// 0 : Ignore if CPU not stopped
|
// Accept low-order address digit
|
// 1 : Accept first address digit
|
// 1 : Accept remaining address digits
|
// 2 : Accept remaining address digits
|
// 2 : Calculate word origin in gs RAM
|
// 2 : Calculate word origin in gs RAM
|
// Validate address
|
// Validate address
|
// console_read_gs <= 1;
|
// console_read_gs <= 1;
|
// 3 : Send gs-early digit to out
|
// 3 : Send gs-early digit to out
|
// digit_ready <= 1;
|
// digit_ready <= 1;
|
Line 657... |
Line 661... |
digit_ready <= 0;
|
digit_ready <= 0;
|
end
|
end
|
end
|
end
|
|
|
`state_read_gs_3: begin
|
`state_read_gs_3: begin
|
|
if (d10) begin
|
gs_ram_addr <= gs_word_addr;
|
gs_ram_addr <= gs_word_addr;
|
|
read_gs <= 1;
|
state <= `state_read_gs_4;
|
state <= `state_read_gs_4;
|
end
|
end
|
|
end
|
|
|
`state_read_gs_4: begin
|
`state_read_gs_4: begin
|
cmd_digit_out <= gs_in;
|
|
state <= `state_read_gs_5;
|
state <= `state_read_gs_5;
|
|
gs_ram_addr <= gs_ram_addr + 1;
|
|
end
|
|
|
|
`state_read_gs_5: begin
|
|
digit_ready <= 1;
|
|
cmd_digit_out <= gs_in;
|
|
gs_ram_addr <= gs_ram_addr + 1;
|
|
if (dx) begin
|
|
state <= `state_read_gs_6;
|
|
read_gs <= 0;
|
|
end
|
|
end
|
|
|
|
`state_read_gs_6: begin
|
|
digit_ready <= 0;
|
|
state <= `state_idle;
|
end
|
end
|
|
|
// 0 : Ignore if not in manual
|
// 0 : Ignore if not in manual
|
// Clear gs_ram_addr
|
// Clear gs_ram_addr
|
// 1 : Synchronize with d10
|
// 1 : Synchronize with d10
|