From af451dcc805865b570c6598be0ee7eea4e13e215 Mon Sep 17 00:00:00 2001 From: Sorgelig Date: Tue, 12 May 2026 01:21:27 +0800 Subject: [PATCH] hps_io: remove unrelated framework signals. --- Template.sv | 2 +- sys/hps_io.sv | 12 ++---------- sys/sys_top.v | 16 +++++++++++----- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Template.sv b/Template.sv index a76b8c0..c845b77 100644 --- a/Template.sv +++ b/Template.sv @@ -26,7 +26,7 @@ module emu input RESET, //Must be passed to hps_io module - inout [48:0] HPS_BUS, + inout [45:0] HPS_BUS, //Base video clock. Usually equals to CLK_SYS. output CLK_VIDEO, diff --git a/sys/hps_io.sv b/sys/hps_io.sv index 460b97a..1df2e02 100644 --- a/sys/hps_io.sv +++ b/sys/hps_io.sv @@ -2,7 +2,7 @@ // hps_io.v // // Copyright (c) 2014 Till Harbaum -// Copyright (c) 2017-2020 Alexey Melnikov +// Copyright (c) 2017-2026 Alexey Melnikov // // This source file is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published @@ -35,7 +35,7 @@ module hps_io #(parameter CONF_STR, CONF_STR_BRAM=0, PS2DIV=0, WIDE=0, VDNUM=1, BLKSZ=2, PS2WE=0, STRLEN=$size(CONF_STR)>>3, F12KEYMOD=0) ( input clk_sys, - inout [48:0] HPS_BUS, + inout [45:0] HPS_BUS, // buttons up to 32 output reg [31:0] joystick_0, @@ -330,18 +330,10 @@ always@(posedge clk_sys) begin : uio_block 'h0X17, 'h0X18: begin sd_ack <= disk[VD:0]; sdn_ack <= io_din[11:8]; end 'h29: io_dout <= {4'hA, stflg}; -`ifdef MISTER_DISABLE_ADAPTIVE - 'h2B: io_dout <= {HPS_BUS[48:46],4'b0110}; -`else - 'h2B: io_dout <= {HPS_BUS[48:46],4'b0111}; -`endif - 'h2F: io_dout <= 1; 'h32: io_dout <= gamma_bus[21]; 'h36: begin io_dout <= info_n; info_n <= 0; end - 'h39: io_dout <= 1; 'h3C: if(upload_req) begin io_dout <= {ioctl_upload_index, 8'd1}; upload_req <= 0; end 'h43: io_dout <= |F12KEYMOD; - 'h3E: io_dout <= 1; // shadow mask 'h003F: io_dout <= joystick_0_rumble; 'h013F: io_dout <= joystick_1_rumble; 'h023F: io_dout <= joystick_2_rumble; diff --git a/sys/sys_top.v b/sys/sys_top.v index 5f9dfa4..1fad3f4 100644 --- a/sys/sys_top.v +++ b/sys/sys_top.v @@ -357,8 +357,10 @@ always@(posedge clk_sys) begin reg vs_d0,vs_d1,vs_d2; reg [4:0] acx_att; reg [7:0] fb_crc; + reg [1:0] sl_r; coef_wr <= 0; + sl_r <= FB_EN ? 2'b00 : scanlines; `ifndef MISTER_DEBUG_NOHDMI shadowmask_wr <= 0; @@ -390,8 +392,16 @@ always@(posedge clk_sys) begin acy1 <= 24'd6143386; acy2 <= -24'd2023767; areset <= 1; + io_dout_sys <= 1; end if(io_din[7:0] == 'h20) io_dout_sys <= 'b11; +`ifdef MISTER_DISABLE_ADAPTIVE + if(io_din[7:0] == 'h2B) io_dout_sys <= {fb_en, sl_r, 4'b0110}; +`else + if(io_din[7:0] == 'h2B) io_dout_sys <= {fb_en, sl_r, 4'b0111}; +`endif + if(io_din[7:0] == 'h2F) io_dout_sys <= 1; + if(io_din[7:0] == 'h3E) io_dout_sys <= 1; `ifndef MISTER_DEBUG_NOHDMI if(io_din[7:0] == 'h40) io_dout_sys <= fb_crc; `endif @@ -1740,15 +1750,11 @@ wire [13:0] fb_stride; assign fb_stride = 0; `endif -reg [1:0] sl_r; -wire [1:0] sl = sl_r; -always @(posedge clk_sys) sl_r <= FB_EN ? 2'b00 : scanlines; - emu emu ( .CLK_50M(FPGA_CLK2_50), .RESET(reset), - .HPS_BUS({fb_en, sl, f1, HDMI_TX_VS, + .HPS_BUS({f1, HDMI_TX_VS, clk_100m, clk_ihdmi, ce_hpix, hde_emu, hhs_fix, hvs_fix, io_wait, clk_sys, io_fpga, io_uio, io_strobe, io_wide, io_din, io_dout}),