scsi: don't combine sd_lba and sd_buff_din.

This commit is contained in:
Sorgelig 2022-03-09 14:44:49 +08:00
parent e4ca3f4533
commit 0c094b4d59
4 changed files with 36 additions and 38 deletions

View File

@ -208,7 +208,7 @@ localparam CONF_STR = {
"F2,DSK,Mount Sec Floppy;",
"-;",
"SC0,IMGVHD,Mount SCSI-6;",
"SC1,IMGVHD,Mount SCSI-2;",
"SC1,IMGVHD,Mount SCSI-5;",
"-;",
"O78,Aspect ratio,Original,Full Screen,[ARC1],[ARC2];",
"OBC,Scale,Normal,V-Integer,Narrower HV-Integer,Wider HV-Integer;",
@ -263,18 +263,20 @@ end
///////////////////////////////////////////////////
localparam SCSI_DEVS = 2;
// the status register is controlled by the on screen display (OSD)
wire [31:0] status;
wire [1:0] buttons;
wire [31:0] sd_lba;
wire [1:0] sd_rd;
wire [1:0] sd_wr;
wire [1:0] sd_ack;
wire [31:0] sd_lba[SCSI_DEVS];
wire [SCSI_DEVS-1:0] sd_rd;
wire [SCSI_DEVS-1:0] sd_wr;
wire [SCSI_DEVS-1:0] sd_ack;
wire [7:0] sd_buff_addr;
wire [15:0] sd_buff_dout;
wire [15:0] sd_buff_din;
wire [15:0] sd_buff_din[SCSI_DEVS];
wire sd_buff_wr;
wire [1:0] img_mounted;
wire [SCSI_DEVS-1:0] img_mounted;
wire [31:0] img_size;
wire ioctl_write;
@ -289,7 +291,7 @@ wire [15:0] ioctl_data;
wire [32:0] TIMESTAMP;
hps_io #(.CONF_STR(CONF_STR), .VDNUM(2), .WIDE(1)) hps_io
hps_io #(.CONF_STR(CONF_STR), .VDNUM(SCSI_DEVS), .WIDE(1)) hps_io
(
.clk_sys(clk_sys),
.HPS_BUS(HPS_BUS),
@ -297,14 +299,14 @@ hps_io #(.CONF_STR(CONF_STR), .VDNUM(2), .WIDE(1)) hps_io
.buttons(buttons),
.status(status),
.sd_lba('{sd_lba,sd_lba}),
.sd_lba(sd_lba),
.sd_rd(sd_rd),
.sd_wr(sd_wr),
.sd_ack(sd_ack),
.sd_buff_addr(sd_buff_addr),
.sd_buff_dout(sd_buff_dout),
.sd_buff_din('{sd_buff_din,sd_buff_din}),
.sd_buff_din(sd_buff_din),
.sd_buff_wr(sd_buff_wr),
.img_mounted(img_mounted),
@ -618,7 +620,7 @@ addrController_top ac0
wire [1:0] diskEject;
wire [1:0] diskMotor, diskAct;
dataController_top dc0
dataController_top #(SCSI_DEVS) dc0
(
.clk32(clk_sys),
.clk8_en_p(clk8_en_p),

View File

@ -2,7 +2,7 @@ set_global_assignment -name QIP_FILE rtl/tg68k/TG68K.qip
set_global_assignment -name QIP_FILE rtl/fx68k/fx68k.qip
set_global_assignment -name VERILOG_FILE rtl/sdram.v
set_global_assignment -name VERILOG_FILE rtl/scsi.v
set_global_assignment -name VERILOG_FILE rtl/ncr5380.v
set_global_assignment -name SYSTEMVERILOG_FILE rtl/ncr5380.sv
set_global_assignment -name VERILOG_FILE rtl/floppy_track_encoder.v
set_global_assignment -name VERILOG_FILE rtl/floppy.v
set_global_assignment -name SYSTEMVERILOG_FILE rtl/ps2_kbd.sv
@ -14,7 +14,7 @@ set_global_assignment -name VERILOG_FILE rtl/iwm.v
set_global_assignment -name VHDL_FILE rtl/via6522.vhd
set_global_assignment -name VERILOG_FILE rtl/addrDecoder.v
set_global_assignment -name VERILOG_FILE rtl/addrController_top.v
set_global_assignment -name VERILOG_FILE rtl/dataController_top.v
set_global_assignment -name SYSTEMVERILOG_FILE rtl/dataController_top.sv
set_global_assignment -name VERILOG_FILE rtl/videoTimer.v
set_global_assignment -name VERILOG_FILE rtl/videoShifter.v
set_global_assignment -name VERILOG_FILE rtl/rtc.v

View File

@ -79,18 +79,20 @@ module dataController_top(
input dskReadAckExt,
// connections to io controller
input [1:0] img_mounted,
input [SCSI_DEVS-1:0] img_mounted,
input [31:0] img_size,
output [31:0] io_lba,
output [1:0] io_rd,
output [1:0] io_wr,
input [1:0] io_ack,
output [31:0] io_lba[SCSI_DEVS],
output [SCSI_DEVS-1:0] io_rd,
output [SCSI_DEVS-1:0] io_wr,
input [SCSI_DEVS-1:0] io_ack,
input [7:0] sd_buff_addr,
input [15:0] sd_buff_dout,
output [15:0] sd_buff_din,
output [15:0] sd_buff_din[SCSI_DEVS],
input sd_buff_wr
);
parameter SCSI_DEVS = 2;
// add binary volume levels according to volume setting
assign audioOut =
(snd_vol[0]?audio_x1:11'd0) +
@ -165,7 +167,7 @@ module dataController_top(
assign memoryDataOut = cpuDataIn;
// SCSI
ncr5380 scsi(
ncr5380 #(SCSI_DEVS) scsi(
.clk(clk32),
.reset(!_cpuReset),
.bus_cs(selectSCSI),

View File

@ -64,14 +64,14 @@ module ncr5380
input [DEVS-1:0] img_mounted,
input [31:0] img_size,
output reg [31:0] io_lba,
output reg [31:0] io_lba[DEVS],
output [DEVS-1:0] io_rd,
output [DEVS-1:0] io_wr,
input [DEVS-1:0] io_ack,
input [7:0] sd_buff_addr,
input [15:0] sd_buff_dout,
output reg [15:0] sd_buff_din,
output [15:0] sd_buff_din[DEVS],
input sd_buff_wr
);
parameter DEVS = 2;
@ -240,8 +240,6 @@ module ncr5380
scsi_msg = 0;
scsi_req = 0;
din = 8'h55;
io_lba = 0;
sd_buff_din = 0;
for (i = 0; i < DEVS; i = i + 1) begin
if (target_bsy[i]) begin
@ -250,8 +248,6 @@ module ncr5380
scsi_msg = target_msg[i];
scsi_req = target_req[i];
din = target_dout[i];
io_lba = target_lba[i];
sd_buff_din = target_buff_din[i];
end
end
end
@ -263,8 +259,6 @@ module ncr5380
wire [DEVS-1:0] target_cd;
wire [DEVS-1:0] target_req;
wire [7:0] target_dout[DEVS];
wire [31:0] target_lba[DEVS];
wire [15:0] target_buff_din[DEVS];
generate
genvar i;
@ -292,14 +286,14 @@ module ncr5380
// to sd card
.img_mounted(img_mounted[i]),
.img_blocks(img_size),
.io_lba ( target_lba[i] ),
.io_lba ( io_lba[i] ),
.io_rd ( io_rd[i] ),
.io_wr ( io_wr[i] ),
.io_ack ( io_ack[i] & target_bsy[i] ),
.sd_buff_addr( sd_buff_addr ),
.sd_buff_dout( sd_buff_dout ),
.sd_buff_din( target_buff_din[i] ),
.sd_buff_din( sd_buff_din[i] ),
.sd_buff_wr( sd_buff_wr & target_bsy[i] )
);
end