67 lines
2.5 KiB
Verilog
67 lines
2.5 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 5
|
|
|
|
|
|
`define PROC_HALT_STATE 5'b00000
|
|
|
|
/*INSTRUCTION FETCH STATE*/
|
|
`define PROC_IF_STATE_ENTRY 5'b00001
|
|
`define PROC_IF_WRITE_CIR 5'b00010
|
|
`define PROC_IF_STATE_EXTRA_FETCH_SET 5'b00011
|
|
`define PROC_IF_STATE_EXTRA_FETCH 5'b00100
|
|
|
|
/*DECODE SATE*/
|
|
`define PROC_DE_STATE_ENTRY 5'b01000
|
|
`define PROC_DE_LOAD_16_PARAM 5'b01001
|
|
`define PROC_DE_LOAD_16_EXTRA_FETCH_SET 5'b01010
|
|
`define PROC_DE_LOAD_16_EXTRA_FETCH 5'b01011
|
|
`define PROC_DE_LOAD_REG_TO_PARAM 5'b11011 /****/
|
|
|
|
/*MEM/IO READ*/
|
|
`define RPOC_MEMIO_READ 5'b10000
|
|
`define PROC_MEMIO_READ_SETADDR 5'b10001
|
|
`define PROC_MEMIO_GET_ALIGNED_DATA 5'b10010 /* :) */
|
|
`define PROC_MEMIO_GET_UNALIGNED_DATA 5'b10011 /* :( */
|
|
`define PROC_MEMIO_GET_SECOND_BYTE 5'b11100 /******/
|
|
`define PROC_MEMIO_GET_SECOND_BYTE1 5'b11101 /******/
|
|
`define PROC_DE_LOAD_8_PARAM 5'b00110 /******/
|
|
`define PROC_DE_LOAD_8_PARAM_UNALIGNED 5'b00111 /******/
|
|
|
|
/*EXECUTE STATE*/
|
|
`define PROC_EX_STATE_ENTRY 5'b11000
|
|
`define PROC_EX_STATE_EXIT 5'b11001
|
|
|
|
/*MEM/IO WRITE*/
|
|
`define PROC_MEMIO_WRITE 5'b10100
|
|
//`define PROC_MEMIO_WRITE_SETADDR 5'b10101
|
|
`define PROC_MEMIO_PUT_ALIGNED_DATA 5'b10101
|
|
`define PROC_MEMIO_PUT_UNALIGNED_DATA 5'b10110
|
|
`define PROC_MEMIO_PUT_BYTE 5'b10111
|
|
`define PROC_MEMIO_PUT_BYTE_STOP_READ 5'b11110 /****/
|
|
`define PROC_MEMIO_WRITE_EXIT 5'b11111 /****/
|
|
`define PROC_MEMIO_PUT_UNALIGNED_FIRST_BYTE 5'b00101 /****/
|
|
`define PROC_MEMIO_PUT_UNALIGNED_PREP_NEXT 5'b01100 /****/
|
|
`define PROC_MEMIO_PUT_UNALIGNED_PREP_NEXT1 5'b01101 /****/
|
|
`define PROC_MEMIO_PUT_UNALIGNED_PREP_NEXT2 5'b01110 /****/
|
|
`define PROC_MEMIO_PUT_UNALIGNED_PREP_NEXT3 5'b01111 /****/
|
|
`define PROC_MEMIO_PUT_UNALIGNED_PREP_NEXT4 5'b11010 /****/
|