Warp-SE/cpld/FSB.v

38 lines
1.0 KiB
Coq
Raw Normal View History

2021-10-29 10:04:59 +00:00
module FSB(
/* MC68HC000 interface */
input FCLK, input nAS, output reg nDTACK, output reg nVPA,
2024-09-29 07:29:49 +00:00
/* MC68HC000 clock enable */
input MCKEi, output reg MCKE,
2021-10-29 10:04:59 +00:00
/* AS cycle detection */
2024-09-06 10:05:06 +00:00
output BACT, output reg BACTr,
2021-10-29 10:04:59 +00:00
/* Ready inputs */
input ROMCS,
input RAMCS, input RAMReady,
input IOPWCS, input IOPWReady, input IONPReady,
2024-09-30 03:15:06 +00:00
input IOQoSEN,
2023-04-08 09:49:29 +00:00
/* Interrupt acknowledge select */
2024-09-30 03:15:06 +00:00
input IACKCS);
2021-10-29 10:04:59 +00:00
2024-09-29 07:29:49 +00:00
/* MC68k clock enable */
always @(negedge FCLK) MCKE <= MCKEi;
2021-10-29 10:04:59 +00:00
/* AS cycle detection */
reg ASrf = 0;
always @(negedge FCLK) begin ASrf <= !nAS; end
2024-09-29 07:29:49 +00:00
assign BACTu = !nAS || ASrf;
assign BACT = BACTu && MCKE;
2024-09-06 10:05:06 +00:00
always @(posedge FCLK) BACTr <= BACT;
2021-10-29 10:04:59 +00:00
/* DTACK/VPA control */
2024-09-29 07:29:49 +00:00
wire Ready = (RAMCS && !IOQoSEN && RAMReady && !IOPWCS) ||
(RAMCS && !IOQoSEN && RAMReady && IOPWCS && IOPWReady) ||
(ROMCS && !IOQoSEN) ||
2024-09-30 03:15:06 +00:00
(IONPReady);
always @(posedge FCLK) nDTACK <= !(Ready && BACT && !IACKCS);
always @(posedge FCLK, posedge nAS) begin
if (nAS) nVPA <= 1;
2024-09-30 03:15:06 +00:00
else nVPA <= !(Ready && BACT && IACKCS);
2021-10-29 10:04:59 +00:00
end
endmodule