56 lines
1.4 KiB
Verilog
56 lines
1.4 KiB
Verilog
/* top.v - Implements FPGA and Board specific circuitry
|
|
|
|
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/>. */
|
|
|
|
`include "error_header.v"
|
|
|
|
module fpga_top(
|
|
input clk48,
|
|
|
|
input user_button;
|
|
output reset_n;
|
|
|
|
output reg rgb_led0_r;
|
|
output reg rgb_led0_g;
|
|
output reg rgb_led0_b;
|
|
);
|
|
|
|
wire HALT,[`ERROR_BITS-1:0]ERROR;
|
|
system system(
|
|
/* MISC */ clk48,user_button,HALT,ERROR
|
|
/* MEMORY / IO */ ,address_bus,data_bus,rd,wr,BHE,IOMEM
|
|
)
|
|
|
|
always @(HALT or ERROR or user_button) begin
|
|
if (HALT==0) begin
|
|
/* yellow */
|
|
rgb_led_r=0;
|
|
rgb_led_g=0;
|
|
rgb_led_b=1;
|
|
end else if (ERROR != `ERROR_BITS'b0) begin
|
|
/* red */
|
|
rgb_led_r=0;
|
|
rgb_led_g=1;
|
|
rgb_led_b=1;
|
|
end else begin
|
|
rgb_led_r=1;
|
|
rgb_led_g=0;
|
|
rgb_led_b=1;
|
|
end
|
|
end
|