From 973e9d9c1d914972553db656fdba36d29cbae088 Mon Sep 17 00:00:00 2001 From: Carson Bush Date: Mon, 1 Apr 2024 16:11:29 -0600 Subject: [PATCH 1/7] Add beginnings of top level CPU module --- .../eight_bit_console.cache/wt/project.wpc | 2 +- .../sources_1/new/cpu.v | 79 +++++++++++++++++++ .../sources_1/new/register_file.v | 2 +- eight_bit_console/eight_bit_console.xpr | 76 +++++++++++++++--- 4 files changed, 148 insertions(+), 11 deletions(-) create mode 100644 eight_bit_console/eight_bit_console.srcs/sources_1/new/cpu.v diff --git a/eight_bit_console/eight_bit_console.cache/wt/project.wpc b/eight_bit_console/eight_bit_console.cache/wt/project.wpc index 2599f42..d5e2b40 100644 --- a/eight_bit_console/eight_bit_console.cache/wt/project.wpc +++ b/eight_bit_console/eight_bit_console.cache/wt/project.wpc @@ -1,3 +1,3 @@ version:1 -6d6f64655f636f756e7465727c4755494d6f6465:7 +6d6f64655f636f756e7465727c4755494d6f6465:8 eof: diff --git a/eight_bit_console/eight_bit_console.srcs/sources_1/new/cpu.v b/eight_bit_console/eight_bit_console.srcs/sources_1/new/cpu.v new file mode 100644 index 0000000..8560900 --- /dev/null +++ b/eight_bit_console/eight_bit_console.srcs/sources_1/new/cpu.v @@ -0,0 +1,79 @@ +`timescale 1ns / 1ps +////////////////////////////////////////////////////////////////////////////////// +// Company: +// Engineer: +// +// Create Date: 04/01/2024 11:14:34 AM +// Design Name: +// Module Name: cpu +// Project Name: +// Target Devices: +// Tool Versions: +// Description: +// +// Dependencies: +// +// Revision: +// Revision 0.01 - File Created +// Additional Comments: +// +////////////////////////////////////////////////////////////////////////////////// + + +module cpu( + input clk + ); + + wire rfile_bit_mode; + wire rfile_we; + wire rfile_data_in; + wire rfile_data_in_wide; + wire rfile_write_sel; + wire rfile_sel_a; + wire rfile_sel_b; + wire rfile_output_a; + wire rfile_output_a_wide; + wire rfile_output_b; + wire rfile_output_b_wide; + wire rfile_flags_we; + wire rfile_new_flags; + wire rfile_cur_flags; + + + register_file rfile ( + .clk(clk), + .wide_mode(rfile_bit_mode), + .we(rfile_we), + .data(rfile_data_in), + .data_wide(rfile_data_in_wide), + .dest_sel(rfile_write_sel), + .src_a_sel(rfile_sel_a), + .src_b_sel(rfile_sel_b), + .port_a(rfile_output_a), + .port_a_wide(rfile_output_a_wide), + .port_b(rfile_output_b), + .port_b_wide(rfile_output_b_wide), + .we_flags(rfile_flags_we), + .new_flags(rfile_new_flags), + .flags(rfile_cur_flags) + ); + + + wire enable_pc; + wire pc_we; + wire pc_j_addr; + wire pc_cur_count; + + program_counter prog_count ( + .clk(clk), + .enable(enable_pc), + .we(pc_we), + .j_addr(pc_j_addr), + .count(pc_cur_count) + ); + + + + +endmodule + diff --git a/eight_bit_console/eight_bit_console.srcs/sources_1/new/register_file.v b/eight_bit_console/eight_bit_console.srcs/sources_1/new/register_file.v index a7780df..3709699 100644 --- a/eight_bit_console/eight_bit_console.srcs/sources_1/new/register_file.v +++ b/eight_bit_console/eight_bit_console.srcs/sources_1/new/register_file.v @@ -30,8 +30,8 @@ module register_file( input [3:0] src_a_sel, input [3:0] src_b_sel, output [7:0] port_a, - output [7:0] port_b, output [7:0] port_a_wide, + output [7:0] port_b, output [7:0] port_b_wide, input we_flags, input [7:0] new_flags, diff --git a/eight_bit_console/eight_bit_console.xpr b/eight_bit_console/eight_bit_console.xpr index 1a89958..10bceb6 100644 --- a/eight_bit_console/eight_bit_console.xpr +++ b/eight_bit_console/eight_bit_console.xpr @@ -44,7 +44,7 @@