2021-10-29 10:04:59 +00:00
|
|
|
module FSB(
|
|
|
|
/* MC68HC000 interface */
|
2023-04-07 03:11:11 +00:00
|
|
|
input FCLK, input nAS, output reg nDTACK, output reg nVPA,
|
2021-10-29 10:04:59 +00:00
|
|
|
/* AS cycle detection */
|
2023-03-22 01:11:58 +00:00
|
|
|
output BACT,
|
2021-10-29 10:04:59 +00:00
|
|
|
/* Ready inputs */
|
2023-04-07 03:11:11 +00:00
|
|
|
input ROMCS,
|
|
|
|
input RAMCS, input RAMReady,
|
|
|
|
input IOPWCS, input IOPWReady, input IONPReady,
|
2021-10-29 10:04:59 +00:00
|
|
|
/* Interrupt acknowledge select */
|
|
|
|
input IACS);
|
|
|
|
|
|
|
|
/* AS cycle detection */
|
|
|
|
reg ASrf = 0;
|
2023-04-07 03:11:11 +00:00
|
|
|
always @(negedge FCLK) begin ASrf <= !nAS; end
|
|
|
|
assign BACT = !nAS || ASrf; // BACT - bus active
|
|
|
|
|
|
|
|
|
2021-10-29 10:04:59 +00:00
|
|
|
/* DTACK/VPA control */
|
2023-04-07 06:33:04 +00:00
|
|
|
wire Ready = (RAMCS && RAMReady && !IOPWCS) ||
|
|
|
|
(RAMCS && RAMReady && IOPWCS && IOPWReady) ||
|
2023-04-07 03:11:11 +00:00
|
|
|
(ROMCS) || (IONPReady);
|
|
|
|
always @(posedge FCLK) nDTACK <= !(Ready && BACT && !IACS);
|
|
|
|
always @(posedge FCLK, posedge nAS) begin
|
|
|
|
if (nAS) nVPA <= 1;
|
|
|
|
else nVPA <= !(Ready && BACT && IACS);
|
2021-10-29 10:04:59 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
endmodule
|