2021-10-29 06:04:59 -04:00
|
|
|
module FSB(
|
|
|
|
/* MC68HC000 interface */
|
2023-04-06 23:11:11 -04:00
|
|
|
input FCLK, input nAS, output reg nDTACK, output reg nVPA,
|
2021-10-29 06:04:59 -04:00
|
|
|
/* AS cycle detection */
|
2024-10-09 07:59:55 -04:00
|
|
|
output reg ASrf, output BACT, output reg BACTr,
|
2021-10-29 06:04:59 -04:00
|
|
|
/* Ready inputs */
|
2023-04-06 23:11:11 -04:00
|
|
|
input ROMCS,
|
|
|
|
input RAMCS, input RAMReady,
|
2023-07-15 23:21:44 -04:00
|
|
|
input IOPWCS, input IOPWReady, input IONPReady,
|
2024-10-11 16:41:31 -04:00
|
|
|
input QoSEN,
|
2023-04-08 05:49:29 -04:00
|
|
|
/* Interrupt acknowledge select */
|
2024-10-11 16:41:31 -04:00
|
|
|
input IACKCS);
|
2024-09-29 03:29:49 -04:00
|
|
|
|
2021-10-29 06:04:59 -04:00
|
|
|
/* AS cycle detection */
|
2023-04-06 23:11:11 -04:00
|
|
|
always @(negedge FCLK) begin ASrf <= !nAS; end
|
2024-10-03 05:51:10 -04:00
|
|
|
assign BACT = !nAS || ASrf; // BACT - bus active
|
2024-09-06 06:05:06 -04:00
|
|
|
always @(posedge FCLK) BACTr <= BACT;
|
2023-04-06 23:11:11 -04:00
|
|
|
|
2021-10-29 06:04:59 -04:00
|
|
|
/* DTACK/VPA control */
|
2024-10-03 05:51:10 -04:00
|
|
|
wire Ready = (RAMCS && !QoSEN && RAMReady && !IOPWCS) ||
|
|
|
|
(RAMCS && !QoSEN && RAMReady && IOPWCS && IOPWReady) ||
|
2024-10-11 16:41:31 -04:00
|
|
|
(ROMCS && !QoSEN) || (IONPReady);
|
2024-10-07 01:04:37 -04:00
|
|
|
always @(posedge FCLK, posedge nAS) begin
|
|
|
|
if (nAS) nDTACK <= 1;
|
2024-10-11 16:41:31 -04:00
|
|
|
else nDTACK <= !(Ready && !IACKCS);
|
2024-10-07 01:04:37 -04:00
|
|
|
end
|
2023-04-06 23:11:11 -04:00
|
|
|
always @(posedge FCLK, posedge nAS) begin
|
|
|
|
if (nAS) nVPA <= 1;
|
2024-10-11 16:41:31 -04:00
|
|
|
else nVPA <= !(Ready && IACKCS);
|
2021-10-29 06:04:59 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
endmodule
|