65 lines
2.2 KiB
Verilog
65 lines
2.2 KiB
Verilog
/* 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/>. */
|
|
|
|
`define PROC_STATE_BITS 6
|
|
|
|
|
|
`define PROC_HALT_STATE 6'b000000
|
|
|
|
/*INSTRUCTION FETCH STATE*/
|
|
`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
|
|
|
|
|
|
/*DECODE SATE*/
|
|
`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
|
|
|
|
/*MEM/IO READ*/
|
|
`define PROC_MEMIO_READ 6'b010000
|
|
`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
|
|
|
|
/*EXECUTE STATE*/
|
|
`define PROC_EX_STATE_ENTRY 6'b100000
|
|
|
|
/*MEM/IO WRITE*/
|
|
`define PROC_MEMIO_WRITE 6'b101000
|
|
//`define PROC_MEMIO_WRITE_SETADDR 6'b010101
|
|
`define PROC_MEMIO_PUT_ALIGNED_16BIT_DATA 6'b101001
|
|
`define PROC_MEMIO_PUT_UNALIGNED_16BIT_DATA 6'b101010
|
|
`define PROC_MEMIO_PUT_BYTE 6'b101011
|
|
`define PROC_MEMIO_WRITE_EXIT 6'b101101
|
|
`define PROC_MEMIO_PUT_UNALIGNED_PREP_NEXT 6'b101111
|
|
`define PROC_MEMIO_PUT_UNALIGNED_PREP_NEXT2 6'b110010
|
|
|
|
`define PROC_NEXT_MICROCODE 6'b111000
|
|
|
|
`define PROC_RESET 6'b111100
|