Warp-SE/cpld/WarpSE.v

148 lines
3.4 KiB
Coq
Raw Normal View History

2022-03-29 08:23:54 +00:00
module WarpSE(
2021-10-29 10:04:59 +00:00
input [23:1] A_FSB,
input nAS_FSB,
input nLDS_FSB,
input nUDS_FSB,
input nWE_FSB,
output nDTACK_FSB,
output nVPA_FSB,
output nBERR_FSB,
input CLK_FSB,
input CLK2X_IOB,
input CLK_IOB,
input E_IOB,
input nDTACK_IOB,
input nVPA_IOB,
output nVMA_IOB,
output nAS_IOB,
output nUDS_IOB,
output nLDS_IOB,
2022-03-28 03:45:53 +00:00
output nBR_IOB,
input nBG_IOB,
2021-10-29 10:04:59 +00:00
input nBERR_IOB,
2022-09-04 01:32:05 +00:00
inout nRES,
2022-03-28 03:45:53 +00:00
input nIPL2,
2021-10-29 10:04:59 +00:00
output nROMCS,
output nRAMLWE,
output nRAMUWE,
output nROMWE,
output nRAS,
output nCAS,
output [11:0] RA,
output nOE,
output nADoutLE0,
output nADoutLE1,
output nAoutOE,
output nDoutOE,
output nDinOE,
2022-03-28 03:45:53 +00:00
output nDinLE,
2022-09-04 01:32:05 +00:00
input [3:1] SW,
output C20MEN,
output C25MEN);
2022-03-28 03:45:53 +00:00
2022-09-04 01:32:05 +00:00
/* Reset input and open-drain output */
wire nRESin = nRES;
wire nRESout;
assign nRES = !nRESout ? 1'b0 : 1'bZ;
2021-10-29 10:04:59 +00:00
/* AS cycle detection */
wire BACT;
/* Refresh request/ack signals */
2022-09-04 01:32:05 +00:00
wire RefReq, RefUrgent;
/* Fast ROM enable setting */
wire FastROMEN;
2021-10-29 10:04:59 +00:00
wire IOCS, SCSICS, IOPWCS, IACS, ROMCS, RAMCS, SndRAMCSWR;
CS cs(
2022-03-28 03:45:53 +00:00
/* Setting input */
2022-09-04 01:32:05 +00:00
FastROMEN,
2021-10-29 10:04:59 +00:00
/* MC68HC000 interface */
2022-09-04 01:32:05 +00:00
A_FSB[23:08], CLK_FSB, nRESin, nWE_FSB,
2021-10-29 10:04:59 +00:00
/* AS cycle detection */
BACT,
/* Device select outputs */
IOCS, SCSICS, IOPWCS, IACS, ROMCS, RAMCS, SndRAMCSWR);
wire Ready_RAM;
RAM ram(
/* MC68HC000 interface */
CLK_FSB, A_FSB[21:1], nWE_FSB, nAS_FSB, nLDS_FSB, nUDS_FSB,
/* AS cycle detection */
BACT,
/* Select and ready signals */
RAMCS, ROMCS, Ready_RAM,
/* Refresh Counter Interface */
2022-09-04 01:32:05 +00:00
RefReq, RefUrgent,
2021-10-29 10:04:59 +00:00
/* DRAM and NOR flash interface */
RA[11:0], nRAS, nCAS,
nRAMLWE, nRAMUWE, nOE, nROMCS, nROMWE);
wire Ready_IOBS, BERR_IOBS;
2022-09-04 01:32:05 +00:00
wire IOREQ, IOACT, IOBERR;
2021-10-29 10:04:59 +00:00
wire ALE0S, ALE0M, ALE1;
assign nADoutLE0 = ~(ALE0S || ALE0M);
assign nADoutLE1 = ~ALE1;
wire IORW0, IOL0, IOU0;
IOBS iobs(
/* MC68HC000 interface */
CLK_FSB, nWE_FSB, nAS_FSB, nLDS_FSB, nUDS_FSB,
/* AS cycle detection, FSB BERR */
BACT,
/* Select and ready signals */
IOCS, IOPWCS, Ready_IOBS, BERR_IOBS,
/* Read data OE control */
nDinOE,
/* IOB Master Controller Interface */
IOREQ, IOACT, IOBERR,
/* FIFO primary level control */
ALE0S, IORW0, IOL0, IOU0,
/* FIFO secondary level control */
ALE1);
2022-03-28 03:45:53 +00:00
wire nAS_IOBout, nLDS_IOBout, nUDS_IOBout, nVMA_IOBout;
assign nAS_IOB = nAoutOE ? 1'bZ : nAS_IOBout;
assign nLDS_IOB = nAoutOE ? 1'bZ : nLDS_IOBout;
assign nUDS_IOB = nAoutOE ? 1'bZ : nUDS_IOBout;
assign nVMA_IOB = nAoutOE ? 1'bZ : nVMA_IOBout;
2021-10-29 10:04:59 +00:00
IOBM iobm(
/* PDS interface */
CLK2X_IOB, CLK_IOB, E_IOB,
2022-09-04 01:32:05 +00:00
nAS_IOBout, nLDS_IOBout, nUDS_IOBout, nVMA_IOBout,
nAS_IOB, nBG_IOB, nDTACK_IOB, nVPA_IOB, nBERR_IOB, nRESin,
2021-10-29 10:04:59 +00:00
/* PDS address and data latch control */
nAoutOE, nDoutOE, ALE0M, nDinLE,
/* IO bus slave port interface */
2022-03-28 03:45:53 +00:00
IOACT, IOBERR,
2022-09-04 01:32:05 +00:00
IOREQ, IOL0, IOU0, IORW0);
2021-10-29 10:04:59 +00:00
2022-09-04 01:32:05 +00:00
wire BERRTimeout, QoSReady;
2021-10-29 10:04:59 +00:00
CNT cnt(
2022-09-04 01:32:05 +00:00
/* C16M clock */
C16M,
/* FSB clock and bus active signal */
FCLK, BACT,
2021-10-29 10:04:59 +00:00
/* Refresh request */
2022-09-04 01:32:05 +00:00
RefReq, RefUrgent,
/* BERR and QoS speed limit output */
BERRTimeout, QoSReady,
/* Reset, switch, button */
SW[3:1], nRESin, nRESout, nIPL2,
/* Configuration outputs */
nBR_IOB, FastROMEN, C20MEN, C25MEN);
2021-10-29 10:04:59 +00:00
FSB fsb(
/* MC68HC000 interface */
CLK_FSB, nAS_FSB, nDTACK_FSB, nVPA_FSB, nBERR_FSB,
/* AS cycle detection */
BACT,
/* Ready and IA inputs */
2022-09-04 01:32:05 +00:00
Ready_RAM, Ready_IOBS, (!SndRAMCSWR || QoSReady),
2021-10-29 10:04:59 +00:00
/* BERR inputs */
2022-09-04 01:32:05 +00:00
(~IOCS && BERRTimeout), BERR_IOBS,
2021-10-29 10:04:59 +00:00
/* Interrupt acknowledge select */
IACS);
endmodule