mirror of
https://github.com/MiSTer-devel/MacPlus_MiSTer.git
synced 2024-12-14 07:29:04 +00:00
Update sys.
This commit is contained in:
parent
8469c02b28
commit
b04c6c7eec
29
MacPlus.qpf
29
MacPlus.qpf
@ -1,31 +1,2 @@
|
||||
# -------------------------------------------------------------------------- #
|
||||
#
|
||||
# Copyright (C) 2017 Intel Corporation. All rights reserved.
|
||||
# Your use of Intel 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 Intel Program License
|
||||
# Subscription Agreement, the Intel Quartus Prime License Agreement,
|
||||
# the Intel 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 Intel and sold by Intel or its
|
||||
# authorized distributors. Please refer to the applicable
|
||||
# agreement for further details.
|
||||
#
|
||||
# -------------------------------------------------------------------------- #
|
||||
#
|
||||
# Quartus Prime
|
||||
# Version 17.0.1 Build 598 06/07/2017 SJ Standard Edition
|
||||
# Date created = 04:04:47 October 16, 2017
|
||||
#
|
||||
# -------------------------------------------------------------------------- #
|
||||
|
||||
QUARTUS_VERSION = "17.0"
|
||||
DATE = "04:04:47 October 16, 2017"
|
||||
|
||||
# Revisions
|
||||
|
||||
PROJECT_REVISION = "MacPlus"
|
||||
|
377
MacPlus.qsf
377
MacPlus.qsf
@ -1,46 +1,25 @@
|
||||
# -------------------------------------------------------------------------- #
|
||||
# --------------------------------------------------------------------------
|
||||
#
|
||||
# Copyright (C) 2017 Intel Corporation. All rights reserved.
|
||||
# Your use of Intel 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 Intel Program License
|
||||
# Subscription Agreement, the Intel Quartus Prime License Agreement,
|
||||
# the Intel 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 Intel and sold by Intel or its
|
||||
# authorized distributors. Please refer to the applicable
|
||||
# agreement for further details.
|
||||
# MiSTer project
|
||||
#
|
||||
# -------------------------------------------------------------------------- #
|
||||
# WARNING WARNING WARNING:
|
||||
# Do not add files to project in Quartus IDE! It will mess this file!
|
||||
# Add the files manually to files.qip file.
|
||||
#
|
||||
# Quartus Prime
|
||||
# Version 16.1.2 Build 203 01/18/2017 SJ Standard Edition
|
||||
# Date created = 01:53:32 April 20, 2017
|
||||
#
|
||||
# -------------------------------------------------------------------------- #
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
set_global_assignment -name FAMILY "Cyclone V"
|
||||
set_global_assignment -name DEVICE 5CSEBA6U23I7
|
||||
set_global_assignment -name TOP_LEVEL_ENTITY sys_top
|
||||
set_global_assignment -name ORIGINAL_QUARTUS_VERSION 16.1.2
|
||||
set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
|
||||
set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top
|
||||
set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top
|
||||
|
||||
set_global_assignment -name LAST_QUARTUS_VERSION "17.0.2 Standard Edition"
|
||||
set_global_assignment -name PROJECT_CREATION_TIME_DATE "01:53:30 APRIL 20, 2017"
|
||||
set_global_assignment -name DEVICE_FILTER_PACKAGE UFBGA
|
||||
set_global_assignment -name DEVICE_FILTER_PIN_COUNT 672
|
||||
set_global_assignment -name DEVICE_FILTER_SPEED_GRADE 7
|
||||
|
||||
set_global_assignment -name GENERATE_RBF_FILE ON
|
||||
set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files
|
||||
set_global_assignment -name NUM_PARALLEL_PROCESSORS ALL
|
||||
set_global_assignment -name SAVE_DISK_SPACE OFF
|
||||
set_global_assignment -name SMART_RECOMPILE ON
|
||||
set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
|
||||
set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top
|
||||
set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top
|
||||
set_global_assignment -name MIN_CORE_JUNCTION_TEMP "-40"
|
||||
set_global_assignment -name MAX_CORE_JUNCTION_TEMP 100
|
||||
set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "23 MM HEAT SINK WITH 200 LFPM AIRFLOW"
|
||||
@ -50,324 +29,28 @@ set_global_assignment -name OPTIMIZE_POWER_DURING_FITTING OFF
|
||||
set_global_assignment -name FINAL_PLACEMENT_OPTIMIZATION ALWAYS
|
||||
set_global_assignment -name FITTER_EFFORT "STANDARD FIT"
|
||||
set_global_assignment -name OPTIMIZATION_MODE "HIGH PERFORMANCE EFFORT"
|
||||
set_global_assignment -name ALLOW_POWER_UP_DONT_CARE ON
|
||||
set_global_assignment -name QII_AUTO_PACKED_REGISTERS NORMAL
|
||||
set_global_assignment -name ROUTER_LCELL_INSERTION_AND_LOGIC_DUPLICATION ON
|
||||
set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC ON
|
||||
set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_DUPLICATION ON
|
||||
set_global_assignment -name PHYSICAL_SYNTHESIS_REGISTER_RETIMING ON
|
||||
set_global_assignment -name OPTIMIZATION_TECHNIQUE SPEED
|
||||
set_global_assignment -name MUX_RESTRUCTURE ON
|
||||
set_global_assignment -name REMOVE_REDUNDANT_LOGIC_CELLS ON
|
||||
set_global_assignment -name AUTO_DELAY_CHAINS_FOR_HIGH_FANOUT_INPUT_PINS ON
|
||||
set_global_assignment -name PHYSICAL_SYNTHESIS_COMBO_LOGIC_FOR_AREA ON
|
||||
set_global_assignment -name ADV_NETLIST_OPT_SYNTH_WYSIWYG_REMAP ON
|
||||
set_global_assignment -name SYNTH_GATED_CLOCK_CONVERSION ON
|
||||
set_global_assignment -name PRE_MAPPING_RESYNTHESIS ON
|
||||
set_global_assignment -name ROUTER_CLOCKING_TOPOLOGY_ANALYSIS ON
|
||||
set_global_assignment -name ECO_OPTIMIZE_TIMING ON
|
||||
set_global_assignment -name PERIPHERY_TO_CORE_PLACEMENT_AND_ROUTING_OPTIMIZATION ON
|
||||
set_global_assignment -name PHYSICAL_SYNTHESIS_ASYNCHRONOUS_SIGNAL_PIPELINING ON
|
||||
set_global_assignment -name ALM_REGISTER_PACKING_EFFORT LOW
|
||||
set_global_assignment -name SEED 1
|
||||
|
||||
#============================================================
|
||||
# ADC
|
||||
#============================================================
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to ADC_CONVST
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to ADC_SCK
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to ADC_SDI
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to ADC_SDO
|
||||
set_location_assignment PIN_U9 -to ADC_CONVST
|
||||
set_location_assignment PIN_V10 -to ADC_SCK
|
||||
set_location_assignment PIN_AC4 -to ADC_SDI
|
||||
set_location_assignment PIN_AD4 -to ADC_SDO
|
||||
|
||||
#============================================================
|
||||
# ARDUINO
|
||||
#============================================================
|
||||
set_location_assignment PIN_AG9 -to ARDUINO_IO[3]
|
||||
set_location_assignment PIN_U14 -to ARDUINO_IO[4]
|
||||
set_location_assignment PIN_U13 -to ARDUINO_IO[5]
|
||||
set_location_assignment PIN_AG8 -to ARDUINO_IO[6]
|
||||
set_location_assignment PIN_AH8 -to ARDUINO_IO[7]
|
||||
set_location_assignment PIN_AF17 -to ARDUINO_IO[8]
|
||||
set_location_assignment PIN_AE15 -to ARDUINO_IO[9]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to ARDUINO_IO[*]
|
||||
set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to ARDUINO_IO[*]
|
||||
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to ARDUINO_IO[*]
|
||||
|
||||
#============================================================
|
||||
# USER PORT
|
||||
#============================================================
|
||||
set_location_assignment PIN_AF15 -to USER_IO[5]
|
||||
set_location_assignment PIN_AG16 -to USER_IO[4]
|
||||
set_location_assignment PIN_AH11 -to USER_IO[3]
|
||||
set_location_assignment PIN_AH12 -to USER_IO[2]
|
||||
set_location_assignment PIN_AH9 -to USER_IO[1]
|
||||
set_location_assignment PIN_AG11 -to USER_IO[0]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to USER_IO[*]
|
||||
set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to USER_IO[*]
|
||||
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to USER_IO[*]
|
||||
|
||||
#============================================================
|
||||
# SDIO
|
||||
#============================================================
|
||||
set_location_assignment PIN_AF25 -to SDIO_DAT[0]
|
||||
set_location_assignment PIN_AF23 -to SDIO_DAT[1]
|
||||
set_location_assignment PIN_AD26 -to SDIO_DAT[2]
|
||||
set_location_assignment PIN_AF28 -to SDIO_DAT[3]
|
||||
set_location_assignment PIN_AF27 -to SDIO_CMD
|
||||
set_location_assignment PIN_AH26 -to SDIO_CLK
|
||||
set_location_assignment PIN_AH7 -to SDIO_CD
|
||||
|
||||
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to SDIO_*
|
||||
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SDIO_*
|
||||
set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to SDIO_DAT[*]
|
||||
set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to SDIO_CMD
|
||||
set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to SDIO_CD
|
||||
|
||||
#============================================================
|
||||
# VGA
|
||||
#============================================================
|
||||
set_location_assignment PIN_AE17 -to VGA_R[0]
|
||||
set_location_assignment PIN_AE20 -to VGA_R[1]
|
||||
set_location_assignment PIN_AF20 -to VGA_R[2]
|
||||
set_location_assignment PIN_AH18 -to VGA_R[3]
|
||||
set_location_assignment PIN_AH19 -to VGA_R[4]
|
||||
set_location_assignment PIN_AF21 -to VGA_R[5]
|
||||
|
||||
set_location_assignment PIN_AE19 -to VGA_G[0]
|
||||
set_location_assignment PIN_AG15 -to VGA_G[1]
|
||||
set_location_assignment PIN_AF18 -to VGA_G[2]
|
||||
set_location_assignment PIN_AG18 -to VGA_G[3]
|
||||
set_location_assignment PIN_AG19 -to VGA_G[4]
|
||||
set_location_assignment PIN_AG20 -to VGA_G[5]
|
||||
|
||||
set_location_assignment PIN_AG21 -to VGA_B[0]
|
||||
set_location_assignment PIN_AA20 -to VGA_B[1]
|
||||
set_location_assignment PIN_AE22 -to VGA_B[2]
|
||||
set_location_assignment PIN_AF22 -to VGA_B[3]
|
||||
set_location_assignment PIN_AH23 -to VGA_B[4]
|
||||
set_location_assignment PIN_AH21 -to VGA_B[5]
|
||||
|
||||
set_location_assignment PIN_AH22 -to VGA_HS
|
||||
set_location_assignment PIN_AG24 -to VGA_VS
|
||||
|
||||
set_location_assignment PIN_AH27 -to VGA_EN
|
||||
set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to VGA_EN
|
||||
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to VGA_*
|
||||
set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to VGA_*
|
||||
|
||||
#============================================================
|
||||
# AUDIO
|
||||
#============================================================
|
||||
set_location_assignment PIN_AC24 -to AUDIO_L
|
||||
set_location_assignment PIN_AE25 -to AUDIO_R
|
||||
set_location_assignment PIN_AG26 -to AUDIO_SPDIF
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to AUDIO_*
|
||||
set_instance_assignment -name CURRENT_STRENGTH_NEW 8MA -to AUDIO_*
|
||||
|
||||
#============================================================
|
||||
# SDRAM
|
||||
#============================================================
|
||||
set_location_assignment PIN_Y11 -to SDRAM_A[0]
|
||||
set_location_assignment PIN_AA26 -to SDRAM_A[1]
|
||||
set_location_assignment PIN_AA13 -to SDRAM_A[2]
|
||||
set_location_assignment PIN_AA11 -to SDRAM_A[3]
|
||||
set_location_assignment PIN_W11 -to SDRAM_A[4]
|
||||
set_location_assignment PIN_Y19 -to SDRAM_A[5]
|
||||
set_location_assignment PIN_AB23 -to SDRAM_A[6]
|
||||
set_location_assignment PIN_AC23 -to SDRAM_A[7]
|
||||
set_location_assignment PIN_AC22 -to SDRAM_A[8]
|
||||
set_location_assignment PIN_C12 -to SDRAM_A[9]
|
||||
set_location_assignment PIN_AB26 -to SDRAM_A[10]
|
||||
set_location_assignment PIN_AD17 -to SDRAM_A[11]
|
||||
set_location_assignment PIN_D12 -to SDRAM_A[12]
|
||||
set_location_assignment PIN_Y17 -to SDRAM_BA[0]
|
||||
set_location_assignment PIN_AB25 -to SDRAM_BA[1]
|
||||
|
||||
set_location_assignment PIN_E8 -to SDRAM_DQ[0]
|
||||
set_location_assignment PIN_V12 -to SDRAM_DQ[1]
|
||||
set_location_assignment PIN_D11 -to SDRAM_DQ[2]
|
||||
set_location_assignment PIN_W12 -to SDRAM_DQ[3]
|
||||
set_location_assignment PIN_AH13 -to SDRAM_DQ[4]
|
||||
set_location_assignment PIN_D8 -to SDRAM_DQ[5]
|
||||
set_location_assignment PIN_AH14 -to SDRAM_DQ[6]
|
||||
set_location_assignment PIN_AF7 -to SDRAM_DQ[7]
|
||||
set_location_assignment PIN_AE24 -to SDRAM_DQ[8]
|
||||
set_location_assignment PIN_AD23 -to SDRAM_DQ[9]
|
||||
set_location_assignment PIN_AE6 -to SDRAM_DQ[10]
|
||||
set_location_assignment PIN_AE23 -to SDRAM_DQ[11]
|
||||
set_location_assignment PIN_AG14 -to SDRAM_DQ[12]
|
||||
set_location_assignment PIN_AD5 -to SDRAM_DQ[13]
|
||||
set_location_assignment PIN_AF4 -to SDRAM_DQ[14]
|
||||
set_location_assignment PIN_AH3 -to SDRAM_DQ[15]
|
||||
set_location_assignment PIN_AG13 -to SDRAM_DQML
|
||||
set_location_assignment PIN_AF13 -to SDRAM_DQMH
|
||||
|
||||
set_location_assignment PIN_AD20 -to SDRAM_CLK
|
||||
set_location_assignment PIN_AG10 -to SDRAM_CKE
|
||||
|
||||
set_location_assignment PIN_AA19 -to SDRAM_nWE
|
||||
set_location_assignment PIN_AA18 -to SDRAM_nCAS
|
||||
set_location_assignment PIN_Y18 -to SDRAM_nCS
|
||||
set_location_assignment PIN_W14 -to SDRAM_nRAS
|
||||
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SDRAM_*
|
||||
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to SDRAM_*
|
||||
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_A*
|
||||
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_BA*
|
||||
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_DQ[*]
|
||||
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_DQM*
|
||||
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to SDRAM_n*
|
||||
set_instance_assignment -name FAST_OUTPUT_ENABLE_REGISTER ON -to SDRAM_DQ[*]
|
||||
set_instance_assignment -name ALLOW_SYNCH_CTRL_USAGE OFF -to *|SDRAM_*
|
||||
|
||||
#============================================================
|
||||
# I/O
|
||||
#============================================================
|
||||
set_location_assignment PIN_Y15 -to LED_USER
|
||||
set_location_assignment PIN_AA15 -to LED_HDD
|
||||
set_location_assignment PIN_AG28 -to LED_POWER
|
||||
|
||||
set_location_assignment PIN_AH24 -to BTN_USER
|
||||
set_location_assignment PIN_AG25 -to BTN_OSD
|
||||
set_location_assignment PIN_AG23 -to BTN_RESET
|
||||
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LED_*
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to BTN_*
|
||||
set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to BTN_*
|
||||
|
||||
#============================================================
|
||||
# CLOCK
|
||||
#============================================================
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to FPGA_CLK1_50
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to FPGA_CLK2_50
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to FPGA_CLK3_50
|
||||
set_location_assignment PIN_V11 -to FPGA_CLK1_50
|
||||
set_location_assignment PIN_Y13 -to FPGA_CLK2_50
|
||||
set_location_assignment PIN_E11 -to FPGA_CLK3_50
|
||||
|
||||
#============================================================
|
||||
# HDMI
|
||||
#============================================================
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_I2C_SCL
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_I2C_SDA
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_I2S
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_LRCLK
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_MCLK
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_SCLK
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_CLK
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_DE
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[0]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[1]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[2]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[3]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[4]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[5]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[6]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[7]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[8]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[9]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[10]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[11]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[12]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[13]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[14]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[15]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[16]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[17]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[18]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[19]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[20]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[21]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[22]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_D[23]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_HS
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_INT
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to HDMI_TX_VS
|
||||
set_location_assignment PIN_U10 -to HDMI_I2C_SCL
|
||||
set_location_assignment PIN_AA4 -to HDMI_I2C_SDA
|
||||
set_location_assignment PIN_T13 -to HDMI_I2S
|
||||
set_location_assignment PIN_T11 -to HDMI_LRCLK
|
||||
set_location_assignment PIN_U11 -to HDMI_MCLK
|
||||
set_location_assignment PIN_T12 -to HDMI_SCLK
|
||||
set_location_assignment PIN_AG5 -to HDMI_TX_CLK
|
||||
set_location_assignment PIN_AD19 -to HDMI_TX_DE
|
||||
set_location_assignment PIN_AD12 -to HDMI_TX_D[0]
|
||||
set_location_assignment PIN_AE12 -to HDMI_TX_D[1]
|
||||
set_location_assignment PIN_W8 -to HDMI_TX_D[2]
|
||||
set_location_assignment PIN_Y8 -to HDMI_TX_D[3]
|
||||
set_location_assignment PIN_AD11 -to HDMI_TX_D[4]
|
||||
set_location_assignment PIN_AD10 -to HDMI_TX_D[5]
|
||||
set_location_assignment PIN_AE11 -to HDMI_TX_D[6]
|
||||
set_location_assignment PIN_Y5 -to HDMI_TX_D[7]
|
||||
set_location_assignment PIN_AF10 -to HDMI_TX_D[8]
|
||||
set_location_assignment PIN_Y4 -to HDMI_TX_D[9]
|
||||
set_location_assignment PIN_AE9 -to HDMI_TX_D[10]
|
||||
set_location_assignment PIN_AB4 -to HDMI_TX_D[11]
|
||||
set_location_assignment PIN_AE7 -to HDMI_TX_D[12]
|
||||
set_location_assignment PIN_AF6 -to HDMI_TX_D[13]
|
||||
set_location_assignment PIN_AF8 -to HDMI_TX_D[14]
|
||||
set_location_assignment PIN_AF5 -to HDMI_TX_D[15]
|
||||
set_location_assignment PIN_AE4 -to HDMI_TX_D[16]
|
||||
set_location_assignment PIN_AH2 -to HDMI_TX_D[17]
|
||||
set_location_assignment PIN_AH4 -to HDMI_TX_D[18]
|
||||
set_location_assignment PIN_AH5 -to HDMI_TX_D[19]
|
||||
set_location_assignment PIN_AH6 -to HDMI_TX_D[20]
|
||||
set_location_assignment PIN_AG6 -to HDMI_TX_D[21]
|
||||
set_location_assignment PIN_AF9 -to HDMI_TX_D[22]
|
||||
set_location_assignment PIN_AE8 -to HDMI_TX_D[23]
|
||||
set_location_assignment PIN_T8 -to HDMI_TX_HS
|
||||
set_location_assignment PIN_AF11 -to HDMI_TX_INT
|
||||
set_location_assignment PIN_V13 -to HDMI_TX_VS
|
||||
|
||||
#============================================================
|
||||
# KEY
|
||||
#============================================================
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to KEY[0]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to KEY[1]
|
||||
set_location_assignment PIN_AH17 -to KEY[0]
|
||||
set_location_assignment PIN_AH16 -to KEY[1]
|
||||
|
||||
#============================================================
|
||||
# LED
|
||||
#============================================================
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LED[0]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LED[1]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LED[2]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LED[3]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LED[4]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LED[5]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LED[6]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LED[7]
|
||||
set_location_assignment PIN_W15 -to LED[0]
|
||||
set_location_assignment PIN_AA24 -to LED[1]
|
||||
set_location_assignment PIN_V16 -to LED[2]
|
||||
set_location_assignment PIN_V15 -to LED[3]
|
||||
set_location_assignment PIN_AF26 -to LED[4]
|
||||
set_location_assignment PIN_AE26 -to LED[5]
|
||||
set_location_assignment PIN_Y16 -to LED[6]
|
||||
set_location_assignment PIN_AA23 -to LED[7]
|
||||
|
||||
#============================================================
|
||||
# SW
|
||||
#============================================================
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SW[0]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SW[1]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SW[2]
|
||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SW[3]
|
||||
set_location_assignment PIN_Y24 -to SW[0]
|
||||
set_location_assignment PIN_W24 -to SW[1]
|
||||
set_location_assignment PIN_W21 -to SW[2]
|
||||
set_location_assignment PIN_W20 -to SW[3]
|
||||
|
||||
set_global_assignment -name PRE_FLOW_SCRIPT_FILE "quartus_sh:sys/build_id.tcl"
|
||||
|
||||
set_global_assignment -name CDF_FILE jtag.cdf
|
||||
set_global_assignment -name QIP_FILE sys/sys.qip
|
||||
set_global_assignment -name QIP_FILE sdram.qip
|
||||
set_global_assignment -name VERILOG_FILE scsi.v
|
||||
set_global_assignment -name VERILOG_FILE ncr5380.v
|
||||
set_global_assignment -name VERILOG_FILE floppy_track_encoder.v
|
||||
set_global_assignment -name VERILOG_FILE floppy.v
|
||||
set_global_assignment -name SYSTEMVERILOG_FILE ps2_kbd.sv
|
||||
set_global_assignment -name VERILOG_FILE ps2_mouse.v
|
||||
set_global_assignment -name VHDL_FILE TG68K_Pack.vhd
|
||||
set_global_assignment -name VHDL_FILE TG68K_ALU.vhd
|
||||
set_global_assignment -name VHDL_FILE TG68KdotC_Kernel.vhd
|
||||
set_global_assignment -name VERILOG_FILE scc.v
|
||||
set_global_assignment -name VERILOG_FILE iwm.v
|
||||
set_global_assignment -name VERILOG_FILE via.v
|
||||
set_global_assignment -name VERILOG_FILE addrDecoder.v
|
||||
set_global_assignment -name VERILOG_FILE addrController_top.v
|
||||
set_global_assignment -name VERILOG_FILE dataController_top.v
|
||||
set_global_assignment -name VERILOG_FILE video.v
|
||||
set_global_assignment -name SYSTEMVERILOG_FILE MacPlus.sv
|
||||
source sys/sys.tcl
|
||||
source sys/sys_analog.tcl
|
||||
source files.qip
|
||||
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
|
11
MacPlus.sv
11
MacPlus.sv
@ -2,7 +2,7 @@
|
||||
// Macintosh Plus
|
||||
//
|
||||
// Port to MiSTer
|
||||
// Copyright (C) 2017,2018 Sorgelig
|
||||
// Copyright (C) 2017-2019 Sorgelig
|
||||
//
|
||||
// This program 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
|
||||
@ -29,7 +29,7 @@ module emu
|
||||
input RESET,
|
||||
|
||||
//Must be passed to hps_io module
|
||||
inout [44:0] HPS_BUS,
|
||||
inout [45:0] HPS_BUS,
|
||||
|
||||
//Base video clock. Usually equals to CLK_SYS.
|
||||
output CLK_VIDEO,
|
||||
@ -63,7 +63,9 @@ module emu
|
||||
output [15:0] AUDIO_R,
|
||||
output AUDIO_S, // 1 - signed audio samples, 0 - unsigned
|
||||
output [1:0] AUDIO_MIX, // 0 - no mix, 1 - 25%, 2 - 50%, 3 - 100% (mono)
|
||||
input TAPE_IN,
|
||||
|
||||
//ADC
|
||||
inout [3:0] ADC_BUS,
|
||||
|
||||
// SD-SPI
|
||||
output SD_SCK,
|
||||
@ -115,7 +117,8 @@ module emu
|
||||
|
||||
input OSD_STATUS
|
||||
);
|
||||
|
||||
|
||||
assign ADC_BUS = 'Z;
|
||||
assign USER_OUT = '1;
|
||||
assign {UART_RTS, UART_TXD, UART_DTR} = 0;
|
||||
assign {DDRAM_CLK, DDRAM_BURSTCNT, DDRAM_ADDR, DDRAM_DIN, DDRAM_BE, DDRAM_RD, DDRAM_WE} = 0;
|
||||
|
18
files.qip
Normal file
18
files.qip
Normal file
@ -0,0 +1,18 @@
|
||||
set_global_assignment -name QIP_FILE sdram.qip
|
||||
set_global_assignment -name VERILOG_FILE scsi.v
|
||||
set_global_assignment -name VERILOG_FILE ncr5380.v
|
||||
set_global_assignment -name VERILOG_FILE floppy_track_encoder.v
|
||||
set_global_assignment -name VERILOG_FILE floppy.v
|
||||
set_global_assignment -name SYSTEMVERILOG_FILE ps2_kbd.sv
|
||||
set_global_assignment -name VERILOG_FILE ps2_mouse.v
|
||||
set_global_assignment -name VHDL_FILE TG68K_Pack.vhd
|
||||
set_global_assignment -name VHDL_FILE TG68K_ALU.vhd
|
||||
set_global_assignment -name VHDL_FILE TG68KdotC_Kernel.vhd
|
||||
set_global_assignment -name VERILOG_FILE scc.v
|
||||
set_global_assignment -name VERILOG_FILE iwm.v
|
||||
set_global_assignment -name VERILOG_FILE via.v
|
||||
set_global_assignment -name VERILOG_FILE addrDecoder.v
|
||||
set_global_assignment -name VERILOG_FILE addrController_top.v
|
||||
set_global_assignment -name VERILOG_FILE dataController_top.v
|
||||
set_global_assignment -name VERILOG_FILE video.v
|
||||
set_global_assignment -name SYSTEMVERILOG_FILE MacPlus.sv
|
21
sys/alsa.sv
21
sys/alsa.sv
@ -23,6 +23,9 @@ module alsa
|
||||
(
|
||||
input reset,
|
||||
|
||||
output reg en_out,
|
||||
input en_in,
|
||||
|
||||
input ram_clk,
|
||||
output reg [28:0] ram_address,
|
||||
output reg [7:0] ram_burstcount,
|
||||
@ -30,11 +33,11 @@ module alsa
|
||||
input [63:0] ram_readdata,
|
||||
input ram_readdatavalid,
|
||||
output reg ram_read,
|
||||
|
||||
|
||||
input spi_ss,
|
||||
input spi_sck,
|
||||
input spi_mosi,
|
||||
|
||||
|
||||
output reg [15:0] pcm_l,
|
||||
output reg [15:0] pcm_r
|
||||
);
|
||||
@ -44,7 +47,7 @@ reg [127:0] spi_data;
|
||||
always @(posedge spi_sck, posedge spi_ss) begin
|
||||
reg [7:0] mosi;
|
||||
reg [6:0] spicnt = 0;
|
||||
|
||||
|
||||
if(spi_ss) spicnt <= 0;
|
||||
else begin
|
||||
mosi <= {mosi[6:0],spi_mosi};
|
||||
@ -68,10 +71,10 @@ always @(posedge ram_clk) begin
|
||||
n1 <= spi_new;
|
||||
n2 <= n1;
|
||||
n3 <= n2;
|
||||
|
||||
|
||||
data1 <= spi_data;
|
||||
data2 <= data1;
|
||||
|
||||
|
||||
if(~n3 & n2) {buf_wptr,buf_len,buf_addr} <= data2[95:0];
|
||||
end
|
||||
|
||||
@ -79,7 +82,7 @@ reg [31:0] buf_rptr = 0;
|
||||
always @(posedge ram_clk) begin
|
||||
reg got_first = 0;
|
||||
reg ready = 0;
|
||||
reg ud;
|
||||
reg ud = 0;
|
||||
reg [31:0] readdata;
|
||||
|
||||
if(~ram_waitrequest) ram_read <= 0;
|
||||
@ -90,7 +93,7 @@ always @(posedge ram_clk) begin
|
||||
if(buf_rptr[31:2] >= buf_len[31:2]) buf_rptr <= 0;
|
||||
end
|
||||
|
||||
if(reset) {ready, got_first} <= 0;
|
||||
if(reset) {ready, got_first, ram_burstcount} <= 0;
|
||||
else
|
||||
if(buf_rptr[31:2] != buf_wptr[31:2]) begin
|
||||
if(~got_first) begin
|
||||
@ -98,7 +101,7 @@ always @(posedge ram_clk) begin
|
||||
got_first <= 1;
|
||||
end
|
||||
else
|
||||
if(!ram_burstcount && ~ram_waitrequest && ~ready) begin
|
||||
if(!ram_burstcount && ~ram_waitrequest && ~ready && en_out == en_in) begin
|
||||
ram_address <= buf_addr[31:3] + buf_rptr[31:3];
|
||||
ud <= buf_rptr[2];
|
||||
ram_burstcount <= 1;
|
||||
@ -111,6 +114,8 @@ always @(posedge ram_clk) begin
|
||||
{pcm_r,pcm_l} <= readdata;
|
||||
ready <= 0;
|
||||
end
|
||||
|
||||
if(ce_48k) en_out <= ~en_out;
|
||||
end
|
||||
|
||||
reg ce_48k;
|
||||
|
801
sys/ascal.vhd
801
sys/ascal.vhd
File diff suppressed because it is too large
Load Diff
86
sys/fbpal.sv
Normal file
86
sys/fbpal.sv
Normal file
@ -0,0 +1,86 @@
|
||||
//============================================================================
|
||||
//
|
||||
// Framebuffer Palette support for MiSTer
|
||||
// (c)2019 Sorgelig
|
||||
//
|
||||
// This program 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.
|
||||
//
|
||||
//============================================================================
|
||||
|
||||
module fbpal
|
||||
(
|
||||
input reset,
|
||||
|
||||
input en_in,
|
||||
output reg en_out,
|
||||
|
||||
input ram_clk,
|
||||
output reg [28:0] ram_address,
|
||||
output reg [7:0] ram_burstcount,
|
||||
input ram_waitrequest,
|
||||
input [63:0] ram_readdata,
|
||||
input ram_readdatavalid,
|
||||
output reg ram_read,
|
||||
|
||||
input [31:0] fb_address,
|
||||
|
||||
input pal_en,
|
||||
output reg [7:0] pal_a,
|
||||
output reg [23:0] pal_d,
|
||||
output reg pal_wr
|
||||
);
|
||||
|
||||
reg [31:0] base_addr;
|
||||
always @(posedge ram_clk) base_addr <= fb_address - 4096;
|
||||
|
||||
reg [6:0] buf_rptr = 0;
|
||||
always @(posedge ram_clk) begin
|
||||
reg [23:0] odd_d;
|
||||
|
||||
if(~pal_a[0] & pal_wr) {pal_a[0], pal_d} <= {1'b1, odd_d};
|
||||
else pal_wr <= 0;
|
||||
|
||||
if(~ram_waitrequest) ram_read <= 0;
|
||||
|
||||
if(pal_en & ~reset) begin
|
||||
if(ram_burstcount) begin
|
||||
if(ram_readdatavalid) begin
|
||||
ram_burstcount <= 0;
|
||||
|
||||
odd_d <= ram_readdata[55:32];
|
||||
pal_d <= ram_readdata[23:0];
|
||||
pal_a <= {buf_rptr, 1'b0};
|
||||
pal_wr <= 1;
|
||||
|
||||
en_out <= en_in;
|
||||
buf_rptr <= buf_rptr + 1'd1;
|
||||
end
|
||||
end
|
||||
else begin
|
||||
if(~ram_waitrequest && en_out != en_in) begin
|
||||
ram_address <= base_addr[31:3] + buf_rptr;
|
||||
ram_burstcount <= 1;
|
||||
ram_read <= 1;
|
||||
end
|
||||
end
|
||||
end
|
||||
else begin
|
||||
en_out <= en_in;
|
||||
buf_rptr <= 0;
|
||||
ram_burstcount <= 0;
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
@ -1,202 +1,235 @@
|
||||
|
||||
module hdmi_config
|
||||
(
|
||||
// Host Side
|
||||
input iCLK,
|
||||
input iRST_N,
|
||||
|
||||
input dvi_mode,
|
||||
input audio_96k,
|
||||
|
||||
// I2C Side
|
||||
output I2C_SCL,
|
||||
inout I2C_SDA
|
||||
);
|
||||
|
||||
// Internal Registers/Wires
|
||||
reg mI2C_GO = 0;
|
||||
wire mI2C_END;
|
||||
wire mI2C_ACK;
|
||||
reg [15:0] LUT_DATA;
|
||||
reg [7:0] LUT_INDEX = 0;
|
||||
|
||||
i2c #(50_000_000, 20_000) i2c_av
|
||||
(
|
||||
.CLK(iCLK),
|
||||
|
||||
.I2C_SCL(I2C_SCL), // I2C CLOCK
|
||||
.I2C_SDA(I2C_SDA), // I2C DATA
|
||||
|
||||
.I2C_DATA({8'h72,init_data[LUT_INDEX]}), // DATA:[SLAVE_ADDR,SUB_ADDR,DATA]. 0x72 is the Slave Address of the ADV7513 chip!
|
||||
.START(mI2C_GO), // START transfer
|
||||
.END(mI2C_END), // END transfer
|
||||
.ACK(mI2C_ACK) // ACK
|
||||
);
|
||||
|
||||
////////////////////// Config Control ////////////////////////////
|
||||
always@(posedge iCLK or negedge iRST_N) begin
|
||||
reg [1:0] mSetup_ST = 0;
|
||||
|
||||
if(!iRST_N) begin
|
||||
LUT_INDEX <= 0;
|
||||
mSetup_ST <= 0;
|
||||
mI2C_GO <= 0;
|
||||
end else begin
|
||||
if(init_data[LUT_INDEX] != 16'hFFFF) begin
|
||||
case(mSetup_ST)
|
||||
0: begin
|
||||
mI2C_GO <= 1;
|
||||
mSetup_ST <= 1;
|
||||
end
|
||||
1: if(~mI2C_END) mSetup_ST <= 2;
|
||||
2: begin
|
||||
mI2C_GO <= 0;
|
||||
if(mI2C_END) begin
|
||||
mSetup_ST <= 0;
|
||||
if(!mI2C_ACK) LUT_INDEX <= LUT_INDEX + 8'd1;
|
||||
end
|
||||
end
|
||||
endcase
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
///////////////////// Config Data LUT //////////////////////////
|
||||
|
||||
wire [15:0] init_data[58] =
|
||||
'{
|
||||
16'h9803, // ADI required Write.
|
||||
|
||||
{8'hD6, 8'b1100_0000}, // [7:6] HPD Control...
|
||||
// 00 = HPD is from both HPD pin or CDC HPD
|
||||
// 01 = HPD is from CDC HPD
|
||||
// 10 = HPD is from HPD pin
|
||||
// 11 = HPD is always high
|
||||
|
||||
16'h4110, // Power Down control
|
||||
16'h9A70, // ADI required Write.
|
||||
16'h9C30, // ADI required Write.
|
||||
{8'h9D, 8'b0110_0001}, // [7:4] must be b0110!.
|
||||
// [3:2] b00 = Input clock not divided. b01 = Clk divided by 2. b10 = Clk divided by 4. b11 = invalid!
|
||||
// [1:0] must be b01!
|
||||
16'hA2A4, // ADI required Write.
|
||||
16'hA3A4, // ADI required Write.
|
||||
16'hE0D0, // ADI required Write.
|
||||
|
||||
|
||||
16'h35_40,
|
||||
16'h36_D9,
|
||||
16'h37_0A,
|
||||
16'h38_00,
|
||||
16'h39_2D,
|
||||
16'h3A_00,
|
||||
|
||||
{8'h16, 8'b0011_1000}, // Output Format 444 [7]=0.
|
||||
// [6] must be 0!
|
||||
// Colour Depth for Input Video data [5:4] b11 = 8-bit.
|
||||
// Input Style [3:2] b10 = Style 1 (ignored when using 444 input).
|
||||
// DDR Input Edge falling [1]=0 (not using DDR atm).
|
||||
// Output Colour Space RGB [0]=0.
|
||||
|
||||
{8'h17, 8'b01100010}, // Aspect ratio 16:9 [1]=1, 4:3 [1]=0
|
||||
|
||||
{8'h18, 8'b0100_0110}, // CSC disabled [7]=0.
|
||||
// CSC Scaling Factor [6:5] b10 = +/- 4.0, -16384 - 16380.
|
||||
// CSC Equation 3 [4:0] b00110.
|
||||
|
||||
|
||||
{8'h3B, 8'b0000_0000}, // Pixel repetition [6:5] b00 AUTO. [4:3] b00 x1 mult of input clock. [2:1] b00 x1 pixel rep to send to HDMI Rx.
|
||||
|
||||
16'h4000, // General Control Packet Enable
|
||||
|
||||
{8'h48, 8'b0000_1000}, // [6]=0 Normal bus order!
|
||||
// [5] DDR Alignment.
|
||||
// [4:3] b01 Data right justified (for YCbCr 422 input modes).
|
||||
|
||||
16'h49A8, // ADI required Write.
|
||||
16'h4C00, // ADI required Write.
|
||||
|
||||
{8'h55, 8'b0001_0000}, // [7] must be 0!. Set RGB444 in AVinfo Frame [6:5], Set active format [4].
|
||||
// AVI InfoFrame Valid [4].
|
||||
// Bar Info [3:2] b00 Bars invalid. b01 Bars vertical. b10 Bars horizontal. b11 Bars both.
|
||||
// Scan Info [1:0] b00 (No data). b01 TV. b10 PC. b11 None.
|
||||
|
||||
16'h7301,
|
||||
|
||||
{8'h94, 8'b1000_0000}, // [7]=1 HPD Interrupt ENabled.
|
||||
|
||||
16'h9902, // ADI required Write.
|
||||
16'h9B18, // ADI required Write.
|
||||
|
||||
16'h9F00, // ADI required Write.
|
||||
|
||||
{8'hA1, 8'b0000_0000}, // [6]=1 Monitor Sense Power Down DISabled.
|
||||
|
||||
16'hA408, // ADI required Write.
|
||||
16'hA504, // ADI required Write.
|
||||
16'hA600, // ADI required Write.
|
||||
16'hA700, // ADI required Write.
|
||||
16'hA800, // ADI required Write.
|
||||
16'hA900, // ADI required Write.
|
||||
16'hAA00, // ADI required Write.
|
||||
16'hAB40, // ADI required Write.
|
||||
|
||||
{8'hAF, 6'b0000_01,~dvi_mode,1'b0}, // [7]=0 HDCP Disabled.
|
||||
// [6:5] must be b00!
|
||||
// [4]=0 Current frame is unencrypted
|
||||
// [3:2] must be b01!
|
||||
// [1]=1 HDMI Mode.
|
||||
// [0] must be b0!
|
||||
|
||||
16'hB900, // ADI required Write.
|
||||
|
||||
{8'hBA, 8'b0110_0000}, // [7:5] Input Clock delay...
|
||||
// b000 = -1.2ns.
|
||||
// b001 = -0.8ns.
|
||||
// b010 = -0.4ns.
|
||||
// b011 = No delay.
|
||||
// b100 = 0.4ns.
|
||||
// b101 = 0.8ns.
|
||||
// b110 = 1.2ns.
|
||||
// b111 = 1.6ns.
|
||||
|
||||
16'hBB00, // ADI required Write.
|
||||
|
||||
16'hDE9C, // ADI required Write.
|
||||
16'hE460, // ADI required Write.
|
||||
16'hFA7D, // Nbr of times to search for good phase
|
||||
|
||||
|
||||
// (Audio stuff on Programming Guide, Page 66)...
|
||||
|
||||
{8'h0A, 8'b0000_0000}, // [6:4] Audio Select. b000 = I2S.
|
||||
// [3:2] Audio Mode. (HBR stuff, leave at 00!).
|
||||
|
||||
{8'h0B, 8'b0000_1110}, //
|
||||
|
||||
{8'h0C, 8'b0000_0100}, // [7] 0 = Use sampling rate from I2S stream. 1 = Use samp rate from I2C Register.
|
||||
// [6] 0 = Use Channel Status bits from stream. 1 = Use Channel Status bits from I2C register.
|
||||
// [2] 1 = I2S0 Enable.
|
||||
// [1:0] I2S Format: 00 = Standard. 01 = Right Justified. 10 = Left Justified. 11 = AES.
|
||||
|
||||
{8'h0D, 8'b0001_0000}, // [4:0] I2S Bit (Word) Width for Right-Justified.
|
||||
{8'h14, 8'b0000_0010}, // [3:0] Audio Word Length. b0010 = 16 bits.
|
||||
{8'h15, audio_96k, 7'b010_0000}, // I2S Sampling Rate [7:4]. b0000 = (44.1KHz). b0010 = 48KHz.
|
||||
// Input ID [3:1] b000 (0) = 24-bit RGB 444 or YCrCb 444 with Separate Syncs.
|
||||
|
||||
// Audio Clock Config
|
||||
16'h0100, //
|
||||
audio_96k ? 16'h0230 : 16'h0218, // Set N Value 12288/6144
|
||||
16'h0300, //
|
||||
|
||||
16'h0701, //
|
||||
16'h0822, // Set CTS Value 74250
|
||||
16'h090A, //
|
||||
|
||||
16'hFFFF // END
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
module hdmi_config
|
||||
(
|
||||
// Host Side
|
||||
input iCLK,
|
||||
input iRST_N,
|
||||
|
||||
input dvi_mode,
|
||||
input audio_96k,
|
||||
input hdmi_limited,
|
||||
output reg done,
|
||||
|
||||
// I2C Side
|
||||
output I2C_SCL,
|
||||
inout I2C_SDA
|
||||
);
|
||||
|
||||
// Internal Registers/Wires
|
||||
reg mI2C_GO = 0;
|
||||
wire mI2C_END;
|
||||
wire mI2C_ACK;
|
||||
reg [15:0] LUT_DATA;
|
||||
reg [7:0] LUT_INDEX = 0;
|
||||
|
||||
i2c #(50_000_000, 20_000) i2c_av
|
||||
(
|
||||
.CLK(iCLK),
|
||||
|
||||
.I2C_SCL(I2C_SCL), // I2C CLOCK
|
||||
.I2C_SDA(I2C_SDA), // I2C DATA
|
||||
|
||||
.I2C_DATA({8'h72,init_data[LUT_INDEX]}), // DATA:[SLAVE_ADDR,SUB_ADDR,DATA]. 0x72 is the Slave Address of the ADV7513 chip!
|
||||
.START(mI2C_GO), // START transfer
|
||||
.END(mI2C_END), // END transfer
|
||||
.ACK(mI2C_ACK) // ACK
|
||||
);
|
||||
|
||||
////////////////////// Config Control ////////////////////////////
|
||||
always@(posedge iCLK or negedge iRST_N) begin
|
||||
reg [1:0] mSetup_ST = 0;
|
||||
|
||||
if(!iRST_N) begin
|
||||
LUT_INDEX <= 0;
|
||||
mSetup_ST <= 0;
|
||||
mI2C_GO <= 0;
|
||||
done <= 0;
|
||||
end else begin
|
||||
if(init_data[LUT_INDEX] != 16'hFFFF) begin
|
||||
case(mSetup_ST)
|
||||
0: begin
|
||||
mI2C_GO <= 1;
|
||||
mSetup_ST <= 1;
|
||||
end
|
||||
1: if(~mI2C_END) mSetup_ST <= 2;
|
||||
2: begin
|
||||
mI2C_GO <= 0;
|
||||
if(mI2C_END) begin
|
||||
mSetup_ST <= 0;
|
||||
if(!mI2C_ACK) LUT_INDEX <= LUT_INDEX + 8'd1;
|
||||
end
|
||||
end
|
||||
endcase
|
||||
end
|
||||
else done <= 1;
|
||||
end
|
||||
end
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
///////////////////// Config Data LUT //////////////////////////
|
||||
|
||||
wire [15:0] init_data[82] =
|
||||
'{
|
||||
16'h9803, // ADI required Write.
|
||||
|
||||
{8'hD6, 8'b1100_0000}, // [7:6] HPD Control...
|
||||
// 00 = HPD is from both HPD pin or CDC HPD
|
||||
// 01 = HPD is from CDC HPD
|
||||
// 10 = HPD is from HPD pin
|
||||
// 11 = HPD is always high
|
||||
|
||||
16'h4110, // Power Down control
|
||||
16'h9A70, // ADI required Write.
|
||||
16'h9C30, // ADI required Write.
|
||||
{8'h9D, 8'b0110_0001}, // [7:4] must be b0110!.
|
||||
// [3:2] b00 = Input clock not divided. b01 = Clk divided by 2. b10 = Clk divided by 4. b11 = invalid!
|
||||
// [1:0] must be b01!
|
||||
16'hA2A4, // ADI required Write.
|
||||
16'hA3A4, // ADI required Write.
|
||||
16'hE0D0, // ADI required Write.
|
||||
|
||||
|
||||
16'h35_40,
|
||||
16'h36_D9,
|
||||
16'h37_0A,
|
||||
16'h38_00,
|
||||
16'h39_2D,
|
||||
16'h3A_00,
|
||||
|
||||
{8'h16, 8'b0011_1000}, // Output Format 444 [7]=0.
|
||||
// [6] must be 0!
|
||||
// Colour Depth for Input Video data [5:4] b11 = 8-bit.
|
||||
// Input Style [3:2] b10 = Style 1 (ignored when using 444 input).
|
||||
// DDR Input Edge falling [1]=0 (not using DDR atm).
|
||||
// Output Colour Space RGB [0]=0.
|
||||
|
||||
{8'h17, 8'b01100010}, // Aspect ratio 16:9 [1]=1, 4:3 [1]=0
|
||||
|
||||
{8'h18, hdmi_limited, // CSC enable [7]. 0 - Off. 1 - On.
|
||||
7'h0D}, // CSC Scaling Factors and Coefficients for RGB Full->Limited.
|
||||
{8'h19, 8'hBC}, // Taken from table in ADV7513 Programming Guide.
|
||||
{8'h1A, 8'h00}, // CSC Channel A.
|
||||
{8'h1B, 8'h00},
|
||||
{8'h1C, 8'h00},
|
||||
{8'h1D, 8'h00},
|
||||
{8'h1E, 8'h01},
|
||||
{8'h1F, 8'h00},
|
||||
|
||||
{8'h20, 8'h00}, // CSC Channel B.
|
||||
{8'h21, 8'h00},
|
||||
{8'h22, 8'h0D},
|
||||
{8'h23, 8'hBC},
|
||||
{8'h24, 8'h00},
|
||||
{8'h25, 8'h00},
|
||||
{8'h26, 8'h01},
|
||||
{8'h27, 8'h00},
|
||||
|
||||
{8'h28, 8'h00}, // CSC Channel C.
|
||||
{8'h29, 8'h00},
|
||||
{8'h2A, 8'h00},
|
||||
{8'h2B, 8'h00},
|
||||
{8'h2C, 8'h0D},
|
||||
{8'h2D, 8'hBC},
|
||||
{8'h2E, 8'h01},
|
||||
{8'h2F, 8'h00},
|
||||
|
||||
|
||||
{8'h3B, 8'b0000_0000}, // Pixel repetition [6:5] b00 AUTO. [4:3] b00 x1 mult of input clock. [2:1] b00 x1 pixel rep to send to HDMI Rx.
|
||||
|
||||
16'h4000, // General Control Packet Enable
|
||||
|
||||
{8'h48, 8'b0000_1000}, // [6]=0 Normal bus order!
|
||||
// [5] DDR Alignment.
|
||||
// [4:3] b01 Data right justified (for YCbCr 422 input modes).
|
||||
|
||||
16'h49A8, // ADI required Write.
|
||||
16'h4C00, // ADI required Write.
|
||||
|
||||
{8'h55, 8'b0001_0000}, // [7] must be 0!. Set RGB444 in AVinfo Frame [6:5], Set active format [4].
|
||||
// AVI InfoFrame Valid [4].
|
||||
// Bar Info [3:2] b00 Bars invalid. b01 Bars vertical. b10 Bars horizontal. b11 Bars both.
|
||||
// Scan Info [1:0] b00 (No data). b01 TV. b10 PC. b11 None.
|
||||
|
||||
{8'h57, 1'b0, // [7] IT Content. 0 - No. 1 - Yes (type set in register h59).
|
||||
3'b000, // [6:4] Color space (ignored for RGB)
|
||||
hdmi_limited ? 2'b01 : 2'b10, // [3:2] RGB Quantization range
|
||||
2'b00}, // [1:0] Non-Uniform Scaled: 00 - None. 01 - Horiz. 10 - Vert. 11 - Both.
|
||||
|
||||
16'h7301,
|
||||
|
||||
{8'h94, 8'b1000_0000}, // [7]=1 HPD Interrupt ENabled.
|
||||
|
||||
16'h9902, // ADI required Write.
|
||||
16'h9B18, // ADI required Write.
|
||||
|
||||
16'h9F00, // ADI required Write.
|
||||
|
||||
{8'hA1, 8'b0000_0000}, // [6]=1 Monitor Sense Power Down DISabled.
|
||||
|
||||
16'hA408, // ADI required Write.
|
||||
16'hA504, // ADI required Write.
|
||||
16'hA600, // ADI required Write.
|
||||
16'hA700, // ADI required Write.
|
||||
16'hA800, // ADI required Write.
|
||||
16'hA900, // ADI required Write.
|
||||
16'hAA00, // ADI required Write.
|
||||
16'hAB40, // ADI required Write.
|
||||
|
||||
{8'hAF, 6'b0000_01,~dvi_mode,1'b0}, // [7]=0 HDCP Disabled.
|
||||
// [6:5] must be b00!
|
||||
// [4]=0 Current frame is unencrypted
|
||||
// [3:2] must be b01!
|
||||
// [1]=1 HDMI Mode.
|
||||
// [0] must be b0!
|
||||
|
||||
16'hB900, // ADI required Write.
|
||||
|
||||
{8'hBA, 8'b0110_0000}, // [7:5] Input Clock delay...
|
||||
// b000 = -1.2ns.
|
||||
// b001 = -0.8ns.
|
||||
// b010 = -0.4ns.
|
||||
// b011 = No delay.
|
||||
// b100 = 0.4ns.
|
||||
// b101 = 0.8ns.
|
||||
// b110 = 1.2ns.
|
||||
// b111 = 1.6ns.
|
||||
|
||||
16'hBB00, // ADI required Write.
|
||||
|
||||
16'hDE9C, // ADI required Write.
|
||||
16'hE460, // ADI required Write.
|
||||
16'hFA7D, // Nbr of times to search for good phase
|
||||
|
||||
|
||||
// (Audio stuff on Programming Guide, Page 66)...
|
||||
|
||||
{8'h0A, 8'b0000_0000}, // [6:4] Audio Select. b000 = I2S.
|
||||
// [3:2] Audio Mode. (HBR stuff, leave at 00!).
|
||||
|
||||
{8'h0B, 8'b0000_1110}, //
|
||||
|
||||
{8'h0C, 8'b0000_0100}, // [7] 0 = Use sampling rate from I2S stream. 1 = Use samp rate from I2C Register.
|
||||
// [6] 0 = Use Channel Status bits from stream. 1 = Use Channel Status bits from I2C register.
|
||||
// [2] 1 = I2S0 Enable.
|
||||
// [1:0] I2S Format: 00 = Standard. 01 = Right Justified. 10 = Left Justified. 11 = AES.
|
||||
|
||||
{8'h0D, 8'b0001_0000}, // [4:0] I2S Bit (Word) Width for Right-Justified.
|
||||
{8'h14, 8'b0000_0010}, // [3:0] Audio Word Length. b0010 = 16 bits.
|
||||
{8'h15, audio_96k, 7'b010_0000}, // I2S Sampling Rate [7:4]. b0000 = (44.1KHz). b0010 = 48KHz.
|
||||
// Input ID [3:1] b000 (0) = 24-bit RGB 444 or YCrCb 444 with Separate Syncs.
|
||||
|
||||
// Audio Clock Config
|
||||
16'h0100, //
|
||||
audio_96k ? 16'h0230 : 16'h0218, // Set N Value 12288/6144
|
||||
16'h0300, //
|
||||
|
||||
16'h0701, //
|
||||
16'h0822, // Set CTS Value 74250
|
||||
16'h090A, //
|
||||
|
||||
16'hFFFF // END
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
endmodule
|
223
sys/hps_io.v
223
sys/hps_io.v
@ -30,20 +30,20 @@
|
||||
|
||||
// WIDE=1 for 16 bit file I/O
|
||||
// VDNUM 1-4
|
||||
module hps_io #(parameter STRLEN=0, PS2DIV=2000, WIDE=0, VDNUM=1, PS2WE=0)
|
||||
module hps_io #(parameter STRLEN=0, PS2DIV=0, WIDE=0, VDNUM=1, PS2WE=0)
|
||||
(
|
||||
input clk_sys,
|
||||
inout [44:0] HPS_BUS,
|
||||
inout [45:0] HPS_BUS,
|
||||
|
||||
// parameter STRLEN and the actual length of conf_str have to match
|
||||
input [(8*STRLEN)-1:0] conf_str,
|
||||
|
||||
output reg [15:0] joystick_0,
|
||||
output reg [15:0] joystick_1,
|
||||
output reg [15:0] joystick_2,
|
||||
output reg [15:0] joystick_3,
|
||||
output reg [15:0] joystick_4,
|
||||
output reg [15:0] joystick_5,
|
||||
output reg [31:0] joystick_0,
|
||||
output reg [31:0] joystick_1,
|
||||
output reg [31:0] joystick_2,
|
||||
output reg [31:0] joystick_3,
|
||||
output reg [31:0] joystick_4,
|
||||
output reg [31:0] joystick_5,
|
||||
output reg [15:0] joystick_analog_0,
|
||||
output reg [15:0] joystick_analog_1,
|
||||
output reg [15:0] joystick_analog_2,
|
||||
@ -57,6 +57,7 @@ module hps_io #(parameter STRLEN=0, PS2DIV=2000, WIDE=0, VDNUM=1, PS2WE=0)
|
||||
output reg [31:0] status,
|
||||
input [31:0] status_in,
|
||||
input status_set,
|
||||
input [15:0] status_menumask,
|
||||
|
||||
//toggle to force notify of video mode change
|
||||
input new_vmode,
|
||||
@ -121,7 +122,8 @@ module hps_io #(parameter STRLEN=0, PS2DIV=2000, WIDE=0, VDNUM=1, PS2WE=0)
|
||||
output reg [10:0] ps2_key = 0,
|
||||
|
||||
// [24] - toggles with every event
|
||||
output reg [24:0] ps2_mouse = 0
|
||||
output reg [24:0] ps2_mouse = 0,
|
||||
output reg [15:0] ps2_mouse_ext = 0 // 15:8 - reserved(additional buttons), 7:0 - wheel movements
|
||||
);
|
||||
|
||||
localparam DW = (WIDE) ? 15 : 7;
|
||||
@ -173,15 +175,18 @@ wire de = HPS_BUS[40];
|
||||
wire hs = HPS_BUS[39];
|
||||
wire vs = HPS_BUS[38];
|
||||
wire vs_hdmi = HPS_BUS[44];
|
||||
wire f1 = HPS_BUS[45];
|
||||
|
||||
reg [31:0] vid_hcnt = 0;
|
||||
reg [31:0] vid_vcnt = 0;
|
||||
reg [7:0] vid_nres = 0;
|
||||
reg [1:0] vid_int = 0;
|
||||
integer hcnt;
|
||||
|
||||
always @(posedge clk_vid) begin
|
||||
integer vcnt;
|
||||
reg old_vs= 0, old_de = 0, old_vmode = 0;
|
||||
reg [3:0] resto = 0;
|
||||
reg calch = 0;
|
||||
|
||||
if(ce_pix) begin
|
||||
@ -193,15 +198,22 @@ always @(posedge clk_vid) begin
|
||||
if(old_de & ~de) calch <= 0;
|
||||
|
||||
if(old_vs & ~vs) begin
|
||||
if(hcnt && vcnt) begin
|
||||
old_vmode <= new_vmode;
|
||||
if(vid_hcnt != hcnt || vid_vcnt != vcnt || old_vmode != new_vmode) vid_nres <= vid_nres + 1'd1;
|
||||
vid_hcnt <= hcnt;
|
||||
vid_vcnt <= vcnt;
|
||||
vid_int <= {vid_int[0],f1};
|
||||
if(~f1) begin
|
||||
if(hcnt && vcnt) begin
|
||||
old_vmode <= new_vmode;
|
||||
|
||||
//report new resolution after timeout
|
||||
if(resto) resto <= resto + 1'd1;
|
||||
if(vid_hcnt != hcnt || vid_vcnt != vcnt || old_vmode != new_vmode) resto <= 1;
|
||||
if(&resto) vid_nres <= vid_nres + 1'd1;
|
||||
vid_hcnt <= hcnt;
|
||||
vid_vcnt <= vcnt;
|
||||
end
|
||||
vcnt <= 0;
|
||||
hcnt <= 0;
|
||||
calch <= 1;
|
||||
end
|
||||
vcnt <= 0;
|
||||
hcnt <= 0;
|
||||
calch <= 1;
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -288,7 +300,7 @@ always@(posedge clk_sys) begin
|
||||
if(b_wr[2] && (~&sd_buff_addr)) sd_buff_addr <= sd_buff_addr + 1'b1;
|
||||
b_wr <= (b_wr<<1);
|
||||
|
||||
{kbd_rd,kbd_we,mouse_rd,mouse_we} <= 0;
|
||||
if(PS2DIV) {kbd_rd,kbd_we,mouse_rd,mouse_we} <= 0;
|
||||
|
||||
if(~io_enable) begin
|
||||
if(cmd == 4 && !ps2skip) ps2_mouse[24] <= ~ps2_mouse[24];
|
||||
@ -321,6 +333,7 @@ always@(posedge clk_sys) begin
|
||||
'h18: sd_ack <= 1;
|
||||
'h29: io_dout <= {4'hA, stflg};
|
||||
'h2B: io_dout <= 1;
|
||||
'h2F: io_dout <= 1;
|
||||
endcase
|
||||
|
||||
sd_buff_addr <= 0;
|
||||
@ -330,18 +343,20 @@ always@(posedge clk_sys) begin
|
||||
|
||||
case(cmd)
|
||||
// buttons and switches
|
||||
'h01: cfg <= io_din[7:0];
|
||||
'h02: joystick_0 <= io_din;
|
||||
'h03: joystick_1 <= io_din;
|
||||
'h10: joystick_2 <= io_din;
|
||||
'h11: joystick_3 <= io_din;
|
||||
'h12: joystick_4 <= io_din;
|
||||
'h13: joystick_5 <= io_din;
|
||||
'h01: cfg <= io_din[7:0];
|
||||
'h02: if(byte_cnt==1) joystick_0[15:0] <= io_din; else joystick_0[31:16] <= io_din;
|
||||
'h03: if(byte_cnt==1) joystick_1[15:0] <= io_din; else joystick_1[31:16] <= io_din;
|
||||
'h10: if(byte_cnt==1) joystick_2[15:0] <= io_din; else joystick_2[31:16] <= io_din;
|
||||
'h11: if(byte_cnt==1) joystick_3[15:0] <= io_din; else joystick_3[31:16] <= io_din;
|
||||
'h12: if(byte_cnt==1) joystick_4[15:0] <= io_din; else joystick_4[31:16] <= io_din;
|
||||
'h13: if(byte_cnt==1) joystick_5[15:0] <= io_din; else joystick_5[31:16] <= io_din;
|
||||
|
||||
// store incoming ps2 mouse bytes
|
||||
'h04: begin
|
||||
mouse_data <= io_din[7:0];
|
||||
mouse_we <= 1;
|
||||
if(PS2DIV) begin
|
||||
mouse_data <= io_din[7:0];
|
||||
mouse_we <= 1;
|
||||
end
|
||||
if(&io_din[15:8]) ps2skip <= 1;
|
||||
if(~&io_din[15:8] & ~ps2skip) begin
|
||||
case(byte_cnt)
|
||||
@ -349,6 +364,11 @@ always@(posedge clk_sys) begin
|
||||
2: ps2_mouse[15:8] <= io_din[7:0];
|
||||
3: ps2_mouse[23:16] <= io_din[7:0];
|
||||
endcase
|
||||
case(byte_cnt)
|
||||
1: ps2_mouse_ext[7:0] <= {io_din[14], io_din[14:8]};
|
||||
2: ps2_mouse_ext[11:8] <= io_din[11:8];
|
||||
3: ps2_mouse_ext[15:12]<= io_din[11:8];
|
||||
endcase
|
||||
end
|
||||
end
|
||||
|
||||
@ -356,8 +376,10 @@ always@(posedge clk_sys) begin
|
||||
'h05: begin
|
||||
if(&io_din[15:8]) ps2skip <= 1;
|
||||
if(~&io_din[15:8] & ~ps2skip) ps2_key_raw[31:0] <= {ps2_key_raw[23:0], io_din[7:0]};
|
||||
kbd_data <= io_din[7:0];
|
||||
kbd_we <= 1;
|
||||
if(PS2DIV) begin
|
||||
kbd_data <= io_din[7:0];
|
||||
kbd_we <= 1;
|
||||
end
|
||||
end
|
||||
|
||||
// reading config string, returning a byte from string
|
||||
@ -418,21 +440,24 @@ always@(posedge clk_sys) begin
|
||||
'h1f: io_dout <= {|PS2WE, 2'b01, ps2_kbd_led_status[2], ps2_kbd_led_use[2], ps2_kbd_led_status[1], ps2_kbd_led_use[1], ps2_kbd_led_status[0], ps2_kbd_led_use[0]};
|
||||
|
||||
// reading ps2 keyboard/mouse control
|
||||
'h21: if(byte_cnt == 1) begin
|
||||
io_dout <= kbd_data_host;
|
||||
kbd_rd <= 1;
|
||||
end
|
||||
else
|
||||
if(byte_cnt == 2) begin
|
||||
io_dout <= mouse_data_host;
|
||||
mouse_rd <= 1;
|
||||
'h21: if(PS2DIV) begin
|
||||
if(byte_cnt == 1) begin
|
||||
io_dout <= kbd_data_host;
|
||||
kbd_rd <= 1;
|
||||
end
|
||||
else
|
||||
if(byte_cnt == 2) begin
|
||||
io_dout <= mouse_data_host;
|
||||
mouse_rd <= 1;
|
||||
end
|
||||
end
|
||||
|
||||
//RTC
|
||||
'h22: RTC[(byte_cnt-6'd1)<<4 +:16] <= io_din;
|
||||
|
||||
//Video res.
|
||||
'h23: case(byte_cnt)
|
||||
1: io_dout <= vid_nres;
|
||||
1: io_dout <= {|vid_int, vid_nres};
|
||||
2: io_dout <= vid_hcnt[15:0];
|
||||
3: io_dout <= vid_hcnt[31:16];
|
||||
4: io_dout <= vid_vcnt[15:0];
|
||||
@ -458,6 +483,9 @@ always@(posedge clk_sys) begin
|
||||
1: io_dout <= status_req[15:0];
|
||||
2: io_dout <= status_req[31:16];
|
||||
endcase
|
||||
|
||||
//menu mask
|
||||
'h2E: if(byte_cnt == 1) io_dout <= status_menumask;
|
||||
endcase
|
||||
end
|
||||
end
|
||||
@ -466,62 +494,71 @@ end
|
||||
|
||||
|
||||
/////////////////////////////// PS2 ///////////////////////////////
|
||||
reg clk_ps2;
|
||||
always @(negedge clk_sys) begin
|
||||
integer cnt;
|
||||
cnt <= cnt + 1'd1;
|
||||
if(cnt == PS2DIV) begin
|
||||
clk_ps2 <= ~clk_ps2;
|
||||
cnt <= 0;
|
||||
generate
|
||||
if(PS2DIV) begin
|
||||
reg clk_ps2;
|
||||
always @(negedge clk_sys) begin
|
||||
integer cnt;
|
||||
cnt <= cnt + 1'd1;
|
||||
if(cnt == PS2DIV) begin
|
||||
clk_ps2 <= ~clk_ps2;
|
||||
cnt <= 0;
|
||||
end
|
||||
end
|
||||
|
||||
reg [7:0] kbd_data;
|
||||
reg kbd_we;
|
||||
wire [8:0] kbd_data_host;
|
||||
reg kbd_rd;
|
||||
|
||||
ps2_device keyboard
|
||||
(
|
||||
.clk_sys(clk_sys),
|
||||
|
||||
.wdata(kbd_data),
|
||||
.we(kbd_we),
|
||||
|
||||
.ps2_clk(clk_ps2),
|
||||
.ps2_clk_out(ps2_kbd_clk_out),
|
||||
.ps2_dat_out(ps2_kbd_data_out),
|
||||
|
||||
.ps2_clk_in(ps2_kbd_clk_in || !PS2WE),
|
||||
.ps2_dat_in(ps2_kbd_data_in || !PS2WE),
|
||||
|
||||
.rdata(kbd_data_host),
|
||||
.rd(kbd_rd)
|
||||
);
|
||||
|
||||
reg [7:0] mouse_data;
|
||||
reg mouse_we;
|
||||
wire [8:0] mouse_data_host;
|
||||
reg mouse_rd;
|
||||
|
||||
ps2_device mouse
|
||||
(
|
||||
.clk_sys(clk_sys),
|
||||
|
||||
.wdata(mouse_data),
|
||||
.we(mouse_we),
|
||||
|
||||
.ps2_clk(clk_ps2),
|
||||
.ps2_clk_out(ps2_mouse_clk_out),
|
||||
.ps2_dat_out(ps2_mouse_data_out),
|
||||
|
||||
.ps2_clk_in(ps2_mouse_clk_in || !PS2WE),
|
||||
.ps2_dat_in(ps2_mouse_data_in || !PS2WE),
|
||||
|
||||
.rdata(mouse_data_host),
|
||||
.rd(mouse_rd)
|
||||
);
|
||||
end
|
||||
end
|
||||
|
||||
reg [7:0] kbd_data;
|
||||
reg kbd_we;
|
||||
wire [8:0] kbd_data_host;
|
||||
reg kbd_rd;
|
||||
|
||||
ps2_device keyboard
|
||||
(
|
||||
.clk_sys(clk_sys),
|
||||
|
||||
.wdata(kbd_data),
|
||||
.we(kbd_we),
|
||||
|
||||
.ps2_clk(clk_ps2),
|
||||
.ps2_clk_out(ps2_kbd_clk_out),
|
||||
.ps2_dat_out(ps2_kbd_data_out),
|
||||
|
||||
.ps2_clk_in(ps2_kbd_clk_in || !PS2WE),
|
||||
.ps2_dat_in(ps2_kbd_data_in || !PS2WE),
|
||||
|
||||
.rdata(kbd_data_host),
|
||||
.rd(kbd_rd)
|
||||
);
|
||||
|
||||
reg [7:0] mouse_data;
|
||||
reg mouse_we;
|
||||
wire [8:0] mouse_data_host;
|
||||
reg mouse_rd;
|
||||
|
||||
ps2_device mouse
|
||||
(
|
||||
.clk_sys(clk_sys),
|
||||
|
||||
.wdata(mouse_data),
|
||||
.we(mouse_we),
|
||||
|
||||
.ps2_clk(clk_ps2),
|
||||
.ps2_clk_out(ps2_mouse_clk_out),
|
||||
.ps2_dat_out(ps2_mouse_data_out),
|
||||
|
||||
.ps2_clk_in(ps2_mouse_clk_in || !PS2WE),
|
||||
.ps2_dat_in(ps2_mouse_data_in || !PS2WE),
|
||||
|
||||
.rdata(mouse_data_host),
|
||||
.rd(mouse_rd)
|
||||
);
|
||||
|
||||
else begin
|
||||
assign ps2_kbd_clk_out = 0;
|
||||
assign ps2_kbd_data_out = 0;
|
||||
assign ps2_mouse_clk_out = 0;
|
||||
assign ps2_mouse_data_out = 0;
|
||||
end
|
||||
endgenerate
|
||||
|
||||
/////////////////////////////// DOWNLOADING ///////////////////////////////
|
||||
|
||||
|
22
sys/hq2x.sv
22
sys/hq2x.sv
@ -15,12 +15,15 @@
|
||||
module Hq2x #(parameter LENGTH, parameter HALF_DEPTH)
|
||||
(
|
||||
input clk,
|
||||
input ce_x4,
|
||||
|
||||
input ce_in,
|
||||
input [DWIDTH:0] inputpixel,
|
||||
input mono,
|
||||
input disable_hq2x,
|
||||
input reset_frame,
|
||||
input reset_line,
|
||||
|
||||
input ce_out,
|
||||
input [1:0] read_y,
|
||||
input hblank,
|
||||
output [DWIDTH:0] outpixel
|
||||
@ -129,6 +132,14 @@ hq2x_buf #(.NUMWORDS(LENGTH*2), .AWIDTH(AWIDTH+1), .DWIDTH(DWIDTH1*4-1)) hq2x_ou
|
||||
.wren(wrout_en)
|
||||
);
|
||||
|
||||
always @(posedge clk) begin
|
||||
if(ce_out) begin
|
||||
if(read_x[0]) outpixel_x2 <= read_y[0] ? outpixel_x4[DWIDTH1*4-1:DWIDTH1*2] : outpixel_x4[DWIDTH1*2-1:0];
|
||||
if(~hblank & ~&read_x) read_x <= read_x + 1'd1;
|
||||
if(hblank) read_x <= 0;
|
||||
end
|
||||
end
|
||||
|
||||
wire [DWIDTH:0] blend_result = HALF_DEPTH ? rgb2h(blend_result_pre) : blend_result_pre[DWIDTH:0];
|
||||
|
||||
reg [AWIDTH:0] offs;
|
||||
@ -139,10 +150,7 @@ always @(posedge clk) begin
|
||||
wrout_en <= 0;
|
||||
wrin_en <= 0;
|
||||
|
||||
if(ce_x4) begin
|
||||
|
||||
pattern <= new_pattern;
|
||||
if(read_x[0]) outpixel_x2 <= read_y[0] ? outpixel_x4[DWIDTH1*4-1:DWIDTH1*2] : outpixel_x4[DWIDTH1*2-1:0];
|
||||
if(ce_in) begin
|
||||
|
||||
if(~&offs) begin
|
||||
if (cyc == 1) begin
|
||||
@ -168,6 +176,7 @@ always @(posedge clk) begin
|
||||
end
|
||||
end
|
||||
|
||||
pattern <= new_pattern;
|
||||
if(cyc==3) begin
|
||||
nextpatt <= {new_pattern[7:6], new_pattern[3], new_pattern[5], new_pattern[2], new_pattern[4], new_pattern[1:0]};
|
||||
{A, G} <= {Prev0, Next0};
|
||||