2023-02-13 16:49:17 +00:00
|
|
|
/* proc_state_def.v - Definitions of the states in the main state machine
|
|
|
|
of the 9086 CPU.
|
|
|
|
|
|
|
|
This file is part of the 9086 project.
|
|
|
|
|
|
|
|
Copyright (c) 2023 Efthymios Kritikos
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
|
2023-02-22 01:28:23 +00:00
|
|
|
`define PROC_STATE_BITS 6
|
2023-02-14 13:13:40 +00:00
|
|
|
|
|
|
|
|
2023-02-22 01:28:23 +00:00
|
|
|
`define PROC_HALT_STATE 6'b000000
|
2023-02-09 14:46:21 +00:00
|
|
|
|
|
|
|
/*INSTRUCTION FETCH STATE*/
|
2023-02-22 01:28:23 +00:00
|
|
|
`define PROC_IF_STATE_ENTRY 6'b000001
|
|
|
|
`define PROC_IF_WRITE_CIR 6'b000010
|
|
|
|
`define PROC_IF_STATE_EXTRA_FETCH_SET 6'b000011
|
|
|
|
`define PROC_IF_STATE_EXTRA_FETCH 6'b000100
|
2023-02-09 14:46:21 +00:00
|
|
|
|
|
|
|
/*DECODE SATE*/
|
2023-02-22 01:28:23 +00:00
|
|
|
`define PROC_DE_STATE_ENTRY 6'b001000
|
|
|
|
`define PROC_DE_LOAD_16_PARAM 6'b001001
|
|
|
|
`define PROC_DE_LOAD_16_EXTRA_FETCH_SET 6'b001010
|
|
|
|
`define PROC_DE_LOAD_16_EXTRA_FETCH 6'b001011
|
|
|
|
`define PROC_DE_LOAD_REG_TO_PARAM 6'b001100
|
2023-02-09 14:46:21 +00:00
|
|
|
|
2023-02-11 20:27:28 +00:00
|
|
|
/*MEM/IO READ*/
|
2023-02-24 02:18:48 +00:00
|
|
|
`define PROC_MEMIO_READ 6'b010000
|
2023-02-22 01:28:23 +00:00
|
|
|
`define PROC_MEMIO_READ_SETADDR 6'b010001
|
|
|
|
`define PROC_MEMIO_GET_ALIGNED_DATA 6'b010010 /* :) */
|
|
|
|
`define PROC_MEMIO_GET_UNALIGNED_DATA 6'b010011 /* :( */
|
|
|
|
`define PROC_MEMIO_GET_SECOND_BYTE 6'b010100
|
|
|
|
`define PROC_MEMIO_GET_SECOND_BYTE1 6'b010101
|
|
|
|
`define PROC_DE_LOAD_8_PARAM 6'b010110
|
|
|
|
`define PROC_DE_LOAD_8_PARAM_UNALIGNED 6'b010111
|
2023-02-11 20:27:28 +00:00
|
|
|
|
2023-02-09 14:46:21 +00:00
|
|
|
/*EXECUTE STATE*/
|
2023-02-22 01:28:23 +00:00
|
|
|
`define PROC_EX_STATE_ENTRY 6'b100000
|
2023-02-14 13:13:40 +00:00
|
|
|
|
|
|
|
/*MEM/IO WRITE*/
|
2023-02-22 01:28:23 +00:00
|
|
|
`define PROC_MEMIO_WRITE 6'b101000
|
|
|
|
//`define PROC_MEMIO_WRITE_SETADDR 6'b010101
|
|
|
|
`define PROC_MEMIO_PUT_ALIGNED_DATA 6'b101001
|
|
|
|
`define PROC_MEMIO_PUT_UNALIGNED_DATA 6'b101010
|
|
|
|
`define PROC_MEMIO_PUT_BYTE 6'b101011
|
|
|
|
`define PROC_MEMIO_PUT_BYTE_STOP_READ 6'b101100
|
|
|
|
`define PROC_MEMIO_WRITE_EXIT 6'b101101
|
|
|
|
`define PROC_MEMIO_PUT_UNALIGNED_FIRST_BYTE 6'b101110
|
|
|
|
`define PROC_MEMIO_PUT_UNALIGNED_PREP_NEXT 6'b101111
|
|
|
|
`define PROC_MEMIO_PUT_UNALIGNED_PREP_NEXT1 6'b110001
|
|
|
|
`define PROC_MEMIO_PUT_UNALIGNED_PREP_NEXT2 6'b110010
|
|
|
|
`define PROC_MEMIO_PUT_UNALIGNED_PREP_NEXT3 6'b110011
|
|
|
|
`define PROC_MEMIO_PUT_UNALIGNED_PREP_NEXT4 6'b110100
|
|
|
|
|
|
|
|
`define PROC_NEXT_MICROCODE 6'b111000
|