-- Copyright © 1993 by McGraw-Hill, Inc. and Zainalabedin Navabi
-- FIGURE 9.52
-- ENTITY DECLARATION OF PARWAN CONTROL SECTION :
LIBRARY cmos;
USE cmos.basic_utilities.ALL;
LIBRARY par_library;
USE par_library.par_utilities.ALL;
USE WORK.alu_operations.ALL;
--
ENTITY par_control_unit IS
GENERIC (read_delay, write_delay : TIME := 3 NS);
PORT (clk : IN qit;
-- register control signals:
load_ac, zero_ac,
load_ir,
increment_pc, load_page_pc, load_offset_pc, reset_pc,
load_page_mar, load_offset_mar,
load_sr, cm_carry_sr,
-- bus connection control signals:
pc_on_mar_page_bus, ir_on_mar_page_bus,
pc_on_mar_offset_bus, dbus_on_mar_offset_bus,
pc_offset_on_dbus, obus_on_dbus, databus_on_dbus,
mar_on_adbus,
dbus_on_databus,
-- logic unit function control outputs:
arith_shift_left, arith_shift_right : OUT qit;
alu_code : OUT qit_vector (2 DOWNTO 0);
-- inputs from the data section:
ir_lines : IN byte; status : IN nibble;
-- memory control and other external signals:
read_mem, write_mem : OUT qit; interrupt : IN qit
);
END par_control_unit;
--
-- FIGURE 9.53
-- DECLARATIVE PART OF PARWAN CONTROL UNIT ARCHITECTURE:
ARCHITECTURE dataflow OF par_control_unit IS
-- oring is implied in the following signals (oi)
SIGNAL load_ac_oi, zero_ac_oi,
load_ir_oi,
increment_pc_oi, load_page_pc_oi, load_offset_pc_oi, reset_pc_oi,
load_page_mar_oi, load_offset_mar_oi,
load_sr_oi, cm_carry_sr_oi,
pc_on_mar_page_bus_oi, ir_on_mar_page_bus_oi,
pc_on_mar_offset_bus_oi, dbus_on_mar_offset_bus_oi,
pc_offset_on_dbus_oi, obus_on_dbus_oi, databus_on_dbus_oi,
mar_on_adbus_oi,
dbus_on_databus_oi,
arith_shift_left_oi, arith_shift_right_oi,
read_mem_oi, write_mem_oi : ored_qit BUS;
SIGNAL alu_code_oi : ored_qit_vector (2 DOWNTO 0) BUS;
SIGNAL s : ored_qit_vector (9 DOWNTO 1) REGISTER := "000000001";
-- FIGURE 9.54
-- FIGURE 9.55
-- FIGURE 9.56
-- FIGURE 9.57
-- FIGURE 9.58
-- FIGURE 9.59
-- FIGURE 9.60
-- STATE 6 : READING THE ACTUAL OPERAND, AND EXECUTING
-- JMP, STA, LDA, AND ADD, AND SUB INSTRUCTIONS:
s6: BLOCK (s(6) = '1')
BEGIN
jm: BLOCK ( (ir_lines (7 DOWNTO 5) = "100") AND GUARD)
BEGIN
load_page_pc_oi <= GUARDED '1';
load_offset_pc_oi <= GUARDED '1';
-- goto 2
ck: BLOCK ( (clk = '0' AND NOT clk'STABLE) AND GUARD )
BEGIN
s(2) <= GUARDED '1';
END BLOCK ck;
END BLOCK jm;
--
st: BLOCK ( (ir_lines (7 DOWNTO 5) = "101") AND GUARD)
BEGIN
-- mar on adbus, ac on databus, write to memory
mar_on_adbus_oi <= GUARDED '1';
alu_code_oi <= GUARDED ored_qit_vector (b_input);
obus_on_dbus_oi <= GUARDED '1';
dbus_on_databus_oi <= GUARDED '1';
write_mem_oi <= GUARDED '1' AFTER write_delay;
-- goto 1
ck: BLOCK ( (clk = '0' AND NOT clk'STABLE) AND GUARD )
BEGIN
s(1) <= GUARDED '1';
END BLOCK ck;
END BLOCK st;
--
rd: BLOCK ( (ir_lines (7) = '0') AND GUARD)
BEGIN
-- mar on adbus, read memory for operand, perform operation
mar_on_adbus_oi <= GUARDED '1';
read_mem_oi <= GUARDED '1' AFTER read_delay;
databus_on_dbus_oi <= GUARDED '1';
WITH ir_lines (6 DOWNTO 5) SELECT
alu_code_oi <= GUARDED
ored_qit_vector (a_input) WHEN "00",
ored_qit_vector (a_and_b) WHEN "01",
ored_qit_vector (a_add_b) WHEN "10",
ored_qit_vector (a_sub_b) WHEN "11",
ored_qit_vector (b_input) WHEN OTHERS;
load_sr_oi <= GUARDED '1';
load_ac_oi <= GUARDED '1';
-- goto 1
ck: BLOCK ( (clk = '0' AND NOT clk'STABLE) AND GUARD )
BEGIN
s(1) <= GUARDED '1';
END BLOCK ck;
END BLOCK rd;
END BLOCK s6;
---------------
-- FIGURE 9.61
-- FIGURE 9.62
-- FIGURE 9.63
-- FIGURE 9.64
-- A ZERO DRIVERS IS PLACED ON ALL STATES, ENDING THE
-- DATAFLOW DESCRIPTION OF THE PARWAN CONTROL UNIT:
ck: BLOCK ( clk = '0' AND NOT clk'STABLE )
BEGIN
s (9 DOWNTO 1) <= GUARDED "000000000";
END BLOCK ck;
---------------
END dataflow;
--