get rid of generated files
This commit is contained in:
@@ -1,971 +0,0 @@
|
||||
-- WARNING: Do NOT edit the input and output ports in this file in a text
|
||||
-- editor if you plan to continue editing the block that represents it in
|
||||
-- the Block Editor! File corruption is VERY likely to occur.
|
||||
|
||||
-- Copyright (C) 1991-2008 Altera Corporation
|
||||
-- Your use of Altera Corporation's design tools, logic functions
|
||||
-- and other software and tools, and its AMPP partner logic
|
||||
-- functions, and any output files from any of the foregoing
|
||||
-- (including device programming or simulation files), and any
|
||||
-- associated documentation or information are expressly subject
|
||||
-- to the terms and conditions of the Altera Program License
|
||||
-- Subscription Agreement, Altera MegaCore Function License
|
||||
-- Agreement, or other applicable license agreement, including,
|
||||
-- without limitation, that your use is for the sole purpose of
|
||||
-- programming logic devices manufactured by Altera and sold by
|
||||
-- Altera or its authorized distributors. Please refer to the
|
||||
-- applicable agreement for further details.
|
||||
|
||||
|
||||
-- Generated by Quartus II Version 8.1 (Build Build 163 10/28/2008)
|
||||
-- Created on Tue Sep 08 16:24:20 2009
|
||||
|
||||
library work;
|
||||
use work.FalconIO_SDCard_IDE_CF_pkg.all;
|
||||
|
||||
library ieee;
|
||||
use ieee.std_logic_1164.all;
|
||||
use ieee.std_logic_unsigned.all;
|
||||
|
||||
|
||||
-- Entity Declaration
|
||||
|
||||
|
||||
-- Entity Declaration
|
||||
|
||||
ENTITY FalconIO_SDCard_IDE_CF IS
|
||||
-- {{ALTERA_IO_BEGIN}} DO NOT REMOVE THIS LINE!
|
||||
PORT
|
||||
(
|
||||
CLK33M : IN STD_LOGIC;
|
||||
MAIN_CLK : IN STD_LOGIC;
|
||||
CLK2M : IN STD_LOGIC;
|
||||
CLK500k : IN STD_LOGIC;
|
||||
nFB_CS1 : IN STD_LOGIC;
|
||||
FB_SIZE0 : IN STD_LOGIC;
|
||||
FB_SIZE1 : IN STD_LOGIC;
|
||||
nFB_BURST : IN STD_LOGIC;
|
||||
FB_ADR : IN STD_LOGIC_VECTOR(31 downto 0);
|
||||
LP_BUSY : IN STD_LOGIC;
|
||||
nACSI_DRQ : IN STD_LOGIC;
|
||||
nACSI_INT : IN STD_LOGIC;
|
||||
nSCSI_DRQ : IN STD_LOGIC;
|
||||
nSCSI_MSG : IN STD_LOGIC;
|
||||
MIDI_IN : IN STD_LOGIC;
|
||||
RxD : IN STD_LOGIC;
|
||||
CTS : IN STD_LOGIC;
|
||||
RI : IN STD_LOGIC;
|
||||
DCD : IN STD_LOGIC;
|
||||
AMKB_RX : IN STD_LOGIC;
|
||||
PIC_AMKB_RX : IN STD_LOGIC;
|
||||
IDE_RDY : IN STD_LOGIC;
|
||||
IDE_INT : IN STD_LOGIC;
|
||||
WP_CS_CARD : IN STD_LOGIC;
|
||||
nINDEX : IN STD_LOGIC;
|
||||
TRACK00 : IN STD_LOGIC;
|
||||
nRD_DATA : IN STD_LOGIC;
|
||||
nDCHG : IN STD_LOGIC;
|
||||
SD_DATA0 : IN STD_LOGIC;
|
||||
SD_DATA1 : IN STD_LOGIC;
|
||||
SD_DATA2 : IN STD_LOGIC;
|
||||
SD_CARD_DEDECT : IN STD_LOGIC;
|
||||
SD_WP : IN STD_LOGIC;
|
||||
nDACK0 : IN STD_LOGIC;
|
||||
nFB_WR : INOUT STD_LOGIC;
|
||||
WP_CF_CARD : IN STD_LOGIC;
|
||||
nWP : IN STD_LOGIC;
|
||||
nFB_CS2 : IN STD_LOGIC;
|
||||
nRSTO : IN STD_LOGIC;
|
||||
HD_DD : IN STD_LOGIC;
|
||||
nSCSI_C_D : IN STD_LOGIC;
|
||||
nSCSI_I_O : IN STD_LOGIC;
|
||||
CLK2M4576 : IN STD_LOGIC;
|
||||
nFB_OE : IN STD_LOGIC;
|
||||
VSYNC : IN STD_LOGIC;
|
||||
HSYNC : IN STD_LOGIC;
|
||||
DSP_INT : IN STD_LOGIC;
|
||||
nBLANK : IN STD_LOGIC;
|
||||
FDC_CLK : IN STD_LOGIC;
|
||||
FB_ALE : IN STD_LOGIC;
|
||||
ACP_CONF : IN STD_LOGIC_VECTOR(31 downto 24);
|
||||
nIDE_CS1 : OUT STD_LOGIC;
|
||||
nIDE_CS0 : OUT STD_LOGIC;
|
||||
LP_STR : OUT STD_LOGIC;
|
||||
LP_DIR : OUT STD_LOGIC;
|
||||
nACSI_ACK : OUT STD_LOGIC;
|
||||
nACSI_RESET : OUT STD_LOGIC;
|
||||
nACSI_CS : OUT STD_LOGIC;
|
||||
ACSI_DIR : OUT STD_LOGIC;
|
||||
ACSI_A1 : OUT STD_LOGIC;
|
||||
nSCSI_ACK : OUT STD_LOGIC;
|
||||
nSCSI_ATN : OUT STD_LOGIC;
|
||||
SCSI_DIR : OUT STD_LOGIC;
|
||||
SD_CLK : OUT STD_LOGIC;
|
||||
YM_QA : OUT STD_LOGIC;
|
||||
YM_QC : OUT STD_LOGIC;
|
||||
YM_QB : OUT STD_LOGIC;
|
||||
nSDSEL : OUT STD_LOGIC;
|
||||
STEP : OUT STD_LOGIC;
|
||||
MOT_ON : OUT STD_LOGIC;
|
||||
nRP_LDS : OUT STD_LOGIC;
|
||||
nRP_UDS : OUT STD_LOGIC;
|
||||
nROM4 : OUT STD_LOGIC;
|
||||
nROM3 : OUT STD_LOGIC;
|
||||
nCF_CS1 : OUT STD_LOGIC;
|
||||
nCF_CS0 : OUT STD_LOGIC;
|
||||
nIDE_RD : INOUT STD_LOGIC;
|
||||
nIDE_WR : INOUT STD_LOGIC;
|
||||
AMKB_TX : OUT STD_LOGIC;
|
||||
IDE_RES : OUT STD_LOGIC;
|
||||
DTR : OUT STD_LOGIC;
|
||||
RTS : OUT STD_LOGIC;
|
||||
TxD : OUT STD_LOGIC;
|
||||
MIDI_OLR : OUT STD_LOGIC;
|
||||
MIDI_TLR : OUT STD_LOGIC;
|
||||
nDREQ0 : OUT STD_LOGIC;
|
||||
DSA_D : OUT STD_LOGIC;
|
||||
nMFP_INT : OUT STD_LOGIC;
|
||||
FALCON_IO_TA : OUT STD_LOGIC;
|
||||
STEP_DIR : OUT STD_LOGIC;
|
||||
WR_DATA : OUT STD_LOGIC;
|
||||
WR_GATE : OUT STD_LOGIC;
|
||||
DMA_DRQ : OUT STD_LOGIC;
|
||||
FB_AD : INOUT STD_LOGIC_VECTOR(31 downto 0);
|
||||
LP_D : INOUT STD_LOGIC_VECTOR(7 downto 0);
|
||||
ACSI_D : INOUT STD_LOGIC_VECTOR(7 downto 0);
|
||||
SCSI_D : INOUT STD_LOGIC_VECTOR(7 downto 0);
|
||||
SCSI_PAR : INOUT STD_LOGIC;
|
||||
nSCSI_SEL : INOUT STD_LOGIC;
|
||||
nSCSI_BUSY : INOUT STD_LOGIC;
|
||||
nSCSI_RST : INOUT STD_LOGIC;
|
||||
SD_CD_DATA3 : INOUT STD_LOGIC;
|
||||
SD_CDM_D1 : INOUT STD_LOGIC
|
||||
);
|
||||
-- {{ALTERA_IO_END}} DO NOT REMOVE THIS LINE!
|
||||
|
||||
END FalconIO_SDCard_IDE_CF;
|
||||
|
||||
|
||||
-- Architecture Body
|
||||
|
||||
ARCHITECTURE FalconIO_SDCard_IDE_CF_architecture OF FalconIO_SDCard_IDE_CF IS
|
||||
-- system
|
||||
signal SYS_CLK : STD_LOGIC;
|
||||
signal RESETn : STD_LOGIC;
|
||||
signal FB_B0 : STD_LOGIC; -- UPPER BYT BEI 16BIT BUS
|
||||
signal FB_B1 : STD_LOGIC; -- LOWER BYT BEI 16BIT BUS
|
||||
signal BYT : STD_LOGIC; -- WENN BYT -> 1
|
||||
signal LONG : STD_LOGIC; -- WENN -> 1
|
||||
-- KEYBOARD MIDI
|
||||
signal ACIA_CS_I : STD_LOGIC;
|
||||
signal IRQ_KEYBDn : STD_LOGIC;
|
||||
signal IRQ_MIDIn : STD_LOGIC;
|
||||
signal KEYB_RxD : STD_LOGIC;
|
||||
signal AMKB_REG : STD_LOGIC_VECTOR(4 downto 0);
|
||||
signal MIDI_OUT : STD_LOGIC;
|
||||
signal DATA_OUT_ACIA_I : STD_LOGIC_VECTOR(7 downto 0);
|
||||
signal DATA_OUT_ACIA_II : STD_LOGIC_VECTOR(7 downto 0);
|
||||
-- MFP
|
||||
signal MFP_CS : STD_LOGIC;
|
||||
signal MFP_INTACK : STD_LOGIC;
|
||||
signal LDS : STD_LOGIC;
|
||||
signal DTACK_OUT_MFPn : STD_LOGIC;
|
||||
signal IRQ_ACIAn : STD_LOGIC;
|
||||
signal DINTn : STD_LOGIC;
|
||||
signal DATA_OUT_MFP : STD_LOGIC_VECTOR(7 downto 0);
|
||||
signal TDO : STD_LOGIC;
|
||||
-- SOUND
|
||||
signal SNDCS : STD_LOGIC;
|
||||
signal SNDCS_I : STD_LOGIC;
|
||||
signal SNDIR_I : STD_LOGIC;
|
||||
signal LP_DIR_X : STD_LOGIC;
|
||||
signal DA_OUT_X : STD_LOGIC_VECTOR(7 downto 0);
|
||||
signal LP_D_X : STD_LOGIC_VECTOR(7 downto 0);
|
||||
-- DIV
|
||||
signal SUB_BUS : STD_LOGIC; -- SUB BUS MIT ROM-PORT, CF UND IDE
|
||||
signal ROM_CS : STD_LOGIC;
|
||||
-- DMA UND FLOPPY
|
||||
signal DMA_DATEN_CS : STD_LOGIC;
|
||||
signal DMA_MODUS_CS : STD_LOGIC;
|
||||
signal DMA_MODUS : STD_LOGIC_VECTOR(15 downto 0);
|
||||
signal WDC_BSL_CS : STD_LOGIC;
|
||||
signal WDC_BSL : STD_LOGIC_VECTOR(1 DOWNTO 0);
|
||||
signal HD_DD_OUT : STD_LOGIC;
|
||||
signal FDCS_In : STD_LOGIC;
|
||||
signal CA0 : STD_LOGIC;
|
||||
signal CA1 : STD_LOGIC;
|
||||
signal CA2 : STD_LOGIC;
|
||||
signal FDINT : STD_LOGIC;
|
||||
signal FDRQ : STD_LOGIC;
|
||||
signal CD_OUT_FDC : STD_LOGIC_VECTOR(7 downto 0);
|
||||
signal CD_IN_FDC : STD_LOGIC_VECTOR(7 downto 0);
|
||||
signal DMA_TOP_CS : STD_LOGIC;
|
||||
signal DMA_TOP : STD_LOGIC_VECTOR(7 downto 0);
|
||||
signal DMA_HIGH_CS : STD_LOGIC;
|
||||
signal DMA_HIGH : STD_LOGIC_VECTOR(7 downto 0);
|
||||
signal DMA_MID_CS : STD_LOGIC;
|
||||
signal DMA_MID : STD_LOGIC_VECTOR(7 downto 0);
|
||||
signal DMA_LOW_CS : STD_LOGIC;
|
||||
signal DMA_LOW : STD_LOGIC_VECTOR(7 downto 0);
|
||||
signal DMA_DIRM_CS : STD_LOGIC;
|
||||
signal DMA_ADR_CS : STD_LOGIC;
|
||||
signal DMA_STATUS : STD_LOGIC_VECTOR(2 downto 0);
|
||||
signal DMA_DIR_OLD : STD_LOGIC;
|
||||
signal DMA_BYT_CNT_CS : STD_LOGIC;
|
||||
signal DMA_BYT_CNT : STD_LOGIC_VECTOR(31 downto 0);
|
||||
signal CLR_FIFO : STD_LOGIC;
|
||||
signal DMA_DRQ_I : STD_LOGIC;
|
||||
signal DMA_DRQ_REG : STD_LOGIC_VECTOR(1 downto 0);
|
||||
signal DMA_DRQQ : STD_LOGIC;
|
||||
signal DMA_DRQ_Q : STD_LOGIC;
|
||||
signal RDF_DOUT : STD_LOGIC_VECTOR(31 downto 0);
|
||||
signal RDF_AZ : STD_LOGIC_VECTOR(9 downto 0);
|
||||
signal RDF_RDE : STD_LOGIC;
|
||||
signal RDF_WRE : STD_LOGIC;
|
||||
signal RDF_DIN : STD_LOGIC_VECTOR(7 downto 0);
|
||||
signal WRF_DOUT : STD_LOGIC_VECTOR(7 downto 0);
|
||||
signal WRF_AZ : STD_LOGIC_VECTOR(9 downto 0);
|
||||
signal WRF_RDE : STD_LOGIC;
|
||||
signal WRF_WRE : STD_LOGIC;
|
||||
signal nFDC_WR : STD_LOGIC;
|
||||
type FCF_STATES is( FCF_IDLE, FCF_T0, FCF_T1, FCF_T2, FCF_T3, FCF_T6, FCF_T7);
|
||||
signal FCF_STATE : FCF_STATES;
|
||||
signal NEXT_FCF_STATE : FCF_STATES;
|
||||
signal DMA_REQ : STD_LOGIC;
|
||||
signal FDC_CS : STD_LOGIC;
|
||||
signal FCF_CS : STD_LOGIC;
|
||||
signal FCF_APH : STD_LOGIC;
|
||||
signal DMA_AZ_CS : STD_LOGIC;
|
||||
signal DMA_ACTIV : STD_LOGIC;
|
||||
signal DMA_ACTIV_NEW : STD_LOGIC;
|
||||
signal FDC_OUT : STD_LOGIC_VECTOR(7 downto 0);
|
||||
-- SCSI
|
||||
signal SCSI_CS : STD_LOGIC;
|
||||
signal SCSI_CSn : STD_LOGIC;
|
||||
signal SCSI_DOUT : STD_LOGIC_VECTOR(7 downto 0);
|
||||
signal nSCSI_DACK : STD_LOGIC;
|
||||
signal SCSI_DRQ : STD_LOGIC;
|
||||
signal SCSI_INT : STD_LOGIC;
|
||||
signal DB_OUTn : STD_LOGIC_VECTOR(7 downto 0);
|
||||
signal DB_EN : STD_LOGIC;
|
||||
signal DBP_OUTn : STD_LOGIC;
|
||||
signal DBP_EN : STD_LOGIC;
|
||||
signal RST_OUTn : STD_LOGIC;
|
||||
signal RST_EN : STD_LOGIC;
|
||||
signal BSY_OUTn : STD_LOGIC;
|
||||
signal BSY_EN : STD_LOGIC;
|
||||
signal SEL_OUTn : STD_LOGIC;
|
||||
signal SEL_EN : STD_LOGIC;
|
||||
-- IDE
|
||||
signal nnIDE_RES : STD_LOGIC;
|
||||
signal IDE_CF_CS : STD_LOGIC;
|
||||
signal IDE_CF_TA : STD_LOGIC;
|
||||
signal NEXT_nIDE_RD : STD_LOGIC;
|
||||
signal NEXT_nIDE_WR : STD_LOGIC;
|
||||
type CMD_STATES is( IDLE, T1, T6, T7);
|
||||
signal CMD_STATE : CMD_STATES;
|
||||
signal NEXT_CMD_STATE : CMD_STATES;
|
||||
|
||||
|
||||
BEGIN
|
||||
LONG <= '1' when FB_SIZE1 = '0' and FB_SIZE0 = '0' else '0';
|
||||
BYT <= '1' when FB_SIZE1 = '0' and FB_SIZE0 = '1' else '0';
|
||||
FB_B0 <= '1' when FB_ADR(0) = '0' or BYT = '0' else '0';
|
||||
FB_B1 <= '1' when FB_ADR(0) = '1' or BYT = '0' else '0';
|
||||
|
||||
FALCON_IO_TA <= '1' when SNDCS = '1' or DTACK_OUT_MFPn = '0' or ACIA_CS_I = '1' or DMA_MODUS_CS ='1'
|
||||
or DMA_ADR_CS = '1' or DMA_DIRM_CS = '1' or DMA_BYT_CNT_CS = '1' or FCF_CS = '1' or IDE_CF_TA = '1' else '0';
|
||||
SUB_BUS <= '1' when nFB_WR = '1' and ROM_CS = '1' ELSE
|
||||
'1' when nFB_WR = '1' and IDE_CF_CS = '1' ELSE
|
||||
'1' when nFB_WR = '0' and nIDE_WR = '0' ELSE '0';
|
||||
nRP_UDS <= '0' when SUB_BUS = '1' and FB_B0 = '1' else '1';
|
||||
nRP_LDS <= '0' when SUB_BUS = '1' and FB_B1 = '1' else '1';
|
||||
nDREQ0 <= '0';
|
||||
----------------------------------------------------------------------------
|
||||
-- SD
|
||||
----------------------------------------------------------------------------
|
||||
SD_CLK <= 'Z';
|
||||
SD_CD_DATA3 <= 'Z';
|
||||
SD_CDM_D1 <= 'Z';
|
||||
----------------------------------------------------------------------------
|
||||
-- IDE
|
||||
----------------------------------------------------------------------------
|
||||
CMD_REG: process(nRSTO, MAIN_CLK, CMD_STATE, NEXT_CMD_STATE)
|
||||
begin
|
||||
if nRSTO = '0' then
|
||||
CMD_STATE <= IDLE;
|
||||
elsif rising_edge(MAIN_CLK) then
|
||||
CMD_STATE <= NEXT_CMD_STATE; -- go to next
|
||||
nIDE_RD <= NEXT_nIDE_RD; -- go to next
|
||||
nIDE_WR <= NEXT_nIDE_WR; -- go to next
|
||||
else
|
||||
CMD_STATE <= CMD_STATE; -- halten
|
||||
nIDE_RD <= nIDE_RD; -- halten
|
||||
nIDE_WR <= nIDE_WR; -- halten
|
||||
end if;
|
||||
end process CMD_REG;
|
||||
|
||||
CMD_DECODER: process(CMD_STATE, NEXT_CMD_STATE, NEXT_nIDE_RD, NEXT_nIDE_WR, IDE_RDY, IDE_CF_TA)
|
||||
begin
|
||||
case CMD_STATE is
|
||||
when IDLE =>
|
||||
IDE_CF_TA <= '0';
|
||||
if IDE_CF_CS = '1' then
|
||||
NEXT_nIDE_RD <= not nFB_WR;
|
||||
NEXT_nIDE_WR <= nFB_WR;
|
||||
NEXT_CMD_STATE <= T1;
|
||||
else
|
||||
NEXT_nIDE_RD <= '1';
|
||||
NEXT_nIDE_WR <= '1';
|
||||
NEXT_CMD_STATE <= IDLE;
|
||||
end if;
|
||||
when T1 =>
|
||||
IDE_CF_TA <= '0';
|
||||
NEXT_nIDE_RD <= not nFB_WR;
|
||||
NEXT_nIDE_WR <= nFB_WR;
|
||||
NEXT_CMD_STATE <= T6;
|
||||
when T6 =>
|
||||
IF IDE_RDY = '1' then
|
||||
IDE_CF_TA <= '1';
|
||||
NEXT_nIDE_RD <= '1';
|
||||
NEXT_nIDE_WR <= '1';
|
||||
NEXT_CMD_STATE <= T7;
|
||||
else
|
||||
IDE_CF_TA <= '0';
|
||||
NEXT_nIDE_RD <= not nFB_WR;
|
||||
NEXT_nIDE_WR <= nFB_WR;
|
||||
NEXT_CMD_STATE <= T6;
|
||||
end if;
|
||||
when T7 =>
|
||||
IDE_CF_TA <= '0';
|
||||
NEXT_nIDE_RD <= '1';
|
||||
NEXT_nIDE_WR <= '1';
|
||||
NEXT_CMD_STATE <= IDLE;
|
||||
end case;
|
||||
end process CMD_DECODER;
|
||||
|
||||
IDE_RES <= not nnIDE_RES and nRSTO;
|
||||
IDE_CF_CS <= '1' when nFB_CS1 = '0' and FB_ADR(19 downto 7) = x"0" else '0'; -- FFF0'0000/80
|
||||
nCF_CS0 <= '0' when ACP_CONF(31) = '0' and FB_ADR(19 downto 5) = x"0" else -- FFFO'0000-FFF0'001F
|
||||
'0' when ACP_CONF(31) = '1' and FB_ADR(19 downto 5) = x"2" else '1'; -- FFFO'0040-FFF0'005F
|
||||
nCF_CS1 <= '0' when ACP_CONF(31) = '0' and FB_ADR(19 downto 5) = x"1" else -- FFF0'0020-FFF0'003F
|
||||
'0' when ACP_CONF(31) = '1' and FB_ADR(19 downto 5) = x"3" else '1'; -- FFFO'0060-FFF0'007F
|
||||
nIDE_CS0 <= '0' when ACP_CONF(30) = '0' and FB_ADR(19 downto 5) = x"2" else -- FFF0'0040-FFF0'005F
|
||||
'0' when ACP_CONF(30) = '1' and FB_ADR(19 downto 5) = x"0" else '1'; -- FFFO'0000-FFF0'001F
|
||||
nIDE_CS1 <= '0' when ACP_CONF(30) = '0' and FB_ADR(19 downto 5) = x"3" else -- FFF0'0060-FFF0'007F
|
||||
'0' when ACP_CONF(30) = '1' and FB_ADR(19 downto 5) = x"1" else '1'; -- FFFO'0020-FFF0'003F
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- ACSI, SCSI UND FLOPPY WD1772
|
||||
-------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- daten read fifo
|
||||
RDF: dcfifo0
|
||||
port map(
|
||||
aclr => CLR_FIFO,
|
||||
data => RDF_DIN,
|
||||
rdclk => MAIN_CLK,
|
||||
rdreq => RDF_RDE,
|
||||
wrclk => FDC_CLK,
|
||||
wrreq => RDF_WRE,
|
||||
q => RDF_DOUT,
|
||||
wrusedw => RDF_AZ
|
||||
);
|
||||
FCF_CS <= '1' when nFB_CS2 = '0' and FB_ADR(26 downto 0) = x"0020110" and LONG = '1' else '0'; -- F002'0110 LONG ONLY
|
||||
FCF_APH <= '1' when FB_ALE = '1' and FB_AD(31 downto 0) = x"F0020110" and LONG = '1' else '0'; -- ADRESSPHASE F0020110 LONG ONLY
|
||||
RDF_RDE <= '1' when FCF_APH = '1' and nFB_WR = '1' else '0'; -- AKTIVIEREN IN ADRESSPHASE
|
||||
FB_AD <= RDF_DOUT(7 downto 0) & RDF_DOUT(15 downto 8) & RDF_DOUT(23 downto 16) & RDF_DOUT(31 downto 24) when FCF_CS = '1' and nFB_OE = '0' else "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ";
|
||||
RDF_DIN <= CD_OUT_FDC when DMA_MODUS(7) = '1' else SCSI_DOUT;
|
||||
-- daten write fifo
|
||||
WRF: dcfifo1
|
||||
port map(
|
||||
aclr => CLR_FIFO,
|
||||
data => FB_AD(7 downto 0) & FB_AD(15 downto 8) & FB_AD(23 downto 16) & FB_AD(31 downto 24),
|
||||
rdclk => FDC_CLK,
|
||||
rdreq => WRF_RDE,
|
||||
wrclk => MAIN_CLK,
|
||||
wrreq => WRF_WRE,
|
||||
q => WRF_DOUT,
|
||||
rdusedw => WRF_AZ
|
||||
);
|
||||
CD_IN_FDC <= WRF_DOUT when DMA_ACTIV = '1' and DMA_MODUS(8) = '1' else FB_AD(23 downto 16); -- BEI DMA WRITE <-FIFO SONST <-FB
|
||||
DMA_AZ_CS <= '1' when nFB_CS2 = '0' and FB_ADR(26 downto 0) = x"002010C" else '0'; -- F002'010C LONG
|
||||
FB_AD <= DMA_DRQ_Q & DMA_DRQ_REG & IDE_INT & FDINT & SCSI_INT & RDF_AZ & "0" & DMA_STATUS & "00" & WRF_AZ when DMA_AZ_CS = '1' and nFB_OE = '0' else "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ";
|
||||
DMA_DRQ_Q <= '1' when DMA_DRQ_REG = "11" and DMA_MODUS(6) = '0' else '0';
|
||||
-- FIFO WRITE: GENAU 1 MAIN_CLK -------------------------------------------------------------------------
|
||||
process(MAIN_CLK, nRSTO, WRF_WRE, nFB_WR, FCF_APH)
|
||||
begin
|
||||
if nRSTO = '0' THEN
|
||||
WRF_WRE <= '0';
|
||||
elsif rising_edge(MAIN_CLK) then
|
||||
IF FCF_APH = '1' and nFB_WR = '0' then
|
||||
WRF_WRE <= '1';
|
||||
else
|
||||
WRF_WRE <= '0';
|
||||
end if;
|
||||
else
|
||||
WRF_WRE <= WRF_WRE;
|
||||
end if;
|
||||
END PROCESS;
|
||||
|
||||
FCF_REG: process(nRSTO, FDC_CLK, FCF_STATE, NEXT_FCF_STATE, DMA_ACTIV)
|
||||
begin
|
||||
if nRSTO = '0' then
|
||||
FCF_STATE <= FCF_IDLE;
|
||||
DMA_ACTIV <= '0';
|
||||
elsif rising_edge(FDC_CLK) then
|
||||
FCF_STATE <= NEXT_FCF_STATE; -- go to next
|
||||
DMA_ACTIV <= DMA_ACTIV_NEW;
|
||||
else
|
||||
FCF_STATE <= FCF_STATE; -- halten
|
||||
DMA_ACTIV <= DMA_ACTIV;
|
||||
end if;
|
||||
end process FCF_REG;
|
||||
|
||||
FDC_REG: process(nRSTO, FDC_CLK, FDC_OUT, FDCS_In, CD_OUT_FDC)
|
||||
begin
|
||||
if nRSTO = '0' then
|
||||
FDC_OUT <= x"00";
|
||||
elsif rising_edge(FDC_CLK) and FDCS_In = '0' then
|
||||
FDC_OUT <= CD_OUT_FDC; -- set
|
||||
else
|
||||
FDC_OUT <= FDC_OUT; -- halten
|
||||
end if;
|
||||
end process FDC_REG;
|
||||
|
||||
DMA_REQ <= '1' when ((DMA_DRQ_I = '1' and DMA_MODUS(7) = '1') or (SCSI_DRQ = '1' and DMA_MODUS(7) = '0')) and DMA_STATUS(1) = '1' and DMA_MODUS(6) = '0' and CLR_FIFO = '0' else '0';
|
||||
FDC_CS <= '1' when DMA_DATEN_CS = '1' and DMA_MODUS(4 downto 3) = "00" and FB_B1 = '1' else '0';
|
||||
SCSI_CS <= '1' when DMA_DATEN_CS = '1' and DMA_MODUS(4 downto 3) = "01" and FB_B1 = '1' else '0';
|
||||
|
||||
FCF_DECODER: process(FCF_STATE, NEXT_FCF_STATE, DMA_REQ,FDC_CS, RDF_WRE, WRF_RDE, SCSI_DRQ, nSCSI_DACK, DMA_MODUS, DMA_ACTIV, FDCS_In,SCSI_CS, SCSI_CSn)
|
||||
begin
|
||||
case FCF_STATE is
|
||||
when FCF_IDLE =>
|
||||
SCSI_CSn <= '1';
|
||||
FDCS_In <= '1';
|
||||
RDF_WRE <= '0';
|
||||
WRF_RDE <= '0';
|
||||
nSCSI_DACK <= '1';
|
||||
if DMA_REQ = '1' or FDC_CS = '1' or SCSI_CS = '1' then
|
||||
DMA_ACTIV_NEW <= DMA_REQ;
|
||||
NEXT_FCF_STATE <= FCF_T0;
|
||||
else
|
||||
DMA_ACTIV_NEW <= '0';
|
||||
NEXT_FCF_STATE <= FCF_IDLE;
|
||||
end if;
|
||||
when FCF_T0 =>
|
||||
SCSI_CSn <= '1';
|
||||
FDCS_In <= '1';
|
||||
RDF_WRE <= '0';
|
||||
nSCSI_DACK <= '1';
|
||||
DMA_ACTIV_NEW <= DMA_REQ;
|
||||
WRF_RDE <= DMA_MODUS(8) and DMA_REQ; -- WRITE -> READ FROM FIFO
|
||||
if DMA_REQ = '0' and DMA_ACTIV = '1' THEN -- spike?
|
||||
NEXT_FCF_STATE <= FCF_IDLE; -- ja -> zum start
|
||||
else
|
||||
NEXT_FCF_STATE <= FCF_T1;
|
||||
end if;
|
||||
when FCF_T1 =>
|
||||
RDF_WRE <= '0';
|
||||
WRF_RDE <= '0';
|
||||
DMA_ACTIV_NEW <= DMA_ACTIV;
|
||||
SCSI_CSn <= not SCSI_CS;
|
||||
FDCS_In <= DMA_MODUS(4) or DMA_MODUS(3);
|
||||
nSCSI_DACK <= DMA_MODUS(7) and DMA_ACTIV;
|
||||
NEXT_FCF_STATE <= FCF_T2;
|
||||
when FCF_T2 =>
|
||||
RDF_WRE <= '0';
|
||||
WRF_RDE <= '0';
|
||||
DMA_ACTIV_NEW <= DMA_ACTIV;
|
||||
SCSI_CSn <= not SCSI_CS;
|
||||
FDCS_In <= DMA_MODUS(4) or DMA_MODUS(3);
|
||||
nSCSI_DACK <= DMA_MODUS(7) and DMA_ACTIV;
|
||||
NEXT_FCF_STATE <= FCF_T3;
|
||||
when FCF_T3 =>
|
||||
RDF_WRE <= '0';
|
||||
WRF_RDE <= '0';
|
||||
DMA_ACTIV_NEW <= DMA_ACTIV;
|
||||
SCSI_CSn <= not SCSI_CS;
|
||||
FDCS_In <= DMA_MODUS(4) or DMA_MODUS(3);
|
||||
nSCSI_DACK <= DMA_MODUS(7) and DMA_ACTIV;
|
||||
NEXT_FCF_STATE <= FCF_T6;
|
||||
when FCF_T6 =>
|
||||
WRF_RDE <= '0';
|
||||
DMA_ACTIV_NEW <= DMA_ACTIV;
|
||||
SCSI_CSn <= not SCSI_CS;
|
||||
FDCS_In <= DMA_MODUS(4) or DMA_MODUS(3);
|
||||
nSCSI_DACK <= DMA_MODUS(7) and DMA_ACTIV;
|
||||
RDF_WRE <= not DMA_MODUS(8) and DMA_ACTIV; -- READ -> WRITE IN FIFO
|
||||
NEXT_FCF_STATE <= FCF_T7;
|
||||
when FCF_T7 =>
|
||||
SCSI_CSn <= '1';
|
||||
FDCS_In <= '1';
|
||||
RDF_WRE <= '0';
|
||||
WRF_RDE <= '0';
|
||||
nSCSI_DACK <= '1';
|
||||
DMA_ACTIV_NEW <= '0';
|
||||
if FDC_CS = '1' and DMA_REQ = '0' then
|
||||
NEXT_FCF_STATE <= FCF_T7;
|
||||
else
|
||||
NEXT_FCF_STATE <= FCF_IDLE;
|
||||
end if;
|
||||
end case;
|
||||
end process FCF_DECODER;
|
||||
|
||||
I_FDC: WF1772IP_TOP_SOC
|
||||
port map(
|
||||
CLK => FDC_CLK,
|
||||
RESETn => nRSTO,
|
||||
CSn => FDCS_In,
|
||||
RWn => nFDC_WR,
|
||||
A1 => CA2,
|
||||
A0 => CA1,
|
||||
DATA_IN => CD_IN_FDC,
|
||||
DATA_OUT => CD_OUT_FDC,
|
||||
-- DATA_EN => CD_EN_FDC,
|
||||
RDn => nRD_DATA,
|
||||
TR00n => TRACK00,
|
||||
IPn => nINDEX,
|
||||
WPRTn => nWP,
|
||||
DDEn => '0', -- Fixed to MFM.
|
||||
HDTYPE => HD_DD_OUT,
|
||||
MO => MOT_ON,
|
||||
WG => WR_GATE,
|
||||
WD => WR_DATA,
|
||||
STEP => STEP,
|
||||
DIRC => STEP_DIR,
|
||||
DRQ => DMA_DRQ_I,
|
||||
INTRQ => FDINT
|
||||
);
|
||||
DMA_DATEN_CS <= '1' when nFB_CS1 = '0' and FB_ADR(19 downto 1) = x"7C302" else '0'; -- F8604/2
|
||||
DMA_MODUS_CS <= '1' when nFB_CS1 = '0' and FB_ADR(19 downto 1) = x"7C303" else '0'; -- F8606/2
|
||||
WDC_BSL_CS <= '1' when nFB_CS1 = '0' and FB_ADR(19 downto 1) = x"7C307" else '0'; -- F860E/2
|
||||
HD_DD_OUT <= HD_DD WHEN ACP_CONF(29) = '0' ELSE WDC_BSL(0);
|
||||
nFDC_WR <= (not DMA_MODUS(8)) when DMA_ACTIV = '1' else nFB_WR;
|
||||
CA0 <= '1' when DMA_ACTIV = '1' ELSE DMA_MODUS(0);
|
||||
CA1 <= '1' when DMA_ACTIV = '1' ELSE DMA_MODUS(1);
|
||||
CA2 <= '1' when DMA_ACTIV = '1' ELSE DMA_MODUS(2);
|
||||
FB_AD(23 downto 16) <= "0000" & (not DMA_STATUS(1)) & "0" & WDC_BSL(1) & HD_DD when WDC_BSL_CS = '1' and nFB_OE = '0' else "ZZZZZZZZ";
|
||||
FB_AD(31 downto 24) <= "00000000" when DMA_DATEN_CS = '1' and nFB_OE = '0' else "ZZZZZZZZ";
|
||||
FB_AD(23 downto 16) <= FDC_OUT when DMA_DATEN_CS = '1' and DMA_MODUS(4 downto 3) = "00" and nFB_OE = '0' else
|
||||
SCSI_DOUT when DMA_DATEN_CS = '1' and DMA_MODUS(4 downto 3) = "01" and nFB_OE = '0' else
|
||||
DMA_BYT_CNT(16 downto 9) when DMA_DATEN_CS = '1' and DMA_MODUS(4) = '1' and nFB_OE = '0' else "ZZZZZZZZ";
|
||||
--- WDC BSL REGISTER -------------------------------------------------------
|
||||
process(MAIN_CLK, nRSTO, WDC_BSL_CS, WDC_BSL, nFB_WR, FB_B0, FB_B1)
|
||||
begin
|
||||
if nRSTO = '0' THEN
|
||||
WDC_BSL <= "00";
|
||||
elsif rising_edge(MAIN_CLK) and WDC_BSL_CS = '1' and nFB_WR = '0' then
|
||||
IF FB_B0 = '1' THEN
|
||||
WDC_BSL(1 DOWNTO 0) <= FB_AD(25 DOWNTO 24);
|
||||
else
|
||||
WDC_BSL(1 DOWNTO 0) <= WDC_BSL(1 DOWNTO 0);
|
||||
end if;
|
||||
end if;
|
||||
END PROCESS;
|
||||
--- DMA MODUS REGISTER -------------------------------------------------------
|
||||
process(MAIN_CLK, nRSTO, DMA_MODUS_CS, DMA_MODUS, nFB_WR, FB_B0, FB_B1)
|
||||
begin
|
||||
if nRSTO = '0' THEN
|
||||
DMA_MODUS <= x"0000";
|
||||
elsif rising_edge(MAIN_CLK) and DMA_MODUS_CS = '1' and nFB_WR = '0' then
|
||||
IF FB_B0 = '1' THEN
|
||||
DMA_MODUS(15 downto 8) <= FB_AD(31 downto 24);
|
||||
else
|
||||
DMA_MODUS(15 downto 8) <= DMA_MODUS(15 downto 8);
|
||||
end if;
|
||||
IF FB_B1 = '1' THEN
|
||||
DMA_MODUS(7 downto 0) <= FB_AD(23 downto 16);
|
||||
else
|
||||
DMA_MODUS(7 downto 0) <= DMA_MODUS(7 downto 0);
|
||||
end if;
|
||||
else
|
||||
DMA_MODUS <= DMA_MODUS;
|
||||
end if;
|
||||
END PROCESS;
|
||||
-- BYT COUNTER, SECTOR COUNTER ----------------------------------------------------
|
||||
process(MAIN_CLK, nRSTO, DMA_DATEN_CS, DMA_BYT_CNT_CS, DMA_BYT_CNT, nFB_WR, FB_B0, FB_B1, DMA_MODUS, CLR_FIFO)
|
||||
begin
|
||||
if nRSTO = '0' or CLR_FIFO = '1' THEN
|
||||
DMA_BYT_CNT <= x"00000000";
|
||||
elsif rising_edge(MAIN_CLK) and nFB_WR = '0' and DMA_DATEN_CS = '1' and nFB_WR = '0' and DMA_MODUS(4) = '1' and FB_B1 = '1' then
|
||||
DMA_BYT_CNT(31 downto 17) <= "000000000000000";
|
||||
DMA_BYT_CNT(16 downto 9) <= FB_AD(23 downto 16);
|
||||
DMA_BYT_CNT(8 downto 0) <= "000000000";
|
||||
elsif rising_edge(MAIN_CLK) and nFB_WR = '0' and DMA_BYT_CNT_CS = '1' then
|
||||
DMA_BYT_CNT <= FB_AD;
|
||||
else
|
||||
DMA_BYT_CNT <= DMA_BYT_CNT;
|
||||
end if;
|
||||
END PROCESS;
|
||||
--------------------------------------------------------------------
|
||||
FB_AD(31 downto 16) <= "0000000000000" & DMA_STATUS when DMA_MODUS_CS = '1' and nFB_OE = '0' else "ZZZZZZZZZZZZZZZZ";
|
||||
DMA_STATUS(0) <= '1'; -- DMA OK
|
||||
DMA_STATUS(1) <= '1' when DMA_BYT_CNT /= 0 and DMA_BYT_CNT(31) = '0' else '0'; -- WENN byts UND NICHT MINUS
|
||||
DMA_STATUS(2) <= '0' when DMA_DRQ_I = '1' or SCSI_DRQ = '1' else '0';
|
||||
DMA_DRQQ <= '1' when DMA_STATUS(1) = '1' and DMA_MODUS(8) = '0' and RDF_AZ > 15 and DMA_MODUS(6) = '0' else
|
||||
'1' when DMA_STATUS(1) = '1' and DMA_MODUS(8) = '1' and WRF_AZ < 512 and DMA_MODUS(6) = '0' else '0';
|
||||
DMA_DRQ <= '1' when DMA_DRQ_REG = "11" and DMA_MODUS(6) = '0' else '0';
|
||||
-- DMA REQUEST: SPIKES AUSFILTERN ------------------------------------------
|
||||
process(FDC_CLK, nRSTO, DMA_DRQ_REG)
|
||||
begin
|
||||
if nRSTO = '0' THEN
|
||||
DMA_DRQ_REG <= "00";
|
||||
elsif rising_edge(FDC_CLK) then
|
||||
DMA_DRQ_REG(0) <= DMA_DRQQ;
|
||||
DMA_DRQ_REG(1) <= DMA_DRQ_REG(0) and DMA_DRQQ;
|
||||
else
|
||||
DMA_DRQ_REG <= DMA_DRQ_REG;
|
||||
end if;
|
||||
END PROCESS;
|
||||
-- DMA ADRESSE ------------------------------------------------------
|
||||
process(MAIN_CLK, nRSTO, DMA_TOP_CS, DMA_TOP, nFB_WR, DMA_ADR_CS)
|
||||
begin
|
||||
if nRSTO = '0' THEN
|
||||
DMA_TOP <= x"00";
|
||||
elsif rising_edge(MAIN_CLK) and nFB_WR = '0' and (DMA_TOP_CS = '1' or DMA_ADR_CS = '1') then
|
||||
DMA_TOP <= FB_AD(31 downto 24);
|
||||
else
|
||||
DMA_TOP <= DMA_TOP;
|
||||
end if;
|
||||
END PROCESS;
|
||||
process(MAIN_CLK, nRSTO, DMA_HIGH_CS, DMA_HIGH, nFB_WR, DMA_ADR_CS)
|
||||
begin
|
||||
if nRSTO = '0' THEN
|
||||
DMA_HIGH <= x"00";
|
||||
elsif rising_edge(MAIN_CLK) and nFB_WR = '0' and (DMA_HIGH_CS = '1' or DMA_ADR_CS = '1') then
|
||||
DMA_HIGH <= FB_AD(23 downto 16);
|
||||
else
|
||||
DMA_HIGH <= DMA_HIGH;
|
||||
end if;
|
||||
END PROCESS;
|
||||
process(MAIN_CLK, nRSTO, DMA_MID_CS, DMA_MID, nFB_WR)
|
||||
begin
|
||||
DMA_MID <= DMA_MID;
|
||||
if nRSTO = '0' THEN
|
||||
DMA_MID <= x"00";
|
||||
elsif rising_edge(MAIN_CLK) and nFB_WR = '0' then
|
||||
if DMA_MID_CS = '1' then
|
||||
DMA_MID <= FB_AD(23 downto 16);
|
||||
elsif DMA_ADR_CS = '1' then
|
||||
DMA_MID <= FB_AD(15 downto 8);
|
||||
end if;
|
||||
end if;
|
||||
END PROCESS;
|
||||
process(MAIN_CLK, nRSTO, DMA_LOW_CS, DMA_LOW, nFB_WR)
|
||||
begin
|
||||
DMA_LOW <= DMA_LOW;
|
||||
if nRSTO = '0' THEN
|
||||
DMA_LOW <= x"00";
|
||||
elsif rising_edge(MAIN_CLK) and nFB_WR = '0' then
|
||||
if DMA_LOW_CS = '1'then
|
||||
DMA_LOW <= FB_AD(23 downto 16);
|
||||
elsif DMA_ADR_CS = '1' then
|
||||
DMA_LOW <= FB_AD(7 downto 0);
|
||||
end if;
|
||||
end if;
|
||||
END PROCESS;
|
||||
--------------------------------------------------------------------------------------------
|
||||
DMA_TOP_CS <= '1' when nFB_CS1 = '0' and FB_ADR(19 downto 1) = x"7C304" and FB_B0 = '1' else '0'; -- F8608/2
|
||||
DMA_HIGH_CS <= '1' when nFB_CS1 = '0' and FB_ADR(19 downto 1) = x"7C304" and FB_B1 = '1' else '0'; -- F8609/2
|
||||
DMA_MID_CS <= '1' when nFB_CS1 = '0' and FB_ADR(19 downto 1) = x"7C305" and FB_B1 = '1' else '0'; -- F860B/2
|
||||
DMA_LOW_CS <= '1' when nFB_CS1 = '0' and FB_ADR(19 downto 1) = x"7C306" and FB_B1 = '1' else '0'; -- F860D/2
|
||||
FB_AD(31 downto 24) <= DMA_TOP when DMA_TOP_CS = '1' and nFB_OE = '0' else "ZZZZZZZZ";
|
||||
FB_AD(23 downto 16) <= DMA_HIGH when DMA_HIGH_CS = '1' and nFB_OE = '0' else "ZZZZZZZZ";
|
||||
FB_AD(23 downto 16) <= DMA_MID when DMA_MID_CS = '1' and nFB_OE = '0' else "ZZZZZZZZ";
|
||||
FB_AD(23 downto 16) <= DMA_LOW when DMA_LOW_CS = '1' and nFB_OE = '0' else "ZZZZZZZZ";
|
||||
-- DIRECTZUGRIFF
|
||||
DMA_DIRM_CS <= '1' when nFB_CS2 = '0' and FB_ADR(26 downto 0) = x"20100" else '0'; -- F002'0100 WORD
|
||||
DMA_ADR_CS <= '1' when nFB_CS2 = '0' and FB_ADR(26 downto 0) = x"20104" else '0'; -- F002'0104 LONG
|
||||
DMA_BYT_CNT_CS <= '1' when nFB_CS2 = '0' and FB_ADR(26 downto 0) = x"20108" else '0'; -- F002'0108 LONG
|
||||
FB_AD <= DMA_TOP & DMA_HIGH & DMA_MID & DMA_LOW when DMA_ADR_CS = '1' and nFB_OE = '0' else "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ";
|
||||
FB_AD(31 downto 16) <= DMA_MODUS when DMA_DIRM_CS = '1' and nFB_OE = '0' else "ZZZZZZZZZZZZZZZZ";
|
||||
FB_AD <= DMA_BYT_CNT when DMA_BYT_CNT_CS = '1' and nFB_OE = '0' else "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ";
|
||||
-- DMA RW TOGGLE ------------------------------------------
|
||||
process(MAIN_CLK, nRSTO, DMA_MODUS_CS, DMA_MODUS, DMA_DIR_OLD)
|
||||
begin
|
||||
if nRSTO = '0' THEN
|
||||
DMA_DIR_OLD <= '0';
|
||||
elsif rising_edge(MAIN_CLK) and DMA_MODUS_CS = '0' then
|
||||
DMA_DIR_OLD <= DMA_MODUS(8);
|
||||
else
|
||||
DMA_DIR_OLD <= DMA_DIR_OLD;
|
||||
end if;
|
||||
END PROCESS;
|
||||
CLR_FIFO <= DMA_MODUS(8) xor DMA_DIR_OLD;
|
||||
-- SCSI ----------------------------------------------------------------------------------
|
||||
I_SCSI: WF5380_TOP_SOC
|
||||
port map(
|
||||
CLK => FDC_CLK,
|
||||
RESETn => nRSTO,
|
||||
ADR => CA2 & CA1 & CA0,
|
||||
DATA_IN => CD_IN_FDC,
|
||||
DATA_OUT => SCSI_DOUT,
|
||||
--DATA_EN : out bit;
|
||||
-- Bus and DMA controls:
|
||||
CSn => '1', --SCSI_CSn, ABGESCHALTET
|
||||
RDn => (not nFDC_WR) or (not SCSI_CS),
|
||||
WRn => nFDC_WR or (not SCSI_CS),
|
||||
EOPn => '1',
|
||||
DACKn => nSCSI_DACK,
|
||||
DRQ => SCSI_DRQ,
|
||||
INT => SCSI_INT,
|
||||
-- READY =>
|
||||
-- SCSI bus:
|
||||
DB_INn => SCSI_D,
|
||||
DB_OUTn => DB_OUTn,
|
||||
DB_EN => DB_EN,
|
||||
DBP_INn => SCSI_PAR,
|
||||
DBP_OUTn => DBP_OUTn,
|
||||
DBP_EN => DBP_EN, -- wenn 1 dann output
|
||||
RST_INn => nSCSI_RST,
|
||||
RST_OUTn => RST_OUTn,
|
||||
RST_EN => RST_EN,
|
||||
BSY_INn => nSCSI_BUSY,
|
||||
BSY_OUTn => BSY_OUTn,
|
||||
BSY_EN => BSY_EN,
|
||||
SEL_INn => nSCSI_SEL,
|
||||
SEL_OUTn => SEL_OUTn,
|
||||
SEL_EN => SEL_EN,
|
||||
ACK_INn => '1',
|
||||
ACK_OUTn => nSCSI_ACK,
|
||||
-- ACK_EN => ACK_EN,
|
||||
ATN_INn => '1',
|
||||
ATN_OUTn => nSCSI_ATN,
|
||||
-- ATN_EN => ATN_EN,
|
||||
REQ_INn => nSCSI_DRQ,
|
||||
-- REQ_OUTn => REQ_OUTn,
|
||||
-- REQ_EN => REQ_EN,
|
||||
IOn_IN => nSCSI_I_O,
|
||||
-- IOn_OUT => IOn_OUT,
|
||||
-- IO_EN => IO_EN,
|
||||
CDn_IN => nSCSI_C_D,
|
||||
-- CDn_OUT => CDn_OUT,
|
||||
-- CD_EN => CD_EN,
|
||||
MSG_INn => nSCSI_MSG
|
||||
-- MSG_OUTn => MSG_OUTn,
|
||||
-- MSG_EN => MSG_EN
|
||||
);
|
||||
-- SCSI ACSI ---------------------------------------------------------------
|
||||
SCSI_D <= DB_OUTn when DB_EN = '1' else "ZZZZZZZZ";
|
||||
SCSI_DIR <= '1'; --'0' when DB_EN = '1' else '1'; --ABGESCHALTET
|
||||
SCSI_PAR <= DBP_OUTn when DBP_EN = '1' else 'Z';
|
||||
nSCSI_RST <= RST_OUTn when RST_EN = '1' else 'Z';
|
||||
nSCSI_BUSY <= BSY_OUTn when BSY_EN = '1' else 'Z';
|
||||
nSCSI_SEL <= SEL_OUTn when SEL_EN = '1' else 'Z';
|
||||
ACSI_DIR <= '0';
|
||||
ACSI_D <= "ZZZZZZZZ";
|
||||
nACSI_CS <= '1';
|
||||
ACSI_A1 <= CA1;
|
||||
nACSI_RESET <= nRSTO;
|
||||
nACSI_ACK <= '1';
|
||||
----------------------------------------------------------------------------
|
||||
-- ROM-PORT TA KOMMT FROM DEFAULT TA = 16 BUSCYCLEN = 500ns
|
||||
----------------------------------------------------------------------------
|
||||
ROM_CS <= '1' when nFB_CS1 = '0' and nFB_WR = '1' and FB_ADR(19 downto 17) = x"5" else '0'; -- FFF A'0000/2'0000
|
||||
nROM4 <= '0' when ROM_CS = '1' and FB_ADR(16) = '0' else '1';
|
||||
nROM3 <= '0' when ROM_CS = '1' and FB_ADR(16) = '1' else '1';
|
||||
----------------------------------------------------------------------------
|
||||
-- ACIA KEYBOARD
|
||||
----------------------------------------------------------------------------
|
||||
I_ACIA_KEYBOARD: WF6850IP_TOP_SOC
|
||||
port map(
|
||||
CLK => MAIN_CLK,
|
||||
RESETn => nRSTO,
|
||||
|
||||
CS2n => FB_ADR(2),
|
||||
CS1 => '1',
|
||||
CS0 => ACIA_CS_I,
|
||||
E => ACIA_CS_I,
|
||||
RWn => nFB_WR,
|
||||
RS => FB_ADR(1),
|
||||
|
||||
DATA_IN => FB_AD(31 downto 24),
|
||||
DATA_OUT => DATA_OUT_ACIA_I,
|
||||
-- DATA_EN => DATA_EN_ACIA_I,
|
||||
|
||||
TXCLK => CLK500k,
|
||||
RXCLK => CLK500k,
|
||||
RXDATA => KEYB_RxD,
|
||||
|
||||
CTSn => '0',
|
||||
DCDn => '0',
|
||||
|
||||
IRQn => IRQ_KEYBDn,
|
||||
TXDATA => AMKB_TX
|
||||
--RTSn => -- Not used.
|
||||
);
|
||||
ACIA_CS_I <= '1' when nFB_CS1 = '0'and FB_ADR(19 downto 3) = x"1FF80" else '0'; -- FFC00-FFC07 FFC00/8
|
||||
KEYB_RxD <= '1' when AMKB_REG(3) = '1' or PIC_AMKB_RX = '0' else '0'; -- TASTATUR DATEN VOM PIC(PS2) OR NORMAL
|
||||
FB_AD(31 downto 24) <= DATA_OUT_ACIA_I when ACIA_CS_I = '1' and FB_ADR(2) = '0' and nFB_OE = '0' else "ZZZZZZZZ";
|
||||
-- AMKB_TX: SPIKES AUSFILTERN ------------------------------------------
|
||||
process(CLK2M, AMKB_RX, AMKB_REG)
|
||||
begin
|
||||
if rising_edge(CLK2M) then
|
||||
IF AMKB_RX = '0' THEN
|
||||
IF AMKB_REG < 16 THEN
|
||||
AMKB_REG <= "00000";
|
||||
ELSE
|
||||
AMKB_REG <= AMKB_REG - 1;
|
||||
END IF;
|
||||
ELSE
|
||||
IF AMKB_REG > 15 THEN
|
||||
AMKB_REG <= "11111";
|
||||
ELSE
|
||||
AMKB_REG <= AMKB_REG + 1;
|
||||
END IF;
|
||||
END IF;
|
||||
ELSE
|
||||
AMKB_REG <= AMKB_REG;
|
||||
end if;
|
||||
END PROCESS;
|
||||
----------------------------------------------------------------------------
|
||||
-- ACIA MIDI
|
||||
----------------------------------------------------------------------------
|
||||
I_ACIA_MIDI: WF6850IP_TOP_SOC
|
||||
port map(
|
||||
CLK => MAIN_CLK,
|
||||
RESETn => nRSTO,
|
||||
|
||||
CS2n => '0',
|
||||
CS1 => FB_ADR(2),
|
||||
CS0 => ACIA_CS_I,
|
||||
E => ACIA_CS_I,
|
||||
RWn => nFB_WR,
|
||||
RS => FB_ADR(1),
|
||||
|
||||
DATA_IN => FB_AD(31 downto 24),
|
||||
DATA_OUT => DATA_OUT_ACIA_II,
|
||||
-- DATA_EN => DATA_EN_ACIA_II,
|
||||
|
||||
TXCLK => CLK500k,
|
||||
RXCLK => CLK500k,
|
||||
RXDATA => MIDI_IN,
|
||||
CTSn => '0',
|
||||
DCDn => '0',
|
||||
|
||||
IRQn => IRQ_MIDIn,
|
||||
TXDATA => MIDI_OUT
|
||||
--RTSn => -- Not used.
|
||||
);
|
||||
MIDI_TLR <= MIDI_OUT;
|
||||
MIDI_OLR <= MIDI_OUT;
|
||||
FB_AD(31 downto 24) <= DATA_OUT_ACIA_II when ACIA_CS_I = '1' and FB_ADR(2) = '1' and nFB_OE = '0' else "ZZZZZZZZ";
|
||||
----------------------------------------------------------------------------
|
||||
-- MFP
|
||||
----------------------------------------------------------------------------
|
||||
I_MFP: WF68901IP_TOP_SOC
|
||||
port map(
|
||||
-- System control:
|
||||
CLK => MAIN_CLK,
|
||||
RESETn => nRSTO,
|
||||
-- Asynchronous bus control:
|
||||
DSn => not LDS,
|
||||
CSn => not MFP_CS,
|
||||
RWn => nFB_WR,
|
||||
DTACKn => DTACK_OUT_MFPn,
|
||||
-- Data and Adresses:
|
||||
RS => FB_ADR(5 downto 1),
|
||||
DATA_IN => FB_AD(23 downto 16),
|
||||
DATA_OUT => DATA_OUT_MFP,
|
||||
-- DATA_EN => DATA_EN_MFP,
|
||||
GPIP_IN(7) => not DMA_DRQ_Q,
|
||||
GPIP_IN(6) => not RI,
|
||||
GPIP_IN(5) => DINTn,
|
||||
GPIP_IN(4) => IRQ_ACIAn,
|
||||
GPIP_IN(3) => DSP_INT,
|
||||
GPIP_IN(2) => not CTS,
|
||||
GPIP_IN(1) => not DCD,
|
||||
GPIP_IN(0) => LP_BUSY,
|
||||
-- GPIP_OUT =>, -- Not used; all GPIPs are direction input.
|
||||
-- GPIP_EN =>, -- Not used; all GPIPs are direction input.
|
||||
-- Interrupt control:
|
||||
IACKn => not MFP_INTACK,
|
||||
IEIn => '0',
|
||||
-- IEOn =>, -- Not used.
|
||||
IRQn => nMFP_INT,
|
||||
-- Timers and timer control:
|
||||
XTAL1 => CLK2M4576,
|
||||
TAI => '0',
|
||||
TBI => nBLANK,
|
||||
-- TAO =>,
|
||||
-- TBO =>,
|
||||
-- TCO =>,
|
||||
TDO => TDO,
|
||||
-- Serial I/O control:
|
||||
RC => TDO,
|
||||
TC => TDO,
|
||||
SI => RxD,
|
||||
SO => TxD
|
||||
-- SO_EN => MFP_SO_EN
|
||||
-- DMA control:
|
||||
-- RRn =>,
|
||||
-- TRn =>
|
||||
);
|
||||
|
||||
MFP_CS <= '1' when nFB_CS1 = '0' and FB_ADR(19 downto 6) = x"3FE8" else '0'; -- FFA00/40
|
||||
MFP_INTACK <= '1' when nFB_CS2 = '0' and FB_ADR(26 downto 0) = x"20000" else '0'; --F002'0000
|
||||
LDS <= '1' when MFP_CS = '1' or MFP_INTACK = '1' else '0';
|
||||
FB_AD(23 downto 16) <= DATA_OUT_MFP when MFP_CS = '1' and nFB_OE = '0' else "ZZZZZZZZ";
|
||||
FB_AD(31 downto 10) <= "0000000000000000000000" when MFP_INTACK = '1' and nFB_OE = '0' else "ZZZZZZZZZZZZZZZZZZZZZZ";
|
||||
FB_AD(9 downto 2) <= DATA_OUT_MFP when MFP_INTACK = '1' and nFB_OE = '0' else "ZZZZZZZZ";
|
||||
FB_AD(1 downto 0) <= "00" when MFP_INTACK = '1' and nFB_OE = '0' else "ZZ";
|
||||
DINTn <= '0' when IDE_INT = '1' AND ACP_CONFIG[28] = '1' else
|
||||
'0' when FDINT = '1' else
|
||||
'0' when SCSI_INT = '1' AND ACP_CONFIG[28] = '1' else '1';
|
||||
-- TASTATUR UND KEYBOARD INTERRUPT: SPIKES AUSFILTERN ------------------------------------------
|
||||
process(MAIN_CLK,nRSTO,IRQ_ACIAn,IRQ_KEYBDn,IRQ_MIDIn)
|
||||
begin
|
||||
if nRSTO = '0' THEN
|
||||
IRQ_ACIAn <= '1';
|
||||
elsif rising_edge(MAIN_CLK) then
|
||||
IRQ_ACIAn <= IRQ_KEYBDn and IRQ_MIDIn;
|
||||
else
|
||||
IRQ_ACIAn <= IRQ_ACIAn;
|
||||
end if;
|
||||
END PROCESS;
|
||||
----------------------------------------------------------------------------
|
||||
-- Sound
|
||||
----------------------------------------------------------------------------
|
||||
I_SOUND: WF2149IP_TOP_SOC
|
||||
port map(
|
||||
SYS_CLK => MAIN_CLK,
|
||||
RESETn => nRSTO,
|
||||
|
||||
WAV_CLK => CLK2M,
|
||||
SELn => '1',
|
||||
|
||||
BDIR => SNDIR_I,
|
||||
BC2 => '1',
|
||||
BC1 => SNDCS_I,
|
||||
|
||||
A9n => '0',
|
||||
A8 => '1',
|
||||
DA_IN => FB_AD(31 downto 24),
|
||||
DA_OUT => DA_OUT_X,
|
||||
|
||||
IO_A_IN => x"00", -- All port pins are dedicated outputs.
|
||||
IO_A_OUT(7) => nnIDE_RES,
|
||||
IO_A_OUT(6) => LP_DIR_X,
|
||||
IO_A_OUT(5) => LP_STR,
|
||||
IO_A_OUT(4) => DTR,
|
||||
IO_A_OUT(3) => RTS,
|
||||
-- IO_A_OUT(2) => FDD_D1SEL,
|
||||
IO_A_OUT(1) => DSA_D,
|
||||
IO_A_OUT(0) => nSDSEL,
|
||||
-- IO_A_EN =>, -- Not required.
|
||||
IO_B_IN => LP_D,
|
||||
IO_B_OUT => LP_D_X,
|
||||
-- IO_B_EN => IO_B_EN,
|
||||
|
||||
OUT_A => YM_QA,
|
||||
OUT_B => YM_QB,
|
||||
OUT_C => YM_QC
|
||||
);
|
||||
|
||||
SNDCS <= '1' when nFB_CS1 = '0' and FB_ADR(19 downto 2) = x"3E200" else '0'; -- 8800-8803 F8800/4
|
||||
SNDCS_I <= '1' when SNDCS = '1' and FB_ADR (1 downto 1) = "0" else '0';
|
||||
SNDIR_I <= '1' when SNDCS = '1' and nFB_WR = '0' else '0';
|
||||
FB_AD(31 downto 24) <= DA_OUT_X when SNDCS_I = '1' and nFB_OE = '0' else "ZZZZZZZZ";
|
||||
LP_D <= LP_D_X when LP_DIR_X = '0' else "ZZZZZZZZ";
|
||||
LP_DIR <= LP_DIR_X;
|
||||
|
||||
END FalconIO_SDCard_IDE_CF_architecture;
|
||||
@@ -1,406 +0,0 @@
|
||||
----------------------------------------------------------------------
|
||||
---- ----
|
||||
---- Atari Coldfire IP Core ----
|
||||
---- ----
|
||||
---- This file is part of the Atari Coldfire project. ----
|
||||
---- http://www.experiment-s.de ----
|
||||
---- ----
|
||||
---- Description: ----
|
||||
---- ----
|
||||
---- ----
|
||||
---- ----
|
||||
---- ----
|
||||
---- ----
|
||||
---- Author(s): ----
|
||||
---- - Wolfgang Foerster, wf@experiment-s.de; wf@inventronik.de ----
|
||||
---- ----
|
||||
----------------------------------------------------------------------
|
||||
---- ----
|
||||
---- Copyright (C) 2009 Wolfgang Foerster ----
|
||||
---- ----
|
||||
---- This source file may be used and distributed without ----
|
||||
---- restriction provided that this copyright statement is not ----
|
||||
---- removed from the file and that any derivative work contains ----
|
||||
---- the original copyright notice and the associated disclaimer. ----
|
||||
---- ----
|
||||
---- This source file is free software; you can redistribute it ----
|
||||
---- and/or modify it under the terms of the GNU Lesser General ----
|
||||
---- Public License as published by the Free Software Foundation; ----
|
||||
---- either version 2.1 of the License, or (at your option) any ----
|
||||
---- later version. ----
|
||||
---- ----
|
||||
---- This source is distributed in the hope that it will be ----
|
||||
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
||||
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
||||
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
||||
---- details. ----
|
||||
---- ----
|
||||
---- You should have received a copy of the GNU Lesser General ----
|
||||
---- Public License along with this source; if not, download it ----
|
||||
---- from http://www.gnu.org/licenses/lgpl.html ----
|
||||
---- ----
|
||||
----------------------------------------------------------------------
|
||||
--
|
||||
-- Revision History
|
||||
-- 1.0 Initial Release, 20090925.
|
||||
--
|
||||
|
||||
library ieee;
|
||||
use ieee.std_logic_1164.all;
|
||||
|
||||
package FalconIO_SDCard_IDE_CF_PKG is
|
||||
component WF25915IP_TOP_V1_SOC -- GLUE.
|
||||
port (
|
||||
-- Clock system:
|
||||
GL_CLK : in std_logic; -- Originally 8MHz.
|
||||
GL_CLK_016 : in std_logic; -- One sixteenth of GL_CLK.
|
||||
|
||||
-- Core address select:
|
||||
GL_ROMSEL_FC_E0n : in std_logic;
|
||||
EN_RAM_14MB : in std_logic;
|
||||
-- Adress decoder outputs:
|
||||
GL_ROM_6n : out std_logic; -- STE.
|
||||
GL_ROM_5n : out std_logic; -- STE.
|
||||
GL_ROM_4n : out std_logic; -- ST.
|
||||
GL_ROM_3n : out std_logic; -- ST.
|
||||
GL_ROM_2n : out std_logic;
|
||||
GL_ROM_1n : out std_logic;
|
||||
GL_ROM_0n : out std_logic;
|
||||
|
||||
GL_ACIACS : out std_logic;
|
||||
GL_MFPCSn : out std_logic;
|
||||
GL_SNDCSn : out std_logic;
|
||||
GL_FCSn : out std_logic;
|
||||
|
||||
GL_STE_SNDCS : out std_logic; -- STE: Sound chip select.
|
||||
GL_STE_SNDIR : out std_logic; -- STE: Data flow direction control.
|
||||
|
||||
GL_STE_RTCCSn : out std_logic; --STE only.
|
||||
GL_STE_RTC_WRn : out std_logic; --STE only.
|
||||
GL_STE_RTC_RDn : out std_logic; --STE only.
|
||||
|
||||
-- 6800 peripheral control,
|
||||
GL_VPAn : out std_logic;
|
||||
GL_VMAn : in std_logic;
|
||||
|
||||
GL_DMA_SYNC : in std_logic;
|
||||
GL_DEVn : out std_logic;
|
||||
GL_RAMn : out std_logic;
|
||||
GL_DMAn : out std_logic;
|
||||
|
||||
-- Interrupt system:
|
||||
-- Comment out GL_AVECn for CPUs which do not provide the VMAn signal.
|
||||
GL_AVECn : out std_logic;
|
||||
GL_STE_FDINT : in std_logic; -- Floppy disk interrupt; STE only.
|
||||
GL_STE_HDINTn : in std_logic; -- Hard disk interrupt; STE only.
|
||||
GL_MFPINTn : in std_logic; -- ST.
|
||||
GL_STE_EINT3n : in std_logic; --STE only.
|
||||
GL_STE_EINT5n : in std_logic; --STE only.
|
||||
GL_STE_EINT7n : in std_logic; --STE only.
|
||||
GL_STE_DINTn : out std_logic; -- Disk interrupt (floppy or hard disk); STE only.
|
||||
GL_IACKn : out std_logic; -- ST.
|
||||
GL_STE_IPL2n : out std_logic; --STE only.
|
||||
GL_STE_IPL1n : out std_logic; --STE only.
|
||||
GL_STE_IPL0n : out std_logic; --STE only.
|
||||
|
||||
-- Video timing:
|
||||
GL_BLANKn : out std_logic;
|
||||
GL_DE : out std_logic;
|
||||
GL_MULTISYNC : in std_logic_vector(3 downto 2);
|
||||
GL_VIDEO_HIMODE : out std_logic;
|
||||
GL_HSYNC_INn : in std_logic;
|
||||
GL_HSYNC_OUTn : out std_logic;
|
||||
GL_VSYNC_INn : in std_logic;
|
||||
GL_VSYNC_OUTn : out std_logic;
|
||||
GL_SYNC_OUT_EN : out std_logic;
|
||||
|
||||
-- Bus arstd_logicration control:
|
||||
GL_RDY_INn : in std_logic;
|
||||
GL_RDY_OUTn : out std_logic;
|
||||
GL_BRn : out std_logic;
|
||||
GL_BGIn : in std_logic;
|
||||
GL_BGOn : out std_logic;
|
||||
GL_BGACK_INn : in std_logic;
|
||||
GL_BGACK_OUTn : out std_logic;
|
||||
|
||||
-- Adress and data bus:
|
||||
GL_ADDRESS : in std_logic_vector(23 downto 1);
|
||||
-- ST: put the data bus to 1 downto 0.
|
||||
-- STE: put the data out bus to 15 downto 0.
|
||||
GL_DATA_IN : in std_logic_vector(7 downto 0);
|
||||
GL_DATA_OUT : out std_logic_vector(15 downto 0);
|
||||
GL_DATA_EN : out std_logic;
|
||||
|
||||
-- Asynchronous bus control:
|
||||
GL_RWn_IN : in std_logic;
|
||||
GL_RWn_OUT : out std_logic;
|
||||
GL_AS_INn : in std_logic;
|
||||
GL_AS_OUTn : out std_logic;
|
||||
GL_UDS_INn : in std_logic;
|
||||
GL_UDS_OUTn : out std_logic;
|
||||
GL_LDS_INn : in std_logic;
|
||||
GL_LDS_OUTn : out std_logic;
|
||||
GL_DTACK_INn : in std_logic;
|
||||
GL_DTACK_OUTn : out std_logic;
|
||||
GL_CTRL_EN : out std_logic;
|
||||
|
||||
-- System control:
|
||||
GL_RESETn : in std_logic;
|
||||
GL_BERRn : out std_logic;
|
||||
|
||||
-- Processor function codes:
|
||||
GL_FC : in std_logic_vector(2 downto 0);
|
||||
|
||||
-- STE enhancements:
|
||||
GL_STE_FDDS : out std_logic; -- Floppy type select (HD or DD).
|
||||
GL_STE_FCCLK : out std_logic; -- Floppy controller clock select.
|
||||
GL_STE_JOY_RHn : out std_logic; -- Read only FF9202 high byte.
|
||||
GL_STE_JOY_RLn : out std_logic; -- Read only FF9202 low byte.
|
||||
GL_STE_JOY_WL : out std_logic; -- Write only FF9202 low byte.
|
||||
GL_STE_JOY_WEn : out std_logic; -- Write only FF9202 output enable.
|
||||
GL_STE_BUTTONn : out std_logic; -- Read only FF9000 low byte.
|
||||
GL_STE_PAD0Xn : in std_logic; -- Counter input for the Paddle 0X.
|
||||
GL_STE_PAD0Yn : in std_logic; -- Counter input for the Paddle 0Y.
|
||||
GL_STE_PAD1Xn : in std_logic; -- Counter input for the Paddle 1X.
|
||||
GL_STE_PAD1Yn : in std_logic; -- Counter input for the Paddle 1Y.
|
||||
GL_STE_PADRSTn : out std_logic; -- Paddle monoflops reset.
|
||||
GL_STE_PENn : in std_logic; -- Input of the light pen.
|
||||
GL_STE_SCCn : out std_logic; -- Select signal for the STE or TT SCC chip.
|
||||
GL_STE_CPROGn : out std_logic -- Select signal for the STE's cache processor.
|
||||
);
|
||||
end component WF25915IP_TOP_V1_SOC;
|
||||
|
||||
component WF5380_TOP_SOC
|
||||
port (
|
||||
CLK : in std_logic;
|
||||
RESETn : in std_logic;
|
||||
ADR : in std_logic_vector(2 downto 0);
|
||||
DATA_IN : in std_logic_vector(7 downto 0);
|
||||
DATA_OUT : out std_logic_vector(7 downto 0);
|
||||
DATA_EN : out std_logic;
|
||||
CSn : in std_logic;
|
||||
RDn : in std_logic;
|
||||
WRn : in std_logic;
|
||||
EOPn : in std_logic;
|
||||
DACKn : in std_logic;
|
||||
DRQ : out std_logic;
|
||||
INT : out std_logic;
|
||||
READY : out std_logic;
|
||||
DB_INn : in std_logic_vector(7 downto 0);
|
||||
DB_OUTn : out std_logic_vector(7 downto 0);
|
||||
DB_EN : out std_logic;
|
||||
DBP_INn : in std_logic;
|
||||
DBP_OUTn : out std_logic;
|
||||
DBP_EN : out std_logic;
|
||||
RST_INn : in std_logic;
|
||||
RST_OUTn : out std_logic;
|
||||
RST_EN : out std_logic;
|
||||
BSY_INn : in std_logic;
|
||||
BSY_OUTn : out std_logic;
|
||||
BSY_EN : out std_logic;
|
||||
SEL_INn : in std_logic;
|
||||
SEL_OUTn : out std_logic;
|
||||
SEL_EN : out std_logic;
|
||||
ACK_INn : in std_logic;
|
||||
ACK_OUTn : out std_logic;
|
||||
ACK_EN : out std_logic;
|
||||
ATN_INn : in std_logic;
|
||||
ATN_OUTn : out std_logic;
|
||||
ATN_EN : out std_logic;
|
||||
REQ_INn : in std_logic;
|
||||
REQ_OUTn : out std_logic;
|
||||
REQ_EN : out std_logic;
|
||||
IOn_IN : in std_logic;
|
||||
IOn_OUT : out std_logic;
|
||||
IO_EN : out std_logic;
|
||||
CDn_IN : in std_logic;
|
||||
CDn_OUT : out std_logic;
|
||||
CD_EN : out std_logic;
|
||||
MSG_INn : in std_logic;
|
||||
MSG_OUTn : out std_logic;
|
||||
MSG_EN : out std_logic
|
||||
);
|
||||
end component WF5380_TOP_SOC;
|
||||
|
||||
component WF1772IP_TOP_SOC -- FDC.
|
||||
port (
|
||||
CLK : in std_logic; -- 16MHz clock!
|
||||
RESETn : in std_logic;
|
||||
CSn : in std_logic;
|
||||
RWn : in std_logic;
|
||||
A1, A0 : in std_logic;
|
||||
DATA_IN : in std_logic_vector(7 downto 0);
|
||||
DATA_OUT : out std_logic_vector(7 downto 0);
|
||||
DATA_EN : out std_logic;
|
||||
RDn : in std_logic;
|
||||
TR00n : in std_logic;
|
||||
IPn : in std_logic;
|
||||
WPRTn : in std_logic;
|
||||
DDEn : in std_logic;
|
||||
HDTYPE : in std_logic; -- '0' = DD disks, '1' = HD disks.
|
||||
MO : out std_logic;
|
||||
WG : out std_logic;
|
||||
WD : out std_logic;
|
||||
STEP : out std_logic;
|
||||
DIRC : out std_logic;
|
||||
DRQ : out std_logic;
|
||||
INTRQ : out std_logic
|
||||
);
|
||||
end component WF1772IP_TOP_SOC;
|
||||
|
||||
component WF68901IP_TOP_SOC -- MFP.
|
||||
port ( -- System control:
|
||||
CLK : in std_logic;
|
||||
RESETn : in std_logic;
|
||||
|
||||
-- Asynchronous bus control:
|
||||
DSn : in std_logic;
|
||||
CSn : in std_logic;
|
||||
RWn : in std_logic;
|
||||
DTACKn : out std_logic;
|
||||
|
||||
-- Data and Adresses:
|
||||
RS : in std_logic_vector(5 downto 1);
|
||||
DATA_IN : in std_logic_vector(7 downto 0);
|
||||
DATA_OUT : out std_logic_vector(7 downto 0);
|
||||
DATA_EN : out std_logic;
|
||||
GPIP_IN : in std_logic_vector(7 downto 0);
|
||||
GPIP_OUT : out std_logic_vector(7 downto 0);
|
||||
GPIP_EN : out std_logic_vector(7 downto 0);
|
||||
|
||||
-- Interrupt control:
|
||||
IACKn : in std_logic;
|
||||
IEIn : in std_logic;
|
||||
IEOn : out std_logic;
|
||||
IRQn : out std_logic;
|
||||
|
||||
-- Timers and timer control:
|
||||
XTAL1 : in std_logic; -- Use an oszillator instead of a quartz.
|
||||
TAI : in std_logic;
|
||||
TBI : in std_logic;
|
||||
TAO : out std_logic;
|
||||
TBO : out std_logic;
|
||||
TCO : out std_logic;
|
||||
TDO : out std_logic;
|
||||
|
||||
-- Serial I/O control:
|
||||
RC : in std_logic;
|
||||
TC : in std_logic;
|
||||
SI : in std_logic;
|
||||
SO : out std_logic;
|
||||
SO_EN : out std_logic;
|
||||
|
||||
-- DMA control:
|
||||
RRn : out std_logic;
|
||||
TRn : out std_logic
|
||||
);
|
||||
end component WF68901IP_TOP_SOC;
|
||||
|
||||
component WF2149IP_TOP_SOC -- Sound.
|
||||
port(
|
||||
|
||||
SYS_CLK : in std_logic; -- Read the inforation in the header!
|
||||
RESETn : in std_logic;
|
||||
|
||||
WAV_CLK : in std_logic; -- Read the inforation in the header!
|
||||
SELn : in std_logic;
|
||||
|
||||
BDIR : in std_logic;
|
||||
BC2, BC1 : in std_logic;
|
||||
|
||||
A9n, A8 : in std_logic;
|
||||
DA_IN : in std_logic_vector(7 downto 0);
|
||||
DA_OUT : out std_logic_vector(7 downto 0);
|
||||
DA_EN : out std_logic;
|
||||
|
||||
IO_A_IN : in std_logic_vector(7 downto 0);
|
||||
IO_A_OUT : out std_logic_vector(7 downto 0);
|
||||
IO_A_EN : out std_logic;
|
||||
IO_B_IN : in std_logic_vector(7 downto 0);
|
||||
IO_B_OUT : out std_logic_vector(7 downto 0);
|
||||
IO_B_EN : out std_logic;
|
||||
|
||||
OUT_A : out std_logic; -- Analog (PWM) outputs.
|
||||
OUT_B : out std_logic;
|
||||
OUT_C : out std_logic
|
||||
);
|
||||
end component WF2149IP_TOP_SOC;
|
||||
|
||||
component WF6850IP_TOP_SOC -- ACIA.
|
||||
port (
|
||||
CLK : in std_logic;
|
||||
RESETn : in std_logic;
|
||||
|
||||
CS2n, CS1, CS0 : in std_logic;
|
||||
E : in std_logic;
|
||||
RWn : in std_logic;
|
||||
RS : in std_logic;
|
||||
|
||||
DATA_IN : in std_logic_vector(7 downto 0);
|
||||
DATA_OUT : out std_logic_vector(7 downto 0);
|
||||
DATA_EN : out std_logic;
|
||||
|
||||
TXCLK : in std_logic;
|
||||
RXCLK : in std_logic;
|
||||
RXDATA : in std_logic;
|
||||
CTSn : in std_logic;
|
||||
DCDn : in std_logic;
|
||||
|
||||
IRQn : out std_logic;
|
||||
TXDATA : out std_logic;
|
||||
RTSn : out std_logic
|
||||
);
|
||||
end component WF6850IP_TOP_SOC;
|
||||
|
||||
component WF_SD_CARD
|
||||
port (
|
||||
RESETn : in std_logic;
|
||||
CLK : in std_logic;
|
||||
ACSI_A1 : in std_logic;
|
||||
ACSI_CSn : in std_logic;
|
||||
ACSI_ACKn : in std_logic;
|
||||
ACSI_INTn : out std_logic;
|
||||
ACSI_DRQn : out std_logic;
|
||||
ACSI_D_IN : in std_logic_vector(7 downto 0);
|
||||
ACSI_D_OUT : out std_logic_vector(7 downto 0);
|
||||
ACSI_D_EN : out std_logic;
|
||||
MC_DO : in std_logic;
|
||||
MC_PIO_DMAn : in std_logic;
|
||||
MC_RWn : in std_logic;
|
||||
MC_CLR_CMD : in std_logic;
|
||||
MC_DONE : out std_logic;
|
||||
MC_GOT_CMD : out std_logic;
|
||||
MC_D_IN : in std_logic_vector(7 downto 0);
|
||||
MC_D_OUT : out std_logic_vector(7 downto 0);
|
||||
MC_D_EN : out std_logic
|
||||
);
|
||||
end component WF_SD_CARD;
|
||||
|
||||
component dcfifo0
|
||||
PORT (
|
||||
aclr : IN STD_LOGIC ;
|
||||
data : IN STD_LOGIC_VECTOR (7 DOWNTO 0);
|
||||
rdclk : IN STD_LOGIC ;
|
||||
rdreq : IN STD_LOGIC ;
|
||||
wrclk : IN STD_LOGIC ;
|
||||
wrreq : IN STD_LOGIC ;
|
||||
q : OUT STD_LOGIC_VECTOR (31 DOWNTO 0);
|
||||
wrusedw : OUT STD_LOGIC_VECTOR (5 DOWNTO 0)
|
||||
);
|
||||
end component dcfifo0;
|
||||
|
||||
component dcfifo1
|
||||
PORT (
|
||||
aclr : IN STD_LOGIC ;
|
||||
data : IN STD_LOGIC_VECTOR (31 DOWNTO 0);
|
||||
rdclk : IN STD_LOGIC ;
|
||||
rdreq : IN STD_LOGIC ;
|
||||
wrclk : IN STD_LOGIC ;
|
||||
wrreq : IN STD_LOGIC ;
|
||||
q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
|
||||
rdusedw : OUT STD_LOGIC_VECTOR (5 DOWNTO 0)
|
||||
);
|
||||
end component;
|
||||
|
||||
|
||||
end FalconIO_SDCard_IDE_CF_PKG;
|
||||
@@ -1,239 +0,0 @@
|
||||
----------------------------------------------------------------------
|
||||
---- ----
|
||||
---- ATARI IP Core peripheral Add-On ----
|
||||
---- ----
|
||||
---- This file is part of the FPGA-ATARI project. ----
|
||||
---- http://www.experiment-s.de ----
|
||||
---- ----
|
||||
---- Description: ----
|
||||
---- This hardware provides an interface to connect to a SD-Card. ----
|
||||
---- ----
|
||||
---- This interface is based on the project 'SatanDisk' of ----
|
||||
---- Miroslav Nohaj 'Jookie'. The code is an interpretation of ----
|
||||
---- the original code, written in VERILOG. It is provided for ----
|
||||
---- the use in a system on programmable chips (SOPC). ----
|
||||
---- ----
|
||||
---- Timing: Use a clock frequency of 16MHz for this component. ----
|
||||
---- Use the same clock frequency for the connected AVR ----
|
||||
---- microcontroller. ----
|
||||
---- ----
|
||||
---- To Do: ----
|
||||
---- - ----
|
||||
---- ----
|
||||
---- Author(s): ----
|
||||
---- - Wolfgang Foerster, wf@experiment-s.de; wf@inventronik.de ----
|
||||
---- ----
|
||||
----------------------------------------------------------------------
|
||||
---- ----
|
||||
---- Copyright (C) 2007 - 2008 Wolfgang Foerster ----
|
||||
---- ----
|
||||
---- This source file may be used and distributed without ----
|
||||
---- restriction provided that this copyright statement is not ----
|
||||
---- removed from the file and that any derivative work contains ----
|
||||
---- the original copyright notice and the associated disclaimer. ----
|
||||
---- ----
|
||||
---- This source file is free software; you can redistribute it ----
|
||||
---- and/or modify it under the terms of the GNU Lesser General ----
|
||||
---- Public License as published by the Free Software Foundation; ----
|
||||
---- either version 2.1 of the License, or (at your option) any ----
|
||||
---- later version. ----
|
||||
---- ----
|
||||
---- This source is distributed in the hope that it will be ----
|
||||
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
||||
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
||||
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
||||
---- details. ----
|
||||
---- ----
|
||||
---- You should have received a copy of the GNU Lesser General ----
|
||||
---- Public License along with this source; if not, download it ----
|
||||
---- from http://www.gnu.org/licenses/lgpl.html ----
|
||||
---- ----
|
||||
----------------------------------------------------------------------
|
||||
---- This hardware works with the original ATARI ----
|
||||
---- hard dik driver. ----
|
||||
----------------------------------------------------------------------
|
||||
--
|
||||
-- Revision History
|
||||
--
|
||||
-- Revision 2K7A 2007/01/05 WF
|
||||
-- Initial Release.
|
||||
-- Revision 2K8A 2008/07/14 WF
|
||||
-- Minor changes.
|
||||
--
|
||||
library ieee;
|
||||
use ieee.std_logic_1164.all;
|
||||
use ieee.std_logic_unsigned.all;
|
||||
|
||||
entity WF_SD_CARD is
|
||||
port (
|
||||
-- System:
|
||||
RESETn : in bit;
|
||||
CLK : in bit; -- 16MHz, see above.
|
||||
|
||||
-- ACSI section:
|
||||
ACSI_A1 : in bit;
|
||||
ACSI_CSn : in bit;
|
||||
ACSI_ACKn : in bit;
|
||||
ACSI_INTn : out bit;
|
||||
ACSI_DRQn : out bit;
|
||||
ACSI_D_IN : in std_logic_vector(7 downto 0);
|
||||
ACSI_D_OUT : out std_logic_vector(7 downto 0);
|
||||
ACSI_D_EN : out bit;
|
||||
|
||||
-- Microcontroller interface:
|
||||
MC_DO : in bit;
|
||||
MC_PIO_DMAn : in bit;
|
||||
MC_RWn : in bit;
|
||||
MC_CLR_CMD : in bit;
|
||||
MC_DONE : out bit;
|
||||
MC_GOT_CMD : out bit;
|
||||
MC_D_IN : in std_logic_vector(7 downto 0);
|
||||
MC_D_OUT : out std_logic_vector(7 downto 0);
|
||||
MC_D_EN : out bit
|
||||
);
|
||||
end WF_SD_CARD;
|
||||
|
||||
architecture BEHAVIOR of WF_SD_CARD is
|
||||
signal DATA_REG : std_logic_vector(7 downto 0);
|
||||
signal D0_REG : bit;
|
||||
signal INT_REG : bit;
|
||||
signal DRQ_REG : bit;
|
||||
signal DONE_REG : bit;
|
||||
signal GOT_CMD_REG : bit;
|
||||
signal HOLD : bit;
|
||||
signal PREV_CSn : bit;
|
||||
signal PREV_ACKn : bit;
|
||||
begin
|
||||
MC_D_OUT <= DATA_REG when MC_RWn = '0' and DONE_REG = '1' else (others => '0');
|
||||
MC_D_EN <= '1' when MC_RWn = '0' and DONE_REG = '1' else '0';
|
||||
ACSI_D_OUT <= DATA_REG when MC_RWn = '1' and (ACSI_CSn = '0' or ACSI_ACKn = '0' or HOLD = '1') else (others => '0');
|
||||
-- ???:
|
||||
--ACSI_D_EN <= '1' when MC_RWn = '1' and (ACSI_CSn = '0' or ACSI_ACKn = '0' or HOLD = '1') else '0';
|
||||
ACSI_D_EN <= '0';
|
||||
ACSI_INTn <= INT_REG;
|
||||
ACSI_DRQn <= DRQ_REG;
|
||||
MC_DONE <= DONE_REG;
|
||||
MC_GOT_CMD <= GOT_CMD_REG;
|
||||
|
||||
P_DATA: process(RESETn, CLK)
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
DATA_REG <= (others => '0');
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if D0_REG = '0' and MC_DO = '1' and MC_RWn = '1' then
|
||||
DATA_REG <= MC_D_IN; -- Read from AVR to ACSI.
|
||||
end if;
|
||||
--
|
||||
if PREV_CSn = '0' and ACSI_CSn = '0' and MC_RWn = '0' and DONE_REG = '0' then
|
||||
DATA_REG <= ACSI_D_IN; -- Write from ACSI to AVR.
|
||||
elsif PREV_ACKn = '0' and ACSI_ACKn = '0' and MC_RWn = '0' and DONE_REG = '0' then
|
||||
DATA_REG <= ACSI_D_IN; -- Write from ACSI to AVR.
|
||||
end if;
|
||||
end if;
|
||||
end process P_DATA;
|
||||
|
||||
P_SYNC: process
|
||||
begin
|
||||
wait until CLK = '1' and CLK' event;
|
||||
PREV_CSn <= ACSI_CSn;
|
||||
PREV_ACKn <= ACSI_ACKn;
|
||||
end process P_SYNC;
|
||||
|
||||
P_INT_DRQ: process(RESETn, CLK)
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
INT_REG <= '1'; -- No interrupt.
|
||||
DRQ_REG <= '1'; -- No data request.
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if D0_REG = '0' and MC_DO = '1' and MC_PIO_DMAn = '1' then -- Positive MC_DO edge.
|
||||
INT_REG <= '0'; -- Release an interrupt.
|
||||
DRQ_REG <= '1';
|
||||
elsif D0_REG = '0' and MC_DO = '1' then
|
||||
INT_REG <= '1';
|
||||
DRQ_REG <= '0'; -- Release a data request.
|
||||
end if;
|
||||
--
|
||||
if MC_CLR_CMD = '1' then -- Clear done.
|
||||
INT_REG <= '1'; -- Restore INT_REG.
|
||||
DRQ_REG <= '1'; -- Restore DRQ_REG.
|
||||
end if;
|
||||
--
|
||||
if (PREV_CSn = '0' and ACSI_CSn = '0') or (PREV_ACKn = '0' and ACSI_ACKn = '0') then
|
||||
if ACSI_CSn = '0' then
|
||||
INT_REG <= '1';
|
||||
end if;
|
||||
--
|
||||
if ACSI_ACKn = '0' then
|
||||
DRQ_REG <= '1';
|
||||
end if;
|
||||
end if;
|
||||
end if;
|
||||
end process P_INT_DRQ;
|
||||
|
||||
P_HOLD: process(RESETn, CLK)
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
HOLD <= '0';
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if (PREV_CSn = '0' and ACSI_CSn = '0') or (PREV_ACKn = '0' and ACSI_ACKn = '0') then
|
||||
HOLD <= '1';
|
||||
elsif PREV_CSn = '1' and ACSI_CSn = '1' then -- If signal is high.
|
||||
HOLD <= '0';
|
||||
elsif PREV_ACKn = '1' and ACSI_ACKn = '1' then -- If signal is high.
|
||||
HOLD <= '0';
|
||||
elsif PREV_CSn = '0' and ACSI_CSn = '1' then -- Rising edge.
|
||||
HOLD <= '1';
|
||||
elsif PREV_ACKn = '0' and ACSI_ACKn = '1' then -- Rising edge.
|
||||
HOLD <= '1';
|
||||
elsif MC_CLR_CMD = '1' then -- Clear done.
|
||||
HOLD <= '0';
|
||||
end if;
|
||||
end if;
|
||||
end process P_HOLD;
|
||||
|
||||
P_DONE: process(RESETn, CLK)
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
DONE_REG <= '0';
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if (PREV_CSn = '0' and ACSI_CSn = '0') or (PREV_ACKn = '0' and ACSI_ACKn = '0') then
|
||||
DONE_REG <= '1';
|
||||
elsif MC_CLR_CMD = '1' then -- Clear done.
|
||||
DONE_REG <= '0';
|
||||
elsif D0_REG = '0' and MC_DO = '1' then -- Positive MC_DO edge.
|
||||
DONE_REG <= '0';
|
||||
elsif D0_REG = '1' and MC_DO = '0' then -- Negative MC_DO edge.
|
||||
DONE_REG <= '0';
|
||||
end if;
|
||||
end if;
|
||||
end process P_DONE;
|
||||
|
||||
P_DO_REG: process(RESETn, CLK)
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
D0_REG <= '0';
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if D0_REG = '0' and MC_DO = '1' then -- Positive MC_DO edge.
|
||||
D0_REG <= MC_DO;
|
||||
elsif D0_REG = '1' and MC_DO = '0' then -- Negative MC_DO edge.
|
||||
D0_REG <= MC_DO;
|
||||
end if;
|
||||
end if;
|
||||
end process P_DO_REG;
|
||||
|
||||
P_GOT_CMD: process(RESETn, CLK)
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
GOT_CMD_REG <= '0';
|
||||
elsif CLK = '1' and CLK' event then
|
||||
-- ?? ACSI_CSn doppelt!
|
||||
--if PREV_CSn = '0' and ACSI_CSn = '0' and ACSI_CSn = '0' and ACSI_A1 = '0' then
|
||||
GOT_CMD_REG <= '1'; -- If command was received.
|
||||
elsif PREV_ACKn = '0' and ACSI_ACKn = '0' and ACSI_CSn = '0' and ACSI_A1 = '0' then
|
||||
GOT_CMD_REG <= '1'; -- If command was received.
|
||||
elsif MC_CLR_CMD = '1' then -- Clear done.
|
||||
GOT_CMD_REG <= '0';
|
||||
end if;
|
||||
end if;
|
||||
end process P_GOT_CMD;
|
||||
end architecture BEHAVIOR;
|
||||
@@ -1,244 +0,0 @@
|
||||
----------------------------------------------------------------------
|
||||
---- ----
|
||||
---- 6850 compatible IP Core ----
|
||||
---- ----
|
||||
---- This file is part of the SUSKA ATARI clone project. ----
|
||||
---- http://www.experiment-s.de ----
|
||||
---- ----
|
||||
---- Description: ----
|
||||
---- UART 6850 compatible IP core ----
|
||||
---- ----
|
||||
---- Control unit and status logic. ----
|
||||
---- ----
|
||||
---- ----
|
||||
---- To Do: ----
|
||||
---- - ----
|
||||
---- ----
|
||||
---- Author(s): ----
|
||||
---- - Wolfgang Foerster, wf@experiment-s.de; wf@inventronik.de ----
|
||||
---- ----
|
||||
----------------------------------------------------------------------
|
||||
---- ----
|
||||
---- Copyright (C) 2006 - 2008 Wolfgang Foerster ----
|
||||
---- ----
|
||||
---- This source file may be used and distributed without ----
|
||||
---- restriction provided that this copyright statement is not ----
|
||||
---- removed from the file and that any derivative work contains ----
|
||||
---- the original copyright notice and the associated disclaimer. ----
|
||||
---- ----
|
||||
---- This source file is free software; you can redistribute it ----
|
||||
---- and/or modify it under the terms of the GNU Lesser General ----
|
||||
---- Public License as published by the Free Software Foundation; ----
|
||||
---- either version 2.1 of the License, or (at your option) any ----
|
||||
---- later version. ----
|
||||
---- ----
|
||||
---- This source is distributed in the hope that it will be ----
|
||||
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
||||
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
||||
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
||||
---- details. ----
|
||||
---- ----
|
||||
---- You should have received a copy of the GNU Lesser General ----
|
||||
---- Public License along with this source; if not, download it ----
|
||||
---- from http://www.gnu.org/licenses/lgpl.html ----
|
||||
---- ----
|
||||
----------------------------------------------------------------------
|
||||
--
|
||||
-- Revision History
|
||||
--
|
||||
-- Revision 2K6A 2006/06/03 WF
|
||||
-- Initial Release.
|
||||
-- Revision 2K6B 2006/11/07 WF
|
||||
-- Modified Source to compile with the Xilinx ISE.
|
||||
-- Revision 2K8A 2008/07/14 WF
|
||||
-- Minor changes.
|
||||
-- Revision 2K9A 2009/06/20 WF
|
||||
-- CTRL_REG has now synchronous reset to meet preset requirements.
|
||||
-- Process P_DCD has now synchronous reset to meet preset requirements.
|
||||
-- IRQ_In has now synchronous reset to meet preset requirement.
|
||||
-- Revision 2K9B 2009/12/24 WF
|
||||
-- Fixed the interrupt logic.
|
||||
-- Introduced a minor RTSn correction.
|
||||
--
|
||||
|
||||
library ieee;
|
||||
use ieee.std_logic_1164.all;
|
||||
use ieee.std_logic_unsigned.all;
|
||||
|
||||
entity WF6850IP_CTRL_STATUS is
|
||||
port (
|
||||
CLK : in bit;
|
||||
RESETn : in bit;
|
||||
|
||||
CS : in bit_vector(2 downto 0); -- Active if "011".
|
||||
E : in bit;
|
||||
RWn : in bit;
|
||||
RS : in bit;
|
||||
|
||||
DATA_IN : in bit_vector(7 downto 0);
|
||||
DATA_OUT : out bit_vector(7 downto 0);
|
||||
DATA_EN : out bit;
|
||||
|
||||
-- Status register stuff:
|
||||
RDRF : in bit; -- Receive data register full.
|
||||
TDRE : in bit; -- Transmit data register empty.
|
||||
DCDn : in bit; -- Data carrier detect.
|
||||
CTSn : in bit; -- Clear to send.
|
||||
FE : in bit; -- Framing error.
|
||||
OVR : in bit; -- Overrun error.
|
||||
PE : in bit; -- Parity error.
|
||||
|
||||
-- Control register stuff:
|
||||
MCLR : buffer bit; -- Master clear (high active).
|
||||
RTSn : out bit; -- Request to send.
|
||||
CDS : out bit_vector(1 downto 0); -- Clock control.
|
||||
WS : out bit_vector(2 downto 0); -- Word select.
|
||||
TC : out bit_vector(1 downto 0); -- Transmit control.
|
||||
IRQn : out bit -- Interrupt request.
|
||||
);
|
||||
end entity WF6850IP_CTRL_STATUS;
|
||||
|
||||
architecture BEHAVIOR of WF6850IP_CTRL_STATUS is
|
||||
signal CTRL_REG : bit_vector(7 downto 0);
|
||||
signal STATUS_REG : bit_vector(7 downto 0);
|
||||
signal RIE : bit;
|
||||
signal IRQ_I : bit;
|
||||
signal CTS_In : bit;
|
||||
signal DCD_In : bit;
|
||||
signal DCD_FLAGn : bit;
|
||||
begin
|
||||
P_SAMPLE: process
|
||||
begin
|
||||
wait until CLK = '0' and CLK' event;
|
||||
CTS_In <= CTSn; -- Sample CTSn on the negative clock edge.
|
||||
DCD_In <= DCDn; -- Sample DCDn on the negative clock edge.
|
||||
end process P_SAMPLE;
|
||||
|
||||
STATUS_REG(7) <= IRQ_I;
|
||||
STATUS_REG(6) <= PE;
|
||||
STATUS_REG(5) <= OVR;
|
||||
STATUS_REG(4) <= FE;
|
||||
STATUS_REG(3) <= CTS_In; -- Reflexion of the input pin.
|
||||
STATUS_REG(2) <= DCD_FLAGn;
|
||||
STATUS_REG(1) <= TDRE and not CTS_In; -- No TDRE for CTSn = '1'.
|
||||
STATUS_REG(0) <= RDRF and not DCD_In; -- DCDn = '1' indicates empty.
|
||||
|
||||
DATA_OUT <= STATUS_REG when CS = "011" and RWn = '1' and RS = '0' and E = '1' else (others => '0');
|
||||
DATA_EN <= '1' when CS = "011" and RWn = '1' and RS = '0' and E = '1' else '0';
|
||||
|
||||
MCLR <= '1' when CTRL_REG(1 downto 0) = "11" else '0';
|
||||
RTSn <= '0' when CTRL_REG(6 downto 5) /= "10" else '1';
|
||||
|
||||
CDS <= CTRL_REG(1 downto 0);
|
||||
WS <= CTRL_REG(4 downto 2);
|
||||
TC <= CTRL_REG(6 downto 5);
|
||||
RIE <= CTRL_REG(7);
|
||||
|
||||
P_IRQ: process
|
||||
variable DCD_OVR_LOCK : boolean;
|
||||
variable DCD_LOCK : boolean;
|
||||
variable DCD_TRANS : boolean;
|
||||
begin
|
||||
wait until CLK = '1' and CLK' event;
|
||||
if RESETn = '0' then
|
||||
DCD_OVR_LOCK := false;
|
||||
IRQn <= '1';
|
||||
IRQ_I <= '0';
|
||||
elsif CS = "011" and RWn = '1' and RS = '0' and E = '1' then
|
||||
DCD_OVR_LOCK := false; -- Enable reset by reading the status.
|
||||
end if;
|
||||
|
||||
-- Clear interrupts when disabled.
|
||||
if CTRL_REG(7) = '0' then
|
||||
IRQn <= '1';
|
||||
IRQ_I <= '0';
|
||||
elsif CTRL_REG(6 downto 5) /= "01" then
|
||||
IRQn <= '1';
|
||||
IRQ_I <= '0';
|
||||
end if;
|
||||
|
||||
-- Transmitter interrupt:
|
||||
if TDRE = '1' and CTRL_REG(6 downto 5) = "01" and CTS_In = '0' then
|
||||
IRQn <= '0';
|
||||
IRQ_I <= '1';
|
||||
elsif CS = "011" and RWn = '0' and RS = '1' and E = '1' then
|
||||
IRQn <= '1'; -- Clear by writing to the transmit data register.
|
||||
end if;
|
||||
|
||||
-- Receiver interrupts:
|
||||
if RDRF = '1' and RIE = '1' and DCD_In = '0' then
|
||||
IRQn <= '0';
|
||||
IRQ_I <= '1';
|
||||
elsif CS = "011" and RWn = '1' and RS = '1' and E = '1' then
|
||||
IRQn <= '1'; -- Clear by reading the receive data register.
|
||||
end if;
|
||||
|
||||
if OVR = '1' and RIE = '1' then
|
||||
IRQn <= '0';
|
||||
IRQ_I <= '1';
|
||||
DCD_OVR_LOCK := true;
|
||||
elsif CS = "011" and RWn = '1' and RS = '1' and E = '1' and DCD_OVR_LOCK = false then
|
||||
IRQn <= '1'; -- Clear by reading the receive data register after the status.
|
||||
end if;
|
||||
|
||||
if DCD_In = '1' and RIE = '1' and DCD_TRANS = false then
|
||||
IRQn <= '0';
|
||||
IRQ_I <= '1';
|
||||
-- DCD_TRANS is used to detect a low to high transition of DCDn.
|
||||
DCD_TRANS := true;
|
||||
DCD_OVR_LOCK := true;
|
||||
elsif CS = "011" and RWn = '1' and RS = '1' and E = '1' and DCD_OVR_LOCK = false then
|
||||
IRQn <= '1'; -- Clear by reading the receive data register after the status.
|
||||
elsif DCD_In = '0' then
|
||||
DCD_TRANS := false;
|
||||
end if;
|
||||
|
||||
-- The reset of the IRQ status flag:
|
||||
-- Clear by writing to the transmit data register.
|
||||
-- Clear by reading the receive data register.
|
||||
if CS = "011" and RS = '1' and E = '1' then
|
||||
IRQ_I <= '0';
|
||||
end if;
|
||||
end process P_IRQ;
|
||||
|
||||
CONTROL: process
|
||||
begin
|
||||
wait until CLK = '1' and CLK' event;
|
||||
if RESETn = '0' then
|
||||
CTRL_REG <= "01000000";
|
||||
elsif CS = "011" and RWn = '0' and RS = '0' and E = '1' then
|
||||
CTRL_REG <= DATA_IN;
|
||||
end if;
|
||||
end process CONTROL;
|
||||
|
||||
P_DCD: process
|
||||
-- This process is some kind of tricky. Refer to the MC6850 data
|
||||
-- sheet for more information.
|
||||
variable READ_LOCK : boolean;
|
||||
variable DCD_RELEASE : boolean;
|
||||
begin
|
||||
wait until CLK = '1' and CLK' event;
|
||||
if RESETn = '0' then
|
||||
DCD_FLAGn <= '0'; -- This interrupt source must initialise low.
|
||||
READ_LOCK := true;
|
||||
DCD_RELEASE := false;
|
||||
elsif MCLR = '1' then
|
||||
DCD_FLAGn <= DCD_In;
|
||||
READ_LOCK := true;
|
||||
elsif DCD_In = '1' then
|
||||
DCD_FLAGn <= '1';
|
||||
elsif CS = "011" and RWn = '1' and RS = '0' and E = '1' then
|
||||
READ_LOCK := false; -- Un-READ_LOCK if receiver data register is read.
|
||||
elsif CS = "011" and RWn = '1' and RS = '1' and E = '1' and READ_LOCK = false then
|
||||
-- Clear if receiver status register read access.
|
||||
-- After data register has ben read and READ_LOCK again.
|
||||
DCD_RELEASE := true;
|
||||
READ_LOCK := true;
|
||||
DCD_FLAGn <= DCD_In;
|
||||
elsif DCD_In = '0' and DCD_RELEASE = true then
|
||||
DCD_FLAGn <= '0';
|
||||
DCD_RELEASE := false;
|
||||
end if;
|
||||
end process P_DCD;
|
||||
end architecture BEHAVIOR;
|
||||
|
||||
@@ -1,415 +0,0 @@
|
||||
----------------------------------------------------------------------
|
||||
---- ----
|
||||
---- 6850 compatible IP Core ----
|
||||
---- ----
|
||||
---- This file is part of the SUSKA ATARI clone project. ----
|
||||
---- http://www.experiment-s.de ----
|
||||
---- ----
|
||||
---- Description: ----
|
||||
---- UART 6850 compatible IP core ----
|
||||
---- ----
|
||||
---- 6850's receiver unit. ----
|
||||
---- ----
|
||||
---- ----
|
||||
---- To Do: ----
|
||||
---- - ----
|
||||
---- ----
|
||||
---- Author(s): ----
|
||||
---- - Wolfgang Foerster, wf@experiment-s.de; wf@inventronik.de ----
|
||||
---- ----
|
||||
----------------------------------------------------------------------
|
||||
---- ----
|
||||
---- Copyright (C) 2006 Wolfgang Foerster ----
|
||||
---- ----
|
||||
---- This source file may be used and distributed without ----
|
||||
---- restriction provided that this copyright statement is not ----
|
||||
---- removed from the file and that any derivative work contains ----
|
||||
---- the original copyright notice and the associated disclaimer. ----
|
||||
---- ----
|
||||
---- This source file is free software; you can redistribute it ----
|
||||
---- and/or modify it under the terms of the GNU Lesser General ----
|
||||
---- Public License as published by the Free Software Foundation; ----
|
||||
---- either version 2.1 of the License, or (at your option) any ----
|
||||
---- later version. ----
|
||||
---- ----
|
||||
---- This source is distributed in the hope that it will be ----
|
||||
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
||||
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
||||
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
||||
---- details. ----
|
||||
---- ----
|
||||
---- You should have received a copy of the GNU Lesser General ----
|
||||
---- Public License along with this source; if not, download it ----
|
||||
---- from http://www.gnu.org/licenses/lgpl.html ----
|
||||
---- ----
|
||||
----------------------------------------------------------------------
|
||||
--
|
||||
-- Revision History
|
||||
--
|
||||
-- Revision 2K6A 2006/06/03 WF
|
||||
-- Initial Release.
|
||||
-- Revision 2K6B 2006/11/07 WF
|
||||
-- Modified Source to compile with the Xilinx ISE.
|
||||
--
|
||||
|
||||
library ieee;
|
||||
use ieee.std_logic_1164.all;
|
||||
use ieee.std_logic_unsigned.all;
|
||||
|
||||
entity WF6850IP_RECEIVE is
|
||||
port (
|
||||
CLK : in bit;
|
||||
RESETn : in bit;
|
||||
MCLR : in bit;
|
||||
|
||||
CS : in bit_vector(2 downto 0);
|
||||
E : in bit;
|
||||
RWn : in bit;
|
||||
RS : in bit;
|
||||
|
||||
DATA_OUT : out bit_vector(7 downto 0);
|
||||
DATA_EN : out bit;
|
||||
|
||||
WS : in bit_vector(2 downto 0);
|
||||
CDS : in bit_vector(1 downto 0);
|
||||
|
||||
RXCLK : in bit;
|
||||
RXDATA : in bit;
|
||||
|
||||
RDRF : buffer bit;
|
||||
OVR : out bit;
|
||||
PE : out bit;
|
||||
FE : out bit
|
||||
);
|
||||
end entity WF6850IP_RECEIVE;
|
||||
|
||||
architecture BEHAVIOR of WF6850IP_RECEIVE is
|
||||
type RCV_STATES is (IDLE, WAIT_START, SAMPLE, PARITY, STOP1, STOP2, SYNC);
|
||||
signal RCV_STATE, RCV_NEXT_STATE : RCV_STATES;
|
||||
signal RXDATA_I : bit;
|
||||
signal RXDATA_S : bit;
|
||||
signal DATA_REG : bit_vector(7 downto 0);
|
||||
signal SHIFT_REG : bit_vector(7 downto 0);
|
||||
signal CLK_STRB : bit;
|
||||
signal BITCNT : std_logic_vector(2 downto 0);
|
||||
begin
|
||||
P_SAMPLE: process
|
||||
-- This filter provides a synchronisation to the system
|
||||
-- clock, even for random baud rates of the received data
|
||||
-- stream.
|
||||
variable FLT_TMP : integer range 0 to 2;
|
||||
begin
|
||||
wait until CLK = '1' and CLK' event;
|
||||
--
|
||||
RXDATA_I <= RXDATA;
|
||||
--
|
||||
if RXDATA_I = '1' and FLT_TMP < 2 then
|
||||
FLT_TMP := FLT_TMP + 1;
|
||||
elsif RXDATA_I = '1' then
|
||||
RXDATA_S <= '1';
|
||||
elsif RXDATA_I = '0' and FLT_TMP > 0 then
|
||||
FLT_TMP := FLT_TMP - 1;
|
||||
elsif RXDATA_I = '0' then
|
||||
RXDATA_S <= '0';
|
||||
end if;
|
||||
end process P_SAMPLE;
|
||||
|
||||
CLKDIV: process
|
||||
variable CLK_LOCK : boolean;
|
||||
variable STRB_LOCK : boolean;
|
||||
variable CLK_DIVCNT : std_logic_vector(6 downto 0);
|
||||
begin
|
||||
wait until CLK = '1' and CLK' event;
|
||||
if CDS = "00" then -- Divider off.
|
||||
if RXCLK = '1' and STRB_LOCK = false then
|
||||
CLK_STRB <= '1';
|
||||
STRB_LOCK := true;
|
||||
elsif RXCLK = '0' then
|
||||
CLK_STRB <= '0';
|
||||
STRB_LOCK := false;
|
||||
else
|
||||
CLK_STRB <= '0';
|
||||
end if;
|
||||
elsif RCV_STATE = IDLE then
|
||||
-- Preset the CLKDIV with the start delays.
|
||||
if CDS = "01" then
|
||||
CLK_DIVCNT := "0001000"; -- Half of div by 16 mode.
|
||||
elsif CDS = "10" then
|
||||
CLK_DIVCNT := "0100000"; -- Half of div by 64 mode.
|
||||
end if;
|
||||
CLK_STRB <= '0';
|
||||
else
|
||||
if CLK_DIVCNT > "0000000" and RXCLK = '1' and CLK_LOCK = false then
|
||||
CLK_DIVCNT := CLK_DIVCNT - '1';
|
||||
CLK_STRB <= '0';
|
||||
CLK_LOCK := true;
|
||||
elsif CDS = "01" and CLK_DIVCNT = "0000000" then
|
||||
CLK_DIVCNT := "0010000"; -- Div by 16 mode.
|
||||
--
|
||||
if STRB_LOCK = false then
|
||||
STRB_LOCK := true;
|
||||
CLK_STRB <= '1';
|
||||
else
|
||||
CLK_STRB <= '0';
|
||||
end if;
|
||||
elsif CDS = "10" and CLK_DIVCNT = "0000000" then
|
||||
CLK_DIVCNT := "1000000"; -- Div by 64 mode.
|
||||
if STRB_LOCK = false then
|
||||
STRB_LOCK := true;
|
||||
CLK_STRB <= '1';
|
||||
else
|
||||
CLK_STRB <= '0';
|
||||
end if;
|
||||
elsif RXCLK = '0' then
|
||||
CLK_LOCK := false;
|
||||
STRB_LOCK := false;
|
||||
CLK_STRB <= '0';
|
||||
else
|
||||
CLK_STRB <= '0';
|
||||
end if;
|
||||
end if;
|
||||
end process CLKDIV;
|
||||
|
||||
DATAREG: process(RESETn, CLK)
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
DATA_REG <= x"00";
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if MCLR = '1' then
|
||||
DATA_REG <= x"00";
|
||||
elsif RCV_STATE = SYNC and WS(2) = '0' and RDRF = '0' then -- 7 bit data.
|
||||
-- Transfer from shift- to data register only if
|
||||
-- data register is empty (RDRF = '0').
|
||||
DATA_REG <= '0' & SHIFT_REG(7 downto 1);
|
||||
elsif RCV_STATE = SYNC and WS(2) = '1' and RDRF = '0' then -- 8 bit data.
|
||||
-- Transfer from shift- to data register only if
|
||||
-- data register is empty (RDRF = '0').
|
||||
DATA_REG <= SHIFT_REG;
|
||||
end if;
|
||||
end if;
|
||||
end process DATAREG;
|
||||
--DATA_OUT <= DATA_REG when CS = "011" and RWn = '1' and RS = '1' and E = '1' else (others => '0');
|
||||
--DATA_EN <= '1' when CS = "011" and RWn = '1' and RS = '1' and E = '1' else '0';
|
||||
DATA_OUT <= DATA_REG when CS = "011" and RWn = '1' and RS = '1' else (others => '0');
|
||||
DATA_EN <= '1' when CS = "011" and RWn = '1' and RS = '1' else '0';
|
||||
|
||||
SHIFTREG: process(RESETn, CLK)
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
SHIFT_REG <= x"00";
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if MCLR = '1' then
|
||||
SHIFT_REG <= x"00";
|
||||
elsif RCV_STATE = SAMPLE and CLK_STRB = '1' then
|
||||
SHIFT_REG <= RXDATA_S & SHIFT_REG(7 downto 1); -- Shift right.
|
||||
end if;
|
||||
end if;
|
||||
end process SHIFTREG;
|
||||
|
||||
P_BITCNT: process
|
||||
begin
|
||||
wait until CLK = '1' and CLK' event;
|
||||
if RCV_STATE = SAMPLE and CLK_STRB = '1' then
|
||||
BITCNT <= BITCNT + '1';
|
||||
elsif RCV_STATE /= SAMPLE then
|
||||
BITCNT <= (others => '0');
|
||||
end if;
|
||||
end process P_BITCNT;
|
||||
|
||||
FRAME_ERR: process(RESETn, CLK)
|
||||
-- This module detects a framing error
|
||||
-- during stop bit 1 and stop bit 2.
|
||||
variable FE_I: bit;
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
FE_I := '0';
|
||||
FE <= '0';
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if MCLR = '1' then
|
||||
FE_I := '0';
|
||||
FE <= '0';
|
||||
elsif CLK_STRB = '1' then
|
||||
if RCV_STATE = STOP1 and RXDATA_S = '0' then
|
||||
FE_I := '1';
|
||||
elsif RCV_STATE = STOP2 and RXDATA_S = '0' then
|
||||
FE_I := '1';
|
||||
elsif RCV_STATE = STOP1 or RCV_STATE = STOP2 then
|
||||
FE_I := '0'; -- Error resets when correct data appears.
|
||||
end if;
|
||||
end if;
|
||||
if RCV_STATE = SYNC then
|
||||
FE <= FE_I; -- Update the FE every SYNC time.
|
||||
end if;
|
||||
end if;
|
||||
end process FRAME_ERR;
|
||||
|
||||
OVERRUN: process(RESETn, CLK)
|
||||
variable OVR_I : bit;
|
||||
variable FIRST_READ : boolean;
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
OVR_I := '0';
|
||||
OVR <= '0';
|
||||
FIRST_READ := false;
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if MCLR = '1' then
|
||||
OVR_I := '0';
|
||||
OVR <= '0';
|
||||
FIRST_READ := false;
|
||||
elsif CLK_STRB = '1' and RCV_STATE = STOP1 then
|
||||
-- Overrun appears if RDRF is '1' in this state.
|
||||
OVR_I := RDRF;
|
||||
end if;
|
||||
if CS = "011" and RWn = '1' and RS = '1' and E = '1' and OVR_I = '1' then
|
||||
-- If an overrun was detected, the concerning flag is
|
||||
-- set when the valid data word in the receiver data
|
||||
-- register is read. Thereafter the RDRF flag is reset
|
||||
-- and the overrun disappears (OVR_I goes low) after
|
||||
-- a second read (in time) of the receiver data register.
|
||||
if FIRST_READ = false then
|
||||
OVR <= '1';
|
||||
FIRST_READ := true;
|
||||
else
|
||||
OVR <= '0';
|
||||
FIRST_READ := false;
|
||||
end if;
|
||||
end if;
|
||||
end if;
|
||||
end process OVERRUN;
|
||||
|
||||
PARITY_TEST: process(RESETn, CLK)
|
||||
variable PAR_TMP : bit;
|
||||
variable PE_I : bit;
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
PE <= '0';
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if MCLR = '1' then
|
||||
PE <= '0';
|
||||
elsif CLK_STRB = '1' then -- Sample parity on clock strobe.
|
||||
PE_I := '0'; -- Initialise.
|
||||
if RCV_STATE = PARITY then
|
||||
for i in 1 to 7 loop
|
||||
if i = 1 then
|
||||
PAR_TMP := SHIFT_REG(i-1) xor SHIFT_REG(i);
|
||||
else
|
||||
PAR_TMP := PAR_TMP xor SHIFT_REG(i);
|
||||
end if;
|
||||
end loop;
|
||||
if WS = "000" or WS = "010" or WS = "110" then -- Even parity.
|
||||
PE_I := PAR_TMP xor RXDATA_S;
|
||||
elsif WS = "001" or WS = "011" or WS = "111" then -- Odd parity.
|
||||
PE_I := not PAR_TMP xor RXDATA_S;
|
||||
else -- No parity for WS = "100" and WS = "101".
|
||||
PE_I := '0';
|
||||
end if;
|
||||
end if;
|
||||
end if;
|
||||
-- Transmit the parity flag together with the data
|
||||
-- In other words: no parity to the status register
|
||||
-- when RDRF inhibits the data transfer to the
|
||||
-- receiver data register.
|
||||
if RCV_STATE = SYNC and RDRF = '0' then
|
||||
PE <= PE_I;
|
||||
elsif CS = "011" and RWn = '1' and RS = '1' and E = '1' then
|
||||
PE <= '0'; -- Clear when reading the data register.
|
||||
end if;
|
||||
end if;
|
||||
end process PARITY_TEST;
|
||||
|
||||
P_RDRF: process(RESETn, CLK)
|
||||
-- Receive data register full flag.
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
RDRF <= '0';
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if MCLR = '1' then
|
||||
RDRF <= '0';
|
||||
elsif RCV_STATE = SYNC then
|
||||
RDRF <= '1'; -- Data register is full until now!
|
||||
elsif CS = "011" and RWn = '1' and RS = '1' and E = '1' then
|
||||
RDRF <= '0'; -- After reading the data register ...
|
||||
end if;
|
||||
end if;
|
||||
end process P_RDRF;
|
||||
|
||||
RCV_STATEREG: process(RESETn, CLK)
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
RCV_STATE <= IDLE;
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if MCLR = '1' then
|
||||
RCV_STATE <= IDLE;
|
||||
else
|
||||
RCV_STATE <= RCV_NEXT_STATE;
|
||||
end if;
|
||||
end if;
|
||||
end process RCV_STATEREG;
|
||||
|
||||
RCV_STATEDEC: process(RCV_STATE, RXDATA_S, CDS, WS, BITCNT, CLK_STRB)
|
||||
begin
|
||||
case RCV_STATE is
|
||||
when IDLE =>
|
||||
if RXDATA_S = '0' and CDS = "00" then
|
||||
RCV_NEXT_STATE <= SAMPLE; -- Startbit detected in div by 1 mode.
|
||||
elsif RXDATA_S = '0' and CDS = "01" then
|
||||
RCV_NEXT_STATE <= WAIT_START; -- Startbit detected in div by 16 mode.
|
||||
elsif RXDATA_S = '0' and CDS = "10" then
|
||||
RCV_NEXT_STATE <= WAIT_START; -- Startbit detected in div by 64 mode.
|
||||
else
|
||||
RCV_NEXT_STATE <= IDLE; -- No startbit; sleep well :-)
|
||||
end if;
|
||||
when WAIT_START =>
|
||||
if CLK_STRB = '1' then
|
||||
if RXDATA_S = '0' then
|
||||
RCV_NEXT_STATE <= SAMPLE; -- Start condition in no div by 1 modes.
|
||||
else
|
||||
RCV_NEXT_STATE <= IDLE; -- No valid start condition, go back.
|
||||
end if;
|
||||
else
|
||||
RCV_NEXT_STATE <= WAIT_START; -- Stay.
|
||||
end if;
|
||||
when SAMPLE =>
|
||||
if CLK_STRB = '1' then
|
||||
if BITCNT < "110" and WS(2) = '0' then
|
||||
RCV_NEXT_STATE <= SAMPLE; -- Go on sampling 7 data bits.
|
||||
elsif BITCNT < "111" and WS(2) = '1' then
|
||||
RCV_NEXT_STATE <= SAMPLE; -- Go on sampling 8 data bits.
|
||||
elsif WS = "100" or WS = "101" then
|
||||
RCV_NEXT_STATE <= STOP1; -- No parity check enabled.
|
||||
else
|
||||
RCV_NEXT_STATE <= PARITY; -- Parity enabled.
|
||||
end if;
|
||||
else
|
||||
RCV_NEXT_STATE <= SAMPLE; -- Stay in sample mode.
|
||||
end if;
|
||||
when PARITY =>
|
||||
if CLK_STRB = '1' then
|
||||
RCV_NEXT_STATE <= STOP1;
|
||||
else
|
||||
RCV_NEXT_STATE <= PARITY;
|
||||
end if;
|
||||
when STOP1 =>
|
||||
if CLK_STRB = '1' then
|
||||
if RXDATA_S = '0' then
|
||||
RCV_NEXT_STATE <= SYNC; -- Framing error detected.
|
||||
elsif WS = "000" or WS = "001" or WS = "100" then
|
||||
RCV_NEXT_STATE <= STOP2; -- Two stop bits selected.
|
||||
else
|
||||
RCV_NEXT_STATE <= SYNC; -- One stop bit selected.
|
||||
end if;
|
||||
else
|
||||
RCV_NEXT_STATE <= STOP1;
|
||||
end if;
|
||||
when STOP2 =>
|
||||
if CLK_STRB = '1' then
|
||||
RCV_NEXT_STATE <= SYNC;
|
||||
else
|
||||
RCV_NEXT_STATE <= STOP2;
|
||||
end if;
|
||||
when SYNC =>
|
||||
RCV_NEXT_STATE <= IDLE;
|
||||
end case;
|
||||
end process RCV_STATEDEC;
|
||||
end architecture BEHAVIOR;
|
||||
|
||||
@@ -1,252 +0,0 @@
|
||||
----------------------------------------------------------------------
|
||||
---- ----
|
||||
---- 6850 compatible IP Core ----
|
||||
---- ----
|
||||
---- This file is part of the SUSKA ATARI clone project. ----
|
||||
---- http://www.experiment-s.de ----
|
||||
---- ----
|
||||
---- Description: ----
|
||||
---- UART 6850 compatible IP core ----
|
||||
---- ----
|
||||
---- This is the top level file. ----
|
||||
---- Top level file for use in systems on programmable chips. ----
|
||||
---- ----
|
||||
---- ----
|
||||
---- To Do: ----
|
||||
---- - ----
|
||||
---- ----
|
||||
---- Author(s): ----
|
||||
---- - Wolfgang Foerster, wf@experiment-s.de; wf@inventronik.de ----
|
||||
---- ----
|
||||
----------------------------------------------------------------------
|
||||
---- ----
|
||||
---- Copyright (C) 2006 - 2008 Wolfgang Foerster ----
|
||||
---- ----
|
||||
---- This source file may be used and distributed without ----
|
||||
---- restriction provided that this copyright statement is not ----
|
||||
---- removed from the file and that any derivative work contains ----
|
||||
---- the original copyright notice and the associated disclaimer. ----
|
||||
---- ----
|
||||
---- This source file is free software; you can redistribute it ----
|
||||
---- and/or modify it under the terms of the GNU Lesser General ----
|
||||
---- Public License as published by the Free Software Foundation; ----
|
||||
---- either version 2.1 of the License, or (at your option) any ----
|
||||
---- later version. ----
|
||||
---- ----
|
||||
---- This source is distributed in the hope that it will be ----
|
||||
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
||||
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
||||
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
||||
---- details. ----
|
||||
---- ----
|
||||
---- You should have received a copy of the GNU Lesser General ----
|
||||
---- Public License along with this source; if not, download it ----
|
||||
---- from http://www.gnu.org/licenses/lgpl.html ----
|
||||
---- ----
|
||||
----------------------------------------------------------------------
|
||||
--
|
||||
-- Revision History
|
||||
--
|
||||
-- Revision 2K6A 2006/06/03 WF
|
||||
-- Initial Release.
|
||||
-- Revision 2K6B 2006/11/07 WF
|
||||
-- Modified Source to compile with the Xilinx ISE.
|
||||
-- Top level file provided for SOC (systems on programmable chips).
|
||||
-- Revision 2K8A 2008/07/14 WF
|
||||
-- Minor changes.
|
||||
--
|
||||
|
||||
library ieee;
|
||||
use ieee.std_logic_1164.all;
|
||||
use ieee.std_logic_unsigned.all;
|
||||
|
||||
entity WF6850IP_TOP_SOC is
|
||||
port (
|
||||
CLK : in bit;
|
||||
RESETn : in bit;
|
||||
|
||||
CS2n, CS1, CS0 : in bit;
|
||||
E : in bit;
|
||||
RWn : in bit;
|
||||
RS : in bit;
|
||||
|
||||
DATA_IN : in std_logic_vector(7 downto 0);
|
||||
DATA_OUT : out std_logic_vector(7 downto 0);
|
||||
DATA_EN : out bit;
|
||||
|
||||
TXCLK : in bit;
|
||||
RXCLK : in bit;
|
||||
RXDATA : in bit;
|
||||
CTSn : in bit;
|
||||
DCDn : in bit;
|
||||
|
||||
IRQn : out bit;
|
||||
TXDATA : out bit;
|
||||
RTSn : out bit
|
||||
);
|
||||
end entity WF6850IP_TOP_SOC;
|
||||
|
||||
architecture STRUCTURE of WF6850IP_TOP_SOC is
|
||||
component WF6850IP_CTRL_STATUS
|
||||
port (
|
||||
CLK : in bit;
|
||||
RESETn : in bit;
|
||||
CS : in bit_vector(2 downto 0);
|
||||
E : in bit;
|
||||
RWn : in bit;
|
||||
RS : in bit;
|
||||
DATA_IN : in bit_vector(7 downto 0);
|
||||
DATA_OUT : out bit_vector(7 downto 0);
|
||||
DATA_EN : out bit;
|
||||
RDRF : in bit;
|
||||
TDRE : in bit;
|
||||
DCDn : in bit;
|
||||
CTSn : in bit;
|
||||
FE : in bit;
|
||||
OVR : in bit;
|
||||
PE : in bit;
|
||||
MCLR : out bit;
|
||||
RTSn : out bit;
|
||||
CDS : out bit_vector(1 downto 0);
|
||||
WS : out bit_vector(2 downto 0);
|
||||
TC : out bit_vector(1 downto 0);
|
||||
IRQn : out bit
|
||||
);
|
||||
end component;
|
||||
|
||||
component WF6850IP_RECEIVE
|
||||
port (
|
||||
CLK : in bit;
|
||||
RESETn : in bit;
|
||||
MCLR : in bit;
|
||||
CS : in bit_vector(2 downto 0);
|
||||
E : in bit;
|
||||
RWn : in bit;
|
||||
RS : in bit;
|
||||
DATA_OUT : out bit_vector(7 downto 0);
|
||||
DATA_EN : out bit;
|
||||
WS : in bit_vector(2 downto 0);
|
||||
CDS : in bit_vector(1 downto 0);
|
||||
RXCLK : in bit;
|
||||
RXDATA : in bit;
|
||||
RDRF : out bit;
|
||||
OVR : out bit;
|
||||
PE : out bit;
|
||||
FE : out bit
|
||||
);
|
||||
end component;
|
||||
|
||||
component WF6850IP_TRANSMIT
|
||||
port (
|
||||
CLK : in bit;
|
||||
RESETn : in bit;
|
||||
MCLR : in bit;
|
||||
CS : in bit_vector(2 downto 0);
|
||||
E : in bit;
|
||||
RWn : in bit;
|
||||
RS : in bit;
|
||||
DATA_IN : in bit_vector(7 downto 0);
|
||||
CTSn : in bit;
|
||||
TC : in bit_vector(1 downto 0);
|
||||
WS : in bit_vector(2 downto 0);
|
||||
CDS : in bit_vector(1 downto 0);
|
||||
TXCLK : in bit;
|
||||
TDRE : out bit;
|
||||
TXDATA : out bit
|
||||
);
|
||||
end component;
|
||||
signal DATA_IN_I : bit_vector(7 downto 0);
|
||||
signal DATA_RX : bit_vector(7 downto 0);
|
||||
signal DATA_RX_EN : bit;
|
||||
signal DATA_CTRL : bit_vector(7 downto 0);
|
||||
signal DATA_CTRL_EN : bit;
|
||||
signal RDRF_I : bit;
|
||||
signal TDRE_I : bit;
|
||||
signal FE_I : bit;
|
||||
signal OVR_I : bit;
|
||||
signal PE_I : bit;
|
||||
signal MCLR_I : bit;
|
||||
signal CDS_I : bit_vector(1 downto 0);
|
||||
signal WS_I : bit_vector(2 downto 0);
|
||||
signal TC_I : bit_vector(1 downto 0);
|
||||
signal IRQ_In : bit;
|
||||
begin
|
||||
DATA_IN_I <= To_BitVector(DATA_IN);
|
||||
DATA_EN <= DATA_RX_EN or DATA_CTRL_EN;
|
||||
DATA_OUT <= To_StdLogicVector(DATA_RX) when DATA_RX_EN = '1' else
|
||||
To_StdLogicVector(DATA_CTRL) when DATA_CTRL_EN = '1' else (others => '0');
|
||||
|
||||
IRQn <= '0' when IRQ_In = '0' else '1';
|
||||
|
||||
I_UART_CTRL_STATUS: WF6850IP_CTRL_STATUS
|
||||
port map(
|
||||
CLK => CLK,
|
||||
RESETn => RESETn,
|
||||
CS(2) => CS2n,
|
||||
CS(1) => CS1,
|
||||
CS(0) => CS0,
|
||||
E => E,
|
||||
RWn => RWn,
|
||||
RS => RS,
|
||||
DATA_IN => DATA_IN_I,
|
||||
DATA_OUT => DATA_CTRL,
|
||||
DATA_EN => DATA_CTRL_EN,
|
||||
RDRF => RDRF_I,
|
||||
TDRE => TDRE_I,
|
||||
DCDn => DCDn,
|
||||
CTSn => CTSn,
|
||||
FE => FE_I,
|
||||
OVR => OVR_I,
|
||||
PE => PE_I,
|
||||
MCLR => MCLR_I,
|
||||
RTSn => RTSn,
|
||||
CDS => CDS_I,
|
||||
WS => WS_I,
|
||||
TC => TC_I,
|
||||
IRQn => IRQ_In
|
||||
);
|
||||
|
||||
I_UART_RECEIVE: WF6850IP_RECEIVE
|
||||
port map (
|
||||
CLK => CLK,
|
||||
RESETn => RESETn,
|
||||
MCLR => MCLR_I,
|
||||
CS(2) => CS2n,
|
||||
CS(1) => CS1,
|
||||
CS(0) => CS0,
|
||||
E => E,
|
||||
RWn => RWn,
|
||||
RS => RS,
|
||||
DATA_OUT => DATA_RX,
|
||||
DATA_EN => DATA_RX_EN,
|
||||
WS => WS_I,
|
||||
CDS => CDS_I,
|
||||
RXCLK => RXCLK,
|
||||
RXDATA => RXDATA,
|
||||
RDRF => RDRF_I,
|
||||
OVR => OVR_I,
|
||||
PE => PE_I,
|
||||
FE => FE_I
|
||||
);
|
||||
|
||||
I_UART_TRANSMIT: WF6850IP_TRANSMIT
|
||||
port map (
|
||||
CLK => CLK,
|
||||
RESETn => RESETn,
|
||||
MCLR => MCLR_I,
|
||||
CS(2) => CS2n,
|
||||
CS(1) => CS1,
|
||||
CS(0) => CS0,
|
||||
E => E,
|
||||
RWn => RWn,
|
||||
RS => RS,
|
||||
DATA_IN => DATA_IN_I,
|
||||
CTSn => CTSn,
|
||||
TC => TC_I,
|
||||
WS => WS_I,
|
||||
CDS => CDS_I,
|
||||
TDRE => TDRE_I,
|
||||
TXCLK => TXCLK,
|
||||
TXDATA => TXDATA
|
||||
);
|
||||
end architecture STRUCTURE;
|
||||
@@ -1,339 +0,0 @@
|
||||
----------------------------------------------------------------------
|
||||
---- ----
|
||||
---- 6850 compatible IP Core ----
|
||||
---- ----
|
||||
---- This file is part of the SUSKA ATARI clone project. ----
|
||||
---- http://www.experiment-s.de ----
|
||||
---- ----
|
||||
---- Description: ----
|
||||
---- UART 6850 compatible IP core ----
|
||||
---- ----
|
||||
---- 6850's transmitter unit. ----
|
||||
---- ----
|
||||
---- ----
|
||||
---- To Do: ----
|
||||
---- - ----
|
||||
---- ----
|
||||
---- Author(s): ----
|
||||
---- - Wolfgang Foerster, wf@experiment-s.de; wf@inventronik.de ----
|
||||
---- ----
|
||||
----------------------------------------------------------------------
|
||||
---- ----
|
||||
---- Copyright (C) 2006 - 2008 Wolfgang Foerster ----
|
||||
---- ----
|
||||
---- This source file may be used and distributed without ----
|
||||
---- restriction provided that this copyright statement is not ----
|
||||
---- removed from the file and that any derivative work contains ----
|
||||
---- the original copyright notice and the associated disclaimer. ----
|
||||
---- ----
|
||||
---- This source file is free software; you can redistribute it ----
|
||||
---- and/or modify it under the terms of the GNU Lesser General ----
|
||||
---- Public License as published by the Free Software Foundation; ----
|
||||
---- either version 2.1 of the License, or (at your option) any ----
|
||||
---- later version. ----
|
||||
---- ----
|
||||
---- This source is distributed in the hope that it will be ----
|
||||
---- useful, but WITHOUT ANY WARRANTY; without even the implied ----
|
||||
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ----
|
||||
---- PURPOSE. See the GNU Lesser General Public License for more ----
|
||||
---- details. ----
|
||||
---- ----
|
||||
---- You should have received a copy of the GNU Lesser General ----
|
||||
---- Public License along with this source; if not, download it ----
|
||||
---- from http://www.gnu.org/licenses/lgpl.html ----
|
||||
---- ----
|
||||
----------------------------------------------------------------------
|
||||
--
|
||||
-- Revision History
|
||||
--
|
||||
-- Revision 2K6A 2006/06/03 WF
|
||||
-- Initial Release.
|
||||
-- Revision 2K6B 2006/11/07 WF
|
||||
-- Modified Source to compile with the Xilinx ISE.
|
||||
-- Revision 2K8A 2008/07/14 WF
|
||||
-- Minor changes.
|
||||
-- Revision 2K8B 2008/11/01 WF
|
||||
-- Fixed the T_DRE process concerning the TDRE <= '1' setting.
|
||||
-- Thanks to Lyndon Amsdon finding the bug.
|
||||
--
|
||||
|
||||
library ieee;
|
||||
use ieee.std_logic_1164.all;
|
||||
use ieee.std_logic_unsigned.all;
|
||||
|
||||
entity WF6850IP_TRANSMIT is
|
||||
port (
|
||||
CLK : in bit;
|
||||
RESETn : in bit;
|
||||
MCLR : in bit;
|
||||
|
||||
CS : in bit_vector(2 downto 0);
|
||||
E : in bit;
|
||||
RWn : in bit;
|
||||
RS : in bit;
|
||||
|
||||
DATA_IN : in bit_vector(7 downto 0);
|
||||
|
||||
CTSn : in bit;
|
||||
|
||||
TC : in bit_vector(1 downto 0);
|
||||
WS : in bit_vector(2 downto 0);
|
||||
CDS : in bit_vector(1 downto 0);
|
||||
|
||||
TXCLK : in bit;
|
||||
|
||||
TDRE : buffer bit;
|
||||
TXDATA : out bit
|
||||
);
|
||||
end entity WF6850IP_TRANSMIT;
|
||||
|
||||
architecture BEHAVIOR of WF6850IP_TRANSMIT is
|
||||
type TR_STATES is (IDLE, LOAD_SHFT, START, SHIFTOUT, PARITY, STOP1, STOP2);
|
||||
signal TR_STATE, TR_NEXT_STATE : TR_STATES;
|
||||
signal CLK_STRB : bit;
|
||||
signal DATA_REG : bit_vector(7 downto 0);
|
||||
signal SHIFT_REG : bit_vector(7 downto 0);
|
||||
signal BITCNT : std_logic_vector(2 downto 0);
|
||||
signal PARITY_I : bit;
|
||||
begin
|
||||
-- The default condition in this statement is to ensure
|
||||
-- to cover all possibilities for example if there is a
|
||||
-- one hot decoding of the state machine with wrong states
|
||||
-- (e.g. not one of the given here).
|
||||
TXDATA <= '1' when TR_STATE = IDLE else
|
||||
'1' when TR_STATE = LOAD_SHFT else
|
||||
'0' when TR_STATE = START else
|
||||
SHIFT_REG(0) when TR_STATE = SHIFTOUT else
|
||||
PARITY_I when TR_STATE = PARITY else
|
||||
'1' when TR_STATE = STOP1 else
|
||||
'1' when TR_STATE = STOP2 else '1';
|
||||
|
||||
CLKDIV: process
|
||||
variable CLK_LOCK : boolean;
|
||||
variable STRB_LOCK : boolean;
|
||||
variable CLK_DIVCNT : std_logic_vector(6 downto 0);
|
||||
begin
|
||||
wait until CLK = '1' and CLK' event;
|
||||
if CDS = "00" then -- divider off
|
||||
if TXCLK = '0' and STRB_LOCK = false then -- Works on negative TXCLK edge.
|
||||
CLK_STRB <= '1';
|
||||
STRB_LOCK := true;
|
||||
elsif TXCLK = '1' then
|
||||
CLK_STRB <= '0';
|
||||
STRB_LOCK := false;
|
||||
else
|
||||
CLK_STRB <= '0';
|
||||
end if;
|
||||
elsif TR_STATE = IDLE then
|
||||
-- preset the CLKDIV with the start delays
|
||||
if CDS = "01" then
|
||||
CLK_DIVCNT := "0010000"; -- div by 16 mode
|
||||
elsif CDS = "10" then
|
||||
CLK_DIVCNT := "1000000"; -- div by 64 mode
|
||||
end if;
|
||||
CLK_STRB <= '0';
|
||||
else
|
||||
-- Works on negative TXCLK edge:
|
||||
if CLK_DIVCNT > "0000000" and TXCLK = '0' and CLK_LOCK = false then
|
||||
CLK_DIVCNT := CLK_DIVCNT - '1';
|
||||
CLK_STRB <= '0';
|
||||
CLK_LOCK := true;
|
||||
elsif CDS = "01" and CLK_DIVCNT = "0000000" then
|
||||
CLK_DIVCNT := "0010000"; -- Div by 16 mode.
|
||||
if STRB_LOCK = false then
|
||||
STRB_LOCK := true;
|
||||
CLK_STRB <= '1';
|
||||
else
|
||||
CLK_STRB <= '0';
|
||||
end if;
|
||||
elsif CDS = "10" and CLK_DIVCNT = "0000000" then
|
||||
CLK_DIVCNT := "1000000"; -- Div by 64 mode.
|
||||
if STRB_LOCK = false then
|
||||
STRB_LOCK := true;
|
||||
CLK_STRB <= '1';
|
||||
else
|
||||
CLK_STRB <= '0';
|
||||
end if;
|
||||
elsif TXCLK = '1' then
|
||||
CLK_LOCK := false;
|
||||
STRB_LOCK := false;
|
||||
CLK_STRB <= '0';
|
||||
else
|
||||
CLK_STRB <= '0';
|
||||
end if;
|
||||
end if;
|
||||
end process CLKDIV;
|
||||
|
||||
DATAREG: process(RESETn, CLK)
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
DATA_REG <= x"00";
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if MCLR = '1' then
|
||||
DATA_REG <= x"00";
|
||||
elsif WS(2) = '0' and CS = "011" and RWn = '0' and RS = '1' and E = '1' then
|
||||
DATA_REG <= '0' & DATA_IN(6 downto 0); -- 7 bit data mode.
|
||||
elsif WS(2) = '1' and CS = "011" and RWn = '0' and RS = '1' and E = '1' then
|
||||
DATA_REG <= DATA_IN; -- 8 bit data mode.
|
||||
end if;
|
||||
end if;
|
||||
end process DATAREG;
|
||||
|
||||
SHIFTREG: process(RESETn, CLK)
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
SHIFT_REG <= x"00";
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if MCLR = '1' then
|
||||
SHIFT_REG <= x"00";
|
||||
elsif TR_STATE = LOAD_SHFT and TDRE = '0' then
|
||||
-- If during LOAD_SHIFT the transmitter data register
|
||||
-- is empty (TDRE = '1') the shift register will not
|
||||
-- be loaded. When additionally TC = "11", the break
|
||||
-- character (zero data and no stop bits) is sent.
|
||||
SHIFT_REG <= DATA_REG;
|
||||
elsif TR_STATE = SHIFTOUT and CLK_STRB = '1' then
|
||||
SHIFT_REG <= '0' & SHIFT_REG(7 downto 1); -- Shift right.
|
||||
end if;
|
||||
end if;
|
||||
end process SHIFTREG;
|
||||
|
||||
P_BITCNT: process
|
||||
-- Counter for the data bits transmitted.
|
||||
begin
|
||||
wait until CLK = '1' and CLK' event;
|
||||
if TR_STATE = SHIFTOUT and CLK_STRB = '1' then
|
||||
BITCNT <= BITCNT + '1';
|
||||
elsif TR_STATE /= SHIFTOUT then
|
||||
BITCNT <= "000";
|
||||
end if;
|
||||
end process P_BITCNT;
|
||||
|
||||
P_TDRE: process(RESETn, CLK)
|
||||
-- Transmit data register empty flag.
|
||||
variable LOCK : boolean;
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
TDRE <= '1';
|
||||
LOCK := false;
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if MCLR = '1' then
|
||||
TDRE <= '1';
|
||||
elsif TR_NEXT_STATE = START and TR_STATE /= START then
|
||||
-- Data has been loaded to shift register, thus data register is free again.
|
||||
-- Thanks to Lyndon Amsdon for finding a bug here. The TDRE is set to one once
|
||||
-- entering the state now.
|
||||
TDRE <= '1';
|
||||
elsif CS = "011" and RWn = '0' and RS = '1' and E = '1' and LOCK = false then
|
||||
LOCK := true;
|
||||
elsif E = '0' and LOCK = true and CS /= "011" then
|
||||
-- This construction clears TDRE after the falling edge of E
|
||||
-- and after the transmit data register has been written to.
|
||||
TDRE <= '0';
|
||||
LOCK := false;
|
||||
end if;
|
||||
end if;
|
||||
end process P_TDRE;
|
||||
|
||||
PARITY_GEN: process
|
||||
variable PAR_TMP : bit;
|
||||
begin
|
||||
wait until CLK = '1' and CLK' event;
|
||||
if TR_STATE = START then -- Calculate the parity during the start phase.
|
||||
for i in 1 to 7 loop
|
||||
if i = 1 then
|
||||
PAR_TMP := SHIFT_REG(i-1) xor SHIFT_REG(i);
|
||||
else
|
||||
PAR_TMP := PAR_TMP xor SHIFT_REG(i);
|
||||
end if;
|
||||
end loop;
|
||||
if WS = "000" or WS = "010" or WS = "110" then -- Even parity.
|
||||
PARITY_I <= PAR_TMP;
|
||||
elsif WS = "001" or WS = "011" or WS = "111" then -- Odd parity.
|
||||
PARITY_I <= not PAR_TMP;
|
||||
else -- No parity for WS = "100" and WS = "101".
|
||||
PARITY_I <= '0';
|
||||
end if;
|
||||
end if;
|
||||
end process PARITY_GEN;
|
||||
|
||||
TR_STATEREG: process(RESETn, CLK)
|
||||
begin
|
||||
if RESETn = '0' then
|
||||
TR_STATE <= IDLE;
|
||||
elsif CLK = '1' and CLK' event then
|
||||
if MCLR = '1' then
|
||||
TR_STATE <= IDLE;
|
||||
else
|
||||
TR_STATE <= TR_NEXT_STATE;
|
||||
end if;
|
||||
end if;
|
||||
end process TR_STATEREG;
|
||||
|
||||
TR_STATEDEC: process(TR_STATE, CLK_STRB, TC, BITCNT, WS, TDRE, CTSn)
|
||||
begin
|
||||
case TR_STATE is
|
||||
when IDLE =>
|
||||
if TDRE = '1' and TC = "11" then
|
||||
TR_NEXT_STATE <= LOAD_SHFT;
|
||||
elsif TDRE = '0' and CTSn = '0' then -- Start if data register is not empty.
|
||||
TR_NEXT_STATE <= LOAD_SHFT;
|
||||
else
|
||||
TR_NEXT_STATE <= IDLE;
|
||||
end if;
|
||||
when LOAD_SHFT =>
|
||||
TR_NEXT_STATE <= START;
|
||||
when START =>
|
||||
if CLK_STRB = '1' then
|
||||
TR_NEXT_STATE <= SHIFTOUT;
|
||||
else
|
||||
TR_NEXT_STATE <= START;
|
||||
end if;
|
||||
when SHIFTOUT =>
|
||||
if CLK_STRB = '1' then
|
||||
if BITCNT < "110" and WS(2) = '0' then
|
||||
TR_NEXT_STATE <= SHIFTOUT; -- Transmit 7 data bits.
|
||||
elsif BITCNT < "111" and WS(2) = '1' then
|
||||
TR_NEXT_STATE <= SHIFTOUT; -- Transmit 8 data bits.
|
||||
elsif WS = "100" or WS = "101" then
|
||||
if TDRE = '1' and TC = "11" then
|
||||
-- Break condition, do not send a stop bit.
|
||||
TR_NEXT_STATE <= IDLE;
|
||||
else
|
||||
TR_NEXT_STATE <= STOP1; -- No parity check enabled.
|
||||
end if;
|
||||
else
|
||||
TR_NEXT_STATE <= PARITY; -- Parity enabled.
|
||||
end if;
|
||||
else
|
||||
TR_NEXT_STATE <= SHIFTOUT;
|
||||
end if;
|
||||
when PARITY =>
|
||||
if CLK_STRB = '1' then
|
||||
if TDRE = '1' and TC = "11" then
|
||||
-- Break condition, do not send a stop bit.
|
||||
TR_NEXT_STATE <= IDLE;
|
||||
else
|
||||
TR_NEXT_STATE <= STOP1; -- No parity check enabled.
|
||||
end if;
|
||||
else
|
||||
TR_NEXT_STATE <= PARITY;
|
||||
end if;
|
||||
when STOP1 =>
|
||||
if CLK_STRB = '1' and (WS = "000" or WS = "001" or WS = "100") then
|
||||
TR_NEXT_STATE <= STOP2; -- Two stop bits selected.
|
||||
elsif CLK_STRB = '1' then
|
||||
TR_NEXT_STATE <= IDLE; -- One stop bits selected.
|
||||
else
|
||||
TR_NEXT_STATE <= STOP1;
|
||||
end if;
|
||||
when STOP2 =>
|
||||
if CLK_STRB = '1' then
|
||||
TR_NEXT_STATE <= IDLE;
|
||||
else
|
||||
TR_NEXT_STATE <= STOP2;
|
||||
end if;
|
||||
end case;
|
||||
end process TR_STATEDEC;
|
||||
end architecture BEHAVIOR;
|
||||
|
||||
@@ -1,202 +0,0 @@
|
||||
-- megafunction wizard: %LPM_FIFO+%
|
||||
-- GENERATION: STANDARD
|
||||
-- VERSION: WM1.0
|
||||
-- MODULE: dcfifo_mixed_widths
|
||||
|
||||
-- ============================================================
|
||||
-- File Name: dcfifo0.vhd
|
||||
-- Megafunction Name(s):
|
||||
-- dcfifo_mixed_widths
|
||||
--
|
||||
-- Simulation Library Files(s):
|
||||
-- altera_mf
|
||||
-- ============================================================
|
||||
-- ************************************************************
|
||||
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
|
||||
--
|
||||
-- 9.1 Build 222 10/21/2009 SJ Web Edition
|
||||
-- ************************************************************
|
||||
|
||||
|
||||
--Copyright (C) 1991-2009 Altera Corporation
|
||||
--Your use of Altera Corporation's design tools, logic functions
|
||||
--and other software and tools, and its AMPP partner logic
|
||||
--functions, and any output files from any of the foregoing
|
||||
--(including device programming or simulation files), and any
|
||||
--associated documentation or information are expressly subject
|
||||
--to the terms and conditions of the Altera Program License
|
||||
--Subscription Agreement, Altera MegaCore Function License
|
||||
--Agreement, or other applicable license agreement, including,
|
||||
--without limitation, that your use is for the sole purpose of
|
||||
--programming logic devices manufactured by Altera and sold by
|
||||
--Altera or its authorized distributors. Please refer to the
|
||||
--applicable agreement for further details.
|
||||
|
||||
|
||||
LIBRARY ieee;
|
||||
USE ieee.std_logic_1164.all;
|
||||
|
||||
LIBRARY altera_mf;
|
||||
USE altera_mf.all;
|
||||
|
||||
ENTITY dcfifo0 IS
|
||||
PORT
|
||||
(
|
||||
aclr : IN STD_LOGIC := '0';
|
||||
data : IN STD_LOGIC_VECTOR (7 DOWNTO 0);
|
||||
rdclk : IN STD_LOGIC ;
|
||||
rdreq : IN STD_LOGIC ;
|
||||
wrclk : IN STD_LOGIC ;
|
||||
wrreq : IN STD_LOGIC ;
|
||||
q : OUT STD_LOGIC_VECTOR (15 DOWNTO 0);
|
||||
wrusedw : OUT STD_LOGIC_VECTOR (4 DOWNTO 0)
|
||||
);
|
||||
END dcfifo0;
|
||||
|
||||
|
||||
ARCHITECTURE SYN OF dcfifo0 IS
|
||||
|
||||
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (4 DOWNTO 0);
|
||||
SIGNAL sub_wire1 : STD_LOGIC_VECTOR (15 DOWNTO 0);
|
||||
|
||||
|
||||
|
||||
COMPONENT dcfifo_mixed_widths
|
||||
GENERIC (
|
||||
intended_device_family : STRING;
|
||||
lpm_numwords : NATURAL;
|
||||
lpm_showahead : STRING;
|
||||
lpm_type : STRING;
|
||||
lpm_width : NATURAL;
|
||||
lpm_widthu : NATURAL;
|
||||
lpm_widthu_r : NATURAL;
|
||||
lpm_width_r : NATURAL;
|
||||
overflow_checking : STRING;
|
||||
rdsync_delaypipe : NATURAL;
|
||||
underflow_checking : STRING;
|
||||
use_eab : STRING;
|
||||
write_aclr_synch : STRING;
|
||||
wrsync_delaypipe : NATURAL
|
||||
);
|
||||
PORT (
|
||||
wrclk : IN STD_LOGIC ;
|
||||
rdreq : IN STD_LOGIC ;
|
||||
wrusedw : OUT STD_LOGIC_VECTOR (4 DOWNTO 0);
|
||||
aclr : IN STD_LOGIC ;
|
||||
rdclk : IN STD_LOGIC ;
|
||||
q : OUT STD_LOGIC_VECTOR (15 DOWNTO 0);
|
||||
wrreq : IN STD_LOGIC ;
|
||||
data : IN STD_LOGIC_VECTOR (7 DOWNTO 0)
|
||||
);
|
||||
END COMPONENT;
|
||||
|
||||
BEGIN
|
||||
wrusedw <= sub_wire0(4 DOWNTO 0);
|
||||
q <= sub_wire1(15 DOWNTO 0);
|
||||
|
||||
dcfifo_mixed_widths_component : dcfifo_mixed_widths
|
||||
GENERIC MAP (
|
||||
intended_device_family => "Cyclone III",
|
||||
lpm_numwords => 32,
|
||||
lpm_showahead => "OFF",
|
||||
lpm_type => "dcfifo",
|
||||
lpm_width => 8,
|
||||
lpm_widthu => 5,
|
||||
lpm_widthu_r => 4,
|
||||
lpm_width_r => 16,
|
||||
overflow_checking => "ON",
|
||||
rdsync_delaypipe => 5,
|
||||
underflow_checking => "ON",
|
||||
use_eab => "ON",
|
||||
write_aclr_synch => "OFF",
|
||||
wrsync_delaypipe => 5
|
||||
)
|
||||
PORT MAP (
|
||||
wrclk => wrclk,
|
||||
rdreq => rdreq,
|
||||
aclr => aclr,
|
||||
rdclk => rdclk,
|
||||
wrreq => wrreq,
|
||||
data => data,
|
||||
wrusedw => sub_wire0,
|
||||
q => sub_wire1
|
||||
);
|
||||
|
||||
|
||||
|
||||
END SYN;
|
||||
|
||||
-- ============================================================
|
||||
-- CNX file retrieval info
|
||||
-- ============================================================
|
||||
-- Retrieval info: PRIVATE: AlmostEmpty NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "-1"
|
||||
-- Retrieval info: PRIVATE: AlmostFull NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1"
|
||||
-- Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: Clock NUMERIC "4"
|
||||
-- Retrieval info: PRIVATE: Depth NUMERIC "32"
|
||||
-- Retrieval info: PRIVATE: Empty NUMERIC "1"
|
||||
-- Retrieval info: PRIVATE: Full NUMERIC "1"
|
||||
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone III"
|
||||
-- Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: LegacyRREQ NUMERIC "1"
|
||||
-- Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: Optimize NUMERIC "1"
|
||||
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
|
||||
-- Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: UsedW NUMERIC "1"
|
||||
-- Retrieval info: PRIVATE: Width NUMERIC "8"
|
||||
-- Retrieval info: PRIVATE: dc_aclr NUMERIC "1"
|
||||
-- Retrieval info: PRIVATE: diff_widths NUMERIC "1"
|
||||
-- Retrieval info: PRIVATE: msb_usedw NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: output_width NUMERIC "16"
|
||||
-- Retrieval info: PRIVATE: rsEmpty NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: rsFull NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: rsUsedW NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: sc_aclr NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: sc_sclr NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: wsEmpty NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: wsFull NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: wsUsedW NUMERIC "1"
|
||||
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone III"
|
||||
-- Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "32"
|
||||
-- Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "OFF"
|
||||
-- Retrieval info: CONSTANT: LPM_TYPE STRING "dcfifo"
|
||||
-- Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "8"
|
||||
-- Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "5"
|
||||
-- Retrieval info: CONSTANT: LPM_WIDTHU_R NUMERIC "4"
|
||||
-- Retrieval info: CONSTANT: LPM_WIDTH_R NUMERIC "16"
|
||||
-- Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "ON"
|
||||
-- Retrieval info: CONSTANT: RDSYNC_DELAYPIPE NUMERIC "5"
|
||||
-- Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "ON"
|
||||
-- Retrieval info: CONSTANT: USE_EAB STRING "ON"
|
||||
-- Retrieval info: CONSTANT: WRITE_ACLR_SYNCH STRING "OFF"
|
||||
-- Retrieval info: CONSTANT: WRSYNC_DELAYPIPE NUMERIC "5"
|
||||
-- Retrieval info: USED_PORT: aclr 0 0 0 0 INPUT GND aclr
|
||||
-- Retrieval info: USED_PORT: data 0 0 8 0 INPUT NODEFVAL data[7..0]
|
||||
-- Retrieval info: USED_PORT: q 0 0 16 0 OUTPUT NODEFVAL q[15..0]
|
||||
-- Retrieval info: USED_PORT: rdclk 0 0 0 0 INPUT NODEFVAL rdclk
|
||||
-- Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL rdreq
|
||||
-- Retrieval info: USED_PORT: wrclk 0 0 0 0 INPUT NODEFVAL wrclk
|
||||
-- Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL wrreq
|
||||
-- Retrieval info: USED_PORT: wrusedw 0 0 5 0 OUTPUT NODEFVAL wrusedw[4..0]
|
||||
-- Retrieval info: CONNECT: @data 0 0 8 0 data 0 0 8 0
|
||||
-- Retrieval info: CONNECT: q 0 0 16 0 @q 0 0 16 0
|
||||
-- Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0
|
||||
-- Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0
|
||||
-- Retrieval info: CONNECT: @rdclk 0 0 0 0 rdclk 0 0 0 0
|
||||
-- Retrieval info: CONNECT: @wrclk 0 0 0 0 wrclk 0 0 0 0
|
||||
-- Retrieval info: CONNECT: wrusedw 0 0 5 0 @wrusedw 0 0 5 0
|
||||
-- Retrieval info: CONNECT: @aclr 0 0 0 0 aclr 0 0 0 0
|
||||
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
|
||||
-- Retrieval info: GEN_FILE: TYPE_NORMAL dcfifo0.vhd TRUE
|
||||
-- Retrieval info: GEN_FILE: TYPE_NORMAL dcfifo0.inc FALSE
|
||||
-- Retrieval info: GEN_FILE: TYPE_NORMAL dcfifo0.cmp TRUE
|
||||
-- Retrieval info: GEN_FILE: TYPE_NORMAL dcfifo0.bsf TRUE
|
||||
-- Retrieval info: GEN_FILE: TYPE_NORMAL dcfifo0_inst.vhd FALSE
|
||||
-- Retrieval info: GEN_FILE: TYPE_NORMAL dcfifo0_waveforms.html FALSE
|
||||
-- Retrieval info: GEN_FILE: TYPE_NORMAL dcfifo0_wave*.jpg FALSE
|
||||
-- Retrieval info: LIB_FILE: altera_mf
|
||||
@@ -1,202 +0,0 @@
|
||||
-- megafunction wizard: %LPM_FIFO+%
|
||||
-- GENERATION: STANDARD
|
||||
-- VERSION: WM1.0
|
||||
-- MODULE: dcfifo_mixed_widths
|
||||
|
||||
-- ============================================================
|
||||
-- File Name: dcfifo1.vhd
|
||||
-- Megafunction Name(s):
|
||||
-- dcfifo_mixed_widths
|
||||
--
|
||||
-- Simulation Library Files(s):
|
||||
-- altera_mf
|
||||
-- ============================================================
|
||||
-- ************************************************************
|
||||
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
|
||||
--
|
||||
-- 9.1 Build 222 10/21/2009 SJ Web Edition
|
||||
-- ************************************************************
|
||||
|
||||
|
||||
--Copyright (C) 1991-2009 Altera Corporation
|
||||
--Your use of Altera Corporation's design tools, logic functions
|
||||
--and other software and tools, and its AMPP partner logic
|
||||
--functions, and any output files from any of the foregoing
|
||||
--(including device programming or simulation files), and any
|
||||
--associated documentation or information are expressly subject
|
||||
--to the terms and conditions of the Altera Program License
|
||||
--Subscription Agreement, Altera MegaCore Function License
|
||||
--Agreement, or other applicable license agreement, including,
|
||||
--without limitation, that your use is for the sole purpose of
|
||||
--programming logic devices manufactured by Altera and sold by
|
||||
--Altera or its authorized distributors. Please refer to the
|
||||
--applicable agreement for further details.
|
||||
|
||||
|
||||
LIBRARY ieee;
|
||||
USE ieee.std_logic_1164.all;
|
||||
|
||||
LIBRARY altera_mf;
|
||||
USE altera_mf.all;
|
||||
|
||||
ENTITY dcfifo1 IS
|
||||
PORT
|
||||
(
|
||||
aclr : IN STD_LOGIC := '0';
|
||||
data : IN STD_LOGIC_VECTOR (15 DOWNTO 0);
|
||||
rdclk : IN STD_LOGIC ;
|
||||
rdreq : IN STD_LOGIC ;
|
||||
wrclk : IN STD_LOGIC ;
|
||||
wrreq : IN STD_LOGIC ;
|
||||
q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
|
||||
wrusedw : OUT STD_LOGIC_VECTOR (3 DOWNTO 0)
|
||||
);
|
||||
END dcfifo1;
|
||||
|
||||
|
||||
ARCHITECTURE SYN OF dcfifo1 IS
|
||||
|
||||
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (3 DOWNTO 0);
|
||||
SIGNAL sub_wire1 : STD_LOGIC_VECTOR (7 DOWNTO 0);
|
||||
|
||||
|
||||
|
||||
COMPONENT dcfifo_mixed_widths
|
||||
GENERIC (
|
||||
intended_device_family : STRING;
|
||||
lpm_numwords : NATURAL;
|
||||
lpm_showahead : STRING;
|
||||
lpm_type : STRING;
|
||||
lpm_width : NATURAL;
|
||||
lpm_widthu : NATURAL;
|
||||
lpm_widthu_r : NATURAL;
|
||||
lpm_width_r : NATURAL;
|
||||
overflow_checking : STRING;
|
||||
rdsync_delaypipe : NATURAL;
|
||||
underflow_checking : STRING;
|
||||
use_eab : STRING;
|
||||
write_aclr_synch : STRING;
|
||||
wrsync_delaypipe : NATURAL
|
||||
);
|
||||
PORT (
|
||||
wrclk : IN STD_LOGIC ;
|
||||
rdreq : IN STD_LOGIC ;
|
||||
wrusedw : OUT STD_LOGIC_VECTOR (3 DOWNTO 0);
|
||||
aclr : IN STD_LOGIC ;
|
||||
rdclk : IN STD_LOGIC ;
|
||||
q : OUT STD_LOGIC_VECTOR (7 DOWNTO 0);
|
||||
wrreq : IN STD_LOGIC ;
|
||||
data : IN STD_LOGIC_VECTOR (15 DOWNTO 0)
|
||||
);
|
||||
END COMPONENT;
|
||||
|
||||
BEGIN
|
||||
wrusedw <= sub_wire0(3 DOWNTO 0);
|
||||
q <= sub_wire1(7 DOWNTO 0);
|
||||
|
||||
dcfifo_mixed_widths_component : dcfifo_mixed_widths
|
||||
GENERIC MAP (
|
||||
intended_device_family => "Cyclone III",
|
||||
lpm_numwords => 16,
|
||||
lpm_showahead => "OFF",
|
||||
lpm_type => "dcfifo",
|
||||
lpm_width => 16,
|
||||
lpm_widthu => 4,
|
||||
lpm_widthu_r => 5,
|
||||
lpm_width_r => 8,
|
||||
overflow_checking => "ON",
|
||||
rdsync_delaypipe => 5,
|
||||
underflow_checking => "ON",
|
||||
use_eab => "ON",
|
||||
write_aclr_synch => "OFF",
|
||||
wrsync_delaypipe => 5
|
||||
)
|
||||
PORT MAP (
|
||||
wrclk => wrclk,
|
||||
rdreq => rdreq,
|
||||
aclr => aclr,
|
||||
rdclk => rdclk,
|
||||
wrreq => wrreq,
|
||||
data => data,
|
||||
wrusedw => sub_wire0,
|
||||
q => sub_wire1
|
||||
);
|
||||
|
||||
|
||||
|
||||
END SYN;
|
||||
|
||||
-- ============================================================
|
||||
-- CNX file retrieval info
|
||||
-- ============================================================
|
||||
-- Retrieval info: PRIVATE: AlmostEmpty NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: AlmostEmptyThr NUMERIC "-1"
|
||||
-- Retrieval info: PRIVATE: AlmostFull NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: AlmostFullThr NUMERIC "-1"
|
||||
-- Retrieval info: PRIVATE: CLOCKS_ARE_SYNCHRONIZED NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: Clock NUMERIC "4"
|
||||
-- Retrieval info: PRIVATE: Depth NUMERIC "16"
|
||||
-- Retrieval info: PRIVATE: Empty NUMERIC "1"
|
||||
-- Retrieval info: PRIVATE: Full NUMERIC "1"
|
||||
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone III"
|
||||
-- Retrieval info: PRIVATE: LE_BasedFIFO NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: LegacyRREQ NUMERIC "1"
|
||||
-- Retrieval info: PRIVATE: MAX_DEPTH_BY_9 NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: OVERFLOW_CHECKING NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: Optimize NUMERIC "1"
|
||||
-- Retrieval info: PRIVATE: RAM_BLOCK_TYPE NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
|
||||
-- Retrieval info: PRIVATE: UNDERFLOW_CHECKING NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: UsedW NUMERIC "1"
|
||||
-- Retrieval info: PRIVATE: Width NUMERIC "16"
|
||||
-- Retrieval info: PRIVATE: dc_aclr NUMERIC "1"
|
||||
-- Retrieval info: PRIVATE: diff_widths NUMERIC "1"
|
||||
-- Retrieval info: PRIVATE: msb_usedw NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: output_width NUMERIC "8"
|
||||
-- Retrieval info: PRIVATE: rsEmpty NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: rsFull NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: rsUsedW NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: sc_aclr NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: sc_sclr NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: wsEmpty NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: wsFull NUMERIC "0"
|
||||
-- Retrieval info: PRIVATE: wsUsedW NUMERIC "1"
|
||||
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone III"
|
||||
-- Retrieval info: CONSTANT: LPM_NUMWORDS NUMERIC "16"
|
||||
-- Retrieval info: CONSTANT: LPM_SHOWAHEAD STRING "OFF"
|
||||
-- Retrieval info: CONSTANT: LPM_TYPE STRING "dcfifo"
|
||||
-- Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "16"
|
||||
-- Retrieval info: CONSTANT: LPM_WIDTHU NUMERIC "4"
|
||||
-- Retrieval info: CONSTANT: LPM_WIDTHU_R NUMERIC "5"
|
||||
-- Retrieval info: CONSTANT: LPM_WIDTH_R NUMERIC "8"
|
||||
-- Retrieval info: CONSTANT: OVERFLOW_CHECKING STRING "ON"
|
||||
-- Retrieval info: CONSTANT: RDSYNC_DELAYPIPE NUMERIC "5"
|
||||
-- Retrieval info: CONSTANT: UNDERFLOW_CHECKING STRING "ON"
|
||||
-- Retrieval info: CONSTANT: USE_EAB STRING "ON"
|
||||
-- Retrieval info: CONSTANT: WRITE_ACLR_SYNCH STRING "OFF"
|
||||
-- Retrieval info: CONSTANT: WRSYNC_DELAYPIPE NUMERIC "5"
|
||||
-- Retrieval info: USED_PORT: aclr 0 0 0 0 INPUT GND aclr
|
||||
-- Retrieval info: USED_PORT: data 0 0 16 0 INPUT NODEFVAL data[15..0]
|
||||
-- Retrieval info: USED_PORT: q 0 0 8 0 OUTPUT NODEFVAL q[7..0]
|
||||
-- Retrieval info: USED_PORT: rdclk 0 0 0 0 INPUT NODEFVAL rdclk
|
||||
-- Retrieval info: USED_PORT: rdreq 0 0 0 0 INPUT NODEFVAL rdreq
|
||||
-- Retrieval info: USED_PORT: wrclk 0 0 0 0 INPUT NODEFVAL wrclk
|
||||
-- Retrieval info: USED_PORT: wrreq 0 0 0 0 INPUT NODEFVAL wrreq
|
||||
-- Retrieval info: USED_PORT: wrusedw 0 0 4 0 OUTPUT NODEFVAL wrusedw[3..0]
|
||||
-- Retrieval info: CONNECT: @data 0 0 16 0 data 0 0 16 0
|
||||
-- Retrieval info: CONNECT: q 0 0 8 0 @q 0 0 8 0
|
||||
-- Retrieval info: CONNECT: @wrreq 0 0 0 0 wrreq 0 0 0 0
|
||||
-- Retrieval info: CONNECT: @rdreq 0 0 0 0 rdreq 0 0 0 0
|
||||
-- Retrieval info: CONNECT: @rdclk 0 0 0 0 rdclk 0 0 0 0
|
||||
-- Retrieval info: CONNECT: @wrclk 0 0 0 0 wrclk 0 0 0 0
|
||||
-- Retrieval info: CONNECT: wrusedw 0 0 4 0 @wrusedw 0 0 4 0
|
||||
-- Retrieval info: CONNECT: @aclr 0 0 0 0 aclr 0 0 0 0
|
||||
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
|
||||
-- Retrieval info: GEN_FILE: TYPE_NORMAL dcfifo1.vhd TRUE
|
||||
-- Retrieval info: GEN_FILE: TYPE_NORMAL dcfifo1.inc FALSE
|
||||
-- Retrieval info: GEN_FILE: TYPE_NORMAL dcfifo1.cmp TRUE
|
||||
-- Retrieval info: GEN_FILE: TYPE_NORMAL dcfifo1.bsf TRUE
|
||||
-- Retrieval info: GEN_FILE: TYPE_NORMAL dcfifo1_inst.vhd FALSE
|
||||
-- Retrieval info: GEN_FILE: TYPE_NORMAL dcfifo1_waveforms.html FALSE
|
||||
-- Retrieval info: GEN_FILE: TYPE_NORMAL dcfifo1_wave*.jpg FALSE
|
||||
-- Retrieval info: LIB_FILE: altera_mf
|
||||
Reference in New Issue
Block a user