Author SHA1 Message Date
Markus Fröschle fab65c7718 remove generated files from git 2019-08-28 16:35:08 +02:00
Markus Fröschle d50983a69b add more file extensions of generated files 2019-08-28 16:34:31 +02:00
Markus Fröschle 18fcbbd7de add .pin file type 2019-08-28 08:36:19 +02:00
Markus Fröschle b5e9e10bc3 fix typo in .qpf and Makefile 2019-08-28 08:21:59 +02:00
Markus Fröschle cc0a0fb8bf fix (potential) typo in .qpf naming 2019-08-28 08:20:40 +02:00
Markus Fröschle bbc93f9498 add more generated files to .gitignore 2019-08-28 08:17:14 +02:00
Markus Fröschle 1b90408416 add .gitignore and Makefile 2019-08-28 08:12:52 +02:00
Markus Fröschle 02834eaa01 fix DOS path names 2019-08-28 08:12:26 +02:00
Markus Fröschle eb3e414002 fix capitalization in include path name 2019-08-28 08:11:34 +02:00
Markus Fröschle 6021b6ee96 remove unneeded files 2018-04-28 11:27:16 +02:00
David Gálvez 38144f937c Create README.md 2018-04-09 17:33:13 +02:00
David Gálvez 3a91813da7 Sync with Fredi's source 22/06/2017
Blitter work.
2018-04-09 17:25:52 +02:00
David Gálvez 343ede8328 Sync with Fredi's source tree 18/04/2017
Blitter work.
2018-04-09 17:23:44 +02:00
David Gálvez b2d17efff1 Sync with Fredi's source tree 15/04/2017
IDE and Blitter work.
2018-04-09 17:21:35 +02:00
David Gálvez 68129dbe57 Sync with Fredi's source tree 13/06/2015
Parallel port fix.
2018-04-09 17:19:13 +02:00
aschi54 3fb6e3bd8a Initial commit 2018-04-09 13:18:37 +02:00
451 changed files with 37823 additions and 17604 deletions
-52
View File
@@ -1,52 +0,0 @@
library ieee;
use ieee.std_logic_1164.all;
-- Entity Declaration
entity dsp is
port
(
CLK33M : in std_logic;
MAIN_CLK : in std_logic;
nFB_OE : in std_logic;
nFB_WR : in std_logic;
nFB_CS1 : in std_logic;
nFB_CS2 : 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);
nRSTO : in std_logic;
nFB_CS3 : in std_logic;
nSRCS : inout std_logic;
nSRBLE : out std_logic;
nSRBHE : out std_logic;
nSRWE : out std_logic;
nSROE : out std_logic;
DSP_INT : out std_logic;
DSP_TA : out std_logic;
fb_ad_in : in std_logic_vector(31 downto 0);
fb_ad_out : out std_logic_vector(31 downto 0);
IO : inout std_logic_vector(17 downto 0);
SRD : inout std_logic_vector(15 downto 0)
);
end dsp;
-- Architecture Body
architecture rtl of dsp is
begin
nSRCS <= '0' when nFB_CS2 = '0' and FB_ADR(27 downto 24) = x"4" else '1'; --nFB_CS3;
nSRBHE <= '0' when FB_ADR(0 downto 0) = "0" else '1';
nSRBLE <= '1' when FB_ADR(0 downto 0) = "0" and FB_SIZE1 = '0' and FB_SIZE0 = '1' else '0';
nSRWE <= '0' when nFB_WR = '0' and nSRCS = '0' and MAIN_CLK = '0' else '1';
nSROE <= '0' when nFB_OE = '0' and nSRCS = '0' else '1';
DSP_INT <= '0';
DSP_TA <= '0';
IO(17 downto 0) <= FB_ADR(18 downto 1);
SRD(15 downto 0) <= fb_ad_in(31 downto 16) when nFB_WR = '0' and nSRCS = '0' else (others => 'Z');
-- fb_ad_out(31 downto 16) <= srd(15 DOWNTO 0 )when nFB_OE = '0' AND nSRCS = '0' ELSE (others => 'Z');
fb_ad_out(31 downto 0) <= (others => 'Z'); -- otherwise we get a constant driver error
end rtl;
Binary file not shown.
File diff suppressed because it is too large Load Diff
@@ -1,432 +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 - 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.
--
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.ALL;
ENTITY WF6850IP_RECEIVE IS
PORT
(
CLK : IN std_logic;
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 rtl 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(CLK)
-- 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
IF rising_edge(CLK) THEN
--
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 IF;
END PROCESS p_sample;
clkdiv : PROCESS(CLK)
VARIABLE CLK_LOCK : boolean;
VARIABLE STRB_LOCK : boolean;
VARIABLE CLK_DIVCNT : std_logic_vector(6 DOWNTO 0);
BEGIN
IF rising_edge(CLK) THEN
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 IF;
END PROCESS clkdiv;
datareg : PROCESS(RESETn, CLK)
BEGIN
IF RESETn = '0' or MCLR = '1' THEN
DATA_REG <= x"00";
ELSE
IF rising_edge(CLK) THEN
IF 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 IF;
END PROCESS datareg;
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' or MCLR = '1' THEN
SHIFT_REG <= x"00";
ELSE
IF rising_edge(CLK) THEN
IF RCV_STATE = SAMPLE and CLK_STRB = '1' THEN
SHIFT_REG <= RXDATA_S & SHIFT_REG(7 DOWNTO 1); -- Shift right.
END IF;
END IF;
END IF;
END PROCESS shiftreg;
p_bitcnt : PROCESS(CLK)
BEGIN
IF rising_edge(CLK) THEN
IF RCV_STATE = SAMPLE and CLK_STRB = '1' THEN
BITCNT <= BITCNT + '1';
ELSIF RCV_STATE /= SAMPLE THEN
BITCNT <= (OTHERS => '0');
END IF;
END IF;
END PROCESS p_bitcnt;
p_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';
ELSE
IF rising_edge(CLK) 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 IF;
END PROCESS p_frame_err;
p_overrun : PROCESS(RESETn, CLK)
VARIABLE OVR_I : bit;
VARIABLE FIRST_READ : boolean;
BEGIN
IF rising_edge(CLK) THEN
IF RESETn = '0' or MCLR = '1' THEN
OVR_I := '0';
OVR <= '0';
FIRST_READ := false;
ELSE
IF 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' 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
IF OVR_I = '1' THEN
OVR <= '1';
OVR_I := '0';
FIRST_READ := true;
ELSE
OVR <= '0';
END IF;
END IF;
ELSE
FIRST_READ := false;
END IF;
END IF;
END IF;
END PROCESS p_overrun;
p_parity_test : PROCESS(RESETn,MCLR,CLK)
VARIABLE PAR_TMP : bit;
VARIABLE PE_I : bit;
BEGIN
IF RESETn = '0' or MCLR = '1' THEN
PE <= '0';
ELSE
IF rising_edge(CLK) THEN
IF 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;
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' THEN
PE <= '0'; -- Clear when reading the data register.
END IF;
END IF;
END PROCESS p_parity_test;
p_rdrf : process(RESETn, CLK)
-- Receive data register full flag.
BEGIN
IF rising_edge(CLK) THEN
IF RESETn = '0' or MCLR = '1' THEN
RDRF <= '0';
ELSE
IF RCV_STATE = SYNC THEN
RDRF <= '1'; -- Data register is full until now!
END IF;
IF CS = "011" and RWn = '1' and RS = '1' THEN
RDRF <= '0'; -- when reading the data register ...
END IF;
END IF;
END IF;
END PROCESS p_rdrf;
p_rcv_statereg : PROCESS(RESETn, CLK)
BEGIN
IF RESETn = '0' THEN
RCV_STATE <= IDLE;
ELSE
IF rising_edge(CLK) THEN
IF MCLR = '1' THEN
RCV_STATE <= IDLE;
ELSE
RCV_STATE <= RCV_NEXT_STATE;
END IF;
END IF;
END IF;
END PROCESS p_rcv_statereg;
p_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 p_rcv_statedec;
END ARCHITECTURE rtl;
File diff suppressed because it is too large Load Diff
-2
View File
@@ -1,2 +0,0 @@
# FPGA_Quartus_13.1
FireBee's FPGA developed on Quartus 13.1
-4
View File
@@ -1,4 +0,0 @@
set_global_assignment -name IP_TOOL_NAME "ALTPLL"
set_global_assignment -name IP_TOOL_VERSION "13.1"
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "altpll1.vhd"]
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "altpll1.ppf"]
-238
View File
@@ -1,238 +0,0 @@
#--------------------------------------------------------------#
# #
# Synopsis design constraints for the Firebee project #
# #
# This file is part of the Firebee ACP project. #
# http://www.firebee.org #
# #
# Description: #
# timing constraints for the Firebee VHDL config #
# #
# #
# #
# To Do: #
# - #
# #
# Author(s): #
# Markus Fröschle, mfro@mubf.de #
# #
#--------------------------------------------------------------#
# #
# Copyright (C) 2015 Markus Fröschle & the ACP project #
# #
# 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 #
# #
################################################################
#**************************************************************
# Time Information
#**************************************************************
set_time_format -unit ns -decimal_places 3
#**************************************************************
# Create Clock
#**************************************************************
create_clock -name {MAIN_CLK} -period 30.303 -waveform { 0.000 15.151 } [get_ports {MAIN_CLK}]
# Clocks used:
# MAIN_CLK 33MHz
#
# PLL1: i_mfp_acia_clk_pll
# input: MAIN_CLK
# c0: 500 kHz
# c1: 2.4576 MHz
# c2: 24.576 MHz
#
# PLL2: i_ddr_clock_pll
# input: MAIN_CLK
# c0: 132 MHz 190°
# c1: 132 MHz 0°
# c2: 132 MHz 180°
# c3: 132 MHz 105°
# c4: 66 MHz 270°
#
# PLL3: i_atari_clk_pll
# input: MAIN_CLK
# c0: 2 MHz
# c1: 16 MHz
# c2: 25 MHz
# c3: 48 MHz
#
# PLL4_ i_video_clk_pll
# input: USB_CLK (48 MHz, PLL3 c3)
# c0: 96 MHz, programmable in 1MHz steps
#
#**************************************************************
# Create Generated Clock
#**************************************************************
derive_pll_clocks
# PIXEL_CLK is either
# CLK13M, CLK17M, CLK25M, CLK33M or CLK_VIDEO
# where CLK13M is half of CLK25M,
# CLK17M is half of CLK33M and CLK_VIDEO is the freely programmable
# clock of i_video_clk_pll
#
#**************************************************************
# Set Clock Latency
#**************************************************************
#**************************************************************
# Set Clock Uncertainty
#**************************************************************
#set_clock_uncertainty -rise_from [get_clocks {MAIN_CLK}] -rise_to [get_clocks {MAIN_CLK}] 2.00
#set_clock_uncertainty -rise_from [get_clocks {MAIN_CLK}] -fall_to [get_clocks {MAIN_CLK}] 2.00
derive_clock_uncertainty
#**************************************************************
# Set Input Delay
#**************************************************************
# set_input_delay -add_delay -clock [get_clocks {MAIN_CLK}] -min 2.500 [all_inputs]
# set_input_delay -add_delay -clock [get_clocks {MAIN_CLK}] -max 2.500 [all_inputs]
#set_input_delay -add_delay -clock [get_clocks {MAIN_CLK}] -min 1.500 [get_ports {FB*}]
#set_input_delay -add_delay -clock [get_clocks {MAIN_CLK}] -min 1.500 {nFB_CS1 nFB_CS2 nFB_CS3 nFB_OE}
#set_input_delay -add_delay -clock [get_clocks {MAIN_CLK}] -max 1.500 [get_ports {FB*}]
#set_input_delay -add_delay -clock [get_clocks {MAIN_CLK}] -max 1.500 {nFB_CS1 nFB_CS2 nFB_CS3 nFB_OE}
#**************************************************************
# Set Output Delay
#**************************************************************
# set_output_delay -add_delay -clock [get_clocks {MAIN_CLK}] -min 2.500 [all_outputs]
# set_output_delay -add_delay -clock [get_clocks {MAIN_CLK}] -max 2.500 [all_outputs]
#set_output_delay -add_delay -clock [get_clocks {MAIN_CLK}] -min 1.500 [get_ports {FB*}]
#set_output_delay -add_delay -clock [get_clocks {MAIN_CLK}] -min 1.500 {nFB_TA}
#set_output_delay -add_delay -clock [get_clocks {MAIN_CLK}] -max 1.500 [get_ports {FB*}]
#set_output_delay -add_delay -clock [get_clocks {MAIN_CLK}] -max 1.500 {nFB_TA}
# video RAM access
#set_output_delay -add_delay -clock [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -min 0.500 [get_ports {VA[*]}]
#set_output_delay -add_delay -clock [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -max 0.500 [get_ports {VA[*]}]
#set_output_delay -add_delay -clock [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -min 0.500 [get_ports {VD[*]}]
#set_output_delay -add_delay -clock [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -max 0.500 [get_ports {VD[*]}]
#set_output_delay -add_delay -clock [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -min 0.500 [get_ports {VDQS[*]}]
#set_output_delay -add_delay -clock [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -max 0.500 [get_ports {VDQS[*]}]
#set_output_delay -add_delay -clock [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -min 0.500 [get_ports {VDM[*]}]
#set_output_delay -add_delay -clock [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -max 0.500 [get_ports {VDM[*]}]
#set_output_delay -add_delay -clock [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -min 0.500 {nVCAS nVRAS nVWE nVCS VCKE DDR_CLK nDDR_CLK BA[*]}
#set_output_delay -add_delay -clock [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -max 0.500 {nVCAS nVRAS nVWE nVCS VCKE DDR_CLK nDDR_CLK BA[*]}
#**************************************************************
# Set Clock Groups
#**************************************************************
#**************************************************************
# Set False Path
#**************************************************************
#
# i_video_clk is freely programmable
#
set_false_path -from [get_clocks {MAIN_CLK}] -to [get_clocks {i_video_clk_pll|altpll_component|auto_generated|pll1|clk[0]}]
# MAIN_CLK to 16 MHz clk -> false_path
set_false_path -from [get_clocks {MAIN_CLK}] -to [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[1]}]
set_false_path -from [get_clocks {MAIN_CLK}] -to [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[2]}]
# MAIN_CLK to DDR clk and v.v.
set_false_path -from [get_clocks {MAIN_CLK}] -to [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}]
set_false_path -from [get_clocks {MAIN_CLK}] -to [get_clocks {i_mfp_acia_clk_pll|altpll_component|auto_generated|pll1|clk[1]}]
set_false_path -from [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -to [get_clocks {MAIN_CLK}]
set_false_path -from [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[3]}] -to [get_clocks {MAIN_CLK}]
set_false_path -from [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[4]}] -to [get_clocks {MAIN_CLK}]
set_false_path -from [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[4]}] -to [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}]
set_false_path -from [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[4]}] -to [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[1]}]
set_false_path -from [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[4]}] -to [get_clocks {i_mfp_acia_clk_pll|altpll_component|auto_generated|pll1|clk[1]}]
set_false_path -from [get_clocks {i_mfp_acia_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -to [get_clocks {MAIN_CLK}]
set_false_path -from [get_clocks {i_mfp_acia_clk_pll|altpll_component|auto_generated|pll1|clk[1]}] -to [get_clocks {MAIN_CLK}]
set_false_path -from [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -to [get_clocks {i_video_clk_pll|altpll_component|auto_generated|pll1|clk[0]}]
# 2 MHz to 33 MHz
set_false_path -from [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -to [get_clocks {MAIN_CLK}]
set_false_path -from [get_clocks {MAIN_CLK}] -to [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[0]}]
set_false_path -from [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[3]}] -to [get_clocks {MAIN_CLK}]
# 16 MHz to 33 MHz
set_false_path -from [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[1]}] -to [get_clocks {MAIN_CLK}]
set_false_path -from [get_clocks {MAIN_CLK}] -to [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[1]}]
# 25 MHz to 33 MHz
set_false_path -from [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[2]}] -to [get_clocks {MAIN_CLK}]
set_false_path -from [get_clocks {MAIN_CLK}] -to [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[2]}]
set_false_path -from [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -to [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}]
set_false_path -from [get_clocks {i_mfp_acia_clk_pll|altpll_component|auto_generated|pll1|clk[2]}] -to [get_clocks {MAIN_CLK}]
set_false_path -from [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[2]}] -to [get_clocks {i_video_clk_pll|altpll_component|auto_generated|pll1|clk[0]}]
set_false_path -from [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[2]}] -to [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}]
set_false_path -from [get_clocks {i_video_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -to [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[2]}]
set_false_path -from [get_clocks {i_video_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -to [get_clocks {MAIN_CLK}]
set_false_path -from [get_clocks {MAIN_CLK}] -to [get_clocks {i_video_clk_pll|altpll_component|auto_generated|pll1|clk[0]}]
set_false_path -from [get_clocks {i_video_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -to [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}]
set_false_path -from [get_clocks {i_video_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] -to [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[0]}]
set_false_path -from [get_keepers {*rdptr_g*}] -to [get_keepers {*ws_dgrp|dffpipe_id9:dffpipe17|dffe18a*}]
set_false_path -from [get_keepers {*delayed_wrptr_g*}] -to [get_keepers {*rs_dgwp|dffpipe_hd9:dffpipe12|dffe13a*}]
set_false_path -from [get_keepers {*rdptr_g*}] -to [get_keepers {*ws_dgrp|dffpipe_kd9:dffpipe15|dffe16a*}]
set_false_path -from [get_keepers {*delayed_wrptr_g*}] -to [get_keepers {*rs_dgwp|dffpipe_jd9:dffpipe12|dffe13a*}]
set_false_path -from [get_keepers {*rdptr_g*}] -to [get_keepers {*ws_dgrp|dffpipe_re9:dffpipe19|dffe20a*}]
#**************************************************************
# Set Multicycle Path
#**************************************************************
#**************************************************************
# Set Maximum Delay
#**************************************************************
#**************************************************************
# Set Minimum Delay
#**************************************************************
#**************************************************************
# Set Input Transition
#**************************************************************
-665
View File
@@ -1,665 +0,0 @@
library ieee;
use ieee.std_logic_1164.all;
library altera;
use altera.altera_primitives_components.all;
library work;
entity firebee1 is
port
(
MAIN_CLK : in std_logic;
nRSTO_MCF : in std_logic;
CLK33MDIR : in std_logic;
-- the ColdFire FlexBus signals
FB_ALE : in std_logic;
FB_AD : inout std_logic_vector(31 downto 0);
nFB_OE : in std_logic;
nFB_WR : in std_logic;
nFB_TA : out std_logic;
nFB_CS1 : in std_logic;
nFB_CS2 : in std_logic;
nFB_CS3 : in std_logic;
FB_SIZE0 : in std_logic;
FB_SIZE1 : in std_logic;
nFB_BURST : in std_logic;
-- serial port pins
RxD : in std_logic;
CTS : in std_logic;
RI : in std_logic;
DCD : in std_logic;
TxD : out std_logic;
RTS : out std_logic;
DTR : out std_logic;
-- parallel port
LP_D : inout std_logic_vector(7 downto 0);
LP_STR : out std_logic;
LPDIR : out std_logic;
LP_BUSY : 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_CF_CARD : in std_logic;
TRACK00 : in std_logic;
nWP : in std_logic;
nDCHG : in std_logic;
SD_DATA0 : in std_logic;
SD_DATA1 : in std_logic;
SD_DATA2 : in std_logic;
sd_card_detect : in std_logic;
nSCSI_DRQ : in std_logic;
SD_WP : in std_logic;
nRD_DATA : in std_logic;
nSCSI_C_D : in std_logic;
nSCSI_I_O : in std_logic;
nSCSI_MSG : in std_logic;
nDACK0 : in std_logic;
PIC_INT : in std_logic;
TOUT0 : in std_logic;
nMASTER : in std_logic;
DVI_INT : in std_logic;
nDACK1 : in std_logic;
nPCI_INTD : in std_logic;
nPCI_INTC : in std_logic;
nPCI_INTB : in std_logic;
nPCI_INTA : in std_logic;
E0_INT : in std_logic;
nINDEX : in std_logic;
HD_DD : in std_logic;
SCSI_PAR : inout std_logic;
nSCSI_RST : inout std_logic;
nSCSI_SEL : inout std_logic;
nSCSI_BUSY : inout std_logic;
SCSI_D : inout std_logic_vector(7 downto 0);
nSCSI_ACK : out std_logic;
nSCSI_ATN : out std_logic;
SCSI_DIR : out std_logic;
SD_CD_DATA3 : inout std_logic;
SD_CMD_D1 : inout std_logic;
MIDI_IN_PIN : inout std_logic;
IO : inout std_logic_vector(17 downto 0);
SRD : inout std_logic_vector(15 downto 0);
VD : inout std_logic_vector(31 downto 0);
VDQS : inout std_logic_vector(3 downto 0);
nACSI_DRQ : in std_logic;
nACSI_INT : in 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;
ACSI_D : inout std_logic_vector(7 downto 0);
MIDI_TLR : out std_logic;
AMKB_TX : out std_logic;
IDE_RES : out std_logic;
nIDE_CS0 : out std_logic;
nIDE_CS1 : out std_logic;
nIDE_WR : out std_logic;
nIDE_RD : out std_logic;
nCF_CS0 : out std_logic;
nCF_CS1 : out std_logic;
nROM3 : out std_logic;
nROM4 : out std_logic;
nRP_UDS : out std_logic;
nRP_LDS : out std_logic;
nSDSEL : out std_logic;
nWR_GATE : out std_logic;
nWR : out std_logic;
YM_QA : out std_logic;
YM_QB : out std_logic;
YM_QC : out std_logic;
SD_CLK : out std_logic;
DSA_D : out std_logic;
nPD_VGA : out std_logic;
TIN0 : out std_logic;
nSRCS : out std_logic;
nSRBLE : out std_logic;
nSRBHE : out std_logic;
nSRWE : out std_logic;
nDREQ1 : out std_logic;
LED_FPGA_OK : out std_logic;
nSROE : out std_logic;
nSYNC : out std_logic;
nMOT_ON : out std_logic;
nSTEP_DIR : out std_logic;
nSTEP : out std_logic;
MIDI_OLR : out std_logic;
CLK25M : out std_logic;
CLKUSB : out std_logic;
CLK24M576 : out std_logic;
nIRQ : out std_logic_vector(7 downto 2);
-- DDR memory signals
BA : out std_logic_vector(1 downto 0);
VA : out std_logic_vector(12 downto 0);
VDM : out std_logic_vector(3 downto 0);
VCKE : out std_logic;
nDDR_CLK : out std_logic;
DDR_CLK : out std_logic;
nVWE : out std_logic;
nVCAS : out std_logic;
nVRAS : out std_logic;
nVCS : out std_logic;
-- video signals
VR : out std_logic_vector(7 downto 0);
VG : out std_logic_vector(7 downto 0);
VB : out std_logic_vector(7 downto 0);
VSYNC_PAD : out std_logic;
HSYNC_PAD : out std_logic;
nBLANK_PAD : out std_logic;
PIXEL_CLK_PAD : out std_logic
);
end firebee1;
architecture rtl of firebee1 is
signal acp_conf : std_logic_vector(31 downto 0);
signal clk25m_i : std_logic;
signal clk2m : std_logic;
signal clk2m4576 : std_logic;
signal clk33m : std_logic;
signal clk48m : std_logic;
signal clk500k : std_logic;
signal clk_video : std_logic;
signal ddr_sync_66m : std_logic;
signal ddrclk : std_logic_vector(3 downto 0);
signal dma_drq : std_logic;
signal dsp_int : std_logic;
signal dsp_ta : std_logic;
signal falcon_io_ta : std_logic;
signal fb_adr : std_logic_vector(31 downto 0);
signal fdc_clk : std_logic;
signal hsync : std_logic;
signal int_handler_ta : std_logic;
signal lp_dir : std_logic;
signal midi_in : std_logic;
signal mot_on : std_logic;
signal blank_n : std_logic;
signal dreq0_n : std_logic;
signal mfp_int_n : std_logic;
signal rsto_n : std_logic;
signal pixel_clk : std_logic;
signal sd_cdm_d1 : std_logic;
signal step : std_logic;
signal step_dir : std_logic;
signal timebase : std_logic_vector(17 downto 0);
signal video_reconfig : std_logic;
signal video_ta : std_logic;
signal vr_busy : std_logic;
signal vr_d : std_logic_vector(8 downto 0);
signal vr_rd : std_logic;
signal vr_wr : std_logic;
signal vsync : std_logic;
signal wr_data : std_logic;
signal wr_gate : std_logic;
signal scandataout : std_logic;
signal scandone : std_logic;
signal reset : std_logic;
signal pll_reset : std_logic;
signal scanclk : std_logic;
signal scandata : std_logic;
signal scan_clkena : std_logic;
signal config_update : std_logic;
signal pll3_locked : std_logic;
signal pll1_locked : std_logic;
signal srcs_n_i : std_logic;
signal fb_wr_n_i : std_logic;
signal ide_rd_n_i : std_logic;
signal ide_wr_n_i : std_logic;
signal fb_ad_in : std_logic_vector(31 downto 0);
signal fb_ad_out : std_logic_vector(31 downto 0);
component altpll_reconfig1
port
(
clock : in std_logic;
counter_param : in std_logic_vector (2 downto 0);
counter_type : in std_logic_vector (3 downto 0);
data_in : in std_logic_vector (8 downto 0);
pll_areset_in : in std_logic := '0';
pll_scandataout : in std_logic;
pll_scandone : in std_logic;
read_param : in std_logic;
reconfig : in std_logic;
reset : in std_logic;
write_param : in std_logic;
busy : out std_logic;
data_out : out std_logic_vector (8 downto 0);
pll_areset : out std_logic;
pll_configupdate : out std_logic;
pll_scanclk : out std_logic;
pll_scanclkena : out std_logic;
pll_scandata : out std_logic
);
end component altpll_reconfig1;
component altpll4
port
(
areset : in std_logic := '0';
configupdate : in std_logic := '0';
inclk0 : in std_logic := '0';
scanclk : in std_logic := '1';
scanclkena : in std_logic := '0';
scandata : in std_logic := '0';
c0 : out std_logic;
locked : out std_logic;
scandataout : out std_logic;
scandone : out std_logic
);
end component altpll4;
begin
nDREQ1 <= nDACK1;
i_atari_clk_pll : work.altpll3
port map
(
inclk0 => MAIN_CLK,
c0 => clk25m_i,
c1 => clk2m,
c2 => clk500k,
c3 => clk2m4576,
locked => pll3_locked
);
i_ddr_clk_pll : work.altpll2
port map
(
inclk0 => MAIN_CLK,
c0 => ddrclk(0),
c1 => ddrclk(1),
c2 => ddrclk(2),
c3 => ddrclk(3),
c4 => ddr_sync_66m
);
i_dsp : work.dsp
port map
(
clk33m => main_clk,
MAIN_CLK => MAIN_CLK,
nFB_OE => nFB_OE,
nFB_WR => nFB_WR,
nFB_CS1 => nFB_CS1,
nFB_CS2 => nFB_CS2,
FB_SIZE0 => FB_SIZE0,
FB_SIZE1 => FB_SIZE1,
nFB_BURST => nFB_BURST,
nrsto => rsto_n,
nFB_CS3 => nFB_CS3,
fb_ad_in => fb_ad_in,
fb_ad_out => fb_ad_out,
fb_adr => fb_adr,
IO => IO,
SRD => SRD,
nSRCS => srcs_n_i,
nSRBLE => nSRBLE,
nSRBHE => nSRBHE,
nSRWE => nSRWE,
nSROE => nSROE,
dsp_int => dsp_int,
dsp_ta => dsp_ta
);
i_falconio_sdcard_ide_cf : entity work.falconio_sdcard_ide_cf
port map
(
clk33m => main_clk,
MAIN_CLK => MAIN_CLK,
clk2m => clk2m,
clk500k => clk500k,
nFB_CS1 => nFB_CS1,
FB_SIZE0 => FB_SIZE0,
FB_SIZE1 => FB_SIZE1,
nFB_BURST => nFB_BURST,
LP_BUSY => LP_BUSY,
nACSI_DRQ => nACSI_DRQ,
nACSI_INT => nACSI_INT,
nSCSI_DRQ => nSCSI_DRQ,
nSCSI_MSG => nSCSI_MSG,
midi_in => midi_in,
RxD => RxD,
CTS => CTS,
RI => RI,
DCD => DCD,
AMKB_RX => AMKB_RX,
PIC_AMKB_RX => PIC_AMKB_RX,
IDE_RDY => IDE_RDY,
IDE_INT => IDE_INT,
WP_CS_CARD => '0',
nINDEX => nINDEX,
TRACK00 => TRACK00,
nRD_DATA => nRD_DATA,
nDCHG => nDCHG,
SD_DATA0 => SD_DATA0,
SD_DATA1 => SD_DATA1,
SD_DATA2 => SD_DATA2,
sd_card_dedect => sd_card_detect,
SD_WP => SD_WP,
nDACK0 => nDACK0,
nFB_WR => nFB_WR,
WP_CF_CARD => WP_CF_CARD,
nWP => nWP,
nFB_CS2 => nFB_CS2,
nrsto => rsto_n,
nSCSI_C_D => nSCSI_C_D,
nSCSI_I_O => nSCSI_I_O,
clk2m4576 => clk2m4576,
nFB_OE => nFB_OE,
vsync => vsync,
hsync => hsync,
dsp_int => dsp_int,
nblank => blank_n,
fdc_clk => fdc_clk,
FB_ALE => FB_ALE,
HD_DD => HD_DD,
SCSI_PAR => SCSI_PAR,
nSCSI_SEL => nSCSI_SEL,
nSCSI_BUSY => nSCSI_BUSY,
nSCSI_RST => nSCSI_RST,
SD_CD_DATA3 => SD_CD_DATA3,
sd_cdm_d1 => sd_cdm_d1,
acp_conf => acp_conf(31 downto 24),
ACSI_D => ACSI_D,
fb_ad_in => fb_ad_in,
fb_ad_out => fb_ad_out,
fb_adr => fb_adr,
LP_D => LP_D,
SCSI_D => SCSI_D,
nIDE_CS1 => nIDE_CS1,
nIDE_CS0 => nIDE_CS0,
LP_STR => LP_STR,
lp_dir => lp_dir,
nACSI_ACK => nACSI_ACK,
nACSI_RESET => nACSI_RESET,
nACSI_CS => nACSI_CS,
ACSI_DIR => ACSI_DIR,
ACSI_A1 => ACSI_A1,
nSCSI_ACK => nSCSI_ACK,
nSCSI_ATN => nSCSI_ATN,
SCSI_DIR => SCSI_DIR,
SD_CLK => SD_CLK,
YM_QA => YM_QA,
YM_QC => YM_QC,
YM_QB => YM_QB,
nSDSEL => nSDSEL,
step => step,
mot_on => mot_on,
nRP_LDS => nRP_LDS,
nRP_UDS => nRP_UDS,
nROM4 => nROM4,
nROM3 => nROM3,
nCF_CS1 => nCF_CS1,
nCF_CS0 => nCF_CS0,
nIDE_RD => ide_rd_n_i,
nIDE_WR => ide_wr_n_i,
AMKB_TX => AMKB_TX,
IDE_RES => IDE_RES,
DTR => DTR,
RTS => RTS,
TxD => TxD,
MIDI_OLR => MIDI_OLR,
DSA_D => DSA_D,
nmfp_int => mfp_int_n,
falcon_io_ta => falcon_io_ta,
step_dir => step_dir,
wr_data => wr_data,
wr_gate => wr_gate,
dma_drq => dma_drq,
MIDI_TLR => MIDI_TLR
);
i_interrupt_handler : entity work.interrupt_handler
port map
(
MAIN_CLK => MAIN_CLK,
nFB_WR => nFB_WR,
nFB_CS1 => nFB_CS1,
nFB_CS2 => nFB_CS2,
FB_SIZE0 => FB_SIZE0,
FB_SIZE1 => FB_SIZE1,
PIC_INT => PIC_INT,
E0_INT => E0_INT,
DVI_INT => DVI_INT,
nPCI_INTA => nPCI_INTA,
nPCI_INTB => nPCI_INTB,
nPCI_INTC => nPCI_INTC,
nPCI_INTD => nPCI_INTD,
nmfp_int => mfp_int_n,
nFB_OE => nFB_OE,
dsp_int => dsp_int,
vsync => vsync,
hsync => hsync,
dma_drq => dma_drq,
nrsto => rsto_n,
fb_ad_in => fb_ad_in,
fb_ad_out => fb_ad_out,
fb_adr => fb_adr,
int_handler_ta => int_handler_ta,
TIN0 => TIN0,
acp_conf => acp_conf,
nIRQ => nIRQ
);
i_mfp_acia_clk_pll : entity work.altpll1
port map
(
inclk0 => MAIN_CLK,
c0 => clk48m,
c1 => fdc_clk,
c2 => CLK24M576,
locked => pll1_locked
);
i_pll_reconfig : altpll_reconfig1
port map
(
reconfig => video_reconfig,
read_param => vr_rd,
write_param => vr_wr,
pll_areset_in => '0',
pll_scandataout => scandataout,
pll_scandone => scandone,
clock => MAIN_CLK,
reset => reset,
counter_param => fb_adr(8 downto 6),
counter_type => fb_adr(5 downto 2),
data_in => FB_AD(24 downto 16),
busy => vr_busy,
pll_scandata => scandata,
pll_scanclk => scanclk,
pll_scanclkena => scan_clkena,
pll_configupdate => config_update,
pll_areset => pll_reset,
data_out => vr_d
);
i_video : entity work.video
port map
(
MAIN_CLK => MAIN_CLK,
nFB_CS1 => nFB_CS1,
nFB_CS2 => nFB_CS2,
nFB_CS3 => nFB_CS3,
nFB_WR => nFB_WR,
FB_SIZE0 => FB_SIZE0,
FB_SIZE1 => FB_SIZE1,
nrsto => rsto_n,
nFB_OE => nFB_OE,
FB_ALE => FB_ALE,
ddr_sync_66m => ddr_sync_66m,
-- clk33m => clk33m,
clk33m => main_clk,
CLK25M => clk25m_i,
clk_video => clk_video,
vr_busy => vr_busy,
ddrclk => ddrclk,
fb_ad_in => fb_ad_in,
fb_ad_out => fb_ad_out,
fb_adr => fb_adr,
VD => VD,
VDQS => VDQS,
vr_d => vr_d,
vr_rd => vr_rd,
nblank => blank_n,
nVWE => nVWE,
nVCAS => nVCAS,
nVRAS => nVRAS,
nVCS => nVCS,
nPD_VGA => nPD_VGA,
VCKE => VCKE,
vsync => vsync,
hsync => hsync,
nSYNC => nSYNC,
VIDEO_TA => video_ta,
pixel_clk => pixel_clk,
video_reconfig => video_reconfig,
vr_wr => vr_wr,
BA => BA,
VA => VA,
VB => VB,
VDM => VDM,
VG => VG,
VR => VR
);
i_video_clk_pll : altpll4
port map
(
inclk0 => clk48m,
areset => pll_reset,
scanclk => scanclk,
scandata => scandata,
scanclkena => scan_clkena,
configupdate => config_update,
c0 => clk_video,
scandataout => scandataout,
scandone => scandone
);
i_fb_adr_latch : entity work.lpm_ff0
port map
(
clock => ddr_sync_66m,
enable => FB_ALE,
data => FB_AD,
q => fb_adr
);
nMOT_ON <= not(mot_on);
nSTEP_DIR <= not(step_dir);
nSTEP <= not(step);
nWR <= not(wr_data);
inst18 : entity work.lpm_counter0
port map
(
clock => clk500k,
q => timebase
);
nWR_GATE <= not(wr_gate);
nFB_TA <= not(video_ta or int_handler_ta or dsp_ta or falcon_io_ta);
fb_ad_in <= FB_AD;
FB_AD <= fb_ad_out when (video_ta or int_handler_ta or dsp_ta or falcon_io_ta) else (others => 'Z');
clk33m <= MAIN_CLK;
reset <= not(rsto_n);
rsto_n <= pll3_locked and pll1_locked and nRSTO_MCF;
inst29 : alt_iobuf
port map
(
i => clk2m,
oe => clk2m,
io => MIDI_IN_PIN,
o => midi_in
);
led_fpga_ok <= timebase(17);
nDDR_CLK <= not(ddrclk(0));
inst5 : entity work.altddio_out3
port map
(
datain_h => vsync,
datain_l => vsync,
outclock => pixel_clk,
dataout => VSYNC_PAD
);
inst6 : entity work.altddio_out3
port map
(
datain_h => hsync,
datain_l => hsync,
outclock => pixel_clk,
dataout => HSYNC_PAD
);
inst8 : entity work.altddio_out3
port map
(
datain_h => blank_n,
datain_l => blank_n,
outclock => pixel_clk,
dataout => nBLANK_PAD
);
inst9 : entity work.altddio_out3
port map
(
datain_h => '0',
datain_l => '1',
outclock => pixel_clk,
dataout => PIXEL_CLK_PAD
);
SD_CMD_D1 <= sd_cdm_d1;
DDR_CLK <= ddrclk(0);
LPDIR <= lp_dir;
CLK25M <= clk25m_i;
CLKUSB <= clk48m;
nSRCS <= srcs_n_i;
nIDE_RD <= ide_rd_n_i;
nIDE_WR <= ide_wr_n_i;
end rtl;
-205
View File
@@ -1,205 +0,0 @@
#--------------------------------------------------------------#
# #
# Synopsis design constraints for the Firebee project #
# #
# This file is part of the Firebee ACP project. #
# http://www.experiment-s.de #
# #
# Description: #
# timing constraints for the Firebee VHDL config #
# #
# #
# #
# To Do: #
# - #
# #
# Author(s): #
# Markus Fröschle, mfro@mubf.de #
# #
#--------------------------------------------------------------#
# #
# Copyright (C) 2015 Markus Fröschle & the ACP project #
# #
# 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 #
# #
################################################################
#**************************************************************
# Time Information
#**************************************************************
set_time_format -unit ns -decimal_places 3
#**************************************************************
# Create Clock
#**************************************************************
create_clock -name {MAIN_CLK} -period 30.303 -waveform { 0.000 15.151 } [get_ports {MAIN_CLK}]
# Clocks used:
# MAIN_CLK 33MHz
#
# PLL1: i_mfp_acia_clk_pll
# input: MAIN_CLK
# c0: 500 kHz
# c1: 2.4576 MHz
# c2: 24.576 MHz
#
# PLL2: i_ddr_clock_pll
# input: MAIN_CLK
# c0: 132 MHz 240°
# c1: 132 MHz 0°
# c2: 132 MHz 180°
# c3: 132 MHz 105°
# c4: 66 MHz 270°
#
# PLL3: i_atari_clk_pll
# input: MAIN_CLK
# c0: 2 MHz
# c1: 16 MHz
# c2: 25 MHz
# c3: 48 MHz
#
# PLL4_ i_video_clk_pll
# input: USB_CLK (48 MHz, PLL3 c3)
# c0: 96 MHz, programmable in 1MHz steps
#
#**************************************************************
# Create Generated Clock
#**************************************************************
derive_pll_clocks
# two (video) clocks created by logic
create_generated_clock -divide_by 2 -source MAIN_CLK i_video|i_video_mod_mux_clutctr|CLK17M_q
create_generated_clock -divide_by 2 -source i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[0] i_video|i_video_mod_mux_clutctr|CLK13M_q
# PIXEL_CLK is either
# CLK13M, CLK17M, CLK25M, CLK33M or CLK_VIDEO
# where CLK13M is half of CLK25M,
# CLK17M is half of CLK33M and CLK_VIDEO is the freely programmable
# clock of i_video_clk_pll
#
# virtual clocks for i/o constraints
create_clock -name virt_main_clk -period 30.303 -waveform { 0.000 15.151 }
create_clock -name virt_ddr_clk0 -period 7.575 -waveform { 0.666 4.456 }
create_clock -name virt_ddr_clk1 -period 7.575 -waveform { 0.0 3.788 }
create_clock -name virt_ddr_clk2 -period 7.575 -waveform { 0.5 4.288 }
create_clock -name virt_ddr_clk3 -period 7.575 -waveform { 0.291 4.080 }
#**************************************************************
# Set Clock Latency
#**************************************************************
#**************************************************************
# Set Clock Uncertainty
#**************************************************************
# set_clock_uncertainty -rise_from [get_clocks {MAIN_CLK}] -rise_to [get_clocks {MAIN_CLK}] 4.5
# set_clock_uncertainty -rise_from [get_clocks {MAIN_CLK}] -fall_to [get_clocks {MAIN_CLK}] 4.5
derive_clock_uncertainty
#**************************************************************
# Set Input Delay
#**************************************************************
#set_input_delay -add_delay -clock [get_clocks {MAIN_CLK}] -max 1.500 [all_inputs]
#set_input_delay -add_delay -clock [get_clocks {MAIN_CLK}] -min 0.500 [all_inputs]
#**************************************************************
# Set Output Delay
#**************************************************************
#set_output_delay -add_delay -clock [get_clocks {MAIN_CLK}] -max 2.500 [all_outputs]
#set_output_delay -add_delay -clock [get_clocks {MAIN_CLK}] -min 0.500 [all_outputs]
#**************************************************************
# Set Clock Groups
#**************************************************************
set_clock_groups -asynchronous -group [get_clocks {MAIN_CLK}] \
[get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[4]}] \
-group [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] \
[get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[1]}] \
[get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[2]}] \
[get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[3]}] \
-group [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] \
-group [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[1]}] \
-group [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[2]}] \
-group [get_clocks {i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[3]}] \
-group [get_clocks {i_mfp_acia_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] \
-group [get_clocks {i_mfp_acia_clk_pll|altpll_component|auto_generated|pll1|clk[1]}] \
-group [get_clocks {i_mfp_acia_clk_pll|altpll_component|auto_generated|pll1|clk[2]}] \
-group [get_clocks {i_video_clk_pll|altpll_component|auto_generated|pll1|clk[0]}] \
-group [get_clocks {video:i_video|video_mod_mux_clutctr:i_video_mod_mux_clutctr|CLK17M_q}] \
-group [get_clocks {video:i_video|video_mod_mux_clutctr:i_video_mod_mux_clutctr|CLK13M_q}]
#**************************************************************
# Set False Path
#**************************************************************
#**************************************************************
# Set Multicycle Path
#**************************************************************
#set_multicycle_path -start -from video:i_video|video_mod_mux_clutctr:i_video_mod_mux_clutctr|CLK17M_q -to i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[0] 2
#set_multicycle_path -start -from video:i_video|video_mod_mux_clutctr:i_video_mod_mux_clutctr|CLK13M_q -to i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[0] 2
#set_multicycle_path -end -from video:i_video|video_mod_mux_clutctr:i_video_mod_mux_clutctr|CLK13M_q -to MAIN_CLK 2
#set_multicycle_path -start -from MAIN_CLK -to i_video_clk_pll|altpll_component|auto_generated|pll1|clk[0] 2
#set_multicycle_path -start -from MAIN_CLK -to i_mfp_acia_clk_pll|altpll_component|auto_generated|pll1|clk[1] 2
#set_multicycle_path -start -from MAIN_CLK -to i_atari_clk_pll|altpll_component|auto_generated|pll1|clk[0] 2
# set_multicycle_path -start -from [get_clocks {MAIN_CLK}] -to [get_clocks {i_ddr_clk_pll|altpll_component|auto_generated|pll1|clk[4]}] 2
#**************************************************************
# Set Maximum Delay
#**************************************************************
#**************************************************************
# Set Minimum Delay
#**************************************************************
#**************************************************************
# Set Input Transition
#**************************************************************
if { [string equal "quartus_fit" $::TimeQuestInfo(nameofexecutable)] } {
post_message -type info "Over constraining hold for MAIN_CLK"
set_clock_uncertainty -add -enable_same_physical_edge -from { MAIN_CLK } -to { MAIN_CLK } -hold 0.2
}
if { [string equal "quartus_fit" $::TimeQuestInfo(nameofexecutable)] } {
post_message -type info "Over constraining setup for i_video_clk_pll|altpll_component|auto_generated|pll1|clk[0]"
set_clock_uncertainty -add -enable_same_physical_edge -from { i_video_clk_pll|altpll_component|auto_generated|pll1|clk[0] } -to { i_video_clk_pll|altpll_component|auto_generated|pll1|clk[0] } -setup 0.25
}
-170
View File
@@ -1,170 +0,0 @@
----------------------------------------------------------------------
---- ----
---- This file is part of the 'Firebee' project. ----
---- http://acp.atari.org ----
---- ----
---- Description: ----
---- This package contains utility functions, procedures and constants
---- for the Firebee project.
----
---- Author(s): ----
---- - Markus Froeschle, mfro@mubf.de
---- ----
----------------------------------------------------------------------
---- ----
---- Copyright (C) 2015 Markus Froeschle
---- ----
---- This source file is free software; you can redistribute it ----
---- and/or modify it under the terms of the GNU General Public ----
---- License as published by the Free Software Foundation; either ----
---- version 2 of the License, or (at your option) any later ----
---- version. ----
---- ----
---- This program 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 General Public License for more ----
---- details. ----
---- ----
---- You should have received a copy of the GNU General Public ----
---- License along with this program; if not, write to the Free ----
---- Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ----
---- Boston, MA 02110-1301, USA. ----
---- ----
----------------------------------------------------------------------
--
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
package firebee_utils_pkg is
function f_addr_cmp_l(signal addr : std_logic_vector; constant addr_const : std_logic_vector) return std_logic;
function f_addr_cmp_w(signal addr : std_logic_vector; constant addr_const : std_logic_vector) return std_logic;
function f_addr_cmp_b(signal addr : std_logic_vector; constant addr_const : std_logic_vector) return std_logic;
function f_addr_cmp_mask(signal addr : std_logic_vector; constant addr_const : std_logic_vector; constant num_ignore : integer) return std_logic;
function max(left : integer; right : integer) return integer;
function min(left : integer; right : integer) return integer;
component synchronizer IS
PORT
(
-- Input ports
source_signal : in std_logic;
target_clock : in std_logic;
target_signal : out std_logic
);
end component synchronizer;
-- size constants for the TSIZE vector
type tsize_t is (SIZE_LONG, SIZE_WORD, SIZE_BYTE, SIZE_LINE, SIZE_TRISTATE);
attribute enum_encoding : string;
attribute enum_encoding of tsize_t: type is "00 10 01 11 ZZ";
-- constant SIZE_LONG : std_logic_vector(1 downto 0) := "00";
-- constant SIZE_WORD : std_logic_vector(1 downto 0) := "10";
-- constant SIZE_BYTE : std_logic_vector(1 downto 0) := "01";
-- constant SIZE_LINE : std_logic_vector(1 downto 0) := "11";
end firebee_utils_pkg;
package body firebee_utils_pkg is
-- returns the smaller of two integers
function min(left : integer; right : integer) return integer is
begin
if left < right then
return left;
else
return right;
end if;
end function min;
-- returns the larger of two integers
function max(left : integer; right : integer) return integer is
begin
if left > right then
return left;
else
return right;
end if;
end function max;
-- returns the number of bits needed to represent n
function log2ceil(n : natural) return natural is
variable n_bit : unsigned(31 downto 0);
begin -- log2ceil
if n = 0 then
return 0;
end if;
n_bit := to_unsigned(n-1,32);
for i in 31 downto 0 loop
if n_bit(i) = '1' then
return i + 1;
end if;
end loop; -- i
return 1;
end log2ceil;
-- this is for arbitrary sized address compares. It compares from the highest bit of addr_const to the lowest - num_ignore
-- bit, thus allowing any size of comparision.
function f_addr_cmp_mask(signal addr : std_logic_vector;
constant addr_const : std_logic_vector;
constant num_ignore : integer
) return std_logic is
variable ret : std_logic := '1';
variable hi : integer;
variable lo : integer;
begin
hi := min(addr_const'high, addr'high);
lo := max(addr_const'low, addr'low);
-- report("faddr_cmp_mask(): hi = " & to_string(hi) & " lo = " & to_string(lo) & " log2ceil(num_ignore) = " & to_string(log2ceil(num_ignore)));
l_loop: for i in hi downto lo + log2ceil(num_ignore) - 1 loop
if addr(i) /= addr_const(i) then
-- synthesis translate_off
-- report("f_addr_cmp_mask(): addr = " & to_hstring(unsigned(addr)) & " differs from addr_const = " & to_hstring(unsigned(addr_const)) &
-- " at bit = " & integer'image(i));
-- report("addr(" & integer'image(i) & ") (" & to_string(addr) & ") = " & to_string(addr(i)) &
-- " addr_const(" & integer'image(i) & ") ( " & to_string(addr_const) & ") = " & to_string(addr_const(i)));
-- synthesis translate_on
ret := '0';
exit l_loop;
else
-- pragma synthesis off
-- report("f_addr_cmp_mask(): addr = " & to_hstring(unsigned(addr)) & " equals to addr_const = " & to_hstring(unsigned(addr_const)) &
-- " at bit = " & integer'image(i));
-- report("addr(" & integer'image(i) & ") (" & to_string(addr) & ") = " & to_string(addr(i)) &
-- " addr_const(" & integer'image(i) & ") ( " & to_string(addr_const) & ") = " & to_string(addr_const(i)));
-- pragma synthesis on
end if;
end loop;
-- pragma synthesis off
report("f_addr_cmp_mask(" & to_hstring(unsigned(addr)) & ", " & to_hstring(unsigned(addr_const)) & "): return " & to_string(ret));
-- pragma synthesis on
return ret;
end function f_addr_cmp_mask;
function f_addr_cmp_l(signal addr : std_logic_vector;
constant addr_const : std_logic_vector
) return std_logic is
begin
return f_addr_cmp_mask(addr, addr_const, 2);
end function f_addr_cmp_l;
function f_addr_cmp_w(signal addr : std_logic_vector;
constant addr_const : std_logic_vector
) return std_logic is
begin
return f_addr_cmp_mask(addr, addr_const, 1);
end function f_addr_cmp_w;
function f_addr_cmp_b(signal addr : std_logic_vector;
constant addr_const : std_logic_vector
) return std_logic is
begin
return f_addr_cmp_mask(addr, addr_const, 0);
end function f_addr_cmp_b;
end package body firebee_utils_pkg;
-115
View File
@@ -1,115 +0,0 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
library work;
use work.firebee_utils_pkg.all;
entity flexbus_register is
generic
(
reg_width : integer := 11;
match_address : std_logic_vector(31 downto 0) := (others => '0');
num_ignore : integer range 0 to 31;
match_fbcs : integer := 0
);
port
(
clk : in std_logic;
-- FlexBus signals
fb_addr : in std_logic_vector(31 downto 0);
fb_ad_in : in std_logic_vector(31 downto 0);
fb_ad_out : out std_logic_vector(31 downto 0);
fb_cs_n : in std_logic_vector(5 downto 1);
fb_wr_n : in std_logic;
fb_oe_n : in std_logic;
fb_size : in std_logic_vector(1 downto 0);
register_ta : out std_logic
);
end entity flexbus_register;
architecture rtl of flexbus_register is
signal fbcs_match : std_logic;
signal address_match : std_logic;
signal fb_b : std_logic_vector(3 downto 0); -- byte selects
signal cs : std_logic;
signal reg_value : std_logic_vector(reg_width - 1 downto 0);
begin
-- byte selects
-- HWORD
-- HHBYT
-- LONG UND LINE
fb_b(0) <= (fb_size(1) and (not fb_size(0)) and (not fb_addr(1))) or
((not fb_size(1)) and fb_size(0) and (not fb_addr(1)) and (not fb_addr(0))) or
((not fb_size(1)) and (not fb_size(0))) or
(fb_size(1) and fb_size(0));
-- HWORD
-- HLBYT
-- LONG UND LINE
fb_b(1) <= (fb_size(1) and (not fb_size(0) and (not fb_addr(1)))) or
((not fb_size(1)) and fb_size(0) and (not fb_addr(1)) and fb_addr(0)) or
((not fb_size(1)) and (not fb_size(0))) or
(fb_size(1) and fb_size(0));
-- LWORD
-- LHBYT
-- LONG UND LINE
fb_b(2) <= (fb_size(1) and (not fb_size(0)) and fb_addr(1)) or
((not fb_size(1)) and fb_size(0) and fb_addr(1) and (not fb_addr(0))) or
((not fb_size(1)) and (not fb_size(0))) or (fb_size(1) and fb_size(0));
-- LWORD
-- LLBYT
-- LONG UND LINE
fb_b(3) <= (fb_size(1) and (not fb_size(0)) and fb_addr(1)) or
((not fb_size(1)) and fb_size(0) and fb_addr(1) and fb_addr(0)) or
((not fb_size(1)) and (not fb_size(0))) or
(fb_size(1) and fb_size(0));
fbcs_match <= '1' when not(fb_cs_n(match_fbcs)) = '1' else '0';
address_match <= f_addr_cmp_mask(fb_addr, match_address, num_ignore);
cs <= '1' when fbcs_match and address_match else '0';
p_copy_data_in : process (all)
begin
reg_value <= reg_value;
if cs and not fb_wr_n then
if reg_width > 24 and fb_b(0) = '1' then -- HH byte
reg_value(reg_width - 1 downto 24) <= fb_ad_in(work.firebee_utils_pkg.min(31, reg_width - 1) downto 24);
end if;
if reg_width > 16 and fb_b(1) = '1' then -- HL byte
reg_value(work.firebee_utils_pkg.min(23, reg_width - 1) downto 16) <= fb_ad_in(work.firebee_utils_pkg.min(23, reg_width - 1) downto 16);
end if;
if reg_width > 8 and fb_b(2) = '1' then -- LH byte
reg_value(work.firebee_utils_pkg.min(15, reg_width - 1) downto 8) <= fb_ad_in(work.firebee_utils_pkg.min(15, reg_width - 1) downto 8);
end if;
if reg_width > 0 and fb_b(3) = '1' then -- LL byte
reg_value(work.firebee_utils_pkg.min(7, reg_width - 1) downto 0) <= fb_ad_in(work.firebee_utils_pkg.min(7, reg_width - 1) downto 0);
end if;
end if;
end process p_copy_data_in;
p_copy_data_out : process (all)
begin
fb_ad_out <= (others => 'Z');
if cs and not fb_oe_n then
if reg_width > 24 and fb_b(0) = '1' then -- HH byte
fb_ad_out(work.firebee_utils_pkg.min(31, reg_width - 1) downto 24) <= reg_value(work.firebee_utils_pkg.min(31, reg_width - 1) downto 24);
end if;
if reg_width > 16 and fb_b(1) = '1' then -- HL byte
fb_ad_out(work.firebee_utils_pkg.min(23, reg_width - 1) downto 16) <= reg_value(work.firebee_utils_pkg.min(23, reg_width - 1) downto 16);
end if;
if reg_width > 8 and fb_b(2) = '1' then -- LH byte
fb_ad_out(work.firebee_utils_pkg.min(15, reg_width - 1) downto 8) <= reg_value(work.firebee_utils_pkg.min(15, reg_width - 1) downto 8);
end if;
if reg_width > 0 and fb_b(3) = '1' then -- LL byte
fb_ad_out(work.firebee_utils_pkg.min(7, reg_width - 1) downto 0) <= reg_value(work.firebee_utils_pkg.min(7, reg_width - 1) downto 0);
end if;
end if;
end process p_copy_data_out;
register_ta <= cs;
end architecture rtl;
@@ -1,47 +0,0 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity blitter is
port
(
nRSTO : in std_logic;
MAIN_CLK : in std_logic;
FB_ALE : in std_logic;
nFB_WR : in std_logic;
nFB_OE : in std_logic;
FB_SIZE0 : in std_logic;
FB_SIZE1 : in std_logic;
VIDEO_RAM_CTR : in std_logic_vector(15 downto 0);
BLITTER_ON : in std_logic;
FB_ADR : in std_logic_vector(31 downto 0);
nFB_CS1 : in std_logic;
nFB_CS2 : in std_logic;
nFB_CS3 : in std_logic;
DDRCLK0 : in std_logic;
BLITTER_DIN : in std_logic_vector(127 downto 0);
BLITTER_DACK : in std_logic_vector(4 downto 0);
SR_BLITTER_DACK : in std_logic;
blitter_run : out std_logic;
blitter_dout : out std_logic_vector(127 downto 0);
blitter_adr : out std_logic_vector(31 downto 0);
blitter_sig : out std_logic;
blitter_wr : out std_logic;
blitter_ta : out std_logic;
fb_ad_in : in std_logic_vector(31 downto 0);
fb_ad_out : out std_logic_vector(31 downto 0)
);
end BLITTER;
architecture rtl of blitter is
begin
blitter_run <= '0';
blitter_dout <= x"FEDCBA9876543210F0F0F0F0F0F0F0F0";
blitter_adr <= x"76543210";
blitter_sig <= '0';
blitter_wr <= '0';
blitter_ta <= '0';
fb_ad_out <= (others => 'Z');
end rtl;
File diff suppressed because it is too large Load Diff
-90
View File
@@ -1,90 +0,0 @@
-- Copyright (C) 1991-2014 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.
-- PROGRAM "Quartus II 64-Bit"
-- VERSION "Version 13.1.4 Build 182 03/12/2014 SJ Web Edition"
-- CREATED "Mon Jan 11 09:37:12 2016"
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY work;
ENTITY mux41 IS
PORT
(
S0 : IN STD_LOGIC;
D2 : IN STD_LOGIC;
INH : IN STD_LOGIC;
D0 : IN STD_LOGIC;
D1 : IN STD_LOGIC;
D3 : IN STD_LOGIC;
S1 : IN STD_LOGIC;
Q : OUT STD_LOGIC
);
END mux41;
ARCHITECTURE bdf_type OF mux41 IS
SIGNAL SYNTHESIZED_WIRE_18 : STD_LOGIC;
SIGNAL SYNTHESIZED_WIRE_19 : STD_LOGIC;
SIGNAL SYNTHESIZED_WIRE_20 : STD_LOGIC;
SIGNAL SYNTHESIZED_WIRE_21 : STD_LOGIC;
SIGNAL SYNTHESIZED_WIRE_22 : STD_LOGIC;
SIGNAL SYNTHESIZED_WIRE_13 : STD_LOGIC;
SIGNAL SYNTHESIZED_WIRE_14 : STD_LOGIC;
SIGNAL SYNTHESIZED_WIRE_15 : STD_LOGIC;
SIGNAL SYNTHESIZED_WIRE_16 : STD_LOGIC;
BEGIN
SYNTHESIZED_WIRE_18 <= NOT(S0);
SYNTHESIZED_WIRE_21 <= NOT(SYNTHESIZED_WIRE_18);
SYNTHESIZED_WIRE_13 <= SYNTHESIZED_WIRE_19 AND SYNTHESIZED_WIRE_20 AND SYNTHESIZED_WIRE_18 AND D0;
SYNTHESIZED_WIRE_14 <= SYNTHESIZED_WIRE_19 AND SYNTHESIZED_WIRE_20 AND SYNTHESIZED_WIRE_21 AND D1;
SYNTHESIZED_WIRE_15 <= SYNTHESIZED_WIRE_19 AND SYNTHESIZED_WIRE_22 AND SYNTHESIZED_WIRE_18 AND D2;
SYNTHESIZED_WIRE_16 <= SYNTHESIZED_WIRE_19 AND SYNTHESIZED_WIRE_22 AND SYNTHESIZED_WIRE_21 AND D3;
Q <= SYNTHESIZED_WIRE_13 OR SYNTHESIZED_WIRE_14 OR SYNTHESIZED_WIRE_15 OR SYNTHESIZED_WIRE_16;
SYNTHESIZED_WIRE_19 <= NOT(INH);
SYNTHESIZED_WIRE_20 <= NOT(S1);
SYNTHESIZED_WIRE_22 <= NOT(SYNTHESIZED_WIRE_20);
END bdf_type;
-54
View File
@@ -1,54 +0,0 @@
-- Copyright (C) 1991-2014 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.
-- PROGRAM "Quartus II 64-Bit"
-- VERSION "Version 13.1.4 Build 182 03/12/2014 SJ Web Edition"
-- CREATED "Mon Jan 11 09:20:56 2016"
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera;
USE altera.maxplus2.all;
LIBRARY work;
ENTITY mux41_0 IS
PORT
(
S0 : IN STD_LOGIC;
S1 : IN STD_LOGIC;
D0 : IN STD_LOGIC;
INH : IN STD_LOGIC;
D1 : IN STD_LOGIC;
Q : OUT STD_LOGIC
);
END mux41_0;
ARCHITECTURE bdf_type OF mux41_0 IS
BEGIN
-- instantiate macrofunction
b2v_inst40 : work.mux41
PORT MAP(S0 => S0,
S1 => S1,
D0 => D0,
INH => INH,
D1 => D1,
D2 => '0',
D3 => '0',
Q => Q);
END bdf_type;
-54
View File
@@ -1,54 +0,0 @@
-- Copyright (C) 1991-2014 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.
-- PROGRAM "Quartus II 64-Bit"
-- VERSION "Version 13.1.4 Build 182 03/12/2014 SJ Web Edition"
-- CREATED "Mon Jan 11 09:20:56 2016"
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera;
USE altera.maxplus2.all;
LIBRARY work;
ENTITY mux41_1 IS
PORT
(
S0 : IN STD_LOGIC;
S1 : IN STD_LOGIC;
D0 : IN STD_LOGIC;
INH : IN STD_LOGIC;
D1 : IN STD_LOGIC;
Q : OUT STD_LOGIC
);
END mux41_1;
ARCHITECTURE bdf_type OF mux41_1 IS
BEGIN
-- instantiate macrofunction
b2v_inst41 : work.mux41
PORT MAP(S0 => S0,
S1 => S1,
D0 => D0,
INH => INH,
D1 => D1,
D2 => '0',
D3 => '0',
Q => Q);
END bdf_type;
-55
View File
@@ -1,55 +0,0 @@
-- Copyright (C) 1991-2014 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.
-- PROGRAM "Quartus II 64-Bit"
-- VERSION "Version 13.1.4 Build 182 03/12/2014 SJ Web Edition"
-- CREATED "Mon Jan 11 09:20:56 2016"
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera;
USE altera.maxplus2.all;
LIBRARY work;
ENTITY mux41_2 IS
PORT
(
S0 : IN STD_LOGIC;
D2 : IN STD_LOGIC;
S1 : IN STD_LOGIC;
D0 : IN STD_LOGIC;
INH : IN STD_LOGIC;
D1 : IN STD_LOGIC;
Q : OUT STD_LOGIC
);
END mux41_2;
ARCHITECTURE bdf_type OF mux41_2 IS
BEGIN
-- instantiate macrofunction
b2v_inst42 : work.mux41
PORT MAP(S0 => S0,
D2 => D2,
S1 => S1,
D0 => D0,
D3 => '0',
INH => INH,
D1 => D1,
Q => Q);
END bdf_type;
-55
View File
@@ -1,55 +0,0 @@
-- Copyright (C) 1991-2014 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.
-- PROGRAM "Quartus II 64-Bit"
-- VERSION "Version 13.1.4 Build 182 03/12/2014 SJ Web Edition"
-- CREATED "Mon Jan 11 09:20:56 2016"
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera;
USE altera.maxplus2.all;
LIBRARY work;
ENTITY mux41_3 IS
PORT
(
S0 : IN STD_LOGIC;
D2 : IN STD_LOGIC;
S1 : IN STD_LOGIC;
D0 : IN STD_LOGIC;
INH : IN STD_LOGIC;
D1 : IN STD_LOGIC;
Q : OUT STD_LOGIC
);
END mux41_3;
ARCHITECTURE bdf_type OF mux41_3 IS
BEGIN
-- instantiate macrofunction
b2v_inst43 : work.mux41
PORT MAP(S0 => S0,
D2 => D2,
S1 => S1,
D0 => D0,
D3 => '0',
INH => INH,
D1 => D1,
Q => Q);
END bdf_type;
-55
View File
@@ -1,55 +0,0 @@
-- Copyright (C) 1991-2014 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.
-- PROGRAM "Quartus II 64-Bit"
-- VERSION "Version 13.1.4 Build 182 03/12/2014 SJ Web Edition"
-- CREATED "Mon Jan 11 09:20:56 2016"
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera;
USE altera.maxplus2.all;
LIBRARY work;
ENTITY mux41_4 IS
PORT
(
S0 : IN STD_LOGIC;
D2 : IN STD_LOGIC;
S1 : IN STD_LOGIC;
D0 : IN STD_LOGIC;
INH : IN STD_LOGIC;
D1 : IN STD_LOGIC;
Q : OUT STD_LOGIC
);
END mux41_4;
ARCHITECTURE bdf_type OF mux41_4 IS
BEGIN
-- instantiate macrofunction
b2v_inst44 : work.mux41
PORT MAP(S0 => S0,
D2 => D2,
S1 => S1,
D0 => D0,
D3 => '0',
INH => INH,
D1 => D1,
Q => Q);
END bdf_type;
-56
View File
@@ -1,56 +0,0 @@
-- Copyright (C) 1991-2014 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.
-- PROGRAM "Quartus II 64-Bit"
-- VERSION "Version 13.1.4 Build 182 03/12/2014 SJ Web Edition"
-- CREATED "Mon Jan 11 09:20:56 2016"
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera;
USE altera.maxplus2.all;
LIBRARY work;
ENTITY mux41_5 IS
PORT
(
S0 : IN STD_LOGIC;
D2 : IN STD_LOGIC;
S1 : IN STD_LOGIC;
D0 : IN STD_LOGIC;
INH : IN STD_LOGIC;
D1 : IN STD_LOGIC;
Q : OUT STD_LOGIC
);
END mux41_5;
ARCHITECTURE bdf_type OF mux41_5 IS
BEGIN
-- instantiate macrofunction
b2v_inst45 : work.mux41
PORT MAP(S0 => S0,
D2 => D2,
S1 => S1,
D0 => D0,
D3 => '0',
INH => INH,
D1 => D1,
Q => Q);
END bdf_type;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+12
View File
@@ -0,0 +1,12 @@
db
incremental_db
*.rpt
*.summary
*.sof
*.rbf
*.pin
*.smsg
*.jdi
PLLJ_PLLSPE_INFO.txt
+2
View File
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<filters version="9.1sp2" />
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<preferences>
<systemtable>
<columns>
<connections preferredWidth="30" />
<export visible="0" />
<irq preferredWidth="34" />
</columns>
</systemtable>
<clocktable>
<columns>
<clockname preferredWidth="138" />
<clocksource preferredWidth="138" />
<frequency preferredWidth="119" />
</columns>
</clocktable>
<window width="900" height="600" x="0" y="0" />
</preferences>
+79
View File
@@ -0,0 +1,79 @@
-- 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:57 2009
LIBRARY ieee;
USE ieee.std_logic_1164.all;
-- Entity Declaration
ENTITY DSP IS
-- {{ALTERA_IO_BEGIN}} DO NOT REMOVE THIS LINE!
PORT
(
CLK33M : IN STD_LOGIC;
MAIN_CLK : IN STD_LOGIC;
nFB_OE : IN STD_LOGIC;
nFB_WR : IN STD_LOGIC;
nFB_CS1 : IN STD_LOGIC;
nFB_CS2 : 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);
nRSTO : IN STD_LOGIC;
nFB_CS3 : IN STD_LOGIC;
nSRCS : INOUT STD_LOGIC;
nSRBLE : OUT STD_LOGIC;
nSRBHE : OUT STD_LOGIC;
nSRWE : OUT STD_LOGIC;
nSROE : OUT STD_LOGIC;
DSP_INT : OUT STD_LOGIC;
DSP_TA : OUT STD_LOGIC;
FB_AD : INOUT STD_LOGIC_VECTOR(31 downto 0);
IO : INOUT STD_LOGIC_VECTOR(17 downto 0);
SRD : INOUT STD_LOGIC_VECTOR(15 downto 0)
);
-- {{ALTERA_IO_END}} DO NOT REMOVE THIS LINE!
END DSP;
-- Architecture Body
ARCHITECTURE DSP_architecture OF DSP IS
BEGIN
nSRCS <= '0' when nFB_CS2 = '0' and FB_ADR(27 downto 24) = x"4" else '1'; --nFB_CS3;
nSRBHE <= '0' when FB_ADR(0 downto 0) = "0" else '1';
nSRBLE <= '1' when FB_ADR(0 downto 0) = "0" and FB_SIZE1 = '0' and FB_SIZE0 = '1' else '0';
nSRWE <= '0' when nFB_WR = '0' and nSRCS = '0' and MAIN_CLK = '0' else '1';
nSROE <= '0' when nFB_OE = '0' and nSRCS = '0' else '1';
DSP_INT <= '0';
DSP_TA <= '0';
IO(17 downto 0) <= FB_ADR(18 downto 1);
SRD(15 downto 0) <= FB_AD(31 downto 16) when nFB_WR = '0' and nSRCS = '0' else "ZZZZZZZZZZZZZZZZ";
FB_AD(31 downto 16) <= SRD(15 downto 0) when nFB_OE = '0' and nSRCS = '0' else "ZZZZZZZZZZZZZZZZ";
END DSP_architecture;
+42
View File
@@ -0,0 +1,42 @@
/*
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-2010 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.
*/
(header "symbol" (version "1.1"))
(symbol
(rect 0 0 88 48)
(text "FPGA_DATE" (rect 6 1 96 17)(font "Arial" (font_size 10)))
(text "inst" (rect 8 32 25 44)(font "Arial" ))
(port
(pt 88 24)
(output)
(text "result[31..0]" (rect 0 0 67 14)(font "Arial" (font_size 8)))
(text "result[31..0]" (rect 85 -31 98 24)(font "Arial" (font_size 8))(invisible))
(line (pt 88 24)(pt 72 24)(line_width 3))
)
(drawing
(text "570826775" (rect 27 18 72 30)(font "Arial" ))
(text "32" (rect 77 25 87 37)(font "Arial" ))
(line (pt 16 16)(pt 72 16)(line_width 1))
(line (pt 72 16)(pt 72 32)(line_width 1))
(line (pt 72 32)(pt 16 32)(line_width 1))
(line (pt 16 32)(pt 16 16)(line_width 1))
(line (pt 72 28)(pt 80 20)(line_width 1))
)
)
+23
View File
@@ -0,0 +1,23 @@
--Copyright (C) 1991-2010 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.
FUNCTION FPGA_DATE
(
)
RETURNS (
result[31..0]
);
+5
View File
@@ -0,0 +1,5 @@
set_global_assignment -name IP_TOOL_NAME "LPM_CONSTANT"
set_global_assignment -name IP_TOOL_VERSION "9.1"
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "FPGA_DATE.tdf"]
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "FPGA_DATE.bsf"]
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "FPGA_DATE.inc"]
+79
View File
@@ -0,0 +1,79 @@
-- megafunction wizard: %LPM_CONSTANT%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: lpm_constant
-- ============================================================
-- File Name: FPGA_DATE.tdf
-- Megafunction Name(s):
-- lpm_constant
--
-- Simulation Library Files(s):
--
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 9.1 Build 350 03/24/2010 SP 2 SJ Web Edition
-- ************************************************************
--Copyright (C) 1991-2010 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.
-- Clearbox generated function header
FUNCTION FPGA_DATE_lpm_constant_f19 ()
RETURNS ( result[31..0]);
SUBDESIGN FPGA_DATE
(
result[31..0] : OUTPUT;
)
VARIABLE
FPGA_DATE_lpm_constant_f19_component : FPGA_DATE_lpm_constant_f19;
BEGIN
result[31..0] = FPGA_DATE_lpm_constant_f19_component.result[31..0];
END;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone III"
-- Retrieval info: PRIVATE: JTAG_ENABLED NUMERIC "0"
-- Retrieval info: PRIVATE: JTAG_ID STRING "NONE"
-- Retrieval info: PRIVATE: Radix NUMERIC "16"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: Value NUMERIC "570826775"
-- Retrieval info: PRIVATE: nBit NUMERIC "32"
-- Retrieval info: CONSTANT: LPM_CVALUE NUMERIC "570826775"
-- Retrieval info: CONSTANT: LPM_HINT STRING "ENABLE_RUNTIME_MOD=NO"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "LPM_CONSTANT"
-- Retrieval info: CONSTANT: LPM_WIDTH NUMERIC "32"
-- Retrieval info: USED_PORT: result 0 0 32 0 OUTPUT NODEFVAL result[31..0]
-- Retrieval info: CONNECT: result 0 0 32 0 @result 0 0 32 0
-- Retrieval info: LIBRARY: lpm lpm.lpm_components.all
-- Retrieval info: GEN_FILE: TYPE_NORMAL FPGA_DATE.tdf TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL FPGA_DATE.inc TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL FPGA_DATE.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL FPGA_DATE.bsf TRUE FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL FPGA_DATE_inst.tdf FALSE
@@ -0,0 +1,30 @@
--lpm_constant CBX_AUTO_BLACKBOX="ALL" ENABLE_RUNTIME_MOD="NO" LPM_CVALUE=21062017 LPM_WIDTH=32 result
--VERSION_BEGIN 9.1SP2 cbx_lpm_constant 2010:03:24:20:43:43:SJ cbx_mgl 2010:03:24:21:01:05:SJ VERSION_END
-- Copyright (C) 1991-2010 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.
--synthesis_resources =
SUBDESIGN FPGA_DATE_lpm_constant_e19
(
result[31..0] : output;
)
BEGIN
result[] = B"00100001000001100010000000010111";
END;
--VALID FILE
@@ -0,0 +1,30 @@
--lpm_constant CBX_AUTO_BLACKBOX="ALL" ENABLE_RUNTIME_MOD="NO" LPM_CVALUE=22062017 LPM_WIDTH=32 result
--VERSION_BEGIN 9.1SP2 cbx_lpm_constant 2010:03:24:20:43:43:SJ cbx_mgl 2010:03:24:21:01:05:SJ VERSION_END
-- Copyright (C) 1991-2010 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.
--synthesis_resources =
SUBDESIGN FPGA_DATE_lpm_constant_f19
(
result[31..0] : output;
)
BEGIN
result[] = B"00100010000001100010000000010111";
END;
--VALID FILE
@@ -0,0 +1,30 @@
--lpm_constant CBX_AUTO_BLACKBOX="ALL" ENABLE_RUNTIME_MOD="NO" LPM_CVALUE=05062017 LPM_WIDTH=32 result
--VERSION_BEGIN 9.1SP2 cbx_lpm_constant 2010:03:24:20:43:43:SJ cbx_mgl 2010:03:24:21:01:05:SJ VERSION_END
-- Copyright (C) 1991-2010 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.
--synthesis_resources =
SUBDESIGN FPGA_DATE_lpm_constant_g19
(
result[31..0] : output;
)
BEGIN
result[] = B"00000101000001100010000000010111";
END;
--VALID FILE
File diff suppressed because it is too large Load Diff
@@ -76,129 +76,129 @@
-- Minor changes.
--
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE work.wf2149ip_pkg.ALL;
library ieee;
use ieee.std_logic_1164.all;
use work.wf2149ip_pkg.all;
ENTITY WF2149IP_TOP_SOC IS
PORT(
entity WF2149IP_TOP_SOC is
port(
SYS_CLK : in bit; -- Read the inforation in the header!
RESETn : IN bit;
RESETn : in bit;
WAV_CLK : IN bit; -- Read the inforation in the header!
SELn : IN bit;
WAV_CLK : in bit; -- Read the inforation in the header!
SELn : in bit;
BDIR : IN bit;
BC2, BC1 : IN bit;
BDIR : in bit;
BC2, BC1 : in bit;
A9n, A8 : IN bit;
DA_IN : IN std_logic_vector(7 DOWNTO 0);
DA_OUT : OUT std_logic_vector(7 DOWNTO 0);
DA_EN : OUT bit;
A9n, A8 : in bit;
DA_IN : in std_logic_vector(7 downto 0);
DA_OUT : out std_logic_vector(7 downto 0);
DA_EN : out bit;
IO_A_IN : IN bit_vector(7 DOWNTO 0);
IO_A_OUT : OUT bit_vector(7 DOWNTO 0);
IO_A_EN : OUT bit;
IO_B_IN : IN bit_vector(7 DOWNTO 0);
IO_B_OUT : OUT bit_vector(7 DOWNTO 0);
IO_B_EN : OUT bit;
IO_A_IN : in bit_vector(7 downto 0);
IO_A_OUT : out bit_vector(7 downto 0);
IO_A_EN : out bit;
IO_B_IN : in bit_vector(7 downto 0);
IO_B_OUT : out bit_vector(7 downto 0);
IO_B_EN : out bit;
OUT_A : OUT bit; -- Analog (PWM) outputs.
OUT_B : OUT bit;
OUT_C : OUT bit
OUT_A : out bit; -- Analog (PWM) outputs.
OUT_B : out bit;
OUT_C : out bit
);
END WF2149IP_TOP_SOC;
end WF2149IP_TOP_SOC;
architecture STRUCTURE of WF2149IP_TOP_SOC is
SIGNAL BUSCYCLE : BUSCYCLES;
SIGNAL DATA_OUT_I : std_logic_vector(7 DOWNTO 0);
SIGNAL DATA_EN_I : bit;
SIGNAL WAV_STRB : bit;
SIGNAL ADR_I : bit_vector(3 DOWNTO 0);
SIGNAL CTRL_REG : bit_vector(7 DOWNTO 0);
SIGNAL PORT_A : bit_vector(7 DOWNTO 0);
SIGNAL PORT_B : bit_vector(7 DOWNTO 0);
BEGIN
P_WAVSTRB: PROCESS(RESETn, SYS_CLK)
VARIABLE LOCK : boolean;
VARIABLE TMP : bit;
BEGIN
IF RESETn = '0' THEN
signal BUSCYCLE : BUSCYCLES;
signal DATA_OUT_I : std_logic_vector(7 downto 0);
signal DATA_EN_I : bit;
signal WAV_STRB : bit;
signal ADR_I : bit_vector(3 downto 0);
signal CTRL_REG : bit_vector(7 downto 0);
signal PORT_A : bit_vector(7 downto 0);
signal PORT_B : bit_vector(7 downto 0);
begin
P_WAVSTRB: process(RESETn, SYS_CLK)
variable LOCK : boolean;
variable TMP : bit;
begin
if RESETn = '0' then
LOCK := false;
TMP := '0';
elsif SYS_CLK = '1' and SYS_CLK' event then
IF WAV_CLK = '1' and LOCK = false THEN
if WAV_CLK = '1' and LOCK = false then
LOCK := true;
TMP := not TMP; -- Divider by 2.
CASE SELn IS
WHEN '1' => WAV_STRB <= '1';
WHEN OTHERS => WAV_STRB <= TMP;
END CASE;
ELSIF WAV_CLK = '0' THEN
case SELn is
when '1' => WAV_STRB <= '1';
when others => WAV_STRB <= TMP;
end case;
elsif WAV_CLK = '0' then
LOCK := false;
WAV_STRB <= '0';
ELSE
else
WAV_STRB <= '0';
END IF;
END IF;
END PROCESS P_WAVSTRB;
end if;
end if;
end process P_WAVSTRB;
WITH BDIR & BC2 & BC1 SELECT
BUSCYCLE <= INACTIVE WHEN "000" | "010" | "101",
ADDRESS WHEN "001" | "100" | "111",
R_READ WHEN "011",
R_WRITE WHEN "110";
with BDIR & BC2 & BC1 select
BUSCYCLE <= INACTIVE when "000" | "010" | "101",
ADDRESS when "001" | "100" | "111",
R_READ when "011",
R_WRITE when "110";
ADDRESSLATCH: PROCESS(RESETn, SYS_CLK)
ADDRESSLATCH: process(RESETn, SYS_CLK)
-- This process is responsible to store the desired register
-- address. The default (after reset) is channel A fine tone
-- adjustment.
BEGIN
IF RESETn = '0' THEN
ADR_I <= (OTHERS => '0');
begin
if RESETn = '0' then
ADR_I <= (others => '0');
elsif SYS_CLK = '1' and SYS_CLK' event then
IF BUSCYCLE = ADDRESS AND A9n = '0' AND A8 = '1' AND DA_IN(7 DOWNTO 4) = x"0" THEN
ADR_I <= To_BitVector(DA_IN(3 DOWNTO 0));
END IF;
END IF;
END PROCESS ADDRESSLATCH;
if BUSCYCLE = ADDRESS and A9n = '0' and A8 = '1' and DA_IN(7 downto 4) = x"0" then
ADR_I <= To_BitVector(DA_IN(3 downto 0));
end if;
end if;
end process ADDRESSLATCH;
P_CTRL_REG: PROCESS(RESETn, SYS_CLK)
P_CTRL_REG: process(RESETn, SYS_CLK)
-- THIS is the Control register for the mixer and for the I/O ports.
BEGIN
IF RESETn = '0' THEN
begin
if RESETn = '0' then
CTRL_REG <= x"00";
elsif SYS_CLK = '1' and SYS_CLK' event then
IF BUSCYCLE = R_WRITE AND ADR_I = x"7" THEN
if BUSCYCLE = R_WRITE and ADR_I = x"7" then
CTRL_REG <= To_BitVector(DA_IN);
END IF;
END IF;
END PROCESS P_CTRL_REG;
end if;
end if;
end process P_CTRL_REG;
DIG_PORTS: PROCESS(RESETn, SYS_CLK)
BEGIN
IF RESETn = '0' THEN
DIG_PORTS: process(RESETn, SYS_CLK)
begin
if RESETn = '0' then
PORT_A <= x"00";
PORT_B <= x"00";
elsif SYS_CLK = '1' and SYS_CLK' event then
IF BUSCYCLE = R_WRITE AND ADR_I = x"E" THEN
if BUSCYCLE = R_WRITE and ADR_I = x"E" then
PORT_A <= To_BitVector(DA_IN);
ELSIF BUSCYCLE = R_WRITE and ADR_I = x"F" THEN
elsif BUSCYCLE = R_WRITE and ADR_I = x"F" then
PORT_B <= To_BitVector(DA_IN);
END IF;
END IF;
END PROCESS DIG_PORTS;
end if;
end if;
end process DIG_PORTS;
-- Set port direction to input or to output:
IO_A_EN <= '1' WHEN CTRL_REG(6) = '1' ELSE '0';
IO_B_EN <= '1' WHEN CTRL_REG(7) = '1' ELSE '0';
IO_A_EN <= '1' when CTRL_REG(6) = '1' else '0';
IO_B_EN <= '1' when CTRL_REG(7) = '1' else '0';
IO_A_OUT <= PORT_A;
IO_B_OUT <= PORT_B;
I_PSG_WAVE: WF2149IP_WAVE
PORT MAP(
port map(
RESETn => RESETn,
SYS_CLK => SYS_CLK,
SYS_CLK => SYS_CLK,
WAV_STRB => WAV_STRB,
@@ -208,7 +208,7 @@ BEGIN
DATA_EN => DATA_EN_I,
BUSCYCLE => BUSCYCLE,
CTRL_REG => CTRL_REG(5 DOWNTO 0),
CTRL_REG => CTRL_REG(5 downto 0),
OUT_A => OUT_A,
OUT_B => OUT_B,
@@ -216,14 +216,14 @@ BEGIN
);
-- Read the ports and registers:
DA_EN <= '1' WHEN DATA_EN_I = '1' ELSE
'1' WHEN BUSCYCLE = R_READ and ADR_I = x"7" ELSE
'1' WHEN BUSCYCLE = R_READ and ADR_I = x"E" ELSE
'1' WHEN BUSCYCLE = R_READ and ADR_I = x"F" ELSE '0';
DA_EN <= '1' when DATA_EN_I = '1' else
'1' when BUSCYCLE = R_READ and ADR_I = x"7" else
'1' when BUSCYCLE = R_READ and ADR_I = x"E" else
'1' when BUSCYCLE = R_READ and ADR_I = x"F" else '0';
DA_OUT <= DATA_OUT_I WHEN DATA_EN_I = '1' ELSE -- WAV stuff.
To_StdLogicVector(IO_A_IN) WHEN BUSCYCLE = R_READ and ADR_I = x"E" ELSE
To_StdLogicVector(IO_B_IN) WHEN BUSCYCLE = R_READ and ADR_I = x"F" ELSE
To_StdLogicVector(CTRL_REG) WHEN BUSCYCLE = R_READ and ADR_I = x"7" ELSE (OTHERS => '0');
DA_OUT <= DATA_OUT_I when DATA_EN_I = '1' else -- WAV stuff.
To_StdLogicVector(IO_A_IN) when BUSCYCLE = R_READ and ADR_I = x"E" else
To_StdLogicVector(IO_B_IN) when BUSCYCLE = R_READ and ADR_I = x"F" else
To_StdLogicVector(CTRL_REG) when BUSCYCLE = R_READ and ADR_I = x"7" else (others => '0');
end STRUCTURE;
@@ -130,41 +130,41 @@ begin
RIE <= CTRL_REG(7);
P_IRQ: process(CLK)
begin
begin
if rising_edge(CLK) then
if RESETn = '0' or MCLR = '1' then
IRQn <= '1';
IRQn <= '1';
else
-- Transmitter interrupt:
-- Transmitter interrupt:
if TDRE = '1' and CTRL_REG(6 downto 5) = "01" then
IRQn <= '0';
end if;
-- Receiver interrupts:
IRQn <= '0';
end if;
-- Receiver interrupts:
if RDRF = '1' and RIE = '1' then
IRQn <= '0';
end if;
IRQn <= '0';
end if;
-- Overrun
if OVR = '1' and RIE = '1' then
IRQn <= '0';
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 OVR = '1' and RIE = '1' then
IRQn <= '0';
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' then
IRQn <= '1';
end if;
end if;
end if;
end if;
end process P_IRQ;
CONTROL: process(CLK)
begin
if rising_edge(CLK) then
if RESETn = '0' then
CTRL_REG <= "01000000";
if RESETn = '0' then
CTRL_REG <= "01000000";
elsif CS = "011" and RWn = '0' and RS = '0' then
CTRL_REG <= DATA_IN;
end if;
CTRL_REG <= DATA_IN;
end if;
end if;
end process CONTROL;
@@ -175,27 +175,27 @@ begin
variable DCD_RELEASE : boolean;
begin
if rising_edge(CLK) then
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';
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' then
READ_LOCK := false; -- Un-READ_LOCK if receiver data register is read.
READ_LOCK := false; -- Un-READ_LOCK if receiver data register is read.
elsif CS = "011" and RWn = '1' and RS = '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;
-- 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 if;
end process P_DCD;
end architecture BEHAVIOR;
@@ -0,0 +1,425 @@
----------------------------------------------------------------------
---- ----
---- 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 - 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.
--
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity WF6850IP_RECEIVE is
port (
CLK : in std_logic;
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(CLK)
-- 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
if rising_edge(CLK) then
--
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 if;
end process P_SAMPLE;
CLKDIV: process(CLK)
variable CLK_LOCK : boolean;
variable STRB_LOCK : boolean;
variable CLK_DIVCNT : std_logic_vector(6 downto 0);
begin
if rising_edge(CLK) then
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 if;
end process CLKDIV;
DATAREG: process(RESETn, CLK)
begin
if RESETn = '0' or MCLR = '1' then
DATA_REG <= x"00";
else
if rising_edge(CLK) then
if 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 if;
end process DATAREG;
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' or MCLR = '1' then
SHIFT_REG <= x"00";
else
if rising_edge(CLK) then
if RCV_STATE = SAMPLE and CLK_STRB = '1' then
SHIFT_REG <= RXDATA_S & SHIFT_REG(7 downto 1); -- Shift right.
end if;
end if;
end if;
end process SHIFTREG;
P_BITCNT: process(CLK)
begin
if rising_edge(CLK) then
if RCV_STATE = SAMPLE and CLK_STRB = '1' then
BITCNT <= BITCNT + '1';
elsif RCV_STATE /= SAMPLE then
BITCNT <= (others => '0');
end if;
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';
else
if rising_edge(CLK) 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 if;
end process FRAME_ERR;
OVERRUN: process(RESETn, CLK)
variable OVR_I : bit;
variable FIRST_READ : boolean;
begin
if rising_edge(CLK) then
if RESETn = '0' or MCLR = '1' then
OVR_I := '0';
OVR <= '0';
FIRST_READ := false;
else
if 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' 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
if OVR_I = '1' then
OVR <= '1';
OVR_I := '0';
FIRST_READ := true;
else
OVR <= '0';
end if;
end if;
else
FIRST_READ := false;
end if;
end if;
end if;
end process OVERRUN;
PARITY_TEST: process(RESETn,MCLR,CLK)
variable PAR_TMP : bit;
variable PE_I : bit;
begin
if RESETn = '0' or MCLR = '1' then
PE <= '0';
else
if rising_edge(CLK) then
if 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;
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' 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 rising_edge(CLK) then
if RESETn = '0' or MCLR = '1' then
RDRF <= '0';
else
if RCV_STATE = SYNC then
RDRF <= '1'; -- Data register is full until now!
end if;
if CS = "011" and RWn = '1' and RS = '1' then
RDRF <= '0'; -- when reading the data register ...
end if;
end if;
end if;
end process P_RDRF;
RCV_STATEREG: process(RESETn, CLK)
begin
if RESETn = '0' then
RCV_STATE <= IDLE;
else
if rising_edge(CLK) then
if MCLR = '1' then
RCV_STATE <= IDLE;
else
RCV_STATE <= RCV_NEXT_STATE;
end if;
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;
@@ -59,121 +59,121 @@
-- Introduced a minor RTSn correction.
--
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_unsigned.ALL;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
ENTITY WF6850IP_TOP_SOC IS
PORT (
CLK : IN bit;
entity WF6850IP_TOP_SOC is
port (
CLK : in bit;
RESETn : in bit;
CS2n, CS1, CS0 : IN bit;
E : IN bit;
RWn : 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;
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;
TXCLK : in bit;
RXCLK : in bit;
RXDATA : in bit;
CTSn : in bit;
DCDn : in bit;
IRQn : OUT bit;
TXDATA : OUT bit;
RTSn : OUT bit
IRQn : out bit;
TXDATA : out bit;
RTSn : out bit
);
END ENTITY WF6850IP_TOP_SOC;
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
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;
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
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
@@ -183,12 +183,12 @@ BEGIN
I_UART_CTRL_STATUS: WF6850IP_CTRL_STATUS
port map(
CLK => CLK,
RESETn => RESETn,
CS(2) => CS2n,
CS(1) => CS1,
CS(0) => CS0,
E => E,
CLK => CLK,
RESETn => RESETn,
CS(2) => CS2n,
CS(1) => CS1,
CS(0) => CS0,
E => E,
RWn => RWn,
RS => RS,
DATA_IN => DATA_IN_I,
@@ -207,7 +207,7 @@ BEGIN
WS => WS_I,
TC => TC_I,
IRQn => IRQ_In
);
);
I_UART_RECEIVE: WF6850IP_RECEIVE
port map (
@@ -230,7 +230,7 @@ BEGIN
OVR => OVR_I,
PE => PE_I,
FE => FE_I
);
);
I_UART_TRANSMIT: WF6850IP_TRANSMIT
port map (
@@ -251,5 +251,5 @@ BEGIN
TDRE => TDRE_I,
TXCLK => TXCLK,
TXDATA => TXDATA
);
END ARCHITECTURE structure;
);
end architecture STRUCTURE;
@@ -114,55 +114,55 @@ begin
variable CLK_DIVCNT : std_logic_vector(6 downto 0);
begin
if rising_edge(CLK) then
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;
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 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';
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;
elsif TXCLK = '1' then
CLK_LOCK := false;
STRB_LOCK := false;
CLK_STRB <= '0';
else
CLK_STRB <= '0';
-- 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 if;
end if;
end process CLKDIV;
DATAREG: process(RESETn, CLK)
@@ -203,11 +203,11 @@ begin
-- Counter for the data bits transmitted.
begin
if rising_edge(CLK) then
if TR_STATE = SHIFTOUT and CLK_STRB = '1' then
BITCNT <= BITCNT + '1';
elsif TR_STATE /= SHIFTOUT then
BITCNT <= "000";
end if;
if TR_STATE = SHIFTOUT and CLK_STRB = '1' then
BITCNT <= BITCNT + '1';
elsif TR_STATE /= SHIFTOUT then
BITCNT <= "000";
end if;
end if;
end process P_BITCNT;
@@ -216,16 +216,16 @@ begin
begin
if rising_edge(CLK) then
if RESETn = '0' or MCLR = '1' then
TDRE <= '1';
TDRE <= '1';
else
if 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';
-- entering the state now.
TDRE <= '1';
end if;
if CS = "011" and RWn = '0' and RS = '1' then
TDRE <= '0';
TDRE <= '0';
end if;
end if;
end if;
@@ -250,7 +250,7 @@ begin
else -- No parity for WS = "100" and WS = "101".
PARITY_I <= '0';
end if;
end if;
end if;
end if;
end process PARITY_GEN;
@@ -260,13 +260,13 @@ begin
TR_STATE <= IDLE;
else
if rising_edge(CLK) then
if MCLR = '1' then
TR_STATE <= IDLE;
else
TR_STATE <= TR_NEXT_STATE;
if MCLR = '1' then
TR_STATE <= IDLE;
else
TR_STATE <= TR_NEXT_STATE;
end if;
end if;
end if;
end if;
end process TR_STATEREG;
TR_STATEDEC: process(TR_STATE, CLK_STRB, TC, BITCNT, WS, TDRE, CTSn)
@@ -0,0 +1,95 @@
/*
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-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.
*/
(header "symbol" (version "1.1"))
(symbol
(rect 0 0 160 168)
(text "dcfifo0" (rect 62 1 105 17)(font "Arial" (font_size 10)))
(text "inst" (rect 8 152 25 164)(font "Arial" ))
(port
(pt 0 32)
(input)
(text "data[7..0]" (rect 0 0 53 14)(font "Arial" (font_size 8)))
(text "data[7..0]" (rect 20 26 65 39)(font "Arial" (font_size 8)))
(line (pt 0 32)(pt 16 32)(line_width 3))
)
(port
(pt 0 56)
(input)
(text "wrreq" (rect 0 0 35 14)(font "Arial" (font_size 8)))
(text "wrreq" (rect 20 50 45 63)(font "Arial" (font_size 8)))
(line (pt 0 56)(pt 16 56)(line_width 1))
)
(port
(pt 0 72)
(input)
(text "wrclk" (rect 0 0 31 14)(font "Arial" (font_size 8)))
(text "wrclk" (rect 26 66 48 79)(font "Arial" (font_size 8)))
(line (pt 0 72)(pt 16 72)(line_width 1))
)
(port
(pt 0 104)
(input)
(text "rdreq" (rect 0 0 30 14)(font "Arial" (font_size 8)))
(text "rdreq" (rect 20 98 44 111)(font "Arial" (font_size 8)))
(line (pt 0 104)(pt 16 104)(line_width 1))
)
(port
(pt 0 120)
(input)
(text "rdclk" (rect 0 0 27 14)(font "Arial" (font_size 8)))
(text "rdclk" (rect 26 114 47 127)(font "Arial" (font_size 8)))
(line (pt 0 120)(pt 16 120)(line_width 1))
)
(port
(pt 0 144)
(input)
(text "aclr" (rect 0 0 21 14)(font "Arial" (font_size 8)))
(text "aclr" (rect 20 138 37 151)(font "Arial" (font_size 8)))
(line (pt 0 144)(pt 16 144)(line_width 1))
)
(port
(pt 160 72)
(output)
(text "wrusedw[9..0]" (rect 0 0 84 14)(font "Arial" (font_size 8)))
(text "wrusedw[9..0]" (rect 69 66 132 79)(font "Arial" (font_size 8)))
(line (pt 160 72)(pt 144 72)(line_width 3))
)
(port
(pt 160 96)
(output)
(text "q[31..0]" (rect 0 0 42 14)(font "Arial" (font_size 8)))
(text "q[31..0]" (rect 105 90 141 103)(font "Arial" (font_size 8)))
(line (pt 160 96)(pt 144 96)(line_width 3))
)
(drawing
(text "8 bits x 1024 words" (rect 63 140 144 152)(font "Arial" ))
(line (pt 16 16)(pt 144 16)(line_width 1))
(line (pt 144 16)(pt 144 152)(line_width 1))
(line (pt 144 152)(pt 16 152)(line_width 1))
(line (pt 16 152)(pt 16 16)(line_width 1))
(line (pt 16 84)(pt 144 84)(line_width 1))
(line (pt 16 132)(pt 144 132)(line_width 1))
(line (pt 16 66)(pt 22 72)(line_width 1))
(line (pt 22 72)(pt 16 78)(line_width 1))
(line (pt 16 114)(pt 22 120)(line_width 1))
(line (pt 22 120)(pt 16 126)(line_width 1))
)
)
@@ -0,0 +1,95 @@
/*
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-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.
*/
(header "symbol" (version "1.1"))
(symbol
(rect 0 0 160 168)
(text "dcfifo1" (rect 62 1 105 17)(font "Arial" (font_size 10)))
(text "inst" (rect 8 152 25 164)(font "Arial" ))
(port
(pt 0 32)
(input)
(text "data[31..0]" (rect 0 0 60 14)(font "Arial" (font_size 8)))
(text "data[31..0]" (rect 20 26 71 39)(font "Arial" (font_size 8)))
(line (pt 0 32)(pt 16 32)(line_width 3))
)
(port
(pt 0 56)
(input)
(text "wrreq" (rect 0 0 35 14)(font "Arial" (font_size 8)))
(text "wrreq" (rect 20 50 45 63)(font "Arial" (font_size 8)))
(line (pt 0 56)(pt 16 56)(line_width 1))
)
(port
(pt 0 72)
(input)
(text "wrclk" (rect 0 0 31 14)(font "Arial" (font_size 8)))
(text "wrclk" (rect 26 66 48 79)(font "Arial" (font_size 8)))
(line (pt 0 72)(pt 16 72)(line_width 1))
)
(port
(pt 0 104)
(input)
(text "rdreq" (rect 0 0 30 14)(font "Arial" (font_size 8)))
(text "rdreq" (rect 20 98 44 111)(font "Arial" (font_size 8)))
(line (pt 0 104)(pt 16 104)(line_width 1))
)
(port
(pt 0 120)
(input)
(text "rdclk" (rect 0 0 27 14)(font "Arial" (font_size 8)))
(text "rdclk" (rect 26 114 47 127)(font "Arial" (font_size 8)))
(line (pt 0 120)(pt 16 120)(line_width 1))
)
(port
(pt 0 144)
(input)
(text "aclr" (rect 0 0 21 14)(font "Arial" (font_size 8)))
(text "aclr" (rect 20 138 37 151)(font "Arial" (font_size 8)))
(line (pt 0 144)(pt 16 144)(line_width 1))
)
(port
(pt 160 96)
(output)
(text "q[7..0]" (rect 0 0 35 14)(font "Arial" (font_size 8)))
(text "q[7..0]" (rect 111 90 141 103)(font "Arial" (font_size 8)))
(line (pt 160 96)(pt 144 96)(line_width 3))
)
(port
(pt 160 120)
(output)
(text "rdusedw[9..0]" (rect 0 0 80 14)(font "Arial" (font_size 8)))
(text "rdusedw[9..0]" (rect 73 114 135 127)(font "Arial" (font_size 8)))
(line (pt 160 120)(pt 144 120)(line_width 3))
)
(drawing
(text "32 bits x 256 words" (rect 63 140 144 152)(font "Arial" ))
(line (pt 16 16)(pt 144 16)(line_width 1))
(line (pt 144 16)(pt 144 152)(line_width 1))
(line (pt 144 152)(pt 16 152)(line_width 1))
(line (pt 16 152)(pt 16 16)(line_width 1))
(line (pt 16 84)(pt 144 84)(line_width 1))
(line (pt 16 132)(pt 144 132)(line_width 1))
(line (pt 16 66)(pt 22 72)(line_width 1))
(line (pt 22 72)(pt 16 78)(line_width 1))
(line (pt 16 114)(pt 22 120)(line_width 1))
(line (pt 22 120)(pt 16 126)(line_width 1))
)
)
@@ -17,67 +17,69 @@ INCLUDE "lpm_bustri_BYT.inc";
SUBDESIGN interrupt_handler
(
-- {{ALTERA_IO_BEGIN}} DO NOT REMOVE THIS LINE!
MAIN_CLK : INPUT;
nFB_WR : INPUT;
nFB_CS1 : INPUT;
nFB_CS2 : INPUT;
FB_SIZE0 : INPUT;
FB_SIZE1 : INPUT;
FB_ADR[31..0] : INPUT;
PIC_INT : INPUT;
E0_INT : INPUT;
DVI_INT : INPUT;
nPCI_INTA : INPUT;
nPCI_INTB : INPUT;
nPCI_INTC : INPUT;
nPCI_INTD : INPUT;
nMFP_INT : INPUT;
nFB_OE : INPUT;
DSP_INT : INPUT;
VSYNC : INPUT;
HSYNC : INPUT;
DMA_DRQ : INPUT;
MAIN_CLK : INPUT;
nFB_WR : INPUT;
nFB_CS1 : INPUT;
nFB_CS2 : INPUT;
FB_SIZE0 : INPUT;
FB_SIZE1 : INPUT;
FB_ADR[31..0] : INPUT;
FPGA_DATE[31..0] : INPUT;
PIC_INT : INPUT;
E0_INT : INPUT;
DVI_INT : INPUT;
nPCI_INTA : INPUT;
nPCI_INTB : INPUT;
nPCI_INTC : INPUT;
nPCI_INTD : INPUT;
nMFP_INT : INPUT;
nFB_OE : INPUT;
DSP_INT : INPUT;
VSYNC : INPUT;
HSYNC : INPUT;
DMA_DRQ : INPUT;
nRSTO : INPUT;
nIRQ[7..2] : OUTPUT;
INT_HANDLER_TA : OUTPUT;
ACP_CONF[31..0] : OUTPUT;
TIN0 : OUTPUT;
FB_AD[31..0] : BIDIR;
nIRQ[7..2] : OUTPUT;
INT_HANDLER_TA : OUTPUT;
ACP_CONF[31..0] : OUTPUT;
TIN0 : OUTPUT;
FB_AD[31..0] : BIDIR;
-- {{ALTERA_IO_END}} DO NOT REMOVE THIS LINE!
)
VARIABLE
FB_B[3..0] :NODE;
INT_CTR[31..0] :DFFE;
INT_CTR_CS :NODE;
INT_LATCH[31..0] :DFF;
INT_LATCH_CS :NODE;
INT_CLEAR[31..0] :DFF;
INT_CLEAR_CS :NODE;
INT_IN[31..0] :NODE;
INT_ENA[31..0] :DFFE;
INT_ENA_CS :NODE;
FB_B[3..0] :NODE;
INT_CTR[31..0] :DFFE;
INT_CTR_CS :NODE;
INT_LATCH[31..0] :DFF;
INT_LATCH_CS :NODE;
INT_CLEAR[31..0] :DFF;
INT_CLEAR_CS :NODE;
INT_IN[31..0] :NODE;
INT_ENA[31..0] :DFFE;
INT_ENA_CS :NODE;
INT_L[9..0] :DFF;
INT_LA[9..0][3..0] :DFF;
ACP_CONF[31..0] :DFFE;
ACP_CONF_CS :NODE;
PSEUDO_BUS_ERROR :NODE;
UHR_AS :NODE;
UHR_DS :NODE;
RTC_ADR[5..0] :DFFE;
ACHTELSEKUNDEN[2..0] :DFFE;
WERTE[7..0][63..0] :DFFE; -- WERTE REGISTER 0-63
PIC_INT_SYNC[2..0] :DFF;
INC_SEC :NODE;
INC_MIN :NODE;
INC_STD :NODE;
INC_TAG :NODE;
ACP_CONF[31..0] :DFFE;
ACP_CONF_CS :NODE;
FPGA_DATE_CS :NODE;
PSEUDO_BUS_ERROR :NODE;
UHR_AS :NODE;
UHR_DS :NODE;
RTC_ADR[5..0] :DFFE;
ACHTELSEKUNDEN[2..0] :DFFE;
WERTE[7..0][63..0] :DFFE; -- WERTE REGISTER 0-63
PIC_INT_SYNC[2..0] :DFF;
INC_SEC :NODE;
INC_MIN :NODE;
INC_STD :NODE;
INC_TAG :NODE;
ANZAHL_TAGE_DES_MONATS[7..0]:NODE;
WINTERZEIT :NODE;
SOMMERZEIT :NODE;
INC_MONAT :NODE;
INC_JAHR :NODE;
UPDATE_ON :NODE;
WINTERZEIT :NODE;
SOMMERZEIT :NODE;
INC_MONAT :NODE;
INC_JAHR :NODE;
UPDATE_ON :NODE;
BEGIN
-- BYT SELECT
@@ -94,7 +96,7 @@ BEGIN
# !FB_SIZE1 & FB_SIZE0 & FB_ADR1 & FB_ADR0 -- LLBYT
# !FB_SIZE1 & !FB_SIZE0 # FB_SIZE1 & FB_SIZE0; -- LONG UND LINE
-- INTERRUPT CONTROL REGISTER: BIT0=INT5 AUSLÖSEN, 1=INT7 AUSLÖSEN
-- INTERRUPT CONTROL REGISTER: BIT0=INT5 AUSLÖSEN, 1=INT7 AUSLÖSEN
INT_CTR[].CLK = MAIN_CLK;
INT_CTR_CS = !nFB_CS2 & FB_ADR[27..2]==H"4000"; -- $10000/4
INT_CTR[] = FB_AD[];
@@ -102,8 +104,7 @@ BEGIN
INT_CTR[23..16].ENA = INT_CTR_CS & FB_B1 & !nFB_WR;
INT_CTR[15..8].ENA = INT_CTR_CS & FB_B2 & !nFB_WR;
INT_CTR[7..0].ENA = INT_CTR_CS & FB_B3 & !nFB_WR;
-- INTERRUPT ENABLE REGISTER BIT31=INT7,30=INT6,29=INT5,28=INT4,27=INT3,26=INT2
-- INTERRUPT ENABLE REGISTER BIT31=INT7,30=INT6,29=INT5,28=INT4,27=INT3,26=INT2
INT_ENA[].CLK = MAIN_CLK;
INT_ENA[].CLRN = nRSTO;
INT_ENA_CS = !nFB_CS2 & FB_ADR[27..2]==H"4001"; -- $10004/4
@@ -112,19 +113,16 @@ BEGIN
INT_ENA[23..16].ENA = INT_ENA_CS & FB_B1 & !nFB_WR;
INT_ENA[15..8].ENA = INT_ENA_CS & FB_B2 & !nFB_WR;
INT_ENA[7..0].ENA = INT_ENA_CS & FB_B3 & !nFB_WR;
-- INTERRUPT CLEAR REGISTER WRITE ONLY 1=INTERRUPT CLEAR
-- INTERRUPT CLEAR REGISTER WRITE ONLY 1=INTERRUPT CLEAR
INT_CLEAR[].CLK = MAIN_CLK;
INT_CLEAR_CS = !nFB_CS2 & FB_ADR[27..2]==H"4002"; -- $10008/4
INT_CLEAR[31..24] = FB_AD[31..24] & INT_CLEAR_CS & FB_B0 & !nFB_WR;
INT_CLEAR[23..16] = FB_AD[23..16] & INT_CLEAR_CS & FB_B1 & !nFB_WR;
INT_CLEAR[15..8] = FB_AD[15..8] & INT_CLEAR_CS & FB_B2 & !nFB_WR;
INT_CLEAR[7..0] = FB_AD[7..0] & INT_CLEAR_CS & FB_B3 & !nFB_WR;
-- INTERRUPT LATCH REGISTER READ ONLY
-- INTERRUPT LATCH REGISTER READ ONLY
INT_LATCH_CS = !nFB_CS2 & FB_ADR[27..2]==H"4003"; -- $1000C/4
-- INTERRUPT
-- INTERRUPT
!nIRQ2 = HSYNC & INT_ENA[26];
!nIRQ3 = INT_CTR0 & INT_ENA[27];
!nIRQ4 = VSYNC & INT_ENA[28];
@@ -132,27 +130,26 @@ BEGIN
!nIRQ6 = !nMFP_INT & INT_ENA[30];
!nIRQ7 = PSEUDO_BUS_ERROR & INT_ENA[31];
PSEUDO_BUS_ERROR = !nFB_CS1 & (FB_ADR[19..4]==H"F8C8" -- SCC
# FB_ADR[19..4]==H"F8E0" -- VME
-- # FB_ADR[19..4]==H"F920" -- PADDLE
-- # FB_ADR[19..4]==H"F921" -- PADDLE
-- # FB_ADR[19..4]==H"F922" -- PADDLE
# FB_ADR[19..4]==H"FFA8" -- MFP2
# FB_ADR[19..4]==H"FFA9" -- MFP2
# FB_ADR[19..4]==H"FFAA" -- MFP2
# FB_ADR[19..4]==H"FFA8" -- MFP2
# FB_ADR[19..8]==H"F87" -- TT SCSI
# FB_ADR[19..4]==H"FFC2" -- ST UHR
# FB_ADR[19..4]==H"FFC3" -- ST UHR
-- # FB_ADR[19..4]==H"F890" -- DMA SOUND
-- # FB_ADR[19..4]==H"F891" -- DMA SOUND
-- # FB_ADR[19..4]==H"F892" -- DMA SOUND
PSEUDO_BUS_ERROR = !nFB_CS1 & (FB_ADR[19..4]==H"F8C8" -- SCC
# FB_ADR[19..4]==H"F8E0" -- VME
-- # FB_ADR[19..4]==H"F920" -- PADDLE
-- # FB_ADR[19..4]==H"F921" -- PADDLE
-- # FB_ADR[19..4]==H"F922" -- PADDLE
# FB_ADR[19..4]==H"FFA8" -- MFP2
# FB_ADR[19..4]==H"FFA9" -- MFP2
# FB_ADR[19..4]==H"FFAA" -- MFP2
# FB_ADR[19..4]==H"FFA8" -- MFP2
# FB_ADR[19..8]==H"F87" -- TT SCSI
# FB_ADR[19..4]==H"FFC2" -- ST UHR
# FB_ADR[19..4]==H"FFC3" -- ST UHR
-- # FB_ADR[19..4]==H"F890" -- DMA SOUND
-- # FB_ADR[19..4]==H"F891" -- DMA SOUND
-- # FB_ADR[19..4]==H"F892" -- DMA SOUND
);
-- IF VIDEO ADR CHANGE
TIN0 = !nFB_CS1 & FB_ADR[19..1]==H"7C100" & !nFB_WR; -- WRITE VIDEO BASE ADR HIGH 0xFFFF8201/2
-- IF VIDEO ADR CHANGE
TIN0 = !nFB_CS1 & FB_ADR[19..1]==H"7C100" & !nFB_WR; -- WRITE VIDEO BASE ADR HIGH 0xFFFF8201/2
-- INTERRUPT LATCH
-- INTERRUPT LATCH
INT_L[].CLK = MAIN_CLK;
INT_L[].CLRN = nRSTO;
INT_L0 = PIC_INT & INT_ENA[0];
@@ -167,11 +164,9 @@ BEGIN
INT_L9 = HSYNC & INT_ENA[9];
INT_LA[][].CLK = MAIN_CLK;
INT_LATCH[] = H"FFFFFFFF";
INT_LATCH[] = H"FFFFFFFF";
INT_LATCH[].CLRN = !INT_CLEAR[] & nRSTO;
FOR I IN 0 TO 9 GENERATE
FOR I IN 0 TO 9 GENERATE
INT_LA[I][].CLRN = INT_ENA[I] & nRSTO;
INT_LA[I][] = INT_LA[I][]+1 & INT_L[I] & INT_LA[I][]<7
# INT_LA[I][]-1 & !INT_L[I] & INT_LA[I][]>8
@@ -198,9 +193,8 @@ BEGIN
INT_IN29 = INT_LATCH[]!=H"00000000";
INT_IN30 = !nMFP_INT;
INT_IN31 = DMA_DRQ;
--***************************************************************************************
-- ACP CONFIG REGISTER: BIT 31-> 0=CF 1=IDE
--***************************************************************************************
-- ACP CONFIG REGISTER: BIT 31-> 0=CF 1=IDE
ACP_CONF[].CLK = MAIN_CLK;
ACP_CONF_CS = !nFB_CS2 & FB_ADR[27..2]==H"10000"; -- $4'0000/4
ACP_CONF[] = FB_AD[];
@@ -208,11 +202,14 @@ BEGIN
ACP_CONF[23..16].ENA = ACP_CONF_CS & FB_B1 & !nFB_WR;
ACP_CONF[15..8].ENA = ACP_CONF_CS & FB_B2 & !nFB_WR;
ACP_CONF[7..0].ENA = ACP_CONF_CS & FB_B3 & !nFB_WR;
--***************************************************************************************
--***************************************************************************************
-- FPGA DATE HEX (ddmmyyyy)
FPGA_DATE_CS = !nFB_CS2 & FB_ADR[27..2]==H"10040"; -- $4'0000/4
--***************************************************************************************
--------------------------------------------------------------
-- C1287 0=SEK 2=MIN 4=STD 6=WOCHENTAG 7=TAG 8=MONAT 9=JAHR
----------------------------------------------------------
--------------------------------------------------------------
-- C1287 0=SEK 2=MIN 4=STD 6=WOCHENTAG 7=TAG 8=MONAT 9=JAHR
----------------------------------------------------------
RTC_ADR[].CLK = MAIN_CLK;
RTC_ADR[] = FB_AD[21..16];
UHR_AS = !nFB_CS1 & FB_ADR[19..1]==H"7C4B0" & FB_B1; -- FFFF8961
@@ -235,8 +232,8 @@ BEGIN
FOR I IN 0 TO 63 GENERATE
WERTE[][I].ENA = RTC_ADR[]==I & UHR_DS & !nFB_WR;
END GENERATE;
PIC_INT_SYNC[].CLK = MAIN_CLK;
PIC_INT_SYNC[0] = PIC_INT;
PIC_INT_SYNC[].CLK = MAIN_CLK;
PIC_INT_SYNC[0] = PIC_INT;
PIC_INT_SYNC[1] = PIC_INT_SYNC[0];
PIC_INT_SYNC[2] = !PIC_INT_SYNC[1] & PIC_INT_SYNC[0];
UPDATE_ON = !WERTE[7][11];
@@ -246,7 +243,7 @@ BEGIN
WERTE[1][11] = VCC; -- IMMER 24H FORMAT
WERTE[0][11] = VCC; -- IMMER SOMMERZEITKORREKTUR
WERTE[7][13] = VCC; -- IMMER RICHTIG
-- SOMMER WINTERZEIT: BIT 0 IM REGISTER D IST DIE INFORMATION OB SOMMERZEIT IST (BRAUCHT MAN F�R R�CKSCHALTUNG)
-- SOMMER WINTERZEIT: BIT 0 IM REGISTER D IST DIE INFORMATION OB SOMMERZEIT IST (BRAUCHT MAN FÜR RÜCKSCHALTUNG)
SOMMERZEIT = WERTE[][6]==1 & WERTE[][4]==1 & WERTE[][8]==4 & WERTE[][7]>23; --LETZTER SONNTAG IM APRIL
WERTE[0][13] = SOMMERZEIT;
WERTE[0][13].ENA = INC_STD & (SOMMERZEIT # WINTERZEIT);
@@ -257,36 +254,36 @@ BEGIN
ACHTELSEKUNDEN[].ENA = PIC_INT_SYNC[2] & UPDATE_ON;
-- SEKUNDEN
INC_SEC = ACHTELSEKUNDEN[]==7 & PIC_INT_SYNC[2] & UPDATE_ON;
WERTE[][0] = (WERTE[][0]+1) & WERTE[][0]!=59 & !(RTC_ADR[]==0 & UHR_DS & !nFB_WR); -- SEKUNDEN Z�HLEN BIS 59
WERTE[][0] = (WERTE[][0]+1) & WERTE[][0]!=59 & !(RTC_ADR[]==0 & UHR_DS & !nFB_WR); -- SEKUNDEN ZÄHLEN BIS 59
WERTE[][0].ENA = INC_SEC & !(RTC_ADR[]==0 & UHR_DS & !nFB_WR);
-- MINUTEN
INC_MIN = INC_SEC & WERTE[][0]==59; --
WERTE[][2] = (WERTE[][2]+1) & WERTE[][2]!=59 & !(RTC_ADR[]==2 & UHR_DS & !nFB_WR); -- MINUTEN Z�HLEN BIS 59
WERTE[][2] = (WERTE[][2]+1) & WERTE[][2]!=59 & !(RTC_ADR[]==2 & UHR_DS & !nFB_WR); -- MINUTEN ZÄHLEN BIS 59
WERTE[][2].ENA = INC_MIN & !(RTC_ADR[]==2 & UHR_DS & !nFB_WR); --
-- STUNDEN
INC_STD = INC_MIN & WERTE[][2]==59;
WERTE[][4] = (WERTE[][4]+1+(1 & SOMMERZEIT)) & WERTE[][4]!=23 & !(RTC_ADR[]==4 & UHR_DS & !nFB_WR); -- STUNDEN Z�HLEN BIS 23
WERTE[][4] = (WERTE[][4]+1+(1 & SOMMERZEIT)) & WERTE[][4]!=23 & !(RTC_ADR[]==4 & UHR_DS & !nFB_WR); -- STUNDEN ZÄHLEN BIS 23
WERTE[][4].ENA = INC_STD & !(WINTERZEIT & WERTE[0][12]) & !(RTC_ADR[]==4 & UHR_DS & !nFB_WR); -- EINE STUNDE AUSLASSEN WENN WINTERZEITUMSCHALTUNG UND NOCH SOMMERZEIT
-- WOCHENTAG UND TAG
INC_TAG = INC_STD & WERTE[][2]==23;
WERTE[][6] = (WERTE[][6]+1) & WERTE[][6]!=7 & !(RTC_ADR[]==6 & UHR_DS & !nFB_WR) -- WOCHENTAG Z�HLEN BIS 7
WERTE[][6] = (WERTE[][6]+1) & WERTE[][6]!=7 & !(RTC_ADR[]==6 & UHR_DS & !nFB_WR) -- WOCHENTAG ZÄHLEN BIS 7
# 1 & WERTE[][6]==7 & !(RTC_ADR[]==6 & UHR_DS & !nFB_WR); -- DANN BEI 1 WEITER
WERTE[][6].ENA = INC_TAG & !(RTC_ADR[]==6 & UHR_DS & !nFB_WR);
ANZAHL_TAGE_DES_MONATS[] = 31 & (WERTE[][8]==1 # WERTE[][8]==3 # WERTE[][8]==5 # WERTE[][8]==7 # WERTE[][8]==8 # WERTE[][8]==10 # WERTE[][8]==12)
# 30 & (WERTE[][8]==4 # WERTE[][8]==6 # WERTE[][8]==9 # WERTE[][8]==11)
# 29 & WERTE[][8]==2 & WERTE[1..0][9]==0
# 28 & WERTE[][8]==2 & WERTE[1..0][9]!=0;
WERTE[][7] = (WERTE[][7]+1) & WERTE[][7]!=ANZAHL_TAGE_DES_MONATS[] & !(RTC_ADR[]==7 & UHR_DS & !nFB_WR) -- TAG Z�HLEN BIS MONATSENDE
WERTE[][7] = (WERTE[][7]+1) & WERTE[][7]!=ANZAHL_TAGE_DES_MONATS[] & !(RTC_ADR[]==7 & UHR_DS & !nFB_WR) -- TAG ZÄHLEN BIS MONATSENDE
# 1 & WERTE[][7]==ANZAHL_TAGE_DES_MONATS[] & !(RTC_ADR[]==7 & UHR_DS & !nFB_WR); -- DANN BEI 1 WEITER
WERTE[][7].ENA = INC_TAG & !(RTC_ADR[]==7 & UHR_DS & !nFB_WR); --
-- MONATE
INC_MONAT = INC_TAG & WERTE[][7]==ANZAHL_TAGE_DES_MONATS[]; --
WERTE[][8] = (WERTE[][8]+1) & WERTE[][8]!=12 & !(RTC_ADR[]==8 & UHR_DS & !nFB_WR) -- MONATE Z�HLEN BIS 12
WERTE[][8] = (WERTE[][8]+1) & WERTE[][8]!=12 & !(RTC_ADR[]==8 & UHR_DS & !nFB_WR) -- MONATE ZÄHLEN BIS 12
# 1 & WERTE[][8]==12 & !(RTC_ADR[]==8 & UHR_DS & !nFB_WR); -- DANN BEI 1 WEITER
WERTE[][8].ENA = INC_MONAT & !(RTC_ADR[]==8 & UHR_DS & !nFB_WR);
-- JAHR
INC_JAHR = INC_MONAT & WERTE[][8]==12; --
WERTE[][9] = (WERTE[][9]+1) & WERTE[][9]!=99 & !(RTC_ADR[]==9 & UHR_DS & !nFB_WR); -- JAHRE Z�HLEN BIS 99
WERTE[][9] = (WERTE[][9]+1) & WERTE[][9]!=99 & !(RTC_ADR[]==9 & UHR_DS & !nFB_WR); -- JAHRE ZÄHLEN BIS 99
WERTE[][9].ENA = INC_JAHR & !(RTC_ADR[]==9 & UHR_DS & !nFB_WR);
-- TRISTATE OUTPUT
@@ -296,7 +293,8 @@ BEGIN
# INT_LATCH_CS & INT_LATCH[31..24]
# INT_CLEAR_CS & INT_IN[31..24]
# ACP_CONF_CS & ACP_CONF[31..24]
,(INT_CTR_CS # INT_ENA_CS # INT_LATCH_CS # INT_CLEAR_CS # ACP_CONF_CS) & !nFB_OE);
# FPGA_DATE_CS & FPGA_DATE[31..24]
,(INT_CTR_CS # INT_ENA_CS # INT_LATCH_CS # INT_CLEAR_CS # ACP_CONF_CS # FPGA_DATE_CS) & !nFB_OE);
FB_AD[23..16] = lpm_bustri_BYT(
WERTE[][0] & RTC_ADR[]==0 & UHR_DS
# WERTE[][1] & RTC_ADR[]==1 & UHR_DS
@@ -368,21 +366,24 @@ BEGIN
# INT_LATCH_CS & INT_LATCH[23..16]
# INT_CLEAR_CS & INT_IN[23..16]
# ACP_CONF_CS & ACP_CONF[23..16]
,(UHR_DS # UHR_AS # INT_CTR_CS # INT_ENA_CS # INT_LATCH_CS # INT_CLEAR_CS # ACP_CONF_CS) & !nFB_OE);
# FPGA_DATE_CS & FPGA_DATE[23..16]
,(UHR_DS # UHR_AS # INT_CTR_CS # INT_ENA_CS # INT_LATCH_CS # INT_CLEAR_CS # ACP_CONF_CS # FPGA_DATE_CS) & !nFB_OE);
FB_AD[15..8] = lpm_bustri_BYT(
INT_CTR_CS & INT_CTR[15..8]
# INT_ENA_CS & INT_ENA[15..8]
# INT_LATCH_CS & INT_LATCH[15..8]
# INT_CLEAR_CS & INT_IN[15..8]
# ACP_CONF_CS & ACP_CONF[15..8]
,(INT_CTR_CS # INT_ENA_CS # INT_LATCH_CS # INT_CLEAR_CS # ACP_CONF_CS) & !nFB_OE);
# FPGA_DATE_CS & FPGA_DATE[15..8]
,(INT_CTR_CS # INT_ENA_CS # INT_LATCH_CS # INT_CLEAR_CS # ACP_CONF_CS # FPGA_DATE_CS) & !nFB_OE);
FB_AD[7..0] = lpm_bustri_BYT(
INT_CTR_CS & INT_CTR[7..0]
# INT_ENA_CS & INT_ENA[7..0]
# INT_LATCH_CS & INT_LATCH[7..0]
# INT_CLEAR_CS & INT_IN[7..0]
# ACP_CONF_CS & ACP_CONF[7..0]
,(INT_CTR_CS # INT_ENA_CS # INT_LATCH_CS # INT_CLEAR_CS # ACP_CONF_CS) & !nFB_OE);
# FPGA_DATE_CS & FPGA_DATE[7..0]
,(INT_CTR_CS # INT_ENA_CS # INT_LATCH_CS # INT_CLEAR_CS # ACP_CONF_CS # FPGA_DATE_CS) & !nFB_OE);
INT_HANDLER_TA = INT_CTR_CS # INT_ENA_CS # INT_LATCH_CS # INT_CLEAR_CS;
END;
+39
View File
@@ -0,0 +1,39 @@
SHELL=/bin/csh
ifeq ($(OS),Windows_NT)
ALTPATH=c:/opt/altera/9.1sp2/quartus/bin64
else
ALTPATH=/opt/altera/9.1sp2/quartus/bin
endif
BITSTREAM=output_files/$(PROJ).sof
BUILD_DIR=.
PROJ=firebee1
all: synthesis fitter assembler timing_analyzer eda
precmd:
(cd $(BUILD_DIR); $(ALTPATH)/quartus_sh $(ALTOPT) -t precmd.tcl)
synthesis:
(cd $(BUILD_DIR); $(ALTPATH)/quartus_map --read_settings_files=on --write_settings_files=off $(ALTOPT) $(PROJ) -c $(PROJ))
fitter:
(cd $(BUILD_DIR); $(ALTPATH)/quartus_fit --read_settings_files=off --write_settings_files=off $(ALTOPT) $(PROJ) -c $(PROJ))
assembler:
(cd $(BUILD_DIR); $(ALTPATH)/quartus_asm --read_settings_files=off --write_settings_files=off $(ALTOPT) $(PROJ) -c $(PROJ))
timing_analyzer:
(cd $(BUILD_DIR); $(ALTPATH)/quartus_sta $(ALTOPT) $(PROJ))
eda:
(cd $(BUILD_DIR); $(ALTPATH)/quartus_eda --simulation --read_settings_files=off --write_settings_files=off $(ALTOPT) $(PROJ) -c $(PROJ))
# program the beast
p: $(BITSTREAM)
(cd $(BUILD_DIR); $(ALTPATH)/quartus_pgm $(ALTOPT) -m JTAG -o P\;$(BITSTREAM)@1)
.PHONY: clean
clean:
(cd $(BUILD_DIR); rm -rf db incremental_db)
+5
View File
@@ -0,0 +1,5 @@
These FPGA's sources can be built with Quartus 9.1.
This repository should be only used to sync(like a kind of mirror) with Fredi's source tree.
Please for further development create a new repository and merge from here.
@@ -0,0 +1,32 @@
--Copyright (C) 1991-2010 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.
FUNCTION altsyncram0
(
address_a[3..0],
address_b[3..0],
byteena_a[1..0],
clock_a,
clock_b,
data_a[15..0],
data_b[15..0],
wren_a,
wren_b
)
RETURNS (
q_a[15..0],
q_b[15..0]
);
@@ -0,0 +1,4 @@
set_global_assignment -name IP_TOOL_NAME "ALTSYNCRAM"
set_global_assignment -name IP_TOOL_VERSION "9.1"
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "altsyncram0.tdf"]
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "altsyncram0.inc"]

Some files were not shown because too many files have changed in this diff Show More