My recommendation is to document as comments EXACTLY what each of these IO ports actually do and where they go:
Z80_bridge_v2 b2v_inst10(
.reset ( reset ),
.GPU_CLK ( clk ),
.Z80_CLK ( Z80_CLK ),
.Z80_M1n ( Z80_M1 ),
.Z80_MREQn ( Z80_MREQ ),
.Z80_WRn ( Z80_WR ),
.Z80_RDn ( Z80_RD ),
.gpu_rd_rdy ( Z80_rd_rdy ),
.sel_pclk ( out3[7] ),
.sel_nclk ( out3[6] ),
.PS2_RDY ( PS2_DAT_RDY ),
.Z80_IORQn ( Z80_IORQ ),
.Z80_IEI ( IEI ),
.GEO_STAT_RD ( geo_stat_rd ),
.gpu_rData ( dat_to_Z80 ),
.PS2_DAT ( key_dat ),
.PS2_STATUS ( DFF_inst33 ),
.RD_PX_CTR ( collision_rd ),
.WR_PX_CTR ( collision_wr ),
.Z80_addr ( Z80_ADDR ),
.Z80_wData ( Z80_data ),
.Z80_245data_dir_r ( DIR_245 ),
.Z80_rData_ena_r ( data_en ),
.Z80_245_oe_r ( OE_245 ),
.gpu_wr_ena ( gpu_wr_enable ),
.gpu_rd_req ( gpu_rd_request ),
.Z80_INT_REQ_r ( Z80_INT_RQ ),
.Z80_WAIT ( Z80_WAIT ),
.Z80_IEO_r ( IEO ),
.EA_DIR_r ( EA_DIR ),
.EA_OE_r ( EA_OE ),
.SPKR_EN ( SP_EN ),
.VIDEO_EN ( video_en ),
.snd_data_tx ( snd_data_tx ),
.GEO_WR_HI_STROBE ( send_geo_cmd ),
.WR_PX_CTR_STROBE ( wr_px_ctr_rs ),
.RD_PX_CTR_STROBE ( rd_px_ctr_rs ),
.GEO_STAT_WR ( geo_stat_wr ),
.GEO_WR_HI ( geo_cmd[15:8] ),
.GEO_WR_LO ( geo_cmd[7:0] ),
.gpu_addr ( gpu_addr ),
.gpu_wdata ( gpu_wdata ),
.snd_data ( snd_data ),
.Z80_rData_r ( Z80_RD_data )
);
Then sort and group them like I told you to in my lat post. This should help you out.
Remember, you want the Z80 write to GPU ram to feed the DDR3 and the current MUX port. But for the Z80 reads, you no longer need to activate the MUX port, but have the DDR3 respond to the read request and have the DDR3 send the response to the Z80 bridge.
Also, do the same for the:
data_mux_geo b2v_inst25(
.clk ( clk ),
.reset ( reset ),
.wr_ena_a ( gpu_wr_enable ),
.rd_req_a ( gpu_rd_request ),
.wr_ena_b ( 1'b0 ), // RS232_wr_ena
.rd_req_b ( 1'b0 ), // RS232_rd_req
.geo_rd_req_a ( geo_rd_req_a ),
.geo_rd_req_b ( geo_rd_req_b ),
.geo_wr_ena ( geo_wr_ena ),
.address_a ( gpu_addr ),
.address_b ( ), // RS232_addr
.address_geo ( geo_ram_addr ),
.data_in_a ( gpu_wdata ),
.data_in_b ( ), // RS232_wDat
.data_in_geo ( geo_wr_data ),
.gpu_data_in ( h_rdat ),
.gpu_wr_ena ( h_wena ),
.gpu_ena_16bit ( h_16bit ),
.gpu_rd_rdy_a ( Z80_rd_rdy ),
.gpu_rd_rdy_b ( 1'b0 ), // RS232_rd_rdy
.geo_rd_rdy_a ( geo_rdy_a ),
.geo_rd_rdy_b ( geo_rdy_b ),
.geo_port_full ( geo_port_full ),
.data_out_a ( dat_to_Z80 ),
.data_out_b ( ), // RS232_rDat
.data_out_geo ( geo_r_data ),
.gpu_address ( h_addr ),
.gpu_data_out ( h_wdat )
);
Now, I want real explanations exactly like all the notes I have at every port inside my DDR3 source code. And I want those ports sorted and bundled by function. (Only sort vertically, you do not need to do the fancy 'tabs' which I have done because of the huge number of ports in my design)