Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e58c44e93c | ||
|
|
e433c8d2c3 |
No files matched your search
@@ -10,4 +10,3 @@ jtag.cdf
|
|||||||
greybox_tmp/cbx_args.txt
|
greybox_tmp/cbx_args.txt
|
||||||
*/greybox_tmp/cbx_args.txt
|
*/greybox_tmp/cbx_args.txt
|
||||||
changes.txt
|
changes.txt
|
||||||
rtl/config_inc.sv
|
|
||||||
Binary file not shown.
@@ -9,9 +9,9 @@
|
|||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
|
|
||||||
set_global_assignment -name TOP_LEVEL_ENTITY sys_top
|
set_global_assignment -name TOP_LEVEL_ENTITY sys_top
|
||||||
#set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
|
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_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top
|
||||||
#set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top
|
set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top
|
||||||
|
|
||||||
set_global_assignment -name LAST_QUARTUS_VERSION "17.0.2 Lite Edition"
|
set_global_assignment -name LAST_QUARTUS_VERSION "17.0.2 Lite Edition"
|
||||||
|
|
||||||
@@ -73,9 +73,9 @@ set_location_assignment PIN_U9 -to ADC_CONVST
|
|||||||
set_location_assignment PIN_V10 -to ADC_SCK
|
set_location_assignment PIN_V10 -to ADC_SCK
|
||||||
set_location_assignment PIN_AC4 -to ADC_SDI
|
set_location_assignment PIN_AC4 -to ADC_SDI
|
||||||
set_location_assignment PIN_AD4 -to ADC_SDO
|
set_location_assignment PIN_AD4 -to ADC_SDO
|
||||||
#set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to ARDUINO_IO[*]
|
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 WEAK_PULL_UP_RESISTOR ON -to ARDUINO_IO[*]
|
||||||
#set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to ARDUINO_IO[*]
|
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to ARDUINO_IO[*]
|
||||||
set_location_assignment PIN_U14 -to IO_SCL
|
set_location_assignment PIN_U14 -to IO_SCL
|
||||||
set_location_assignment PIN_AG9 -to IO_SDA
|
set_location_assignment PIN_AG9 -to IO_SDA
|
||||||
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to IO_S*
|
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to IO_S*
|
||||||
@@ -163,7 +163,7 @@ set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_D[*]
|
|||||||
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_DE
|
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_DE
|
||||||
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_HS
|
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_HS
|
||||||
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_VS
|
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_VS
|
||||||
#set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_CLK
|
set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to HDMI_TX_CLK
|
||||||
set_location_assignment PIN_U10 -to HDMI_I2C_SCL
|
set_location_assignment PIN_U10 -to HDMI_I2C_SCL
|
||||||
set_location_assignment PIN_AA4 -to HDMI_I2C_SDA
|
set_location_assignment PIN_AA4 -to HDMI_I2C_SDA
|
||||||
set_location_assignment PIN_T13 -to HDMI_I2S
|
set_location_assignment PIN_T13 -to HDMI_I2S
|
||||||
@@ -231,6 +231,8 @@ set_hps_location_assignment HPSINTERFACEPERIPHERALSPIMASTER_X52_Y72_N111 -to spi
|
|||||||
set_hps_location_assignment HPSINTERFACEPERIPHERALUART_X52_Y67_N111 -to uart
|
set_hps_location_assignment HPSINTERFACEPERIPHERALUART_X52_Y67_N111 -to uart
|
||||||
set_hps_location_assignment HPSINTERFACEPERIPHERALI2C_X52_Y60_N111 -to hdmi_i2c
|
set_hps_location_assignment HPSINTERFACEPERIPHERALI2C_X52_Y60_N111 -to hdmi_i2c
|
||||||
set_global_assignment -name PRE_FLOW_SCRIPT_FILE "quartus_sh:sys/build_id.tcl"
|
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
|
||||||
source sys/sys_analog.tcl
|
source sys/sys_analog.tcl
|
||||||
set_location_assignment PIN_AF25 -to SDIO_DAT[0]
|
set_location_assignment PIN_AF25 -to SDIO_DAT[0]
|
||||||
set_location_assignment PIN_AF23 -to SDIO_DAT[1]
|
set_location_assignment PIN_AF23 -to SDIO_DAT[1]
|
||||||
@@ -281,22 +283,6 @@ 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 IO_STANDARD "3.3-V LVTTL" -to BTN_*
|
||||||
set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to BTN_*
|
set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to BTN_*
|
||||||
source files.qip
|
source files.qip
|
||||||
|
|
||||||
set_global_assignment -name ENABLE_SIGNALTAP OFF
|
|
||||||
set_global_assignment -name OPTIMIZATION_MODE "AGGRESSIVE PERFORMANCE"
|
|
||||||
set_global_assignment -name USE_SIGNALTAP_FILE Video_Explorer2.stp
|
|
||||||
set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to USER_IO[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 CDF_FILE jtag.cdf
|
|
||||||
set_global_assignment -name QIP_FILE sys/sys.qip
|
|
||||||
set_global_assignment -name VERILOG_FILE rtl/Mister_Video_GIMEX.v
|
|
||||||
set_global_assignment -name VERILOG_FILE rtl/pll.v -library pll
|
|
||||||
set_global_assignment -name VERILOG_FILE rtl/pll/pll_0002.v -library pll
|
|
||||||
set_global_assignment -name SYSTEMVERILOG_FILE rtl/Cassette_Write.sv
|
|
||||||
set_global_assignment -name SYSTEMVERILOG_FILE rtl/config.sv
|
|
||||||
set_global_assignment -name SYSTEMVERILOG_FILE rtl/Auto_Run.sv
|
|
||||||
set_global_assignment -name VHDL_FILE rtl/sram/coco_ram.vhd
|
set_global_assignment -name VHDL_FILE rtl/sram/coco_ram.vhd
|
||||||
set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_cart.vhd
|
set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_cart.vhd
|
||||||
set_global_assignment -name VHDL_FILE rtl/rom/coco3_char_rom.vhd
|
set_global_assignment -name VHDL_FILE rtl/rom/coco3_char_rom.vhd
|
||||||
@@ -314,6 +300,7 @@ set_global_assignment -name VERILOG_FILE rtl/cassette.v
|
|||||||
set_global_assignment -name VERILOG_FILE rtl/rtc.sv
|
set_global_assignment -name VERILOG_FILE rtl/rtc.sv
|
||||||
set_global_assignment -name VERILOG_FILE rtl/AMW.v
|
set_global_assignment -name VERILOG_FILE rtl/AMW.v
|
||||||
set_global_assignment -name VERILOG_FILE rtl/square_gen.v
|
set_global_assignment -name VERILOG_FILE rtl/square_gen.v
|
||||||
|
set_global_assignment -name VERILOG_FILE rtl/config.v
|
||||||
set_global_assignment -name SYSTEMVERILOG_FILE rtl/fdc.sv
|
set_global_assignment -name SYSTEMVERILOG_FILE rtl/fdc.sv
|
||||||
set_global_assignment -name SYSTEMVERILOG_FILE rtl/sdc.sv
|
set_global_assignment -name SYSTEMVERILOG_FILE rtl/sdc.sv
|
||||||
set_global_assignment -name SYSTEMVERILOG_FILE rtl/sdc_top.sv
|
set_global_assignment -name SYSTEMVERILOG_FILE rtl/sdc_top.sv
|
||||||
@@ -328,5 +315,135 @@ set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_32K.vhd
|
|||||||
set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_8K.vhd
|
set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_8K.vhd
|
||||||
set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_16.vhd
|
set_global_assignment -name VHDL_FILE rtl/rom/coco_rom_16.vhd
|
||||||
set_global_assignment -name SDC_FILE rtl/CoCo3FPGA.sdc
|
set_global_assignment -name SDC_FILE rtl/CoCo3FPGA.sdc
|
||||||
|
|
||||||
|
set_global_assignment -name SIGNALTAP_FILE Video_Explorer.stp
|
||||||
|
set_global_assignment -name SIGNALTAP_FILE rom_Exploror.stp1
|
||||||
|
set_global_assignment -name SOURCE_FILE rom_Exploror.stp1
|
||||||
|
set_global_assignment -name SIGNALTAP_FILE Serial.stp
|
||||||
|
set_global_assignment -name SIGNALTAP_FILE AMW.stp
|
||||||
|
set_global_assignment -name SIGNALTAP_FILE HD.stp
|
||||||
|
set_global_assignment -name SIGNALTAP_FILE reset.stp
|
||||||
|
set_global_assignment -name SIGNALTAP_FILE Vsync.stp
|
||||||
|
set_global_assignment -name ENABLE_SIGNALTAP ON
|
||||||
|
set_global_assignment -name OPTIMIZATION_MODE "HIGH PERFORMANCE EFFORT"
|
||||||
|
set_global_assignment -name USE_SIGNALTAP_FILE Video_Explorer2.stp
|
||||||
set_global_assignment -name VERILOG_FILE rtl/mc6809glb/mc6809glb.v
|
set_global_assignment -name VERILOG_FILE rtl/mc6809glb/mc6809glb.v
|
||||||
|
set_global_assignment -name SIGNALTAP_FILE Video_Explorer2.stp
|
||||||
|
set_global_assignment -name SLD_NODE_CREATOR_ID 110 -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_ENTITY_NAME sld_signaltap -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_RAM_BLOCK_TYPE=AUTO" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_NODE_INFO=805334528" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_POWER_UP_TRIGGER=0" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_INVERSION_MASK_LENGTH=0" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ATTRIBUTE_MEM_MODE=OFF" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STATE_FLOW_USE_GENERATED=0" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STATE_BITS=11" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_BUFFER_FULL_STOP=1" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_CURRENT_RESOURCE_WIDTH=1" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_INCREMENTAL_ROUTING=1" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[0] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[3] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[5] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[16] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[28] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[31] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_LEVEL=3" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_IN_ENABLED=0" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_PIPELINE=0" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_COUNTER_PIPELINE=0" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ADVANCED_TRIGGER_ENTITY=basic,1,basic,1,basic,1," -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_LEVEL_PIPELINE=1" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ENABLE_ADVANCED_TRIGGER=0" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[2] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[21] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[22] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[30] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_clk -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|clk_sample" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[0] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|CASS_REWIND_RECORD" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[0] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|CASS_REWIND_RECORD" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[6] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[12] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[17] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[18] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_RAM_PIPELINE=1" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_SEGMENT_SIZE=2048" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[13] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[19] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_SAMPLE_DEPTH=2048" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[8] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[25] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[1] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|MOTOR_ON" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[2] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[0]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[3] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[1]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[4] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[2]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[5] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[3]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[6] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[4]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[7] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[5]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[8] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[6]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[9] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[7]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[10] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[0]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[11] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[1]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[12] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[2]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[13] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[3]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[14] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[4]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[15] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[5]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[16] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[6]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[17] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[7]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[18] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[8]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[19] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[0]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[20] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[1]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[21] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[2]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[22] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[3]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[23] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[4]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[24] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[5]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[25] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[6]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[26] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[7]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[27] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|look_for_sync" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[1] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|MOTOR_ON" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[2] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[0]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[3] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[1]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[4] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[2]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[5] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[3]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[6] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[4]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[7] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[5]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[8] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[6]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[9] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|blk_type[7]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[10] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[0]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[11] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[1]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[12] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[2]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[13] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[3]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[14] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[4]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[15] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[5]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[16] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[6]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[17] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[7]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[18] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_address[8]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[19] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[0]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[20] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[1]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[21] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[2]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[22] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[3]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[23] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[4]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[24] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[5]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[25] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[6]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[26] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|buf_data_in[7]" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[27] -to "emu:emu|coco3fpga:coco3|Cassette_Write:CoCo3_Cassette_Write|look_for_sync" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_DATA_BITS=28" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_BITS=28" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_BITS=28" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_INVERSION_MASK=0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_INVERSION_MASK_LENGTH=277" -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[1] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[4] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[7] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[9] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[10] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[11] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[14] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[15] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[20] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[23] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[24] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[26] -to auto_signaltap_0|gnd -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[27] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_instance_assignment -name POST_FIT_CONNECT_TO_SLD_NODE_ENTITY_PORT crc[29] -to auto_signaltap_0|vcc -section_id auto_signaltap_0
|
||||||
|
set_global_assignment -name SLD_FILE db/Video_Explorer2_auto_stripped.stp
|
||||||
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
|
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
//============================================================================
|
//============================================================================
|
||||||
// CoCo3 port to MiSTer
|
// CoCo3 port to MiSTer
|
||||||
// Copyright (c) 2019 Alan Steremberg - alanswx, Stan Hodge - MasterS3263827
|
// Copyright (c) 2019 Alan Steremberg - alanswx
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//============================================================================
|
//============================================================================
|
||||||
@@ -43,8 +43,6 @@ module emu
|
|||||||
input [11:0] HDMI_WIDTH,
|
input [11:0] HDMI_WIDTH,
|
||||||
input [11:0] HDMI_HEIGHT,
|
input [11:0] HDMI_HEIGHT,
|
||||||
output HDMI_FREEZE,
|
output HDMI_FREEZE,
|
||||||
output HDMI_BLACKOUT,
|
|
||||||
output HDMI_BOB_DEINT,
|
|
||||||
|
|
||||||
`ifdef MISTER_FB
|
`ifdef MISTER_FB
|
||||||
// Use framebuffer in DDRAM
|
// Use framebuffer in DDRAM
|
||||||
@@ -182,8 +180,6 @@ assign LED_POWER = 0;
|
|||||||
|
|
||||||
assign VGA_SCALER = 0;
|
assign VGA_SCALER = 0;
|
||||||
assign HDMI_FREEZE = 0;
|
assign HDMI_FREEZE = 0;
|
||||||
assign HDMI_BLACKOUT = 0;
|
|
||||||
assign HDMI_BOB_DEINT = 0;
|
|
||||||
|
|
||||||
wire [1:0] ar = status[9:8];
|
wire [1:0] ar = status[9:8];
|
||||||
|
|
||||||
@@ -193,8 +189,6 @@ assign VIDEO_ARY = (!ar) ? 12'd3 : 12'd0;
|
|||||||
|
|
||||||
|
|
||||||
`include "build_id.v"
|
`include "build_id.v"
|
||||||
`include "build_id_num.v"
|
|
||||||
|
|
||||||
localparam CONF_STR = {
|
localparam CONF_STR = {
|
||||||
"COCO3;UART19200:9600:4800:2400:1200:300;",
|
"COCO3;UART19200:9600:4800:2400:1200:300;",
|
||||||
"-;",
|
"-;",
|
||||||
@@ -258,7 +252,7 @@ localparam CONF_STR = {
|
|||||||
"J,Button1,Button2;",
|
"J,Button1,Button2;",
|
||||||
"jn,A,B;",
|
"jn,A,B;",
|
||||||
"v,51;",
|
"v,51;",
|
||||||
"V,v",{`BUILD_DATE,"-",`BUILD_NUMBER}
|
"V,v",`BUILD_DATE
|
||||||
};
|
};
|
||||||
|
|
||||||
// Status bits Directory
|
// Status bits Directory
|
||||||
@@ -283,7 +277,7 @@ assign clk_sys=CLK_57;
|
|||||||
wire pll_locked, pll2_locked;
|
wire pll_locked, pll2_locked;
|
||||||
wire CLK_114, CLK_57, CLK_28, CLK_14;
|
wire CLK_114, CLK_57, CLK_28, CLK_14;
|
||||||
|
|
||||||
assign VGA_DISABLE = 1'b0;
|
|
||||||
|
|
||||||
pll pll
|
pll pll
|
||||||
(
|
(
|
||||||
@@ -323,7 +317,6 @@ wire [21:0] gamma_bus;
|
|||||||
assign CLK_VIDEO = clk_sys;
|
assign CLK_VIDEO = clk_sys;
|
||||||
|
|
||||||
wire [64:0] RTC;
|
wire [64:0] RTC;
|
||||||
wire [15:0] sdram_sz;
|
|
||||||
|
|
||||||
// SD - 7 drives [4 fdc, 2 sdc and 1 cass_wr] 512 size blocks [the wd1793 translates to a 256 byte sector size]
|
// SD - 7 drives [4 fdc, 2 sdc and 1 cass_wr] 512 size blocks [the wd1793 translates to a 256 byte sector size]
|
||||||
hps_io #(.CONF_STR(CONF_STR),.PS2DIV(2400), .VDNUM(7), .BLKSZ(2)) hps_io
|
hps_io #(.CONF_STR(CONF_STR),.PS2DIV(2400), .VDNUM(7), .BLKSZ(2)) hps_io
|
||||||
@@ -349,8 +342,6 @@ hps_io #(.CONF_STR(CONF_STR),.PS2DIV(2400), .VDNUM(7), .BLKSZ(2)) hps_io
|
|||||||
.ioctl_dout(ioctl_data),
|
.ioctl_dout(ioctl_data),
|
||||||
.ioctl_index(ioctl_index),
|
.ioctl_index(ioctl_index),
|
||||||
|
|
||||||
.sdram_sz(sdram_sz),
|
|
||||||
|
|
||||||
// SD block level interface
|
// SD block level interface
|
||||||
|
|
||||||
.img_mounted(img_mounted), // signaling that new image has been mounted
|
.img_mounted(img_mounted), // signaling that new image has been mounted
|
||||||
@@ -464,9 +455,7 @@ wire Programmed_EE;
|
|||||||
|
|
||||||
EE_Cold_Bt COCO3_EE_Cold_Bt (
|
EE_Cold_Bt COCO3_EE_Cold_Bt (
|
||||||
.CLK(CLK_14),
|
.CLK(CLK_14),
|
||||||
.RESET(1'b0),
|
|
||||||
|
|
||||||
// .Display_EE(1'b0), // from MISTer subsystem
|
|
||||||
.Display_EE(easter_egg), // from MISTer subsystem
|
.Display_EE(easter_egg), // from MISTer subsystem
|
||||||
.Cold_Boot(AMW_ACK), // from AMW system
|
.Cold_Boot(AMW_ACK), // from AMW system
|
||||||
|
|
||||||
@@ -485,15 +474,11 @@ wire [7:0] r;
|
|||||||
wire [7:0] g;
|
wire [7:0] g;
|
||||||
wire [7:0] b;
|
wire [7:0] b;
|
||||||
|
|
||||||
wire easter_egg = status[10];
|
wire easter_egg = ~status[10];
|
||||||
wire [31:0] probe;
|
wire [31:0] probe;
|
||||||
|
|
||||||
assign USER_OUT[6:0] = probe[6:0];
|
assign USER_OUT[6:0] = probe[6:0];
|
||||||
|
|
||||||
wire [71:0] Config_Data;
|
|
||||||
|
|
||||||
assign Config_Data = {`BUILD_DATE, `BUILD_NUMBER};
|
|
||||||
|
|
||||||
coco3fpga coco3 (
|
coco3fpga coco3 (
|
||||||
// CLOCKS
|
// CLOCKS
|
||||||
|
|
||||||
@@ -537,7 +522,7 @@ coco3fpga coco3 (
|
|||||||
// R1, L2, R2, L1
|
// R1, L2, R2, L1
|
||||||
.P_SWITCH(~{coco_joy2[4],coco_joy1[5],coco_joy2[5],coco_joy1[4]}),
|
.P_SWITCH(~{coco_joy2[4],coco_joy1[5],coco_joy2[5],coco_joy1[4]}),
|
||||||
.SWITCH(switch),
|
.SWITCH(switch),
|
||||||
// .SOUND_OUT(cocosound),
|
.SOUND_OUT(cocosound),
|
||||||
.SOUND_LEFT(audio_left),
|
.SOUND_LEFT(audio_left),
|
||||||
.SOUND_RIGHT(AUDIO_R),
|
.SOUND_RIGHT(AUDIO_R),
|
||||||
|
|
||||||
@@ -548,9 +533,6 @@ coco3fpga coco3 (
|
|||||||
.ioctl_index(ioctl_index),
|
.ioctl_index(ioctl_index),
|
||||||
.ioctl_wr(ioctl_wr),
|
.ioctl_wr(ioctl_wr),
|
||||||
|
|
||||||
// SDRAM Info
|
|
||||||
.sdram_sz(sdram_sz),
|
|
||||||
|
|
||||||
// SD block level interface
|
// SD block level interface
|
||||||
|
|
||||||
.img_mounted(img_mounted), // signaling that new image has been mounted
|
.img_mounted(img_mounted), // signaling that new image has been mounted
|
||||||
@@ -598,7 +580,6 @@ coco3fpga coco3 (
|
|||||||
.RTC(RTC),
|
.RTC(RTC),
|
||||||
|
|
||||||
.AMW_Trigger(coldboot | mpi_reset | mem_reset),
|
.AMW_Trigger(coldboot | mpi_reset | mem_reset),
|
||||||
// .AMW_Trigger(coldboot),
|
|
||||||
.AMW_ACK(AMW_ACK),
|
.AMW_ACK(AMW_ACK),
|
||||||
|
|
||||||
.F_Turbo(F_Turbo),
|
.F_Turbo(F_Turbo),
|
||||||
@@ -607,8 +588,6 @@ coco3fpga coco3 (
|
|||||||
|
|
||||||
.AUTO_MODE(Auto_Mode),
|
.AUTO_MODE(Auto_Mode),
|
||||||
|
|
||||||
.Config_Data(Config_Data),
|
|
||||||
|
|
||||||
.UART_TXD(UART_TXD),
|
.UART_TXD(UART_TXD),
|
||||||
.UART_RXD(UART_RXD),
|
.UART_RXD(UART_RXD),
|
||||||
.UART_RTS(UART_RTS),
|
.UART_RTS(UART_RTS),
|
||||||
@@ -619,7 +598,7 @@ coco3fpga coco3 (
|
|||||||
|
|
||||||
assign status_set = 1'b0;
|
assign status_set = 1'b0;
|
||||||
|
|
||||||
//wire [5:0] cocosound;
|
wire [5:0] cocosound;
|
||||||
|
|
||||||
wire [2:0] turbo_speed = status[34:32];
|
wire [2:0] turbo_speed = status[34:32];
|
||||||
wire [2:0] assigned_turbo_speed;
|
wire [2:0] assigned_turbo_speed;
|
||||||
@@ -762,7 +741,7 @@ cassette cassette(
|
|||||||
|
|
||||||
.sdram_addr(ram_addr),
|
.sdram_addr(ram_addr),
|
||||||
.sdram_data(ram_data_o),
|
.sdram_data(ram_data_o),
|
||||||
// .sdram_rd(ram_rd), // Not connected for sram
|
.sdram_rd(ram_rd), // Not connected for sram
|
||||||
|
|
||||||
.data(casdout)
|
.data(casdout)
|
||||||
);
|
);
|
||||||
|
|||||||
+1
-1
@@ -277,7 +277,7 @@ trigger;]]>
|
|||||||
</storage_qualifier_level>
|
</storage_qualifier_level>
|
||||||
</storage_qualifier_events>
|
</storage_qualifier_events>
|
||||||
<log>
|
<log>
|
||||||
<data global_temp="1" name="log: Trig @ 2024/03/24 16:48:19 (0:0:12.7 elapsed)" power_up_mode="false" sample_depth="2048" trigger_position="256">11100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000101101001101010101111000000010110100110101010111100000001011010011010101011110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000111000000001110100100111100011100000000111010010011110001110000000011101001001111000Line truncated
|
<data global_temp="1" name="log: Trig @ 2024/03/24 15:50:41 (0:0:14.0 elapsed)" power_up_mode="false" sample_depth="2048" trigger_position="256">11100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000011100101010101010111100000001110010101010101011110000000111001010101010101111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000111000000000010101000111100011100000000001010100011110001110000000000101010001111000Line truncated
|
||||||
<extradata>1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111T111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111</extradata>
|
<extradata>1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111T111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111</extradata>
|
||||||
</log>
|
</log>
|
||||||
</trigger>
|
</trigger>
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
`define BUILD_NUMBER "004"
|
|
||||||
-36
@@ -1,39 +1,3 @@
|
|||||||
1. Added support for cassette save. To use: A) You have to have a file [anyname.cas]
|
|
||||||
which is larger than needed. B) Select the file through the UI Menu 'Save
|
|
||||||
Cassette'. C)Set 'Cass Rwd=0 / Rec=1' to 1. D) Issue your 'CSAVE "NAME"'
|
|
||||||
E) When done, set 'Cass Rwd=0 / Rec=1' to 0 to complete the write. The file can
|
|
||||||
now be loaded or copied. Note a dummy file of a specific size can be created in
|
|
||||||
the MiSTer SSH shell in the /media/fat/games/coco3 with the command:
|
|
||||||
'truncate -s 65536 tapefileame.cas'. [Note do NOT use over 65536 file length]
|
|
||||||
2. Fixed serial interrupt [6551] to not be functional on slot 3 [carts].
|
|
||||||
3. Modification of sys_top.v to override use of USER_IO for HDMI - so it can be used
|
|
||||||
for logic analyzer debug. This will only occur when `define Config_Debug is
|
|
||||||
enabled in config.v.
|
|
||||||
4. Fixed MUGS of powerup issue occurring on some MiSTer units.
|
|
||||||
5. Fixed incorrect application of GIME_IRQ on legacy interrupts. Fixed race condition
|
|
||||||
on reading IRQ status vs clearing the interrupt.
|
|
||||||
6. Improved Castle of Tharoggad. App now loads but locks as the graphics animate. This
|
|
||||||
change improved mmu usage through to CARTS.
|
|
||||||
7. Builds now keep track of multiple builds in the same date. It shows as V240512-001 in
|
|
||||||
the menus. Its also exposed to BASIC and a boot.vhd which can be enabled to autorun is
|
|
||||||
supplied in the archive to show how it works.
|
|
||||||
8. Additionally, on the boot.vhd disk, is a program which demonstrated how to load a font -
|
|
||||||
IBMFONT.BAS. Run it and it maps a font much like the IBM font to the 80 column format.
|
|
||||||
Also, a file called TESTRTC.BAS pulls the MiSTer RTC values exposed in BASIC to display
|
|
||||||
a clock.
|
|
||||||
9. Large improvement in the Timer function. Code closer emulates COCO3 Timer. Fixes
|
|
||||||
Sliphead cart.
|
|
||||||
10. In the 20231023 release the wd1773 instances were reduced to 1 for the FDC and one for
|
|
||||||
the FDC. This saved space but introduced a bug when using multiple drives at the same
|
|
||||||
time - like a copy command. This change was removed and the copy command works again.
|
|
||||||
|
|
||||||
To Do...
|
|
||||||
1. Add Speech / Music cart
|
|
||||||
2. Fix Castle of Tharoggad
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
1. Changed PIA 2 addressing to align with real CoCo3 hardware and end at FF2F.
|
1. Changed PIA 2 addressing to align with real CoCo3 hardware and end at FF2F.
|
||||||
2. Re-arranged MiSTer drive LUNs to support future auto-boot from SDC drive 0.
|
2. Re-arranged MiSTer drive LUNs to support future auto-boot from SDC drive 0.
|
||||||
3. Added 'Auto Run' feature. You must use slot 2 [SDC]. Take your floppy or HD
|
3. Added 'Auto Run' feature. You must use slot 2 [SDC]. Take your floppy or HD
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -21,7 +21,7 @@ set_global_assignment -name SYSTEMVERILOG_FILE rtl/Cassette_Write.sv
|
|||||||
set_global_assignment -name VERILOG_FILE rtl/rtc.sv
|
set_global_assignment -name VERILOG_FILE rtl/rtc.sv
|
||||||
set_global_assignment -name VERILOG_FILE rtl/AMW.v
|
set_global_assignment -name VERILOG_FILE rtl/AMW.v
|
||||||
set_global_assignment -name VERILOG_FILE rtl/square_gen.v
|
set_global_assignment -name VERILOG_FILE rtl/square_gen.v
|
||||||
set_global_assignment -name SYSTEMVERILOG_FILE rtl/config.sv
|
set_global_assignment -name VERILOG_FILE rtl/config.v
|
||||||
set_global_assignment -name SYSTEMVERILOG_FILE rtl/fdc.sv
|
set_global_assignment -name SYSTEMVERILOG_FILE rtl/fdc.sv
|
||||||
set_global_assignment -name SYSTEMVERILOG_FILE rtl/sdc.sv
|
set_global_assignment -name SYSTEMVERILOG_FILE rtl/sdc.sv
|
||||||
set_global_assignment -name SYSTEMVERILOG_FILE rtl/sdc_top.sv
|
set_global_assignment -name SYSTEMVERILOG_FILE rtl/sdc_top.sv
|
||||||
|
|||||||
Binary file not shown.
+31
-26
@@ -82,6 +82,8 @@ module Cassette_Write(
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
assign sd_blk_cnt = 6'd0;
|
||||||
|
|
||||||
|
|
||||||
// Create 16x sample clock for the 2400 Baud rate...
|
// Create 16x sample clock for the 2400 Baud rate...
|
||||||
// ~26us based on 1.78Mhz [562 ns]- divide by 46....
|
// ~26us based on 1.78Mhz [562 ns]- divide by 46....
|
||||||
@@ -114,19 +116,15 @@ begin
|
|||||||
end
|
end
|
||||||
|
|
||||||
// Mounted SD Image [for the cass]
|
// Mounted SD Image [for the cass]
|
||||||
// This is not used and only here for completeness
|
|
||||||
|
|
||||||
//reg drive_wp;
|
reg drive_wp;
|
||||||
//reg [31:0] drive_size;
|
reg [31:0] drive_size;
|
||||||
|
|
||||||
//always @(negedge img_mounted)
|
always @(negedge img_mounted)
|
||||||
//begin
|
begin
|
||||||
// drive_wp <= img_readonly;
|
drive_wp <= img_readonly;
|
||||||
// drive_size <= img_size[31:0]; //Size / 256 on [31:8]
|
drive_size <= img_size[31:0]; //Size / 256 on [31:8]
|
||||||
//end
|
end
|
||||||
|
|
||||||
// Set to 1 512 byte block per r/w
|
|
||||||
assign sd_blk_cnt = 6'd0;
|
|
||||||
|
|
||||||
|
|
||||||
// Byte Receiver
|
// Byte Receiver
|
||||||
@@ -140,6 +138,7 @@ reg wave_negative;
|
|||||||
localparam time_out = 6'h3f;
|
localparam time_out = 6'h3f;
|
||||||
localparam wave_zero_level = 6'd32;
|
localparam wave_zero_level = 6'd32;
|
||||||
localparam bit_time_1 = 6'd22;
|
localparam bit_time_1 = 6'd22;
|
||||||
|
//localparam sync = 15'b010_1010_1001_1110; // Pre shift $553C
|
||||||
localparam sync = 15'b0111_1000_1010_101; // Pre shift $553C [L -> R]
|
localparam sync = 15'b0111_1000_1010_101; // Pre shift $553C [L -> R]
|
||||||
localparam sync_proper = 8'h3C;
|
localparam sync_proper = 8'h3C;
|
||||||
localparam leader = 8'h55;
|
localparam leader = 8'h55;
|
||||||
@@ -152,22 +151,21 @@ reg flush_end, flush_end_que;
|
|||||||
reg sd_hold;
|
reg sd_hold;
|
||||||
reg pre_roll;
|
reg pre_roll;
|
||||||
reg [7:0] blk_type;
|
reg [7:0] blk_type;
|
||||||
reg [7:0] protocol_data_count;
|
|
||||||
reg gap;
|
|
||||||
|
|
||||||
// Buffer interface
|
|
||||||
wire [8:0] buf_address;
|
wire [8:0] buf_address;
|
||||||
wire [7:0] buf_data_in;
|
wire [7:0] buf_data_in;
|
||||||
wire [7:0] buf_data_out;
|
wire [7:0] buf_data_out;
|
||||||
wire buf_write;
|
wire buf_write;
|
||||||
|
|
||||||
// State Mach states
|
reg [7:0] protocol_data_count;
|
||||||
|
|
||||||
localparam st_beg0 = 4'd0;
|
localparam st_beg0 = 4'd0;
|
||||||
localparam st_start = 4'd1;
|
localparam st_start = 4'd1;
|
||||||
localparam st_st1 = 4'd2;
|
localparam st_st1 = 4'd2;
|
||||||
localparam st_st2 = 4'd3;
|
localparam st_st2 = 4'd3;
|
||||||
localparam st_wr = 4'd4;
|
localparam st_st3 = 4'd4;
|
||||||
localparam st_wr1 = 4'd5;
|
localparam st_wr = 4'd5;
|
||||||
|
localparam st_wr1 = 4'd6;
|
||||||
|
|
||||||
reg [3:0] st_state;
|
reg [3:0] st_state;
|
||||||
reg [3:0] state_stack;
|
reg [3:0] state_stack;
|
||||||
@@ -212,7 +210,6 @@ begin
|
|||||||
sd_wr_state <= sd_wr_st;
|
sd_wr_state <= sd_wr_st;
|
||||||
sd_hold <= 1'b0;
|
sd_hold <= 1'b0;
|
||||||
pre_roll <= 1'b0;
|
pre_roll <= 1'b0;
|
||||||
gap <= 1'b0;
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@@ -251,7 +248,6 @@ begin
|
|||||||
sd_wr_state <= sd_wr_st;
|
sd_wr_state <= sd_wr_st;
|
||||||
sd_hold <= 1'b0;
|
sd_hold <= 1'b0;
|
||||||
pre_roll <= 1'b0;
|
pre_roll <= 1'b0;
|
||||||
gap <= 1'b0;
|
|
||||||
end
|
end
|
||||||
|
|
||||||
byte_clk <= 1'b0;
|
byte_clk <= 1'b0;
|
||||||
@@ -269,7 +265,7 @@ begin
|
|||||||
if ((DTOA_CODE >= wave_zero_level) && wave_negative)
|
if ((DTOA_CODE >= wave_zero_level) && wave_negative)
|
||||||
begin
|
begin
|
||||||
// Initially we are not collecting the leader bytes just collecting them and
|
// Initially we are not collecting the leader bytes just collecting them and
|
||||||
// waiting for the sync $3C55. The write to file stage will automatically
|
// waiting for the sync $$553C. The write to file stage will automatically
|
||||||
// write the 128 leader bytes befor we start transfering data.
|
// write the 128 leader bytes befor we start transfering data.
|
||||||
if (!look_for_sync)
|
if (!look_for_sync)
|
||||||
begin
|
begin
|
||||||
@@ -305,7 +301,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
buf_address <= 9'b000000000;
|
buf_address <= 9'b000000000;
|
||||||
buf_data_in <= leader;
|
buf_data_in <= leader;
|
||||||
protocol_data_count <= 8'h80; // We will use this to count the 128 bytes
|
protocol_data_count <= 8'h7f; // We will use this to count the 128 bytes
|
||||||
|
|
||||||
st_state <= st_start;
|
st_state <= st_start;
|
||||||
end
|
end
|
||||||
@@ -367,8 +363,6 @@ begin
|
|||||||
state_stack <= st_st1; // We come back here
|
state_stack <= st_st1; // We come back here
|
||||||
st_state <= st_wr; // Write a byte
|
st_state <= st_wr; // Write a byte
|
||||||
p_state <= p_dta;
|
p_state <= p_dta;
|
||||||
if ((blk_type == 8'h00) & (protocol_data_count == 8'h05) & (incomming_reg[15:8] == 8'hff))
|
|
||||||
gap <= 1'b1;
|
|
||||||
if (protocol_data_count == 8'h01)
|
if (protocol_data_count == 8'h01)
|
||||||
p_state <= p_cksum;
|
p_state <= p_cksum;
|
||||||
end
|
end
|
||||||
@@ -396,13 +390,24 @@ begin
|
|||||||
st_st2:
|
st_st2:
|
||||||
begin
|
begin
|
||||||
buf_data_in <= leader;
|
buf_data_in <= leader;
|
||||||
if ((blk_type == 8'h00) || gap)
|
if (blk_type == 8'h00)
|
||||||
protocol_data_count <= 8'h80; // We will use this to count the 128 bytes
|
protocol_data_count <= 8'h7f; // We will use this to count the 128 bytes
|
||||||
else
|
else
|
||||||
protocol_data_count <= 8'h02; // We will use this to count the 2 bytes
|
protocol_data_count <= 8'h01; // We will use this to count the 128 bytes
|
||||||
st_state <= st_start; // No, don't write any more - were done
|
st_state <= st_start; // No, don't write any more - were done
|
||||||
end
|
end
|
||||||
|
|
||||||
|
st_st3:
|
||||||
|
begin
|
||||||
|
state_stack <= st_st3; // We come back here
|
||||||
|
st_state <= st_wr; // Write a byte
|
||||||
|
protocol_data_count <= protocol_data_count - 1'b1;
|
||||||
|
if (protocol_data_count == 8'h00) // 128 bytes
|
||||||
|
begin
|
||||||
|
st_state <= st_st1; // No, don't write any more - were done
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
// Perform the byte writes to the buffer
|
// Perform the byte writes to the buffer
|
||||||
// This acts like a sub routine....
|
// This acts like a sub routine....
|
||||||
st_wr:
|
st_wr:
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ create_clock -period 1000.000 -name img_mounted[2] [get_nodes emu:emu|hps_io:hps
|
|||||||
create_clock -period 1000.000 -name img_mounted[1] [get_nodes emu:emu|hps_io:hps_io|img_mounted[1]]
|
create_clock -period 1000.000 -name img_mounted[1] [get_nodes emu:emu|hps_io:hps_io|img_mounted[1]]
|
||||||
create_clock -period 1000.000 -name img_mounted[0] [get_nodes emu:emu|hps_io:hps_io|img_mounted[0]]
|
create_clock -period 1000.000 -name img_mounted[0] [get_nodes emu:emu|hps_io:hps_io|img_mounted[0]]
|
||||||
create_clock -period 1000.000 -name RESET_N [get_nodes emu:emu|coco3fpga:coco3|RESET_N]
|
create_clock -period 1000.000 -name RESET_N [get_nodes emu:emu|coco3fpga:coco3|RESET_N]
|
||||||
create_clock -period 1000.000 -name NMISample2 [get_nodes emu:emu|coco3fpga:coco3|mc6809x:GLBCPU09|NMISample2]
|
|
||||||
#set_false_path -from [get_nodes sysmem_lite:sysmem|sysmem_HPS_fpga_interfaces:fpga_interfaces|clocks_resets~FF_4365]
|
#set_false_path -from [get_nodes sysmem_lite:sysmem|sysmem_HPS_fpga_interfaces:fpga_interfaces|clocks_resets~FF_4365]
|
||||||
#create_clock -period 17.46 -name PH_2 [get_nodes emu:emu|coco3fpga:coco3|PH_2_RAW]
|
#create_clock -period 17.46 -name PH_2 [get_nodes emu:emu|coco3fpga:coco3|PH_2_RAW]
|
||||||
#create_clock -period 1000.000 -name CLK_6551[4] [get_nodes emu:emu|coco3fpga:coco3|CLK_6551[4]]
|
#create_clock -period 1000.000 -name CLK_6551[4] [get_nodes emu:emu|coco3fpga:coco3|CLK_6551[4]]
|
||||||
|
|||||||
+2
-15
@@ -55,7 +55,6 @@
|
|||||||
|
|
||||||
module EE_Cold_Bt(
|
module EE_Cold_Bt(
|
||||||
input CLK,
|
input CLK,
|
||||||
input RESET,
|
|
||||||
|
|
||||||
input Display_EE, // from MISTer subsystem
|
input Display_EE, // from MISTer subsystem
|
||||||
input Cold_Boot, // from MISTer subsystem
|
input Cold_Boot, // from MISTer subsystem
|
||||||
@@ -107,20 +106,9 @@ assign Start_Display_EE = ((Display_EE == 1'b1) & (Display_EE_D == 1'b0));
|
|||||||
assign Start_Cold_Boot = ((Cold_Boot == 1'b1) & (Cold_Boot_D == 1'b0));
|
assign Start_Cold_Boot = ((Cold_Boot == 1'b1) & (Cold_Boot_D == 1'b0));
|
||||||
|
|
||||||
|
|
||||||
always @ (posedge CLK or posedge RESET)
|
always @(posedge CLK)
|
||||||
begin
|
begin
|
||||||
if(RESET)
|
|
||||||
begin
|
|
||||||
Display_EE_D <= 1'b0;
|
|
||||||
Cold_Boot_D <= 1'b0;
|
|
||||||
EE <= 1'b1;
|
|
||||||
N_RESET <= 1'b1;
|
|
||||||
prog <= 48'h000000000000;
|
|
||||||
next_instruction <= 1'b0;
|
|
||||||
timer <= 24'h000000;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
Display_EE_D <= Display_EE;
|
Display_EE_D <= Display_EE;
|
||||||
Cold_Boot_D <= Cold_Boot;
|
Cold_Boot_D <= Cold_Boot;
|
||||||
|
|
||||||
@@ -217,7 +205,6 @@ begin
|
|||||||
default:;
|
default:;
|
||||||
|
|
||||||
endcase
|
endcase
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
+4
-14
@@ -1827,25 +1827,15 @@ always @ (negedge MASTER_CLK)
|
|||||||
// Adjust HSYNC here
|
// Adjust HSYNC here
|
||||||
**************************************************************************************/
|
**************************************************************************************/
|
||||||
// Width from 87 GIME 5.08 uS = 73 clocks
|
// Width from 87 GIME 5.08 uS = 73 clocks
|
||||||
// 11'd751: // 824 - 751 = 73 (approx 5.09 uS)
|
11'd751: // 824 - 751 = 73 (approx 5.09 uS)
|
||||||
// begin
|
|
||||||
// HSYNC_N <= 1'b0; // Turn on Sync
|
|
||||||
// PIXEL_COUNT <= 11'd752;
|
|
||||||
// end
|
|
||||||
// 11'd810: // End of SYNC start of front porch 804 + 80 - 1, End of Sync to Video = 167 816 + 167 =
|
|
||||||
// begin
|
|
||||||
// HSYNC_N <= 1'b1; // SYNC OFF
|
|
||||||
// PIXEL_COUNT <= 11'd811;
|
|
||||||
// end
|
|
||||||
11'd752: // 824 - 751 = 73 (approx 5.09 uS)
|
|
||||||
begin
|
begin
|
||||||
HSYNC_N <= 1'b0; // Turn on Sync
|
HSYNC_N <= 1'b0; // Turn on Sync
|
||||||
PIXEL_COUNT <= 11'd753;
|
PIXEL_COUNT <= 11'd752;
|
||||||
end
|
end
|
||||||
11'd811: // End of SYNC start of front porch 804 + 80 - 1, End of Sync to Video = 167 816 + 167 =
|
11'd810: // End of SYNC start of front porch 804 + 80 - 1, End of Sync to Video = 167 816 + 167 =
|
||||||
begin
|
begin
|
||||||
HSYNC_N <= 1'b1; // SYNC OFF
|
HSYNC_N <= 1'b1; // SYNC OFF
|
||||||
PIXEL_COUNT <= 11'd812;
|
PIXEL_COUNT <= 11'd811;
|
||||||
end
|
end
|
||||||
/**************************************************************************************
|
/**************************************************************************************
|
||||||
* End of HSYNC adjustment
|
* End of HSYNC adjustment
|
||||||
|
|||||||
+11
-11
@@ -6,16 +6,16 @@ module cassette(
|
|||||||
input rewind,
|
input rewind,
|
||||||
input en,
|
input en,
|
||||||
|
|
||||||
output reg [15:0] sdram_addr,
|
output reg [24:0] sdram_addr,
|
||||||
input [7:0] sdram_data,
|
input [7:0] sdram_data,
|
||||||
// output reg sdram_rd,
|
output reg sdram_rd,
|
||||||
|
|
||||||
output data
|
output data,
|
||||||
// output [2:0] status
|
output [2:0] status
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//assign status = state;
|
assign status = state;
|
||||||
|
|
||||||
reg old_en;
|
reg old_en;
|
||||||
reg ffrewind;
|
reg ffrewind;
|
||||||
@@ -60,25 +60,25 @@ always @(posedge clk) begin
|
|||||||
end
|
end
|
||||||
NEXT: begin
|
NEXT: begin
|
||||||
state <= READ1;
|
state <= READ1;
|
||||||
// sdram_rd <= 1'b0;
|
sdram_rd <= 1'b0;
|
||||||
if (seq == 24'h553c00) name <= 1'd1;
|
if (seq == 24'h553c00) name <= 1'd1;
|
||||||
if (seq == 24'h555555 && name) begin
|
if (seq == 24'h555555 && name) begin
|
||||||
name <= 1'd0;
|
name <= 1'd0;
|
||||||
state <= WAIT;
|
state <= WAIT;
|
||||||
hold <= 19'd445000; // 0.5s
|
hold <= 19'd445000; // 0.5s
|
||||||
sdram_addr <= sdram_addr - 16'd3;
|
sdram_addr <= sdram_addr - 25'd3;
|
||||||
end
|
end
|
||||||
if (seq == 24'h553cff) eof <= 2'd1;
|
if (seq == 24'h553cff) eof <= 2'd1;
|
||||||
if (seq == 24'h00ff55 && eof == 2'd1) eof <= 2'd2;
|
if (seq == 24'h00ff55 && eof == 2'd1) eof <= 2'd2;
|
||||||
if (~en) state <= IDLE;
|
if (~en) state <= IDLE;
|
||||||
end
|
end
|
||||||
READ1: begin
|
READ1: begin
|
||||||
// sdram_rd <= 1'b1;
|
sdram_rd <= 1'b1;
|
||||||
state <= READ2;
|
state <= READ2;
|
||||||
end
|
end
|
||||||
READ2: begin
|
READ2: begin
|
||||||
ibyte <= sdram_data;
|
ibyte <= sdram_data;
|
||||||
// sdram_rd <= 1'b0;
|
sdram_rd <= 1'b0;
|
||||||
state <= READ3;
|
state <= READ3;
|
||||||
sq_start <= 1'b1;
|
sq_start <= 1'b1;
|
||||||
end
|
end
|
||||||
@@ -88,14 +88,14 @@ always @(posedge clk) begin
|
|||||||
end
|
end
|
||||||
READ4: begin
|
READ4: begin
|
||||||
seq <= { seq[15:0], sdram_data };
|
seq <= { seq[15:0], sdram_data };
|
||||||
sdram_addr <= sdram_addr + 16'd1;
|
sdram_addr <= sdram_addr + 25'd1;
|
||||||
state <= eof == 2'd2 ? IDLE : NEXT;
|
state <= eof == 2'd2 ? IDLE : NEXT;
|
||||||
end
|
end
|
||||||
endcase
|
endcase
|
||||||
|
|
||||||
if (ffrewind ^ rewind) begin
|
if (ffrewind ^ rewind) begin
|
||||||
seq <= 24'd0;
|
seq <= 24'd0;
|
||||||
sdram_addr <= 16'd0;
|
sdram_addr <= 25'd0;
|
||||||
state <= IDLE;
|
state <= IDLE;
|
||||||
eof <= 2'd0;
|
eof <= 2'd0;
|
||||||
end
|
end
|
||||||
|
|||||||
+228
-429
@@ -71,6 +71,8 @@
|
|||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// Define Config features
|
||||||
|
`include "../rtl/config.v"
|
||||||
|
|
||||||
|
|
||||||
module coco3fpga(
|
module coco3fpga(
|
||||||
@@ -93,7 +95,7 @@ output reg [7:0] BLUE,
|
|||||||
|
|
||||||
output reg H_SYNC,
|
output reg H_SYNC,
|
||||||
output reg V_SYNC,
|
output reg V_SYNC,
|
||||||
//output reg VGA_SYNC_N,
|
output reg VGA_SYNC_N,
|
||||||
output PIX_CLK,
|
output PIX_CLK,
|
||||||
output HBLANK,
|
output HBLANK,
|
||||||
output VBLANK,
|
output VBLANK,
|
||||||
@@ -115,13 +117,13 @@ output UART_DTR,
|
|||||||
input UART_DSR,
|
input UART_DSR,
|
||||||
|
|
||||||
|
|
||||||
//output [5:0] SOUND_OUT,
|
output [5:0] SOUND_OUT,
|
||||||
output [15:0] SOUND_LEFT,
|
output [15:0] SOUND_LEFT,
|
||||||
output [15:0] SOUND_RIGHT,
|
output [15:0] SOUND_RIGHT,
|
||||||
|
|
||||||
// CoCo Joystick
|
// CoCo Joystick
|
||||||
// Needs removal.... ???
|
// Needs removal.... ???
|
||||||
//input [3:0] PADDLE_CLK,
|
input [3:0] PADDLE_CLK,
|
||||||
input [3:0] P_SWITCH,
|
input [3:0] P_SWITCH,
|
||||||
// joystick input
|
// joystick input
|
||||||
// digital for buttons
|
// digital for buttons
|
||||||
@@ -143,9 +145,6 @@ input ioctl_download,
|
|||||||
input ioctl_wr,
|
input ioctl_wr,
|
||||||
input [15:0] ioctl_index,
|
input [15:0] ioctl_index,
|
||||||
|
|
||||||
// SDRAM Info
|
|
||||||
input [15:0] sdram_sz,
|
|
||||||
|
|
||||||
// SD block level interface
|
// SD block level interface
|
||||||
input [6:0] img_mounted, // signaling that new image has been mounted
|
input [6:0] img_mounted, // signaling that new image has been mounted
|
||||||
input img_readonly, // mounted as read only. valid only for active bit in img_mounted
|
input img_readonly, // mounted as read only. valid only for active bit in img_mounted
|
||||||
@@ -203,9 +202,7 @@ input F_Turbo,
|
|||||||
input [2:0] turbo_speed,
|
input [2:0] turbo_speed,
|
||||||
output [2:0] assigned_turbo_speed,
|
output [2:0] assigned_turbo_speed,
|
||||||
input [2:0] Mem_Size,
|
input [2:0] Mem_Size,
|
||||||
input [1:0] AUTO_MODE,
|
input [1:0] AUTO_MODE
|
||||||
|
|
||||||
input [71:0] Config_Data
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -232,10 +229,6 @@ parameter BOARD_TYPE = 8'h01; // No Riser - 2M
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Define Config features
|
|
||||||
|
|
||||||
reg [7:0] i_val;
|
|
||||||
`include "../rtl/config.sv"
|
|
||||||
|
|
||||||
|
|
||||||
reg [15:0] RAM0_DATA_I;
|
reg [15:0] RAM0_DATA_I;
|
||||||
@@ -257,9 +250,7 @@ reg CLK3_57MHZ;
|
|||||||
|
|
||||||
wire EF;
|
wire EF;
|
||||||
wire PH_2;
|
wire PH_2;
|
||||||
`ifndef CoCo3_CYC_ACC_6809
|
|
||||||
reg PH_2_RAW;
|
reg PH_2_RAW;
|
||||||
`endif
|
|
||||||
reg RESET_N;
|
reg RESET_N;
|
||||||
reg [6:0] CPU_RESET_SM;
|
reg [6:0] CPU_RESET_SM;
|
||||||
reg CPU_RESET;
|
reg CPU_RESET;
|
||||||
@@ -293,7 +284,7 @@ reg MMU_TR;
|
|||||||
reg [3:0] TMR_MSB;
|
reg [3:0] TMR_MSB;
|
||||||
reg [7:0] TMR_LSB;
|
reg [7:0] TMR_LSB;
|
||||||
wire TMR_RST;
|
wire TMR_RST;
|
||||||
reg [1:0] TMR_ENABLE;
|
reg TMR_ENABLE;
|
||||||
reg [15:0] VIDEO_BUFFER;
|
reg [15:0] VIDEO_BUFFER;
|
||||||
reg GRMODE;
|
reg GRMODE;
|
||||||
reg BLINK;
|
reg BLINK;
|
||||||
@@ -371,7 +362,7 @@ wire CART_SEL;
|
|||||||
reg [5:0] DTOA_CODE;
|
reg [5:0] DTOA_CODE;
|
||||||
reg [5:0] SOUND_DTOA;
|
reg [5:0] SOUND_DTOA;
|
||||||
|
|
||||||
//assign SOUND_OUT = SOUND_DTOA; // AJS - hook up sound directly
|
assign SOUND_OUT = SOUND_DTOA; // AJS - hook up sound directly
|
||||||
|
|
||||||
wire [7:0] SOUND;
|
wire [7:0] SOUND;
|
||||||
wire [18:0] DAC_LEFT;
|
wire [18:0] DAC_LEFT;
|
||||||
@@ -392,12 +383,6 @@ wire H_FLAG;
|
|||||||
|
|
||||||
reg [3:0] SWITCH_L;
|
reg [3:0] SWITCH_L;
|
||||||
|
|
||||||
wire RST_FF00_N;
|
|
||||||
wire RST_FF02_N;
|
|
||||||
//reg RST_FF20_N;
|
|
||||||
wire RST_FF22_N;
|
|
||||||
wire RST_FF92_N;
|
|
||||||
wire RST_FF93_N;
|
|
||||||
wire CPU_IRQ_N;
|
wire CPU_IRQ_N;
|
||||||
wire CPU_FIRQ_N;
|
wire CPU_FIRQ_N;
|
||||||
reg [2:0] DIV_7;
|
reg [2:0] DIV_7;
|
||||||
@@ -567,13 +552,19 @@ reg ANALOG;
|
|||||||
wire VDAC_EN;
|
wire VDAC_EN;
|
||||||
wire [15:0] VDAC_OUT;
|
wire [15:0] VDAC_OUT;
|
||||||
|
|
||||||
|
reg RST_FF00_N;
|
||||||
|
reg RST_FF02_N;
|
||||||
|
//reg RST_FF20_N;
|
||||||
|
reg RST_FF22_N;
|
||||||
|
reg RST_FF92_N;
|
||||||
|
reg RST_FF93_N;
|
||||||
|
reg TMR_RST_N;
|
||||||
wire CART_INT_N;
|
wire CART_INT_N;
|
||||||
reg CART_INT_N_D;
|
reg CART_INT_N_D;
|
||||||
wire VSYNC_INT_N;
|
wire VSYNC_INT_N;
|
||||||
reg VSYNC_INT_N_D;
|
reg VSYNC_INT_N_D;
|
||||||
wire HSYNC_INT_N;
|
wire HSYNC_INT_N;
|
||||||
reg HSYNC_INT_N_D;
|
reg HSYNC_INT_N_D;
|
||||||
wire TMR_RESET_N;
|
|
||||||
reg TIMER_INT_N;
|
reg TIMER_INT_N;
|
||||||
reg TIMER_INT_N_D;
|
reg TIMER_INT_N_D;
|
||||||
wire KEY_INT_N;
|
wire KEY_INT_N;
|
||||||
@@ -650,9 +641,8 @@ wire [7:0] CART_DATA;
|
|||||||
wire clk_sys;
|
wire clk_sys;
|
||||||
|
|
||||||
reg hold;
|
reg hold;
|
||||||
`ifndef CoCo3_CYC_ACC_6809
|
|
||||||
reg cpu_ena;
|
reg cpu_ena;
|
||||||
`endif
|
|
||||||
|
|
||||||
wire [4:0] CENT; // BIN Values
|
wire [4:0] CENT; // BIN Values
|
||||||
wire [6:0] YEAR;
|
wire [6:0] YEAR;
|
||||||
@@ -687,7 +677,7 @@ rtc #(50000000) CC3_rtc(
|
|||||||
// Probe's defined
|
// Probe's defined
|
||||||
//assign PROBE[6:0] = {CART1_POL, CART1_BUF_RESET_N, CART1_FIRQ_STAT_N, CART1_CLK_N, CART1_FIRQ_N, RESET_N, PH_2};
|
//assign PROBE[6:0] = {CART1_POL, CART1_BUF_RESET_N, CART1_FIRQ_STAT_N, CART1_CLK_N, CART1_FIRQ_N, RESET_N, PH_2};
|
||||||
//assign PROBE[7:0] = {1'b0, CART1_POL, CART1_FIRQ_N, CART1_FIRQ_BUF[0], CART1_CLK_N_D, CART1_FIRQ_RESET_N, CART1_CLK_N, PH_2};
|
//assign PROBE[7:0] = {1'b0, CART1_POL, CART1_FIRQ_N, CART1_FIRQ_BUF[0], CART1_CLK_N_D, CART1_FIRQ_RESET_N, CART1_CLK_N, PH_2};
|
||||||
assign PROBE[7:0] = {1'b0, TMR_CLK, DATA_IN[5], RST_FF93_N_SFT[0], RST_FF93_N, !TIMER3_FIRQ_N, VSYNC_INT_N, TIMER_INT_N};
|
assign PROBE[7:0] = {2'b00, cache_hit, COCO3_ROM_WRITE, ioctl_wr, ioctl_download, ioctl_index[7], ioctl_index[6]};
|
||||||
assign PROBE[15:8] = 8'h00;
|
assign PROBE[15:8] = 8'h00;
|
||||||
assign PROBE[23:16] = 8'h00;
|
assign PROBE[23:16] = 8'h00;
|
||||||
//assign PROBE[31:24] = {3'b000, DATA_OUT[3], MOTOR, DRIVE_SEL_EXT[0], HDD_EN, ADDRESS[0]};
|
//assign PROBE[31:24] = {3'b000, DATA_OUT[3], MOTOR, DRIVE_SEL_EXT[0], HDD_EN, ADDRESS[0]};
|
||||||
@@ -752,15 +742,12 @@ assign RAM_CS = (ADDRESS[15:0]== 16'hFFE8) ? 1'b1: // GART
|
|||||||
|
|
||||||
assign ROM_SEL = (ADDRESS[15:4] == 12'b111111111111) ? 1'b1: // Enable for Vectors
|
assign ROM_SEL = (ADDRESS[15:4] == 12'b111111111111) ? 1'b1: // Enable for Vectors
|
||||||
(ADDRESS[15:9] == 7'b1111111) ? 1'b0: // Disabled for FE00 - FFFF
|
(ADDRESS[15:9] == 7'b1111111) ? 1'b0: // Disabled for FE00 - FFFF
|
||||||
// (CART_SEL == 1'b1) ? 1'b0:
|
({ROM[1], RAM, BLOCK_ADDRESS[11:2], ADDRESS[14]} == 13'b0000000011110) ? 1'b1: // Enabled Read, 16K Int, Page 7, x1 $78000-$7BFFF
|
||||||
({ROM[1], RAM, BLOCK_ADDRESS[11:1]} == 13'b0000000011110) ? 1'b1: // Enabled Read, 16K Int, Page 7, x1 $78000-$7BFFF
|
|
||||||
// ({ROM[1], RAM, BLOCK_ADDRESS[11:2], ADDRESS[14]} == 13'b0000000011110) ? 1'b1: // Enabled Read, 16K Int, Page 7, x1 $78000-$7BFFF
|
|
||||||
({ROM, RAM, BLOCK_ADDRESS[11:2]} == 13'b1000000001111) ? 1'b1: // Enabled 32K int, Page 7, x $78000-$7FFFF
|
({ROM, RAM, BLOCK_ADDRESS[11:2]} == 13'b1000000001111) ? 1'b1: // Enabled 32K int, Page 7, x $78000-$7FFFF
|
||||||
1'b0;
|
1'b0;
|
||||||
|
|
||||||
assign CART_SEL = (ADDRESS[15:8] == 8'b11111111) ? 1'b0: // Disabled for FF00 - FFFF
|
assign CART_SEL = (ADDRESS[15:8] == 8'b11111111) ? 1'b0: // Disabled for FF00 - FFFF
|
||||||
// ({ROM[1], RAM, BLOCK_ADDRESS[11:2], ADDRESS[14]} == 13'b0000000011111) ? 1'b1: // Enabled Read, 16K Cart, Page 7, x1 $7C000-$7FEFF
|
({ROM[1], RAM, BLOCK_ADDRESS[11:2], ADDRESS[14]} == 13'b0000000011111) ? 1'b1: // Enabled Read, 16K Cart, Page 7, x1 $7C000-$7FEFF
|
||||||
({ROM[1], RAM, BLOCK_ADDRESS[11:1]} == 13'b0000000011111) ? 1'b1: // Enabled Read, 16K Cart, Page 7, x1 $7C000-$7FEFF
|
|
||||||
({ROM, RAM, BLOCK_ADDRESS[11:2]} == 13'b1100000001111) ? 1'b1: // Enabled 32K Cart, Page 7, x1 $78000-$7FEFF
|
({ROM, RAM, BLOCK_ADDRESS[11:2]} == 13'b1100000001111) ? 1'b1: // Enabled 32K Cart, Page 7, x1 $78000-$7FEFF
|
||||||
1'b0;
|
1'b0;
|
||||||
|
|
||||||
@@ -802,7 +789,6 @@ localparam [5:0] BOOT = 6'd0;
|
|||||||
|
|
||||||
wire COCO3_ROM_WRITE = (ioctl_index[7:0] == {BOOT0, BOOT}) & ioctl_wr;
|
wire COCO3_ROM_WRITE = (ioctl_index[7:0] == {BOOT0, BOOT}) & ioctl_wr;
|
||||||
wire COCO3_DISKROM_WRITE = (ioctl_index[7:0] == {BOOT1, BOOT}) & ioctl_wr;
|
wire COCO3_DISKROM_WRITE = (ioctl_index[7:0] == {BOOT1, BOOT}) & ioctl_wr;
|
||||||
wire COCO3_CART_WRITE = (ioctl_index[5:0] == 6'd1) & ioctl_wr & !cart_lock;
|
|
||||||
|
|
||||||
|
|
||||||
COCO_ROM_32K CC3_ROM(
|
COCO_ROM_32K CC3_ROM(
|
||||||
@@ -836,7 +822,7 @@ COCO_ROM_CART CC3_ROM_CART(
|
|||||||
.CLK(~clk_sys),
|
.CLK(~clk_sys),
|
||||||
.WR_ADDR(ioctl_addr[16:0]),
|
.WR_ADDR(ioctl_addr[16:0]),
|
||||||
.WR_DATA(ioctl_data[7:0]),
|
.WR_DATA(ioctl_data[7:0]),
|
||||||
.WRITE(COCO3_CART_WRITE)
|
.WRITE((ioctl_index[5:0] == 6'd1) & ioctl_wr)
|
||||||
);
|
);
|
||||||
|
|
||||||
wire SDC_EN_CS;
|
wire SDC_EN_CS;
|
||||||
@@ -896,138 +882,10 @@ begin
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
wire [3:0] Config_FLAG = `Config_Debug_FLAG;
|
`ifdef Config_Debug
|
||||||
wire [7:0] Build_Info;
|
wire [7:0] Config_FLAG = `Config_Debug_FLAG;
|
||||||
reg [3:0] Build_Info_Count;
|
wire [7:0] Config_Debug_Value = `Config_Debug_Value;
|
||||||
reg Build_Info_Read, Build_Info_Read_Delay;
|
`endif
|
||||||
|
|
||||||
reg [3:0] i_count;
|
|
||||||
|
|
||||||
always @(negedge clk_sys or negedge RESET_N)
|
|
||||||
begin
|
|
||||||
if(!RESET_N)
|
|
||||||
begin
|
|
||||||
i_count <= 4'b0000;
|
|
||||||
i_val <= 8'h00;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
if ( !(i_count == 4'b1000))
|
|
||||||
i_count <= i_count + 1'b1;
|
|
||||||
case(i_count)
|
|
||||||
4'b0001:
|
|
||||||
begin
|
|
||||||
`ifdef Feat_1
|
|
||||||
i_val <= i_val + FEATURE_1;
|
|
||||||
`endif
|
|
||||||
end
|
|
||||||
4'b0010:
|
|
||||||
begin
|
|
||||||
`ifdef Feat_2
|
|
||||||
i_val <= i_val + FEATURE_2;
|
|
||||||
`endif
|
|
||||||
end
|
|
||||||
4'b0011:
|
|
||||||
begin
|
|
||||||
`ifdef Feat_3
|
|
||||||
i_val <= i_val + FEATURE_3;
|
|
||||||
`endif
|
|
||||||
end
|
|
||||||
4'b0100:
|
|
||||||
begin
|
|
||||||
`ifdef Feat_4
|
|
||||||
i_val <= i_val + FEATURE_4;
|
|
||||||
`endif
|
|
||||||
end
|
|
||||||
4'b0101:
|
|
||||||
begin
|
|
||||||
`ifdef Feat_5
|
|
||||||
i_val <= i_val + FEATURE_5;
|
|
||||||
`endif
|
|
||||||
end
|
|
||||||
4'b0110:
|
|
||||||
begin
|
|
||||||
`ifdef Feat_6
|
|
||||||
i_val <= i_val + FEATURE_6;
|
|
||||||
`endif
|
|
||||||
end
|
|
||||||
4'b0111:
|
|
||||||
begin
|
|
||||||
`ifdef Feat_7
|
|
||||||
i_val <= i_val + FEATURE_7;
|
|
||||||
`endif
|
|
||||||
end
|
|
||||||
default:;
|
|
||||||
endcase
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
always @(negedge clk_sys or negedge RESET_N)
|
|
||||||
begin
|
|
||||||
if(!RESET_N)
|
|
||||||
begin
|
|
||||||
Build_Info_Count <= 4'b0000;
|
|
||||||
Build_Info <= 8'h00;
|
|
||||||
Build_Info_Read <= 1'b0;
|
|
||||||
Build_Info_Read_Delay <= 1'b0;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
Build_Info_Read <= 1'b0;
|
|
||||||
Build_Info_Read_Delay <= Build_Info_Read;
|
|
||||||
if (Build_Info_Read_Delay)
|
|
||||||
Build_Info_Count <= Build_Info_Count + 1'b1;
|
|
||||||
|
|
||||||
case (Build_Info_Count)
|
|
||||||
4'd0:
|
|
||||||
Build_Info <= Config_Data[71:64]; // Year MSB
|
|
||||||
4'd1:
|
|
||||||
Build_Info <= Config_Data[63:56]; // Year LSB
|
|
||||||
4'd2:
|
|
||||||
Build_Info <= Config_Data[55:48]; // Month MSB
|
|
||||||
4'd3:
|
|
||||||
Build_Info <= Config_Data[47:40]; // Month LSB
|
|
||||||
4'd4:
|
|
||||||
Build_Info <= Config_Data[39:32]; // Day MSB
|
|
||||||
4'd5:
|
|
||||||
Build_Info <= Config_Data[31:24]; // Day LSB
|
|
||||||
4'd6:
|
|
||||||
Build_Info <= Config_Data[23:16]; // Daily Build ID
|
|
||||||
4'd7:
|
|
||||||
Build_Info <= Config_Data[15:8]; // Daily Build ID
|
|
||||||
4'd8:
|
|
||||||
Build_Info <= Config_Data[7:0]; // Daily Build ID
|
|
||||||
4'd9:
|
|
||||||
`ifdef Config_Debug
|
|
||||||
Build_Info <= {4'b1111, Config_FLAG};
|
|
||||||
`else
|
|
||||||
Build_Info <= {4'b0000, Config_FLAG};
|
|
||||||
`endif
|
|
||||||
4'd10:
|
|
||||||
Build_Info <= i_val;
|
|
||||||
4'd11:
|
|
||||||
Build_Info <= {Config_FLAG, sdram_sz[15], 1'b0, sdram_sz[1:0]};
|
|
||||||
4'd12:
|
|
||||||
Build_Info <= Version_Hi;
|
|
||||||
4'd13:
|
|
||||||
Build_Info <= (Version_Lo + BOARD_TYPE);
|
|
||||||
|
|
||||||
default:
|
|
||||||
Build_Info <= 8'h00;
|
|
||||||
endcase
|
|
||||||
|
|
||||||
if(PH_2)
|
|
||||||
begin
|
|
||||||
case ({RW_N,ADDRESS})
|
|
||||||
17'h1FFEF:
|
|
||||||
begin
|
|
||||||
Build_Info_Read <= 1'b1;
|
|
||||||
end
|
|
||||||
default:;
|
|
||||||
endcase
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
assign DATA_IN =
|
assign DATA_IN =
|
||||||
@@ -1038,22 +896,35 @@ assign DATA_IN =
|
|||||||
HDD_EN ? DATA_HDD:
|
HDD_EN ? DATA_HDD:
|
||||||
RS232_EN ? DATA_RS232:
|
RS232_EN ? DATA_RS232:
|
||||||
SLOT3_HW ? {5'b00000, ROM_BANK}:
|
SLOT3_HW ? {5'b00000, ROM_BANK}:
|
||||||
// FF00, FF04, FF08, FF0C, FF10, FF14, FF18, FF1C
|
// FF00, FF04, FF08, FF0C
|
||||||
({ADDRESS[15:5], ADDRESS[1:0]} == 13'b11111111000_00) ? DATA_REG1:
|
({ADDRESS[15:5], ADDRESS[1:0]} == 13'b1111111100000) ? DATA_REG1:
|
||||||
// FF01, FF05, FF09, FF0D, FF11, FF15, FF19, FF1D
|
// FF01, FF05, FF09, FF0D
|
||||||
({ADDRESS[15:5], ADDRESS[1:0]} == 13'b11111111000_01) ? {!HSYNC1_IRQ_BUF[1], 3'b011, SEL[0], DDR1, HSYNC1_POL, HSYNC1_IRQ_INT}:
|
({ADDRESS[15:5], ADDRESS[1:0]} == 13'b1111111100001) ? {!HSYNC1_IRQ_BUF[1], 3'b011, SEL[0], DDR1, HSYNC1_POL, HSYNC1_IRQ_INT}:
|
||||||
// FF02, FF06, FF0A, FF0E, FF12, FF16, FF1A, FF1E
|
// FF02, FF06, FF0A, FF0E
|
||||||
({ADDRESS[15:5], ADDRESS[1:0]} == 13'b11111111000_10) ? DATA_REG2:
|
({ADDRESS[15:5], ADDRESS[1:0]} == 13'b1111111100010) ? DATA_REG2:
|
||||||
// FF03, FF07, FF0B, FF0F, FF13, FF17, FF1B, FF1F
|
// FF03, FF07, FF0B, FF0F
|
||||||
({ADDRESS[15:5], ADDRESS[1:0]} == 13'b11111111000_11) ? {!VSYNC1_IRQ_BUF[1], 3'b011, SEL[1], DDR2, VSYNC1_POL, VSYNC1_IRQ_INT}:
|
({ADDRESS[15:5], ADDRESS[1:0]} == 13'b1111111100011) ? {!VSYNC1_IRQ_BUF[1], 3'b011, SEL[1], DDR2, VSYNC1_POL, VSYNC1_IRQ_INT}:
|
||||||
// FF20, FF24, FF28, FF2C
|
// FF20, FF24, FF28, FF2C
|
||||||
({ADDRESS[15:4], ADDRESS[1:0]} == 14'b111111110010_00) ? DATA_REG3:
|
({ADDRESS[15:4], ADDRESS[1:0]} == 14'b11111111001000) ? DATA_REG3:
|
||||||
// FF21, FF25, FF29, FF2D
|
// FF21, FF25, FF29, FF2D
|
||||||
({ADDRESS[15:4], ADDRESS[1:0]} == 14'b111111110010_01) ? {4'b0011, CAS_MTR, DDR3, 2'b00}: // CD_POL, CD_INT}:
|
({ADDRESS[15:4], ADDRESS[1:0]} == 14'b11111111001001) ? {4'b0011, CAS_MTR, DDR3, 2'b00}: // CD_POL, CD_INT}:
|
||||||
// FF22, FF26, FF2A, FF2E
|
// FF22, FF26, FF2A, FF2E
|
||||||
({ADDRESS[15:4], ADDRESS[1:0]} == 14'b111111110010_10) ? DATA_REG4:
|
({ADDRESS[15:4], ADDRESS[1:0]} == 14'b11111111001010) ? DATA_REG4:
|
||||||
// FF23, FF27, FF2B, FF2F
|
// FF23, FF27, FF2B, FF2F
|
||||||
({ADDRESS[15:4], ADDRESS[1:0]} == 14'b111111110010_11) ? {!CART1_FIRQ_BUF[1], 3'b011, SOUND_EN, DDR4, CART1_POL, CART1_FIRQ_INT}:
|
({ADDRESS[15:4], ADDRESS[1:0]} == 14'b11111111001011) ? {!CART1_FIRQ_BUF[1], 3'b011, SOUND_EN, DDR4, CART1_POL, CART1_FIRQ_INT}:
|
||||||
|
// HiRes Joystick
|
||||||
|
// ({PDL,ADDRESS} == 17'h0FF60) ? PADDLE_LATCH_0[11:4]:
|
||||||
|
// ({PDL,ADDRESS} == 17'h0FF61) ? {PADDLE_LATCH_0[3:0],4'b0000}:
|
||||||
|
// ({PDL,ADDRESS} == 17'h0FF62) ? PADDLE_LATCH_1[11:4]:
|
||||||
|
// ({PDL,ADDRESS} == 17'h0FF63) ? {PADDLE_LATCH_1[3:0],4'b0000}:
|
||||||
|
// ({PDL,ADDRESS} == 17'h1FF60) ? PADDLE_LATCH_2[11:4]:
|
||||||
|
// ({PDL,ADDRESS} == 17'h1FF61) ? {PADDLE_LATCH_2[3:0],4'b0000}:
|
||||||
|
// ({PDL,ADDRESS} == 17'h1FF62) ? PADDLE_LATCH_3[11:4]:
|
||||||
|
// ({PDL,ADDRESS} == 17'h1FF63) ? {PADDLE_LATCH_3[3:0],4'b0000}:
|
||||||
|
// (ADDRESS == 16'hFF6C) ? {(!WF_RDFIFO_RDEMPTY & WF_IRQ_EN),
|
||||||
|
// 5'b00000,
|
||||||
|
// !WF_RDFIFO_RDEMPTY, // 1 = data available
|
||||||
|
// WF_WRFIFO_WRFULL}: // 1 = Write FIFO Full
|
||||||
|
|
||||||
(ADDRESS == 16'hFF70) ? {1'b0, GART_WRITE[22:16]}: // 2MB
|
(ADDRESS == 16'hFF70) ? {1'b0, GART_WRITE[22:16]}: // 2MB
|
||||||
(ADDRESS == 16'hFF71) ? { GART_WRITE[15:8]}:
|
(ADDRESS == 16'hFF71) ? { GART_WRITE[15:8]}:
|
||||||
@@ -1061,8 +932,19 @@ assign DATA_IN =
|
|||||||
(ADDRESS == 16'hFF74) ? {1'b0, GART_READ[22:16]}:
|
(ADDRESS == 16'hFF74) ? {1'b0, GART_READ[22:16]}:
|
||||||
(ADDRESS == 16'hFF75) ? { GART_READ[15:8]}:
|
(ADDRESS == 16'hFF75) ? { GART_READ[15:8]}:
|
||||||
(ADDRESS == 16'hFF76) ? { GART_READ[7:0]}:
|
(ADDRESS == 16'hFF76) ? { GART_READ[7:0]}:
|
||||||
|
|
||||||
(ADDRESS == 16'hFF7F) ? {2'b11, MPI_CTS, 2'b00, MPI_SCS}:
|
(ADDRESS == 16'hFF7F) ? {2'b11, MPI_CTS, 2'b00, MPI_SCS}:
|
||||||
|
// (ADDRESS == 16'hFF80) ? {CK_DONE_BUF[1],
|
||||||
|
// CK_FAIL,
|
||||||
|
// CK_STATE}:
|
||||||
|
// (ADDRESS == 16'hFF81) ? CK_DATA_IN:
|
||||||
|
|
||||||
|
// (ADDRESS == 16'hFF84) ? {SDRAM_READY_BUF[1], 3'b000, SDRAM_STATE, SDRAM_READ}:
|
||||||
|
// (ADDRESS == 16'hFF85) ? SDRAM_DOUT[7:0]:
|
||||||
|
// (ADDRESS == 16'hFF86) ? SDRAM_DOUT[15:8]:
|
||||||
|
// (ADDRESS == 16'hFF87) ? {1'b0, SDRAM_ADDR[21:15]}:
|
||||||
|
// (ADDRESS == 16'hFF88) ? SDRAM_ADDR[14:7]:
|
||||||
|
// (ADDRESS == 16'hFF87) ? BUFF_DATA[15:8]:
|
||||||
|
// (ADDRESS == 16'hFF88) ? BUFF_DATA[7:0]:
|
||||||
|
|
||||||
(ADDRESS == 16'hFF8E) ? GPIO_DIR:
|
(ADDRESS == 16'hFF8E) ? GPIO_DIR:
|
||||||
(ADDRESS == 16'hFF8F) ? GPIO:
|
(ADDRESS == 16'hFF8F) ? GPIO:
|
||||||
@@ -1073,14 +955,14 @@ assign DATA_IN =
|
|||||||
(ADDRESS == 16'hFF93) ? {2'b00, !TIMER3_FIRQ_N, !HSYNC3_FIRQ_N, !VSYNC3_FIRQ_N, 1'b0, !KEY3_FIRQ_N, !CART3_FIRQ_N}:
|
(ADDRESS == 16'hFF93) ? {2'b00, !TIMER3_FIRQ_N, !HSYNC3_FIRQ_N, !VSYNC3_FIRQ_N, 1'b0, !KEY3_FIRQ_N, !CART3_FIRQ_N}:
|
||||||
(ADDRESS == 16'hFF94) ? {4'h0,TMR_MSB}:
|
(ADDRESS == 16'hFF94) ? {4'h0,TMR_MSB}:
|
||||||
(ADDRESS == 16'hFF95) ? TMR_LSB:
|
(ADDRESS == 16'hFF95) ? TMR_LSB:
|
||||||
(ADDRESS == 16'hFF98) ? {GRMODE, HRES[3], 3'b000, LPR}:
|
// (ADDRESS == 16'hFF98) ? {GRMODE, HRES[3], DESCEN, MONO, 1'b0, LPR}:
|
||||||
(ADDRESS == 16'hFF99) ? {HLPR, LPF, HRES[2:0], CRES}:
|
// (ADDRESS == 16'hFF99) ? {HLPR, LPF, HRES[2:0], CRES}:
|
||||||
(ADDRESS == 16'hFF9A) ? {2'b00, PALETTE[16][5:0]}:
|
// (ADDRESS == 16'hFF9A) ? {2'b00, PALETTE[16][5:0]}:
|
||||||
(ADDRESS == 16'hFF9B) ? {SAM_EXT[2], SCRN_START_HSB[4],SAM_EXT[1:0],SCRN_START_HSB[3:0]}: // 4 extra bits for 8MB. Real hardware can't read back!!
|
// (ADDRESS == 16'hFF9B) ? {2'b00, SAM_EXT, SCRN_START_HSB}: // 4 extra bits for 8MB. Real hardware can't read back!!
|
||||||
(ADDRESS == 16'hFF9C) ? {4'h0,VERT_FIN_SCRL}:
|
// (ADDRESS == 16'hFF9C) ? {4'h0,VERT_FIN_SCRL}:
|
||||||
(ADDRESS == 16'hFF9D) ? SCRN_START_MSB:
|
// (ADDRESS == 16'hFF9D) ? SCRN_START_MSB:
|
||||||
(ADDRESS == 16'hFF9E) ? SCRN_START_LSB:
|
// (ADDRESS == 16'hFF9E) ? SCRN_START_LSB:
|
||||||
(ADDRESS == 16'hFF9F) ? {HVEN,HOR_OFFSET}:
|
// (ADDRESS == 16'hFF9F) ? {HVEN,HOR_OFFSET}:
|
||||||
(ADDRESS == 16'hFFA0) ? SAM00[7:0]:
|
(ADDRESS == 16'hFFA0) ? SAM00[7:0]:
|
||||||
(ADDRESS == 16'hFFA1) ? SAM01[7:0]:
|
(ADDRESS == 16'hFFA1) ? SAM01[7:0]:
|
||||||
(ADDRESS == 16'hFFA2) ? SAM02[7:0]:
|
(ADDRESS == 16'hFFA2) ? SAM02[7:0]:
|
||||||
@@ -1122,10 +1004,37 @@ assign DATA_IN =
|
|||||||
(ADDRESS == 16'hFFC6) ? {2'b00, MIN}:
|
(ADDRESS == 16'hFFC6) ? {2'b00, MIN}:
|
||||||
(ADDRESS == 16'hFFC7) ? {2'b00, SEC}:
|
(ADDRESS == 16'hFFC7) ? {2'b00, SEC}:
|
||||||
|
|
||||||
(ADDRESS == 16'hFFD9) ? {5'h00, RATE_PGM}:
|
(ADDRESS == 16'hFFCC) ? {KEY[51],KEY[52],KEY[72],KEY[71],
|
||||||
|
KEY[28],KEY[27],KEY[30],KEY[29]}:
|
||||||
|
(ADDRESS == 16'hFFCD) ? {KEY[70],KEY[69],KEY[65],KEY[66],
|
||||||
|
KEY[67],KEY[68],2'b00}:
|
||||||
|
(ADDRESS == 16'hFFCE) ? {KEY[61],KEY[60],KEY[59],KEY[58],
|
||||||
|
KEY[57],KEY[56],KEY[54],KEY[53]}:
|
||||||
|
(ADDRESS == 16'hFFCF) ? {V_SYNC,VBLANK,H_SYNC,HBLANK,
|
||||||
|
KEY[0],KEY[64],KEY[63],KEY[62]}:
|
||||||
|
|
||||||
(ADDRESS == 16'hFFEF) ? Build_Info:
|
`ifdef Config_Debug
|
||||||
8'hAA;
|
(ADDRESS == 16'hFFF0) ? Config_FLAG:
|
||||||
|
(ADDRESS == 16'hFFF1) ? Config_Debug_Value:
|
||||||
|
`else
|
||||||
|
(ADDRESS == 16'hFFF0) ? Version_Hi:
|
||||||
|
(ADDRESS == 16'hFFF1) ? (Version_Lo + BOARD_TYPE):
|
||||||
|
`endif
|
||||||
|
(ADDRESS == 16'hFFF2) ? 8'hFE:
|
||||||
|
(ADDRESS == 16'hFFF3) ? 8'hEE:
|
||||||
|
(ADDRESS == 16'hFFF4) ? 8'hFE:
|
||||||
|
(ADDRESS == 16'hFFF5) ? 8'hF1:
|
||||||
|
(ADDRESS == 16'hFFF6) ? 8'hFE:
|
||||||
|
(ADDRESS == 16'hFFF7) ? 8'hF4:
|
||||||
|
(ADDRESS == 16'hFFF8) ? 8'hFE:
|
||||||
|
(ADDRESS == 16'hFFF9) ? 8'hF7:
|
||||||
|
(ADDRESS == 16'hFFFA) ? 8'hFE:
|
||||||
|
(ADDRESS == 16'hFFFB) ? 8'hFA:
|
||||||
|
(ADDRESS == 16'hFFFC) ? 8'hFE:
|
||||||
|
(ADDRESS == 16'hFFFD) ? 8'hFD:
|
||||||
|
(ADDRESS == 16'hFFFE) ? 8'h8C:
|
||||||
|
(ADDRESS == 16'hFFFF) ? 8'h1B:
|
||||||
|
8'h55;
|
||||||
|
|
||||||
assign DATA_REG1 = !DDR1 ? DD_REG1:
|
assign DATA_REG1 = !DDR1 ? DD_REG1:
|
||||||
KEYBOARD_IN;
|
KEYBOARD_IN;
|
||||||
@@ -1241,18 +1150,15 @@ assign cache_hit = (sdram_cpu_addr[24:1] == sdram_cpu_addr_L[24:1]);
|
|||||||
reg cpu_cycle_ena;
|
reg cpu_cycle_ena;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
always @(negedge clk_sys or negedge RESET_N)
|
always @(negedge clk_sys or negedge RESET_N)
|
||||||
begin
|
begin
|
||||||
if(!RESET_N)
|
if(!RESET_N)
|
||||||
begin
|
begin
|
||||||
CLK <= 6'h00;
|
CLK <= 6'h00;
|
||||||
SWITCH_L <= 3'b000;
|
SWITCH_L <= 3'b000;
|
||||||
`ifndef CoCo3_CYC_ACC_6809
|
|
||||||
PH_2_RAW <= 1'b0;
|
PH_2_RAW <= 1'b0;
|
||||||
cpu_ena <= 1'b0;
|
|
||||||
`endif
|
|
||||||
hold <= 1'b0;
|
hold <= 1'b0;
|
||||||
|
cpu_ena <= 1'b0;
|
||||||
end_hold <= 1'b0;
|
end_hold <= 1'b0;
|
||||||
RAM0_BE0_L <= 1'b0;
|
RAM0_BE0_L <= 1'b0;
|
||||||
RAM0_BE1_L <= 1'b0;
|
RAM0_BE1_L <= 1'b0;
|
||||||
@@ -1295,9 +1201,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
// kill end hold and cpu_ena for the read memory hold
|
// kill end hold and cpu_ena for the read memory hold
|
||||||
end_hold <= 1'b0;
|
end_hold <= 1'b0;
|
||||||
`ifndef CoCo3_CYC_ACC_6809
|
|
||||||
cpu_ena <= 1'b0;
|
cpu_ena <= 1'b0;
|
||||||
`endif
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if (sdram_cpu_ack)
|
if (sdram_cpu_ack)
|
||||||
@@ -1313,23 +1217,19 @@ begin
|
|||||||
begin
|
begin
|
||||||
SWITCH_L <= {assigned_turbo_speed, (RATE | F_Turbo)}; // Normal speed
|
SWITCH_L <= {assigned_turbo_speed, (RATE | F_Turbo)}; // Normal speed
|
||||||
CLK <= 6'h01;
|
CLK <= 6'h01;
|
||||||
`ifndef CoCo3_CYC_ACC_6809
|
|
||||||
PH_2_RAW <= 1'b1;
|
PH_2_RAW <= 1'b1;
|
||||||
`endif
|
|
||||||
if (~(hold | end_hold)) // Make sure we are not in a cycle before starting one....
|
if (~(hold | end_hold)) // Make sure we are not in a cycle before starting one....
|
||||||
// If we are still in one - we skip this cpu_enable cycle
|
// If we are still in one - we skip this cpu_enable cycle
|
||||||
begin
|
begin
|
||||||
`ifndef CoCo3_CYC_ACC_6809
|
|
||||||
cpu_ena <= 1'b1;
|
cpu_ena <= 1'b1;
|
||||||
`endif
|
|
||||||
cpu_cycle_ena <= 1'b1; // Default cycle
|
cpu_cycle_ena <= 1'b1; // Default cycle
|
||||||
|
|
||||||
if (AMW_EN) // Automated Memory Write ?
|
if (AMW_EN) // Automated Memory Write ?
|
||||||
begin
|
begin
|
||||||
AMW_WR <= 1'b1;
|
AMW_WR <= 1'b1;
|
||||||
`ifndef CoCo3_CYC_ACC_6809
|
|
||||||
cpu_ena <= 1'b0; // Kill cpu enable
|
cpu_ena <= 1'b0; // Kill cpu enable
|
||||||
`endif
|
|
||||||
cpu_cycle_ena <= 1'b0; // Kill (defer) cycle based on memory transaction
|
cpu_cycle_ena <= 1'b0; // Kill (defer) cycle based on memory transaction
|
||||||
|
|
||||||
|
|
||||||
@@ -1396,14 +1296,11 @@ begin
|
|||||||
end
|
end
|
||||||
6'h01:
|
6'h01:
|
||||||
begin
|
begin
|
||||||
`ifndef CoCo3_CYC_ACC_6809
|
|
||||||
PH_2_RAW <= 1'b0;
|
PH_2_RAW <= 1'b0;
|
||||||
`endif
|
|
||||||
// if we are not in a memory read [hold] then terminate cpu_ena - just like PH_2
|
// if we are not in a memory read [hold] then terminate cpu_ena - just like PH_2
|
||||||
`ifndef CoCo3_CYC_ACC_6809
|
|
||||||
if (!hold)
|
if (!hold)
|
||||||
cpu_ena <= 1'b0;
|
cpu_ena <= 1'b0;
|
||||||
`endif
|
|
||||||
CLK <= 6'h02;
|
CLK <= 6'h02;
|
||||||
end
|
end
|
||||||
6'h05: // 64/6 = 9.55
|
6'h05: // 64/6 = 9.55
|
||||||
@@ -1454,18 +1351,22 @@ begin
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// This is the reset in which includes the MiSTer button, system reset, cold boot reset [frm EE_cold_bt].
|
|
||||||
// Here we add the keyboard reset and turn it positive.
|
|
||||||
//
|
|
||||||
assign RESET_P = !BUTTON_N[3] // Button
|
assign RESET_P = !BUTTON_N[3] // Button
|
||||||
| RESET; // CTRL-ALT-DEL or CTRL-ALT-INS from Keyboard
|
| RESET; // CTRL-ALT-DEL or CTRL-ALT-INS
|
||||||
|
|
||||||
|
reg first_time = 1'b1;
|
||||||
|
|
||||||
|
// Make sure all resets are enabled for a long enough time to allow voltages to settle
|
||||||
always @ (posedge clk_sys)
|
always @ (posedge clk_sys)
|
||||||
begin
|
begin
|
||||||
if (RESET)
|
if (RESET)
|
||||||
MUGS <= RESET_INS; //This is holding a <ctrl><alt><ins> across a reset to activate the Easter Egg
|
MUGS <= RESET_INS; //This is holding a <ctrl><alt><ins> across a reset to activate the Easter Egg
|
||||||
|
if (first_time)
|
||||||
|
begin
|
||||||
|
MUGS <= 1'b0;
|
||||||
|
first_time = 1'b0;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
always @ (posedge clk_sys or posedge RESET_P)
|
always @ (posedge clk_sys or posedge RESET_P)
|
||||||
@@ -1482,16 +1383,12 @@ begin
|
|||||||
begin
|
begin
|
||||||
case (RESET_SM)
|
case (RESET_SM)
|
||||||
25'h0800000: // time = 143 mS
|
25'h0800000: // time = 143 mS
|
||||||
// Take away RESET_N
|
|
||||||
// Leave CPU_RESET Asserted
|
|
||||||
begin
|
begin
|
||||||
RESET_N <= 1'b1;
|
RESET_N <= 1'b1;
|
||||||
CPU_RESET <= 1'b1;
|
CPU_RESET <= 1'b1;
|
||||||
RESET_SM <= RESET_SM + 1'b1;
|
RESET_SM <= RESET_SM + 1'b1;
|
||||||
end
|
end
|
||||||
25'h1000000: // time = 286 mS
|
25'h1000000: // time = 286 mS
|
||||||
// Take away RESET_N & CPU_RESET
|
|
||||||
// Stop RESET_SM count
|
|
||||||
begin
|
begin
|
||||||
RESET_N <= 1'b1;
|
RESET_N <= 1'b1;
|
||||||
CPU_RESET <= 1'b0;
|
CPU_RESET <= 1'b0;
|
||||||
@@ -1747,31 +1644,32 @@ sdc_top coco_sdc_top(
|
|||||||
reg cart_firq_enable;
|
reg cart_firq_enable;
|
||||||
|
|
||||||
reg firq_trig;
|
reg firq_trig;
|
||||||
reg cart_lock;
|
reg [15:0] firq_tmr;
|
||||||
|
|
||||||
always @(negedge clk_sys or negedge RESET_N)
|
always @(negedge clk_sys or negedge RESET_N)
|
||||||
begin
|
begin
|
||||||
if(!RESET_N)
|
if(!RESET_N)
|
||||||
begin
|
begin
|
||||||
firq_trig <= 1'b0;
|
firq_trig <= 1'b0;
|
||||||
|
firq_tmr <= 16'h0000;
|
||||||
cart_firq_enable <= 1'b1;
|
cart_firq_enable <= 1'b1;
|
||||||
cart_lock <= 1'b0;
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if ((ioctl_index[5:0] == 6'd1) & ioctl_download)
|
|
||||||
firq_trig <= 1'b1;
|
|
||||||
|
|
||||||
if (firq_trig)
|
if (firq_trig)
|
||||||
if (!ioctl_download)
|
if (~(firq_tmr == 16'hffff))
|
||||||
|
firq_tmr = firq_tmr + 1'b1;
|
||||||
|
else
|
||||||
|
cart_firq_enable <= SWITCH[4] & ~ioctl_download;
|
||||||
|
|
||||||
|
if ((ioctl_index[5:0] == 6'd1) & ioctl_wr)
|
||||||
begin
|
begin
|
||||||
cart_firq_enable <= 1'b0;
|
firq_trig <= 1'b1;
|
||||||
cart_lock <= 1'b1;
|
firq_tmr <= 16'h0000;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
//***********************************************************************
|
//***********************************************************************
|
||||||
// Interrupt Sources
|
// Interrupt Sources
|
||||||
//***********************************************************************
|
//***********************************************************************
|
||||||
@@ -1787,11 +1685,13 @@ begin
|
|||||||
if (PH_2)
|
if (PH_2)
|
||||||
case (MPI_SCS)
|
case (MPI_SCS)
|
||||||
2'b00:
|
2'b00:
|
||||||
CART_INT_IN_N <= (SER_IRQ);
|
CART_INT_IN_N <= (!CART_INT_IN_N )
|
||||||
|
&(SER_IRQ);
|
||||||
2'b01:
|
2'b01:
|
||||||
CART_INT_IN_N <= (SER_IRQ);
|
CART_INT_IN_N <= (SER_IRQ);
|
||||||
2'b10:
|
2'b10:
|
||||||
CART_INT_IN_N <= (!CART_INT_IN_N | cart_firq_enable);
|
CART_INT_IN_N <= (!CART_INT_IN_N | cart_firq_enable)
|
||||||
|
&(SER_IRQ);
|
||||||
2'b11:
|
2'b11:
|
||||||
CART_INT_IN_N <= (SER_IRQ);
|
CART_INT_IN_N <= (SER_IRQ);
|
||||||
endcase
|
endcase
|
||||||
@@ -1817,93 +1717,91 @@ assign KEY_INT_N = (KEYBOARD_IN == 8'hFF);
|
|||||||
|
|
||||||
//***********************************************************************
|
//***********************************************************************
|
||||||
// Interrupt Latch RESETs
|
// Interrupt Latch RESETs
|
||||||
// This code delays the asynchronus clears by 3 clocks to prevent race
|
|
||||||
// condition of reading and clearing at the same time.
|
|
||||||
//***********************************************************************
|
//***********************************************************************
|
||||||
reg [2:0] RST_FF00_N_SFT, RST_FF02_N_SFT, RST_FF22_N_SFT, RST_FF92_N_SFT, RST_FF93_N_SFT;
|
|
||||||
|
|
||||||
assign RST_FF00_N = RST_FF00_N_SFT[2];
|
|
||||||
assign RST_FF02_N = RST_FF02_N_SFT[2];
|
|
||||||
assign RST_FF22_N = RST_FF22_N_SFT[2];
|
|
||||||
assign RST_FF92_N = RST_FF92_N_SFT[2];
|
|
||||||
assign RST_FF93_N = RST_FF93_N_SFT[2];
|
|
||||||
|
|
||||||
wire [7:0] FF93_Value;
|
|
||||||
assign FF93_Value = {2'b00, !TIMER3_FIRQ_N, !HSYNC3_FIRQ_N, !VSYNC3_FIRQ_N, 1'b0, !KEY3_FIRQ_N, !CART3_FIRQ_N};
|
|
||||||
|
|
||||||
|
|
||||||
always @(negedge clk_sys or negedge RESET_N)
|
always @(negedge clk_sys or negedge RESET_N)
|
||||||
begin
|
begin
|
||||||
if(!RESET_N)
|
if(!RESET_N)
|
||||||
begin
|
begin
|
||||||
RST_FF00_N_SFT <= 3'b111;
|
RST_FF00_N <= 1'b1;
|
||||||
RST_FF02_N_SFT <= 3'b111;
|
RST_FF02_N <= 1'b1;
|
||||||
RST_FF22_N_SFT <= 3'b111;
|
// RST_FF20_N <= 1'b1;
|
||||||
RST_FF92_N_SFT <= 3'b111;
|
RST_FF22_N <= 1'b1;
|
||||||
RST_FF93_N_SFT <= 3'b111;
|
RST_FF92_N <= 1'b1;
|
||||||
|
RST_FF93_N <= 1'b1;
|
||||||
|
TMR_RST_N <= 1'b1;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
RST_FF00_N_SFT[0] <= 1'b1;
|
|
||||||
RST_FF02_N_SFT[0] <= 1'b1;
|
|
||||||
RST_FF22_N_SFT[0] <= 1'b1;
|
|
||||||
RST_FF92_N_SFT[0] <= 1'b1;
|
|
||||||
RST_FF93_N_SFT[0] <= 1'b1;
|
|
||||||
|
|
||||||
RST_FF00_N_SFT[2:1] <= RST_FF00_N_SFT[1:0];
|
|
||||||
RST_FF02_N_SFT[2:1] <= RST_FF02_N_SFT[1:0];
|
|
||||||
RST_FF22_N_SFT[2:1] <= RST_FF22_N_SFT[1:0];
|
|
||||||
RST_FF92_N_SFT[2:1] <= RST_FF92_N_SFT[1:0];
|
|
||||||
RST_FF93_N_SFT[2:1] <= RST_FF93_N_SFT[1:0];
|
|
||||||
|
|
||||||
if (PH_2)
|
if (PH_2)
|
||||||
begin
|
|
||||||
|
|
||||||
case({RW_N,ADDRESS})
|
case({RW_N,ADDRESS})
|
||||||
17'h1FF00,
|
17'h1FF00:
|
||||||
17'h1FF04,
|
RST_FF00_N <= 1'b0;
|
||||||
17'h1FF08,
|
17'h1FF04:
|
||||||
17'h1FF0C,
|
RST_FF00_N <= 1'b0;
|
||||||
17'h1FF10,
|
17'h1FF08:
|
||||||
17'h1FF14,
|
RST_FF00_N <= 1'b0;
|
||||||
17'h1FF18,
|
17'h1FF0C:
|
||||||
|
RST_FF00_N <= 1'b0;
|
||||||
|
17'h1FF10:
|
||||||
|
RST_FF00_N <= 1'b0;
|
||||||
|
17'h1FF14:
|
||||||
|
RST_FF00_N <= 1'b0;
|
||||||
|
17'h1FF18:
|
||||||
|
RST_FF00_N <= 1'b0;
|
||||||
17'h1FF1C:
|
17'h1FF1C:
|
||||||
RST_FF00_N_SFT[0] <= 1'b0;
|
RST_FF00_N <= 1'b0;
|
||||||
|
17'h1FF02:
|
||||||
17'h1FF02,
|
RST_FF02_N <= 1'b0;
|
||||||
17'h1FF06,
|
17'h1FF06:
|
||||||
17'h1FF0A,
|
RST_FF02_N <= 1'b0;
|
||||||
17'h1FF0E,
|
17'h1FF0A:
|
||||||
17'h1FF12,
|
RST_FF02_N <= 1'b0;
|
||||||
17'h1FF16,
|
17'h1FF0E:
|
||||||
17'h1FF1A,
|
RST_FF02_N <= 1'b0;
|
||||||
|
17'h1FF12:
|
||||||
|
RST_FF02_N <= 1'b0;
|
||||||
|
17'h1FF16:
|
||||||
|
RST_FF02_N <= 1'b0;
|
||||||
|
17'h1FF1A:
|
||||||
|
RST_FF02_N <= 1'b0;
|
||||||
17'h1FF1E:
|
17'h1FF1E:
|
||||||
RST_FF02_N_SFT[0] <= 1'b0;
|
RST_FF02_N <= 1'b0;
|
||||||
|
17'h1FF22:
|
||||||
17'h1FF22,
|
RST_FF22_N <= 1'b0;
|
||||||
17'h1FF26,
|
17'h1FF26:
|
||||||
17'h1FF2A,
|
RST_FF22_N <= 1'b0;
|
||||||
17'h1FF2E,
|
17'h1FF2A:
|
||||||
17'h0FF22,
|
RST_FF22_N <= 1'b0;
|
||||||
17'h0FF26,
|
17'h1FF2E:
|
||||||
17'h0FF2A,
|
RST_FF22_N <= 1'b0;
|
||||||
|
17'h0FF22:
|
||||||
|
RST_FF22_N <= 1'b0;
|
||||||
|
17'h0FF26:
|
||||||
|
RST_FF22_N <= 1'b0;
|
||||||
|
17'h0FF2A:
|
||||||
|
RST_FF22_N <= 1'b0;
|
||||||
17'h0FF2E:
|
17'h0FF2E:
|
||||||
RST_FF22_N_SFT[0] <= 1'b0;
|
RST_FF22_N <= 1'b0;
|
||||||
|
|
||||||
17'h1FF92:
|
17'h1FF92:
|
||||||
RST_FF92_N_SFT[0] <= 1'b0;
|
RST_FF92_N <= 1'b0;
|
||||||
|
|
||||||
17'h1FF93:
|
17'h1FF93:
|
||||||
|
RST_FF93_N <= 1'b0;
|
||||||
|
17'h0FF94:
|
||||||
|
TMR_RST_N <= 1'b0;
|
||||||
|
17'h0FF95:
|
||||||
|
TMR_RST_N <= 1'b0;
|
||||||
|
default:
|
||||||
begin
|
begin
|
||||||
if (!(FF93_Value == 8'h00))
|
RST_FF00_N <= 1'b1;
|
||||||
RST_FF93_N_SFT[0] <= 1'b0;
|
RST_FF02_N <= 1'b1;
|
||||||
|
// RST_FF20_N <= 1'b1;
|
||||||
|
RST_FF22_N <= 1'b1;
|
||||||
|
RST_FF92_N <= 1'b1;
|
||||||
|
RST_FF93_N <= 1'b1;
|
||||||
|
TMR_RST_N <= 1'b1;
|
||||||
end
|
end
|
||||||
|
|
||||||
default:;
|
|
||||||
|
|
||||||
endcase
|
endcase
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
//***********************************************************************
|
//***********************************************************************
|
||||||
@@ -2218,7 +2116,6 @@ begin
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
// Timer int for COCO3
|
// Timer int for COCO3
|
||||||
// Output TIMER3_FIRQ_N
|
// Output TIMER3_FIRQ_N
|
||||||
// Status TIMER3_FIRQ_STAT_N
|
// Status TIMER3_FIRQ_STAT_N
|
||||||
@@ -2453,22 +2350,18 @@ begin
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
//assign CPU_IRQ_N = ( GIME_IRQ | (HSYNC1_IRQ_N & VSYNC1_IRQ_N))
|
assign CPU_IRQ_N = ( GIME_IRQ | (HSYNC1_IRQ_N & VSYNC1_IRQ_N))
|
||||||
// & (!GIME_IRQ | (TIMER3_IRQ_N & HSYNC3_IRQ_N & VSYNC3_IRQ_N & KEY3_IRQ_N & CART3_IRQ_N));
|
& (!GIME_IRQ | (TIMER3_IRQ_N & HSYNC3_IRQ_N & VSYNC3_IRQ_N & KEY3_IRQ_N & CART3_IRQ_N));
|
||||||
//assign CPU_FIRQ_N = ( GIME_FIRQ | (CART1_FIRQ_N))
|
assign CPU_FIRQ_N = ( GIME_FIRQ | (CART1_FIRQ_N))
|
||||||
// & (!GIME_FIRQ | (TIMER3_FIRQ_N & HSYNC3_FIRQ_N & VSYNC3_FIRQ_N & KEY3_FIRQ_N & CART3_FIRQ_N));
|
& (!GIME_FIRQ | (TIMER3_FIRQ_N & HSYNC3_FIRQ_N & VSYNC3_FIRQ_N & KEY3_FIRQ_N & CART3_FIRQ_N));
|
||||||
|
|
||||||
assign CPU_IRQ_N = HSYNC1_IRQ_N & VSYNC1_IRQ_N
|
|
||||||
& (!GIME_IRQ | (TIMER3_IRQ_N & HSYNC3_IRQ_N & VSYNC3_IRQ_N & CART3_IRQ_N));
|
|
||||||
|
|
||||||
assign CPU_FIRQ_N = CART1_FIRQ_N
|
|
||||||
& (!GIME_FIRQ | (TIMER3_FIRQ_N & HSYNC3_FIRQ_N & VSYNC3_FIRQ_N & CART3_FIRQ_N));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Timer
|
// Timer
|
||||||
assign TMR_CLK = !TIMER_INS ? HSYNC_INT_N:
|
//assign TMR_CLK = !TIMER_INS ? (!H_SYNC_N | !H_FLAG):
|
||||||
|
// CLK3_57MHZ; // 50 MHz / 14 = 3.57 MHz
|
||||||
|
assign TMR_CLK = !TIMER_INS ? !H_SYNC_N:
|
||||||
CLK3_57MHZ; // 14.32Mhz... /4
|
CLK3_57MHZ; // 14.32Mhz... /4
|
||||||
|
//assign CLK3_57MHZ = DIV_14;
|
||||||
|
|
||||||
reg [1:0] DIV_4;
|
reg [1:0] DIV_4;
|
||||||
reg CLK_14_D;
|
reg CLK_14_D;
|
||||||
@@ -2498,148 +2391,52 @@ begin
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
assign TMR_RESET_N = TMR_ENABLE[1]; // Already == 0 when RESET_N is 0
|
|
||||||
|
|
||||||
always @ (negedge clk_sys or negedge RESET_N)
|
|
||||||
|
always @(negedge clk_sys or negedge TMR_RST_N)
|
||||||
begin
|
begin
|
||||||
if(!RESET_N)
|
if(!TMR_RST_N)
|
||||||
begin
|
|
||||||
TMR_ENABLE <= 2'b00;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
if(PH_2)
|
|
||||||
begin
|
|
||||||
case ({RW_N,ADDRESS})
|
|
||||||
17'h0FF94:
|
|
||||||
begin
|
|
||||||
TMR_ENABLE <= 2'b01;
|
|
||||||
end
|
|
||||||
default:
|
|
||||||
begin
|
|
||||||
TMR_ENABLE <= {TMR_ENABLE[0],TMR_ENABLE[0]}; // This is a write
|
|
||||||
end
|
|
||||||
endcase
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
reg TIMER_LOAD;
|
|
||||||
|
|
||||||
always @(negedge clk_sys or negedge TMR_RESET_N)
|
|
||||||
begin
|
|
||||||
if(!TMR_RESET_N)
|
|
||||||
begin
|
begin
|
||||||
TIMER_INT_N <= 1'b1;
|
TIMER_INT_N <= 1'b1;
|
||||||
BLINK <= 1'b0;
|
BLINK <= 1'b1;
|
||||||
TIMER <= 13'h1FFF;
|
TIMER <= 13'h1FFF;
|
||||||
TIMER_LOAD <= 1'b1;
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
// This turns out being TIMER + 1 as in Sockmaster's GIME Reference 1987 GIME
|
|
||||||
// 0 to TMR_MSB,TMR_LSB (0 to TMR_MSB,TMR_LSB is really counts + 1)
|
|
||||||
|
|
||||||
if (TIMER_LOAD)
|
|
||||||
begin
|
|
||||||
TIMER <= {1'b0,TMR_MSB,TMR_LSB};
|
|
||||||
TIMER_LOAD <= 1'b0;
|
|
||||||
end
|
|
||||||
|
|
||||||
if (TMR_CLK == 1'b0 && TMR_CLK_D == 1'b1)
|
if (TMR_CLK == 1'b0 && TMR_CLK_D == 1'b1)
|
||||||
|
begin
|
||||||
|
if(!TMR_ENABLE)
|
||||||
|
begin
|
||||||
|
TIMER_INT_N <= 1'b1;
|
||||||
|
BLINK <= 1'b1;
|
||||||
|
TIMER <= 13'h1FFF;
|
||||||
|
end
|
||||||
|
else
|
||||||
begin
|
begin
|
||||||
case (TIMER)
|
case (TIMER)
|
||||||
13'h0000:
|
13'h0000:
|
||||||
begin
|
|
||||||
if(({TMR_MSB,TMR_LSB} == 12'h000))
|
|
||||||
begin
|
begin
|
||||||
TIMER_INT_N <= 1'b0;
|
TIMER_INT_N <= 1'b0;
|
||||||
TIMER <= 13'h0000;
|
|
||||||
BLINK <= 1'b0;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
begin
|
|
||||||
TIMER_INT_N <= 1'b1;
|
|
||||||
TIMER <= {1'b0,TMR_MSB,TMR_LSB};
|
|
||||||
BLINK <= !BLINK;
|
BLINK <= !BLINK;
|
||||||
|
TIMER <= 13'h1FFF;
|
||||||
end
|
end
|
||||||
end
|
13'h1FFF: //Maybe this should be 1XXX
|
||||||
13'h0001:
|
|
||||||
begin
|
begin
|
||||||
TIMER_INT_N <= 1'b0;
|
|
||||||
TIMER <= 13'h0000;
|
|
||||||
end
|
|
||||||
default:
|
|
||||||
begin
|
|
||||||
if(TIMER[12])
|
|
||||||
TIMER <= {1'b0,TMR_MSB,TMR_LSB};
|
|
||||||
else
|
|
||||||
TIMER <= TIMER - 1'b1;
|
|
||||||
end
|
|
||||||
endcase
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//reg TIMER_LOAD;
|
|
||||||
|
|
||||||
//always @(negedge clk_sys or negedge TMR_RESET_N)
|
|
||||||
//begin
|
|
||||||
// if(!TMR_RESET_N)
|
|
||||||
// begin
|
|
||||||
// TIMER_INT_N <= 1'b1;
|
|
||||||
// BLINK <= 1'b0;
|
|
||||||
// TIMER <= 13'h1FFF;
|
|
||||||
// TIMER_LOAD <= 1'b1;
|
|
||||||
// end
|
|
||||||
// else
|
|
||||||
// begin
|
|
||||||
|
|
||||||
// This turns out being TIMER + 2 as in Sockmaster's GIME Reference 1986 GIME
|
// This turns out being TIMER + 2 as in Sockmaster's GIME Reference 1986 GIME
|
||||||
// 0 to TIMER-1 (0 to TIMER is really TIMER counts + 1)
|
// 0 to TIMER-1 (0 to TIMER is really TIMER counts + 1)
|
||||||
// This timer goes from 0 directly to 1FFF where it loads the timer count and decrements from there
|
// This timer goes from 0 directly to 1FFF where it loads the timer count and decrements from there
|
||||||
// So 1FFF to TIMER to 0 is TIMER + 2 counts
|
// So 1FFF to TIMER to 0 is TIMER + 2 counts
|
||||||
|
TIMER_INT_N <= 1'b1;
|
||||||
// if (TIMER_LOAD)
|
if({TMR_MSB,TMR_LSB} != 12'h000)
|
||||||
// begin
|
TIMER <= {1'b0,TMR_MSB,TMR_LSB};
|
||||||
// TIMER <= {1'b0,TMR_MSB,TMR_LSB};
|
end
|
||||||
// TIMER_LOAD <= 1'b0;
|
default:
|
||||||
// end
|
TIMER <= TIMER - 1'b1;
|
||||||
|
endcase
|
||||||
// if (!TIMER_INT_N)
|
end
|
||||||
// begin
|
end
|
||||||
// TIMER_INT_N <= 1'b1;
|
end
|
||||||
// TIMER <= {1'b0,TMR_MSB,TMR_LSB};
|
end
|
||||||
// end
|
|
||||||
|
|
||||||
// if (TMR_CLK == 1'b0 && TMR_CLK_D == 1'b1)
|
|
||||||
// begin
|
|
||||||
|
|
||||||
// case (TIMER)
|
|
||||||
// 13'h0000:
|
|
||||||
// begin
|
|
||||||
// if(({TMR_MSB,TMR_LSB} == 12'h000))
|
|
||||||
// begin
|
|
||||||
// TIMER_INT_N <= 1'b0;
|
|
||||||
// TIMER <= 13'h0000;
|
|
||||||
// BLINK <= 1'b0;
|
|
||||||
// end
|
|
||||||
// else
|
|
||||||
// begin
|
|
||||||
// TIMER_INT_N <= 1'b0;
|
|
||||||
// BLINK <= !BLINK;
|
|
||||||
// end
|
|
||||||
// end
|
|
||||||
// default:
|
|
||||||
// begin
|
|
||||||
// TIMER <= TIMER - 1'b1;
|
|
||||||
// end
|
|
||||||
// endcase
|
|
||||||
// end
|
|
||||||
// end
|
|
||||||
//end
|
|
||||||
|
|
||||||
reg sync_rst1;
|
reg sync_rst1;
|
||||||
|
|
||||||
@@ -2720,6 +2517,7 @@ begin
|
|||||||
CART3_FIRQ_INT <= 1'b0;
|
CART3_FIRQ_INT <= 1'b0;
|
||||||
// FF94
|
// FF94
|
||||||
TMR_MSB <= 4'h0;
|
TMR_MSB <= 4'h0;
|
||||||
|
TMR_ENABLE <= 1'b0;
|
||||||
// FF95
|
// FF95
|
||||||
TMR_LSB <= 8'h00;
|
TMR_LSB <= 8'h00;
|
||||||
// FF98
|
// FF98
|
||||||
@@ -3026,6 +2824,7 @@ begin
|
|||||||
16'hFF94:
|
16'hFF94:
|
||||||
begin
|
begin
|
||||||
TMR_MSB <= DATA_OUT[3:0];
|
TMR_MSB <= DATA_OUT[3:0];
|
||||||
|
TMR_ENABLE <= 1'b1;
|
||||||
end
|
end
|
||||||
16'hFF95:
|
16'hFF95:
|
||||||
begin
|
begin
|
||||||
@@ -3836,7 +3635,7 @@ begin
|
|||||||
// RED[3:0] <= 4'B0000;
|
// RED[3:0] <= 4'B0000;
|
||||||
// GREEN[3:0] <= 4'B0000;
|
// GREEN[3:0] <= 4'B0000;
|
||||||
// BLUE[3:0] <= 4'B0000;
|
// BLUE[3:0] <= 4'B0000;
|
||||||
// VGA_SYNC_N <= 1'b1;
|
VGA_SYNC_N <= 1'b1;
|
||||||
|
|
||||||
MISTER_HBLANK_D[3] <= ~HBORDER;
|
MISTER_HBLANK_D[3] <= ~HBORDER;
|
||||||
MISTER_HBLANK_D[2:0] <= MISTER_HBLANK_D[3:1];
|
MISTER_HBLANK_D[2:0] <= MISTER_HBLANK_D[3:1];
|
||||||
|
|||||||
@@ -61,47 +61,23 @@
|
|||||||
// This file is a configuration definition file. The CoCo3FPGA for MiSTer source files
|
// This file is a configuration definition file. The CoCo3FPGA for MiSTer source files
|
||||||
// can be built into multiple objects which have mutually exclusive features.
|
// can be built into multiple objects which have mutually exclusive features.
|
||||||
|
|
||||||
`define Config_Debug_FLAG 4'hA
|
`include "../rtl/config_inc.v"
|
||||||
localparam [7:0] FEATURE_1 = 8'h01;
|
|
||||||
localparam [7:0] FEATURE_2 = 8'h02;
|
|
||||||
localparam [7:0] FEATURE_3 = 8'h04;
|
|
||||||
localparam [7:0] FEATURE_4 = 8'h08;
|
|
||||||
localparam [7:0] FEATURE_5 = 8'h10;
|
|
||||||
localparam [7:0] FEATURE_6 = 8'h20;
|
|
||||||
localparam [7:0] FEATURE_7 = 8'h40;
|
|
||||||
localparam [7:0] FEATURE_8 = 8'h80;
|
|
||||||
|
|
||||||
// This is used for hardware debugging - it overrides the USER_IO to be user_out direct.
|
// If defined the Config_Debug sets the FEATURE MASKS all OR'd together which appears on COCO space at FFF1 & (FFF0 = 0x55 as a debug flag)
|
||||||
// It should be commented out for release
|
|
||||||
//`define Config_Debug
|
//`define Config_Debug
|
||||||
|
|
||||||
// Feature list - note only FEATURE_1 - FEATURE_8 are supported
|
// Feature list - note only FEATURE_1 - FEATURE_8 are supported
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// `set_feature(CoCo3_Horz_INT_FIX,Feat_1) // Connection of the horz int to the Mister CoCo3 V5 rasterizer
|
`set_feature(CoCo3_Horz_INT_FIX, FEATURE_1) // Connection of the horz int to the Mister CoCo3 V5 rasterizer
|
||||||
`define CoCo3_Horz_INT_FIX
|
|
||||||
`define Feat_1
|
|
||||||
|
|
||||||
// `set_feature(CoCo3_Vert_INT_FIX,Feat_2) // Connection of the vert int to the Mister CoCo3 V5 rasterizer
|
//`set_feature(CoCo3_Vert_INT_FIX, FEATURE_2) // Connection of the vert int to the Mister CoCo3 V5 rasterizer
|
||||||
// `define CoCo3_Vert_INT_FIX
|
|
||||||
// `define Feat_2
|
|
||||||
|
|
||||||
// `set_feature(CoCo3_CYC_ACC_6809,Feat_3) // Use cycle accurate 6809
|
`set_feature(CoCo3_CYC_ACC_6809, FEATURE_3) // Use cycle accurate 6809
|
||||||
`define CoCo3_CYC_ACC_6809
|
|
||||||
`define Feat_3
|
|
||||||
|
|
||||||
// `set_feature(CoCo3_sdc_override_size,Feat_4) // Define static size value
|
`set_feature(CoCo3_sdc_override_size, FEATURE_4) // Define static size value
|
||||||
`define CoCo3_sdc_override_size
|
|
||||||
`define Feat_4
|
|
||||||
|
|
||||||
// `set_feature(CoCo3_sdc_fix_os9_driver,Feat_5) // fix sdc query disk size issue in llcocosdc driver in multipak enviroment
|
`set_feature(CoCo3_sdc_fix_os9_driver, FEATURE_5) // fix sdc query disk size issue in llcocosdc driver in multipak enviroment
|
||||||
`define CoCo3_sdc_fix_os9_driver
|
|
||||||
`define Feat_5
|
|
||||||
|
|
||||||
// `set_feature(CoCo3_disable_GART_in_GIMEX,Feat_6) // Disable GIMEX ram transfers [GIMEX detection in OS9 EOU]
|
`set_feature(CoCo3_disable_GART_in_GIMEX, FEATURE_6)// Disable GIMEX ram transfers [GIMEX detection in OS( EOU]
|
||||||
`define CoCo3_disable_GART_in_GIMEX
|
|
||||||
`define Feat_6
|
|
||||||
|
|
||||||
// `set_feature(CoCo3_Select_GIMEX_RAST,Feat_7) // Use GIMEX Rasterizer Engine
|
|
||||||
// `define CoCo3_Select_GIMEX_RAST
|
|
||||||
// `define Feat_7
|
|
||||||
|
|
||||||
|
//`set_feature(CoCo3_Select_GIMEX_RAST, FEATURE_7) // Use GIMEX Rasterizer Engine
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Project Name: CoCo3FPGA Version 5.x.x
|
||||||
|
// File Name: config_inc.v
|
||||||
|
//
|
||||||
|
// CoCo3 in an FPGA
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// CPU section copyrighted by John Kent
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Color Computer 3 compatible system on a chip
|
||||||
|
//
|
||||||
|
// Version : 5.x
|
||||||
|
//
|
||||||
|
// Copyright (c) 2008 Gary Becker ([email protected])
|
||||||
|
//
|
||||||
|
// All rights reserved
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and synthezised forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are met:
|
||||||
|
//
|
||||||
|
// Redistributions of source code must retain the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer.
|
||||||
|
//
|
||||||
|
// Redistributions in synthesized form must reproduce the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer in the
|
||||||
|
// documentation and/or other materials provided with the distribution.
|
||||||
|
//
|
||||||
|
// Neither the name of the author nor the names of other contributors may
|
||||||
|
// be used to endorse or promote products derived from this software without
|
||||||
|
// specific prior written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
|
||||||
|
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
// POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
//
|
||||||
|
// Please report bugs to the author, but before you do so, please
|
||||||
|
// make sure that this is not a derivative work and that
|
||||||
|
// you have the latest version of this file.
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Gary Becker
|
||||||
|
// [email protected]
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// MISTer Conversion by Stan Hodge and Alan Steremberg (& Gary Becker)
|
||||||
|
// [email protected]
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// This file is a configuration definition include file. The CoCo3FPGA for MiSTer source files
|
||||||
|
// can be built into multiple objects which have mutually exclusive features.
|
||||||
|
|
||||||
|
`define Config_Debug_Value (`config_num_1 | `config_num_2 | `config_num_3 | `config_num_4 | `config_num_5 | `config_num_6 | `config_num_7 | `config_num_8)
|
||||||
|
`define Config_Debug_FLAG 8'h55
|
||||||
|
`define FEATURE_1 8'h01
|
||||||
|
`define FEATURE_2 8'h02
|
||||||
|
`define FEATURE_3 8'h04
|
||||||
|
`define FEATURE_4 8'h08
|
||||||
|
`define FEATURE_5 8'h10
|
||||||
|
`define FEATURE_6 8'h20
|
||||||
|
`define FEATURE_7 8'h40
|
||||||
|
`define FEATURE_8 8'h80
|
||||||
|
`define config_num_1 8'h00
|
||||||
|
`define config_num_2 8'h00
|
||||||
|
`define config_num_3 8'h00
|
||||||
|
`define config_num_4 8'h00
|
||||||
|
`define config_num_5 8'h00
|
||||||
|
`define config_num_6 8'h00
|
||||||
|
`define config_num_7 8'h00
|
||||||
|
`define config_num_8 8'h00
|
||||||
|
|
||||||
|
`define set_feature(Feat_Name, Feat_Mask) \
|
||||||
|
`define Feat_Name \
|
||||||
|
`ifndef config_value_1 \
|
||||||
|
`define config_value_1 Feat_Mask \
|
||||||
|
`define config_num_1 Feat_Mask \
|
||||||
|
`else \
|
||||||
|
`ifndef config_value_2 \
|
||||||
|
`define config_value_2 Feat_Mask \
|
||||||
|
`define config_num_2 Feat_Mask \
|
||||||
|
`else \
|
||||||
|
`ifndef config_value_3 \
|
||||||
|
`define config_value_3 Feat_Mask \
|
||||||
|
`define config_num_3 Feat_Mask \
|
||||||
|
`else \
|
||||||
|
`ifndef config_value_4 \
|
||||||
|
`define config_value_4 Feat_Mask \
|
||||||
|
`define config_num_4 Feat_Mask \
|
||||||
|
`else \
|
||||||
|
`ifndef config_value_5 \
|
||||||
|
`define config_value_5 Feat_Mask \
|
||||||
|
`define config_num_5 Feat_Mask \
|
||||||
|
`else \
|
||||||
|
`ifndef config_value_6 \
|
||||||
|
`define config_value_6 Feat_Mask \
|
||||||
|
`define config_num_6 Feat_Mask \
|
||||||
|
`else \
|
||||||
|
`ifndef config_value_7 \
|
||||||
|
`define config_value_7 Feat_Mask \
|
||||||
|
`define config_num_7 Feat_Mask \
|
||||||
|
`else \
|
||||||
|
`ifndef config_value_8 \
|
||||||
|
`define config_value_8 Feat_Mask \
|
||||||
|
`define config_num_8 Feat_Mask \
|
||||||
|
`endif \
|
||||||
|
`endif \
|
||||||
|
`endif \
|
||||||
|
`endif \
|
||||||
|
`endif \
|
||||||
|
`endif \
|
||||||
|
`endif \
|
||||||
|
`endif
|
||||||
+89
-213
@@ -135,10 +135,6 @@ wire [3:0] DRIVE_SEL_EXT_PRE = {DATA_IN[6], DATA_IN[2:0]};
|
|||||||
reg [2:0] drive_index;
|
reg [2:0] drive_index;
|
||||||
|
|
||||||
// SD blk system is a array of 4 systems - one for each drive.
|
// SD blk system is a array of 4 systems - one for each drive.
|
||||||
// To keep disk track memory, we created 4 wd1793's to match the sd block interfaces
|
|
||||||
// For the interface back to the coco - we need to isolate the wd1793 the computer is talking
|
|
||||||
// to and route those feedback signals back to the coco. This is accomplished via the drive
|
|
||||||
// select. 'drive_index' identifies which controller is addressd.
|
|
||||||
|
|
||||||
|
|
||||||
always @(negedge FF40_CLK or negedge RESET_N)
|
always @(negedge FF40_CLK or negedge RESET_N)
|
||||||
@@ -182,7 +178,7 @@ begin
|
|||||||
4'b1001:
|
4'b1001:
|
||||||
drive_index <= 3'd1;
|
drive_index <= 3'd1;
|
||||||
default:
|
default:
|
||||||
drive_index <= 3'd1; // Illegal
|
drive_index <= 3'd0; // Illegal
|
||||||
endcase
|
endcase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -212,13 +208,12 @@ wire DRQ[4];
|
|||||||
wire selected_DRQ;
|
wire selected_DRQ;
|
||||||
wire selected_INTRQ;
|
wire selected_INTRQ;
|
||||||
|
|
||||||
wire WR[4];
|
wire WR;
|
||||||
wire RD[4];
|
wire RD;
|
||||||
wire RD_E[4];
|
wire RD_E;
|
||||||
//wire CE;
|
//wire CE;
|
||||||
wire HALT_EN_RST;
|
wire HALT_EN_RST;
|
||||||
wire [7:0] DATA_1793;
|
wire [7:0] DATA_1793;
|
||||||
wire [7:0] dout[4];
|
|
||||||
reg read;
|
reg read;
|
||||||
reg write;
|
reg write;
|
||||||
reg read_d;
|
reg read_d;
|
||||||
@@ -230,11 +225,7 @@ reg read1;
|
|||||||
reg write1;
|
reg write1;
|
||||||
reg [1:0] ADDRESS_L;
|
reg [1:0] ADDRESS_L;
|
||||||
|
|
||||||
|
assign RD = read || RD_E;
|
||||||
assign RD[0] = (read || RD_E[0]) && (drive_index == 2'd1);
|
|
||||||
assign RD[1] = (read || RD_E[1]) && (drive_index == 3'd2);
|
|
||||||
assign RD[2] = (read || RD_E[2]) && (drive_index == 3'd3);
|
|
||||||
assign RD[3] = (read || RD_E[3]) && (drive_index == 3'd4);
|
|
||||||
|
|
||||||
// The idea here is to "stretch" the CPU read and write signals to ensure we catch a 8 mhz enable.
|
// The idea here is to "stretch" the CPU read and write signals to ensure we catch a 8 mhz enable.
|
||||||
// For writes we will buffer the data out to ensure it does not go away.
|
// For writes we will buffer the data out to ensure it does not go away.
|
||||||
@@ -253,14 +244,8 @@ begin
|
|||||||
write_d <= 1'b0;
|
write_d <= 1'b0;
|
||||||
r_w_active <= 1'b0;
|
r_w_active <= 1'b0;
|
||||||
clk_8Mhz_enable_found <= 1'b0;
|
clk_8Mhz_enable_found <= 1'b0;
|
||||||
WR[0] <= 1'b0;
|
WR <= 1'b0;
|
||||||
WR[1] <= 1'b0;
|
RD_E <= 1'b0;
|
||||||
WR[2] <= 1'b0;
|
|
||||||
WR[3] <= 1'b0;
|
|
||||||
RD_E[0] <= 1'b0;
|
|
||||||
RD_E[1] <= 1'b0;
|
|
||||||
RD_E[2] <= 1'b0;
|
|
||||||
RD_E[3] <= 1'b0;
|
|
||||||
read1 <= 1'b0;
|
read1 <= 1'b0;
|
||||||
write1 <= 1'b0;
|
write1 <= 1'b0;
|
||||||
read <= 1'b0;
|
read <= 1'b0;
|
||||||
@@ -293,32 +278,14 @@ begin
|
|||||||
begin
|
begin
|
||||||
// Set Writes
|
// Set Writes
|
||||||
r_w_active <= 1'b1;
|
r_w_active <= 1'b1;
|
||||||
case (drive_index)
|
WR <= 1'b1;
|
||||||
3'd1:
|
|
||||||
WR[0] <= 1'b1;
|
|
||||||
3'd2:
|
|
||||||
WR[1] <= 1'b1;
|
|
||||||
3'd3:
|
|
||||||
WR[2] <= 1'b1;
|
|
||||||
3'd4:
|
|
||||||
WR[3] <= 1'b1;
|
|
||||||
endcase
|
|
||||||
end
|
end
|
||||||
|
|
||||||
// Synchronus rising edge of read
|
// Synchronus rising edge of read
|
||||||
if ((read == 1'b1) && (read_d == 1'b0))
|
if ((read == 1'b1) && (read_d == 1'b0))
|
||||||
begin
|
begin
|
||||||
r_w_active <= 1'b1;
|
r_w_active <= 1'b1;
|
||||||
case (drive_index)
|
RD_E <= 1'b1;
|
||||||
3'd1:
|
|
||||||
RD_E[0] <= 1'b1;
|
|
||||||
3'd2:
|
|
||||||
RD_E[1] <= 1'b1;
|
|
||||||
3'd3:
|
|
||||||
RD_E[2] <= 1'b1;
|
|
||||||
3'd4:
|
|
||||||
RD_E[3] <= 1'b1;
|
|
||||||
endcase
|
|
||||||
end
|
end
|
||||||
|
|
||||||
// Clears
|
// Clears
|
||||||
@@ -331,48 +298,54 @@ begin
|
|||||||
clk_8Mhz_enable_found <= 1'b0;
|
clk_8Mhz_enable_found <= 1'b0;
|
||||||
r_w_active <= 1'b0;
|
r_w_active <= 1'b0;
|
||||||
|
|
||||||
WR[0] <= 1'b0;
|
WR <= 1'b0;
|
||||||
WR[1] <= 1'b0;
|
|
||||||
WR[2] <= 1'b0;
|
|
||||||
WR[3] <= 1'b0;
|
|
||||||
|
|
||||||
RD_E[0] <= 1'b0;
|
RD_E <= 1'b0;
|
||||||
RD_E[1] <= 1'b0;
|
|
||||||
RD_E[2] <= 1'b0;
|
|
||||||
RD_E[3] <= 1'b0;
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
// NMI from disk controller
|
|
||||||
// Selected INTRQ
|
|
||||||
assign selected_INTRQ = (drive_index == 3'd1) ? INTRQ[0]:
|
|
||||||
(drive_index == 3'd2) ? INTRQ[1]:
|
|
||||||
(drive_index == 3'd3) ? INTRQ[2]:
|
|
||||||
(drive_index == 3'd4) ? INTRQ[3]:
|
|
||||||
1'b0;
|
|
||||||
|
|
||||||
assign NMI_09 = DENSITY & selected_INTRQ; // Send NMI if Double Density (Halt Mode)
|
assign NMI_09 = DENSITY & selected_INTRQ; // Send NMI if Double Density (Halt Mode)
|
||||||
|
|
||||||
// HALT from disk controller
|
|
||||||
// Selected DRQ
|
|
||||||
assign selected_DRQ = (drive_index == 3'd1) ? DRQ[0]:
|
|
||||||
(drive_index == 3'd2) ? DRQ[1]:
|
|
||||||
(drive_index == 3'd3) ? DRQ[2]:
|
|
||||||
(drive_index == 3'd4) ? DRQ[3]:
|
|
||||||
1'b1;
|
|
||||||
|
|
||||||
|
|
||||||
assign HALT = (HALT_EN & ~selected_DRQ);
|
assign HALT = (HALT_EN & ~selected_DRQ);
|
||||||
|
|
||||||
assign HALT_EN_RST = RESET_N & ~selected_INTRQ; // From controller schematic
|
assign HALT_EN_RST = RESET_N & ~selected_INTRQ; // From controller schematic
|
||||||
|
|
||||||
// Data bus selection
|
assign sd_lba[0] = wd1793_sd_lba;
|
||||||
assign DATA_1793 = (drive_index == 3'd1) ? dout[0]:
|
assign sd_lba[1] = wd1793_sd_lba;
|
||||||
(drive_index == 3'd2) ? dout[1]:
|
assign sd_lba[2] = wd1793_sd_lba;
|
||||||
(drive_index == 3'd3) ? dout[2]:
|
assign sd_lba[3] = wd1793_sd_lba;
|
||||||
(drive_index == 3'd4) ? dout[3]:
|
|
||||||
8'd0;
|
assign sd_rd[0] = (drive_index == 3'd1) ? wd1793_sd_rd:
|
||||||
|
1'b0;
|
||||||
|
assign sd_rd[1] = (drive_index == 3'd2) ? wd1793_sd_rd:
|
||||||
|
1'b0;
|
||||||
|
assign sd_rd[2] = (drive_index == 3'd3) ? wd1793_sd_rd:
|
||||||
|
1'b0;
|
||||||
|
assign sd_rd[3] = (drive_index == 3'd4) ? wd1793_sd_rd:
|
||||||
|
1'b0;
|
||||||
|
|
||||||
|
assign sd_wr[0] = (drive_index == 3'd1) ? wd1793_sd_wr:
|
||||||
|
1'b0;
|
||||||
|
assign sd_wr[1] = (drive_index == 3'd2) ? wd1793_sd_wr:
|
||||||
|
1'b0;
|
||||||
|
assign sd_wr[2] = (drive_index == 3'd3) ? wd1793_sd_wr:
|
||||||
|
1'b0;
|
||||||
|
assign sd_wr[3] = (drive_index == 3'd4) ? wd1793_sd_wr:
|
||||||
|
1'b0;
|
||||||
|
|
||||||
|
assign wd1793_sd_ack = (drive_index == 3'd1) ? sd_ack[0]:
|
||||||
|
(drive_index == 3'd2) ? sd_ack[1]:
|
||||||
|
(drive_index == 3'd3) ? sd_ack[2]:
|
||||||
|
(drive_index == 3'd4) ? sd_ack[3]:
|
||||||
|
sd_ack[0]; // default is drive 1
|
||||||
|
|
||||||
|
assign sd_buff_din[0] = wd1793_sd_buff_din;
|
||||||
|
assign sd_buff_din[1] = wd1793_sd_buff_din;
|
||||||
|
assign sd_buff_din[2] = wd1793_sd_buff_din;
|
||||||
|
assign sd_buff_din[3] = wd1793_sd_buff_din;
|
||||||
|
|
||||||
|
|
||||||
// The SD_BLK interface and thus the wd1793 will allways transfer 1 blk. This is blk qty - 1 per spec.
|
// The SD_BLK interface and thus the wd1793 will allways transfer 1 blk. This is blk qty - 1 per spec.
|
||||||
@@ -385,6 +358,13 @@ reg drive_wp[4];
|
|||||||
reg [3:0] drive_ready = 4'B0000;
|
reg [3:0] drive_ready = 4'B0000;
|
||||||
reg [3:0] double_sided = 4'B0000;
|
reg [3:0] double_sided = 4'B0000;
|
||||||
reg [23:0] drive_size[4];
|
reg [23:0] drive_size[4];
|
||||||
|
wire [23:0] selected_drive_size;
|
||||||
|
wire [31:0] wd1793_sd_lba;
|
||||||
|
wire wd1793_sd_rd;
|
||||||
|
wire wd1793_sd_wr;
|
||||||
|
wire wd1793_sd_ack;
|
||||||
|
wire [7:0] wd1793_sd_buff_din;
|
||||||
|
wire selected_drive_ready, selected_drive_wp, selected_double_sided;
|
||||||
|
|
||||||
|
|
||||||
// As drives are mounted in MISTer this logic saves the write protect and generates ready for
|
// As drives are mounted in MISTer this logic saves the write protect and generates ready for
|
||||||
@@ -433,6 +413,28 @@ begin
|
|||||||
//double_sided[3]<= img_size > 20'd368600;//20'd368640;
|
//double_sided[3]<= img_size > 20'd368600;//20'd368640;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
assign selected_drive_size = (drive_index == 3'd1) ? drive_size[0]:
|
||||||
|
(drive_index == 3'd2) ? drive_size[1]:
|
||||||
|
(drive_index == 3'd3) ? drive_size[2]:
|
||||||
|
(drive_index == 3'd4) ? drive_size[3]:
|
||||||
|
drive_size[0]; // default is drive 1
|
||||||
|
|
||||||
|
assign selected_drive_wp = (drive_index == 3'd1) ? drive_wp[0]:
|
||||||
|
(drive_index == 3'd2) ? drive_wp[1]:
|
||||||
|
(drive_index == 3'd3) ? drive_wp[2]:
|
||||||
|
(drive_index == 3'd4) ? drive_wp[3]:
|
||||||
|
drive_wp[0]; // default is drive 1
|
||||||
|
|
||||||
|
assign selected_double_sided= (drive_index == 3'd1) ? double_sided[0]:
|
||||||
|
(drive_index == 3'd2) ? double_sided[1]:
|
||||||
|
(drive_index == 3'd3) ? double_sided[2]:
|
||||||
|
double_sided[0]; // default is drive 1
|
||||||
|
|
||||||
|
assign selected_drive_ready = (drive_index == 3'd1) ? drive_ready[0]:
|
||||||
|
(drive_index == 3'd2) ? drive_ready[1]:
|
||||||
|
(drive_index == 3'd3) ? drive_ready[2]:
|
||||||
|
(drive_index == 3'd4) ? drive_ready[3]:
|
||||||
|
1'b0; // default is not ready
|
||||||
|
|
||||||
wd1793 #(1,0) coco_wd1793_0
|
wd1793 #(1,0) coco_wd1793_0
|
||||||
(
|
(
|
||||||
@@ -440,160 +442,34 @@ wd1793 #(1,0) coco_wd1793_0
|
|||||||
.ce(ena_8Mhz),
|
.ce(ena_8Mhz),
|
||||||
.reset(~RESET_N),
|
.reset(~RESET_N),
|
||||||
.io_en(1'b1),
|
.io_en(1'b1),
|
||||||
.rd(RD[0]),
|
.rd(RD),
|
||||||
.wr(WR[0]),
|
.wr(WR),
|
||||||
.addr(ADDRESS_L[1:0]),
|
.addr(ADDRESS_L[1:0]),
|
||||||
.din(DATA_IN_L),
|
.din(DATA_IN_L),
|
||||||
.dout(dout[0]),
|
.dout(DATA_1793),
|
||||||
.drq(DRQ[0]),
|
.drq(selected_DRQ),
|
||||||
.intrq(INTRQ[0]),
|
.intrq(selected_INTRQ),
|
||||||
|
|
||||||
.img_mounted(1'b0),
|
.img_mounted(1'b0),
|
||||||
.img_mounted_overide(1'b1),
|
.img_mounted_overide(1'b1),
|
||||||
.img_size(drive_size[0]),
|
.img_size(selected_drive_size[19:0]),
|
||||||
|
|
||||||
.sd_lba(sd_lba[0]),
|
.sd_lba(wd1793_sd_lba),
|
||||||
.sd_rd(sd_rd[0]),
|
.sd_rd(wd1793_sd_rd),
|
||||||
.sd_wr(sd_wr[0]),
|
.sd_wr(wd1793_sd_wr),
|
||||||
.sd_ack(sd_ack[0]),
|
.sd_ack(wd1793_sd_ack),
|
||||||
|
|
||||||
.sd_buff_addr(sd_buff_addr),
|
.sd_buff_addr(sd_buff_addr),
|
||||||
.sd_buff_dout(sd_buff_dout),
|
.sd_buff_dout(sd_buff_dout),
|
||||||
.sd_buff_din(sd_buff_din[0]),
|
.sd_buff_din(wd1793_sd_buff_din),
|
||||||
.sd_buff_wr(sd_buff_wr),
|
.sd_buff_wr(sd_buff_wr),
|
||||||
|
|
||||||
.wp(drive_wp[0]),
|
.wp(selected_drive_wp),
|
||||||
|
|
||||||
.size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard
|
.size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard
|
||||||
.layout(~double_sided[0]), // 0 = Track-Side-Sector, 1 - Side-Track-Sector
|
.layout(~selected_double_sided), // 0 = Track-Side-Sector, 1 - Side-Track-Sector
|
||||||
.side(double_sided[0] & DRIVE_SEL_EXT[3]),
|
.side(selected_double_sided & DRIVE_SEL_EXT[3]),
|
||||||
.ready(drive_ready[0]),
|
.ready(selected_drive_ready),
|
||||||
|
|
||||||
.input_active(0), // Section not used
|
|
||||||
.input_addr(0),
|
|
||||||
.input_data(0),
|
|
||||||
.input_wr(0),
|
|
||||||
.buff_din(0)
|
|
||||||
);
|
|
||||||
|
|
||||||
wd1793 #(1,0) coco_wd1793_1
|
|
||||||
(
|
|
||||||
.clk_sys(~CLK),
|
|
||||||
.ce(ena_8Mhz),
|
|
||||||
.reset(~RESET_N),
|
|
||||||
.io_en(1'b1),
|
|
||||||
.rd(RD[1]),
|
|
||||||
.wr(WR[1]),
|
|
||||||
.addr(ADDRESS_L[1:0]),
|
|
||||||
.din(DATA_IN_L),
|
|
||||||
.dout(dout[1]),
|
|
||||||
.drq(DRQ[1]),
|
|
||||||
.intrq(INTRQ[1]),
|
|
||||||
|
|
||||||
.img_mounted(1'b0),
|
|
||||||
.img_mounted_overide(1'b1),
|
|
||||||
.img_size(drive_size[1]),
|
|
||||||
|
|
||||||
.sd_lba(sd_lba[1]),
|
|
||||||
.sd_rd(sd_rd[1]),
|
|
||||||
.sd_wr(sd_wr[1]),
|
|
||||||
.sd_ack(sd_ack[1]),
|
|
||||||
|
|
||||||
.sd_buff_addr(sd_buff_addr),
|
|
||||||
.sd_buff_dout(sd_buff_dout),
|
|
||||||
.sd_buff_din(sd_buff_din[1]),
|
|
||||||
.sd_buff_wr(sd_buff_wr),
|
|
||||||
|
|
||||||
.wp(drive_wp[1]),
|
|
||||||
|
|
||||||
.size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard
|
|
||||||
.layout(~double_sided[1]), // 0 = Track-Side-Sector, 1 - Side-Track-Sector
|
|
||||||
.side(double_sided[1] & DRIVE_SEL_EXT[3]),
|
|
||||||
.ready(drive_ready[1]),
|
|
||||||
|
|
||||||
.input_active(0), // Section not used
|
|
||||||
.input_addr(0),
|
|
||||||
.input_data(0),
|
|
||||||
.input_wr(0),
|
|
||||||
.buff_din(0)
|
|
||||||
);
|
|
||||||
|
|
||||||
wd1793 #(1,0) coco_wd1793_2
|
|
||||||
(
|
|
||||||
.clk_sys(~CLK),
|
|
||||||
.ce(ena_8Mhz),
|
|
||||||
.reset(~RESET_N),
|
|
||||||
.io_en(1'b1),
|
|
||||||
.rd(RD[2]),
|
|
||||||
.wr(WR[2]),
|
|
||||||
.addr(ADDRESS_L[1:0]),
|
|
||||||
.din(DATA_IN_L),
|
|
||||||
.dout(dout[2]),
|
|
||||||
.drq(DRQ[2]),
|
|
||||||
.intrq(INTRQ[2]),
|
|
||||||
|
|
||||||
.img_mounted(1'b0),
|
|
||||||
.img_mounted_overide(1'b1),
|
|
||||||
.img_size(drive_size[2]),
|
|
||||||
|
|
||||||
.sd_lba(sd_lba[2]),
|
|
||||||
.sd_rd(sd_rd[2]),
|
|
||||||
.sd_wr(sd_wr[2]),
|
|
||||||
.sd_ack(sd_ack[2]),
|
|
||||||
|
|
||||||
.sd_buff_addr(sd_buff_addr),
|
|
||||||
.sd_buff_dout(sd_buff_dout),
|
|
||||||
.sd_buff_din(sd_buff_din[2]),
|
|
||||||
.sd_buff_wr(sd_buff_wr),
|
|
||||||
|
|
||||||
.wp(drive_wp[2]),
|
|
||||||
|
|
||||||
.size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard
|
|
||||||
.layout(~double_sided[2]), // 0 = Track-Side-Sector, 1 - Side-Track-Sector
|
|
||||||
.side(double_sided[2] & DRIVE_SEL_EXT[3]),
|
|
||||||
.ready(drive_ready[2]),
|
|
||||||
|
|
||||||
.input_active(0), // Section not used
|
|
||||||
.input_addr(0),
|
|
||||||
.input_data(0),
|
|
||||||
.input_wr(0),
|
|
||||||
.buff_din(0)
|
|
||||||
);
|
|
||||||
|
|
||||||
wd1793 #(1,0) coco_wd1793_3
|
|
||||||
(
|
|
||||||
.clk_sys(~CLK),
|
|
||||||
.ce(ena_8Mhz),
|
|
||||||
.reset(~RESET_N),
|
|
||||||
.io_en(1'b1),
|
|
||||||
.rd(RD[3]),
|
|
||||||
.wr(WR[3]),
|
|
||||||
.addr(ADDRESS_L[1:0]),
|
|
||||||
.din(DATA_IN_L),
|
|
||||||
.dout(dout[3]),
|
|
||||||
.drq(DRQ[3]),
|
|
||||||
.intrq(INTRQ[3]),
|
|
||||||
|
|
||||||
.img_mounted(1'b0),
|
|
||||||
.img_mounted_overide(1'b1),
|
|
||||||
.img_size(drive_size[3]),
|
|
||||||
|
|
||||||
.sd_lba(sd_lba[3]),
|
|
||||||
.sd_rd(sd_rd[3]),
|
|
||||||
.sd_wr(sd_wr[3]),
|
|
||||||
.sd_ack(sd_ack[3]),
|
|
||||||
|
|
||||||
.sd_buff_addr(sd_buff_addr),
|
|
||||||
.sd_buff_dout(sd_buff_dout),
|
|
||||||
.sd_buff_din(sd_buff_din[3]),
|
|
||||||
.sd_buff_wr(sd_buff_wr),
|
|
||||||
|
|
||||||
.wp(drive_wp[3]),
|
|
||||||
|
|
||||||
.size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard
|
|
||||||
.layout(1'b1), // 0 = Track-Side-Sector, 1 - Side-Track-Sector
|
|
||||||
.side(1'b0),
|
|
||||||
.ready(drive_ready[3]),
|
|
||||||
|
|
||||||
.input_active(0), // Section not used
|
.input_active(0), // Section not used
|
||||||
.input_addr(0),
|
.input_addr(0),
|
||||||
|
|||||||
+2
-3
@@ -47,6 +47,8 @@
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// Define Config features
|
||||||
|
`include "../RTL/config.v"
|
||||||
|
|
||||||
module sdc(
|
module sdc(
|
||||||
input CLK, // clock
|
input CLK, // clock
|
||||||
@@ -87,9 +89,6 @@ module sdc(
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Define Config features
|
|
||||||
`include "../rtl/config.sv"
|
|
||||||
|
|
||||||
reg [23:0] LSN;
|
reg [23:0] LSN;
|
||||||
reg [7:0] command;
|
reg [7:0] command;
|
||||||
reg [7:0] transfer_address;
|
reg [7:0] transfer_address;
|
||||||
|
|||||||
+74
-107
@@ -146,27 +146,54 @@ assign DATA_HDD =
|
|||||||
|
|
||||||
wire [31:0] sdc_sd_lba[2];
|
wire [31:0] sdc_sd_lba[2];
|
||||||
wire [31:0] fdc_sd_lba[2];
|
wire [31:0] fdc_sd_lba[2];
|
||||||
|
wire [31:0] wd1793_sd_lba;
|
||||||
wire [1:0] sdc_sd_rd;
|
wire [1:0] sdc_sd_rd;
|
||||||
|
wire wd1793_sd_rd;
|
||||||
wire [1:0] fdc_sd_rd;
|
wire [1:0] fdc_sd_rd;
|
||||||
wire [1:0] sdc_sd_wr;
|
wire [1:0] sdc_sd_wr;
|
||||||
wire [1:0] fdc_sd_wr;
|
wire [1:0] fdc_sd_wr;
|
||||||
|
wire wd1793_sd_wr;
|
||||||
wire [7:0] sdc_sd_buff_din[2];
|
wire [7:0] sdc_sd_buff_din[2];
|
||||||
wire [7:0] fdc_sd_buff_din[2];
|
wire [7:0] fdc_sd_buff_din[2];
|
||||||
wire [7:0] wd1793_sd_buff_din;
|
wire [7:0] wd1793_sd_buff_din;
|
||||||
|
wire wd1793_sd_ack;
|
||||||
wire sdc_HALT;
|
wire sdc_HALT;
|
||||||
|
|
||||||
assign sd_lba[0:1] = SDC_EN ? sdc_sd_lba[0:1]:
|
assign sd_lba[0:1] = SDC_EN ? sdc_sd_lba[0:1]:
|
||||||
fdc_sd_lba[0:1];
|
fdc_sd_lba[0:1];
|
||||||
|
|
||||||
|
assign fdc_sd_lba[0] = wd1793_sd_lba;
|
||||||
|
assign fdc_sd_lba[1] = wd1793_sd_lba;
|
||||||
|
|
||||||
assign sd_rd[1:0] = SDC_EN ? sdc_sd_rd[1:0]:
|
assign sd_rd[1:0] = SDC_EN ? sdc_sd_rd[1:0]:
|
||||||
fdc_sd_rd[1:0];
|
fdc_sd_rd[1:0];
|
||||||
|
|
||||||
|
assign fdc_sd_rd[0] = (drive_index == 3'd1) ? wd1793_sd_rd:
|
||||||
|
1'b0;
|
||||||
|
|
||||||
|
assign fdc_sd_rd[1] = (drive_index == 3'd2) ? wd1793_sd_rd:
|
||||||
|
1'b0;
|
||||||
|
|
||||||
assign sd_wr[1:0] = SDC_EN ? sdc_sd_wr[1:0]:
|
assign sd_wr[1:0] = SDC_EN ? sdc_sd_wr[1:0]:
|
||||||
fdc_sd_wr[1:0];
|
fdc_sd_wr[1:0];
|
||||||
|
|
||||||
|
assign fdc_sd_wr[0] = (drive_index == 3'd1) ? wd1793_sd_wr:
|
||||||
|
1'b0;
|
||||||
|
|
||||||
|
assign fdc_sd_wr[1] = (drive_index == 3'd2) ? wd1793_sd_wr:
|
||||||
|
1'b0;
|
||||||
|
|
||||||
assign sd_buff_din[0:1] = SDC_EN ? sdc_sd_buff_din[0:1]:
|
assign sd_buff_din[0:1] = SDC_EN ? sdc_sd_buff_din[0:1]:
|
||||||
fdc_sd_buff_din[0:1];
|
fdc_sd_buff_din[0:1];
|
||||||
|
|
||||||
|
assign fdc_sd_buff_din[0] = wd1793_sd_buff_din;
|
||||||
|
assign fdc_sd_buff_din[1] = wd1793_sd_buff_din;
|
||||||
|
|
||||||
|
|
||||||
|
assign wd1793_sd_ack = (drive_index == 3'd1) ? sd_ack[0]:
|
||||||
|
(drive_index == 3'd2) ? sd_ack[1]:
|
||||||
|
sd_ack[0]; // default is drive 1
|
||||||
|
|
||||||
|
|
||||||
sdc coco_sdc(
|
sdc coco_sdc(
|
||||||
.CLK(CLK), // clock
|
.CLK(CLK), // clock
|
||||||
@@ -250,13 +277,13 @@ begin
|
|||||||
drive_index <= 3'd1;
|
drive_index <= 3'd1;
|
||||||
|
|
||||||
4'b1011: // This is what the Magic Number $43 does so we select a non-active drive
|
4'b1011: // This is what the Magic Number $43 does so we select a non-active drive
|
||||||
drive_index <= 3'd1;
|
drive_index <= 3'd0;
|
||||||
4'b1000: // This is no drive with DS = illegal drive
|
4'b1000: // This is no drive with DS = illegal drive
|
||||||
drive_index <= 3'd1;
|
drive_index <= 3'd0;
|
||||||
4'b0000: // This is no drive (maybe 0 in ff40) = illegal drive
|
4'b0000: // This is no drive (maybe 0 in ff40) = illegal drive
|
||||||
drive_index <= 3'd1;
|
drive_index <= 3'd0;
|
||||||
default:
|
default:
|
||||||
drive_index <= 3'd1;
|
drive_index <= 3'd0;
|
||||||
endcase
|
endcase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -283,17 +310,14 @@ end
|
|||||||
|
|
||||||
// Control signals for the wd1793
|
// Control signals for the wd1793
|
||||||
|
|
||||||
wire INTRQ[2];
|
|
||||||
wire DRQ[2];
|
|
||||||
wire selected_DRQ;
|
wire selected_DRQ;
|
||||||
wire selected_INTRQ;
|
wire selected_INTRQ;
|
||||||
|
|
||||||
wire WR[2];
|
wire WR;
|
||||||
wire RD[2];
|
wire RD;
|
||||||
wire RD_E[2];
|
wire RD_E;
|
||||||
wire HALT_EN_RST;
|
wire HALT_EN_RST;
|
||||||
wire [7:0] DATA_1793;
|
wire [7:0] DATA_1793;
|
||||||
wire [7:0] dout[2];
|
|
||||||
reg read;
|
reg read;
|
||||||
reg write;
|
reg write;
|
||||||
reg read_d;
|
reg read_d;
|
||||||
@@ -305,8 +329,7 @@ reg read1;
|
|||||||
reg write1;
|
reg write1;
|
||||||
reg [1:0] ADDRESS_L;
|
reg [1:0] ADDRESS_L;
|
||||||
|
|
||||||
assign RD[0] = (read || RD_E[0]) && (drive_index == 2'd1);
|
assign RD = (read || RD_E); // Even with no drive selected allow read to the controller
|
||||||
assign RD[1] = (read || RD_E[1]) && (drive_index == 3'd2);
|
|
||||||
|
|
||||||
// The idea here is to "stretch" the CPU read and write signals to ensure we catch a 8 mhz enable.
|
// The idea here is to "stretch" the CPU read and write signals to ensure we catch a 8 mhz enable.
|
||||||
// For writes we will buffer the data out to ensure it does not go away.
|
// For writes we will buffer the data out to ensure it does not go away.
|
||||||
@@ -327,10 +350,8 @@ begin
|
|||||||
write_d <= 1'b0;
|
write_d <= 1'b0;
|
||||||
r_w_active <= 1'b0;
|
r_w_active <= 1'b0;
|
||||||
clk_8Mhz_enable_found <= 1'b0;
|
clk_8Mhz_enable_found <= 1'b0;
|
||||||
WR[0] <= 1'b0;
|
WR <= 1'b0;
|
||||||
WR[1] <= 1'b0;
|
RD_E <= 1'b0;
|
||||||
RD_E[0] <= 1'b0;
|
|
||||||
RD_E[1] <= 1'b0;
|
|
||||||
read1 <= 1'b0;
|
read1 <= 1'b0;
|
||||||
write1 <= 1'b0;
|
write1 <= 1'b0;
|
||||||
read <= 1'b0;
|
read <= 1'b0;
|
||||||
@@ -362,24 +383,14 @@ begin
|
|||||||
begin
|
begin
|
||||||
// Set Write
|
// Set Write
|
||||||
r_w_active <= 1'b1;
|
r_w_active <= 1'b1;
|
||||||
case (drive_index)
|
WR <= 1'b1;
|
||||||
3'd1:
|
|
||||||
WR[0] <= 1'b1;
|
|
||||||
3'd2:
|
|
||||||
WR[1] <= 1'b1;
|
|
||||||
endcase
|
|
||||||
end
|
end
|
||||||
|
|
||||||
// Synchronus rising edge of read
|
// Synchronus rising edge of read
|
||||||
if ((read == 1'b1) && (read_d == 1'b0))
|
if ((read == 1'b1) && (read_d == 1'b0))
|
||||||
begin
|
begin
|
||||||
r_w_active <= 1'b1;
|
r_w_active <= 1'b1;
|
||||||
case (drive_index)
|
RD_E <= 1'b1;
|
||||||
3'd1:
|
|
||||||
RD_E[0] <= 1'b1;
|
|
||||||
3'd2:
|
|
||||||
RD_E[1] <= 1'b1;
|
|
||||||
endcase
|
|
||||||
end
|
end
|
||||||
|
|
||||||
// Clears
|
// Clears
|
||||||
@@ -391,42 +402,23 @@ begin
|
|||||||
begin
|
begin
|
||||||
clk_8Mhz_enable_found <= 1'b0;
|
clk_8Mhz_enable_found <= 1'b0;
|
||||||
r_w_active <= 1'b0;
|
r_w_active <= 1'b0;
|
||||||
WR[0] <= 1'b0;
|
WR <= 1'b0;
|
||||||
WR[1] <= 1'b0;
|
RD_E <= 1'b0;
|
||||||
|
|
||||||
RD_E[0] <= 1'b0;
|
|
||||||
RD_E[1] <= 1'b0;
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
// NMI from disk controller
|
// NMI from disk controller
|
||||||
// Selected INTRQ
|
|
||||||
assign selected_INTRQ = (drive_index == 3'd1) ? INTRQ[0]:
|
|
||||||
(drive_index == 3'd2) ? INTRQ[1]:
|
|
||||||
1'b0;
|
|
||||||
|
|
||||||
assign NMI_09 = ~SDC_EN & DENSITY & selected_INTRQ; // Send NMI if Double Density (Halt Mode)
|
assign NMI_09 = ~SDC_EN & DENSITY & selected_INTRQ; // Send NMI if Double Density (Halt Mode)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// HALT from disk controller
|
// HALT from disk controller
|
||||||
|
|
||||||
// Selected DRQ
|
|
||||||
assign selected_DRQ = (drive_index == 3'd1) ? DRQ[0]:
|
|
||||||
(drive_index == 3'd2) ? DRQ[1]:
|
|
||||||
1'b1;
|
|
||||||
|
|
||||||
assign HALT = (~SDC_EN & HALT_EN & ~selected_DRQ) | sdc_HALT;
|
assign HALT = (~SDC_EN & HALT_EN & ~selected_DRQ) | sdc_HALT;
|
||||||
|
|
||||||
assign HALT_EN_RST = RESET_N & ~selected_INTRQ; // From controller schematic
|
assign HALT_EN_RST = RESET_N & ~selected_INTRQ; // From controller schematic
|
||||||
|
|
||||||
// Data bus selection
|
|
||||||
assign DATA_1793 = (drive_index == 3'd1) ? dout[0]:
|
|
||||||
(drive_index == 3'd2) ? dout[1]:
|
|
||||||
8'd0;
|
|
||||||
|
|
||||||
|
|
||||||
// The SD_BLK interface and thus the wd1793 will allways transfer 1 blk. This is blk qty - 1 per spec.
|
// The SD_BLK interface and thus the wd1793 will allways transfer 1 blk. This is blk qty - 1 per spec.
|
||||||
assign sd_blk_cnt[1] = 6'd0;
|
assign sd_blk_cnt[1] = 6'd0;
|
||||||
@@ -436,6 +428,8 @@ reg drive_wp[2];
|
|||||||
reg [1:0] drive_ready = 2'b00;
|
reg [1:0] drive_ready = 2'b00;
|
||||||
reg [1:0] double_sided = 2'b00;
|
reg [1:0] double_sided = 2'b00;
|
||||||
reg [31:0] drive_size[2];
|
reg [31:0] drive_size[2];
|
||||||
|
wire [31:0] selected_drive_size;
|
||||||
|
wire selected_drive_ready, selected_drive_wp, selected_double_sided;
|
||||||
|
|
||||||
// As drives are mounted in MISTer this logic saves the write protect and generates ready for
|
// As drives are mounted in MISTer this logic saves the write protect and generates ready for
|
||||||
// changing drives to the wd1793.
|
// changing drives to the wd1793.
|
||||||
@@ -463,83 +457,56 @@ begin
|
|||||||
double_sided[1]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640;
|
double_sided[1]<= (img_size > 64'd368600) & (img_size < 64'd740000);//20'd368640;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
assign selected_drive_size = (drive_index == 3'd1) ? drive_size[0]:
|
||||||
|
(drive_index == 3'd2) ? drive_size[1]:
|
||||||
|
drive_size[0]; // default is drive 1
|
||||||
|
|
||||||
wd1793 #(1,0) coco_wd1793_sdc_0
|
assign selected_drive_wp = (drive_index == 3'd1) ? drive_wp[0]:
|
||||||
|
(drive_index == 3'd2) ? drive_wp[1]:
|
||||||
|
drive_wp[0]; // default is drive 1
|
||||||
|
|
||||||
|
assign selected_double_sided= (drive_index == 3'd1) ? double_sided[0]:
|
||||||
|
(drive_index == 3'd2) ? double_sided[1]:
|
||||||
|
double_sided[0]; // default is drive 1
|
||||||
|
|
||||||
|
assign selected_drive_ready = (drive_index == 3'd1) ? drive_ready[0]:
|
||||||
|
(drive_index == 3'd2) ? drive_ready[1]:
|
||||||
|
drive_ready[0]; // default is drive 1
|
||||||
|
|
||||||
|
wd1793 #(1,0) coco_wd1793_sdc
|
||||||
(
|
(
|
||||||
.clk_sys(~CLK),
|
.clk_sys(~CLK),
|
||||||
.ce(ena_8Mhz),
|
.ce(ena_8Mhz),
|
||||||
.reset(~RESET_N),
|
.reset(~RESET_N),
|
||||||
.io_en(1'b1),
|
.io_en(1'b1),
|
||||||
.rd(RD[0]),
|
.rd(RD),
|
||||||
.wr(WR[0]),
|
.wr(WR),
|
||||||
.addr(ADDRESS_L[1:0]),
|
.addr(ADDRESS_L[1:0]),
|
||||||
.din(DATA_IN_L),
|
.din(DATA_IN_L),
|
||||||
.dout(dout[0]),
|
.dout(DATA_1793),
|
||||||
.drq(DRQ[0]),
|
.drq(selected_DRQ),
|
||||||
.intrq(INTRQ[0]),
|
.intrq(selected_INTRQ),
|
||||||
|
|
||||||
.img_mounted(1'b0), // Not used when using _override
|
.img_mounted(1'b0), // Not used when using _override
|
||||||
.img_mounted_overide(1'b1), // Load img_size and layout on each clock
|
.img_mounted_overide(1'b1), // Load img_size and layout on each clock
|
||||||
.img_size(drive_size[0]),
|
.img_size(selected_drive_size[19:0]),
|
||||||
|
|
||||||
.sd_lba(fdc_sd_lba[0]),
|
.sd_lba(wd1793_sd_lba),
|
||||||
.sd_rd(fdc_sd_rd[0]),
|
.sd_rd(wd1793_sd_rd),
|
||||||
.sd_wr(fdc_sd_wr[0]),
|
.sd_wr(wd1793_sd_wr),
|
||||||
.sd_ack(sd_ack[0]),
|
.sd_ack(wd1793_sd_ack),
|
||||||
|
|
||||||
.sd_buff_addr(sd_buff_addr),
|
.sd_buff_addr(sd_buff_addr),
|
||||||
.sd_buff_dout(sd_buff_dout),
|
.sd_buff_dout(sd_buff_dout),
|
||||||
.sd_buff_din(fdc_sd_buff_din[0]),
|
.sd_buff_din(wd1793_sd_buff_din),
|
||||||
.sd_buff_wr(sd_buff_wr),
|
.sd_buff_wr(sd_buff_wr),
|
||||||
|
|
||||||
.wp(drive_wp[0]),
|
.wp(selected_drive_wp),
|
||||||
|
|
||||||
.size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard
|
.size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard
|
||||||
.layout(~double_sided[0]), // 0 = Track-Side-Sector, 1 - Side-Track-Sector
|
.layout(~selected_double_sided), // 0 = Track-Side-Sector, 1 - Side-Track-Sector
|
||||||
.side(double_sided[0] & DRIVE_SEL_EXT[3]),
|
.side(selected_double_sided & DRIVE_SEL_EXT[3]),
|
||||||
.ready(drive_ready[0]),
|
.ready(selected_drive_ready),
|
||||||
|
|
||||||
.input_active(0), // Section not used
|
|
||||||
.input_addr(0),
|
|
||||||
.input_data(0),
|
|
||||||
.input_wr(0),
|
|
||||||
.buff_din(0)
|
|
||||||
);
|
|
||||||
|
|
||||||
wd1793 #(1,0) coco_wd1793_sdc_1
|
|
||||||
(
|
|
||||||
.clk_sys(~CLK),
|
|
||||||
.ce(ena_8Mhz),
|
|
||||||
.reset(~RESET_N),
|
|
||||||
.io_en(1'b1),
|
|
||||||
.rd(RD[1]),
|
|
||||||
.wr(WR[1]),
|
|
||||||
.addr(ADDRESS_L[1:0]),
|
|
||||||
.din(DATA_IN_L),
|
|
||||||
.dout(dout[1]),
|
|
||||||
.drq(DRQ[1]),
|
|
||||||
.intrq(INTRQ[1]),
|
|
||||||
|
|
||||||
.img_mounted(1'b0), // Not used when using _override
|
|
||||||
.img_mounted_overide(1'b1), // Load img_size and layout on each clock
|
|
||||||
.img_size(drive_size[1]),
|
|
||||||
|
|
||||||
.sd_lba(fdc_sd_lba[1]),
|
|
||||||
.sd_rd(fdc_sd_rd[1]),
|
|
||||||
.sd_wr(fdc_sd_wr[1]),
|
|
||||||
.sd_ack(sd_ack[1]),
|
|
||||||
|
|
||||||
.sd_buff_addr(sd_buff_addr),
|
|
||||||
.sd_buff_dout(sd_buff_dout),
|
|
||||||
.sd_buff_din(fdc_sd_buff_din[1]),
|
|
||||||
.sd_buff_wr(sd_buff_wr),
|
|
||||||
|
|
||||||
.wp(drive_wp[1]),
|
|
||||||
|
|
||||||
.size_code(3'd5), // 5 is 18 sector x 256 bits COCO standard
|
|
||||||
.layout(~double_sided[1]), // 0 = Track-Side-Sector, 1 - Side-Track-Sector
|
|
||||||
.side(double_sided[1] & DRIVE_SEL_EXT[3]),
|
|
||||||
.ready(drive_ready[1]),
|
|
||||||
|
|
||||||
.input_active(0), // Section not used
|
.input_active(0), // Section not used
|
||||||
.input_addr(0),
|
.input_addr(0),
|
||||||
|
|||||||
@@ -99,11 +99,6 @@ generate
|
|||||||
assign G = {RGB_fix[7:4],RGB_fix[7:4]};
|
assign G = {RGB_fix[7:4],RGB_fix[7:4]};
|
||||||
assign B = {RGB_fix[3:0],RGB_fix[3:0]};
|
assign B = {RGB_fix[3:0],RGB_fix[3:0]};
|
||||||
end
|
end
|
||||||
else if(DW == 18) begin
|
|
||||||
assign R = {RGB_fix[17:12],RGB_fix[17:16]};
|
|
||||||
assign G = {RGB_fix[11: 6],RGB_fix[11:10]};
|
|
||||||
assign B = {RGB_fix[ 5: 0],RGB_fix[ 5: 4]};
|
|
||||||
end
|
|
||||||
else begin // 24
|
else begin // 24
|
||||||
assign R = RGB_fix[23:16];
|
assign R = RGB_fix[23:16];
|
||||||
assign G = RGB_fix[15:8];
|
assign G = RGB_fix[15:8];
|
||||||
|
|||||||
+41
-160
@@ -103,7 +103,7 @@ USE ieee.numeric_std.ALL;
|
|||||||
-- DOWNSCALE : True=Support downscaling False=Downscaling disabled
|
-- DOWNSCALE : True=Support downscaling False=Downscaling disabled
|
||||||
-- BYTESWAP : Little/Big endian byte swap
|
-- BYTESWAP : Little/Big endian byte swap
|
||||||
-- FRAC : Fractional bits, subpixel resolution
|
-- FRAC : Fractional bits, subpixel resolution
|
||||||
-- OHRES : Max. output horizontal resolution. 1024, 2048, 2304, 2560, 4096
|
-- OHRES : Max. output horizontal resolution. Must be a power of two.
|
||||||
-- (Used for sizing line buffers)
|
-- (Used for sizing line buffers)
|
||||||
-- IHRES : Max. input horizontal resolution. Must be a power of two.
|
-- IHRES : Max. input horizontal resolution. Must be a power of two.
|
||||||
-- (Used for sizing line buffers)
|
-- (Used for sizing line buffers)
|
||||||
@@ -125,7 +125,7 @@ ENTITY ascal IS
|
|||||||
ADAPTIVE : boolean := true;
|
ADAPTIVE : boolean := true;
|
||||||
DOWNSCALE_NN : boolean := false;
|
DOWNSCALE_NN : boolean := false;
|
||||||
FRAC : natural RANGE 4 TO 8 :=4;
|
FRAC : natural RANGE 4 TO 8 :=4;
|
||||||
OHRES : natural RANGE 1 TO 4096 :=2304;
|
OHRES : natural RANGE 1 TO 4096 :=2048;
|
||||||
IHRES : natural RANGE 1 TO 2048 :=2048;
|
IHRES : natural RANGE 1 TO 2048 :=2048;
|
||||||
N_DW : natural RANGE 64 TO 128 := 128;
|
N_DW : natural RANGE 64 TO 128 := 128;
|
||||||
N_AW : natural RANGE 8 TO 32 := 32;
|
N_AW : natural RANGE 8 TO 32 := 32;
|
||||||
@@ -204,7 +204,6 @@ ENTITY ascal IS
|
|||||||
run : IN std_logic :='1'; -- 1=Enable output image. 0=No image
|
run : IN std_logic :='1'; -- 1=Enable output image. 0=No image
|
||||||
freeze : IN std_logic :='0'; -- 1=Disable framebuffer writes
|
freeze : IN std_logic :='0'; -- 1=Disable framebuffer writes
|
||||||
mode : IN unsigned(4 DOWNTO 0);
|
mode : IN unsigned(4 DOWNTO 0);
|
||||||
bob_deint : IN std_logic := '0';
|
|
||||||
-- SYNC |_________________________/"""""""""\_______|
|
-- SYNC |_________________________/"""""""""\_______|
|
||||||
-- DE |""""""""""""""""""\________________________|
|
-- DE |""""""""""""""""""\________________________|
|
||||||
-- RGB | <#IMAGE#> ^HDISP |
|
-- RGB | <#IMAGE#> ^HDISP |
|
||||||
@@ -223,7 +222,6 @@ ENTITY ascal IS
|
|||||||
vmax : IN natural RANGE 0 TO 4095; -- 0 <= vmin < vmax < vdisp
|
vmax : IN natural RANGE 0 TO 4095; -- 0 <= vmin < vmax < vdisp
|
||||||
vrr : IN std_logic := '0';
|
vrr : IN std_logic := '0';
|
||||||
vrrmax : IN natural RANGE 0 TO 4095 := 0;
|
vrrmax : IN natural RANGE 0 TO 4095 := 0;
|
||||||
swblack : IN std_logic := '0'; -- will output 3 black frame on every resolution switch
|
|
||||||
|
|
||||||
-- Scaler format. 00=16bpp 565, 01=24bpp 10=32bpp
|
-- Scaler format. 00=16bpp 565, 01=24bpp 10=32bpp
|
||||||
format : IN unsigned(1 DOWNTO 0) :="01";
|
format : IN unsigned(1 DOWNTO 0) :="01";
|
||||||
@@ -259,9 +257,6 @@ ENTITY ascal IS
|
|||||||
BEGIN
|
BEGIN
|
||||||
ASSERT N_DW=64 OR N_DW=128 REPORT "DW" SEVERITY failure;
|
ASSERT N_DW=64 OR N_DW=128 REPORT "DW" SEVERITY failure;
|
||||||
|
|
||||||
ASSERT OHRES = 1024 OR OHRES = 2048 OR OHRES = 2304 OR
|
|
||||||
OHRES = 2560 OR OHRES = 4096 REPORT "OHRES" SEVERITY failure;
|
|
||||||
|
|
||||||
END ENTITY ascal;
|
END ENTITY ascal;
|
||||||
|
|
||||||
--##############################################################################
|
--##############################################################################
|
||||||
@@ -292,35 +287,6 @@ ARCHITECTURE rtl OF ascal IS
|
|||||||
END IF;
|
END IF;
|
||||||
END FUNCTION to_std_logic;
|
END FUNCTION to_std_logic;
|
||||||
|
|
||||||
----------------------------------------------------------
|
|
||||||
FUNCTION ohres_h(CONSTANT r : natural) RETURN natural IS
|
|
||||||
BEGIN
|
|
||||||
CASE r IS
|
|
||||||
WHEN 1024 => RETURN 1024;
|
|
||||||
WHEN 2048 => RETURN 2048;
|
|
||||||
WHEN OTHERS => RETURN 4096;
|
|
||||||
END CASE;
|
|
||||||
END FUNCTION;
|
|
||||||
FUNCTION ohres_l(CONSTANT r : natural) RETURN natural IS
|
|
||||||
BEGIN
|
|
||||||
CASE r IS
|
|
||||||
WHEN 1024 => RETURN 1024;
|
|
||||||
WHEN 2048 | 2304 | 2560 => RETURN 2048;
|
|
||||||
WHEN OTHERS => RETURN 4096;
|
|
||||||
END CASE;
|
|
||||||
END FUNCTION;
|
|
||||||
FUNCTION ohres_m(CONSTANT r : natural) RETURN natural IS
|
|
||||||
BEGIN
|
|
||||||
CASE r IS
|
|
||||||
WHEN 1024 | 2048 | 2304 => RETURN 256;
|
|
||||||
WHEN OTHERS => RETURN 512;
|
|
||||||
END CASE;
|
|
||||||
END FUNCTION;
|
|
||||||
|
|
||||||
CONSTANT OHRESH : natural := ohres_h(OHRES);
|
|
||||||
CONSTANT OHRESL : natural := ohres_l(OHRES);
|
|
||||||
CONSTANT OHRESM : natural := ohres_m(OHRES);
|
|
||||||
|
|
||||||
----------------------------------------------------------
|
----------------------------------------------------------
|
||||||
CONSTANT NB_BURST : natural :=ilog2(N_BURST);
|
CONSTANT NB_BURST : natural :=ilog2(N_BURST);
|
||||||
CONSTANT NB_LA : natural :=ilog2(N_DW/8); -- Low address bits
|
CONSTANT NB_LA : natural :=ilog2(N_DW/8); -- Low address bits
|
||||||
@@ -352,7 +318,6 @@ ARCHITECTURE rtl OF ascal IS
|
|||||||
SIGNAL i_pvs,i_pfl,i_pde,i_pce : std_logic;
|
SIGNAL i_pvs,i_pfl,i_pde,i_pce : std_logic;
|
||||||
SIGNAL i_ppix : type_pix;
|
SIGNAL i_ppix : type_pix;
|
||||||
SIGNAL i_freeze : std_logic;
|
SIGNAL i_freeze : std_logic;
|
||||||
SIGNAL i_bob_deint : std_logic;
|
|
||||||
SIGNAL i_count : unsigned(2 DOWNTO 0);
|
SIGNAL i_count : unsigned(2 DOWNTO 0);
|
||||||
SIGNAL i_hsize,i_hmin,i_hmax,i_hcpt : uint12;
|
SIGNAL i_hsize,i_hmin,i_hmax,i_hcpt : uint12;
|
||||||
SIGNAL i_hrsize,i_vrsize : uint12;
|
SIGNAL i_hrsize,i_vrsize : uint12;
|
||||||
@@ -368,7 +333,6 @@ ARCHITECTURE rtl OF ascal IS
|
|||||||
SIGNAL i_de_delay : natural RANGE 0 TO 31;
|
SIGNAL i_de_delay : natural RANGE 0 TO 31;
|
||||||
SIGNAL i_intercnt : natural RANGE 0 TO 3;
|
SIGNAL i_intercnt : natural RANGE 0 TO 3;
|
||||||
SIGNAL i_inter,i_half,i_flm : std_logic;
|
SIGNAL i_inter,i_half,i_flm : std_logic;
|
||||||
SIGNAL i_wfl : std_logic_vector(2 DOWNTO 0);
|
|
||||||
SIGNAL i_write,i_wreq,i_alt,i_line,i_wline,i_wline_mem : std_logic;
|
SIGNAL i_write,i_wreq,i_alt,i_line,i_wline,i_wline_mem : std_logic;
|
||||||
SIGNAL i_walt,i_walt_mem,i_wreq_mem : std_logic;
|
SIGNAL i_walt,i_walt_mem,i_wreq_mem : std_logic;
|
||||||
SIGNAL i_wdelay : natural RANGE 0 TO 7;
|
SIGNAL i_wdelay : natural RANGE 0 TO 7;
|
||||||
@@ -398,7 +362,7 @@ ARCHITECTURE rtl OF ascal IS
|
|||||||
SIGNAL i_hacc,i_vacc : uint13;
|
SIGNAL i_hacc,i_vacc : uint13;
|
||||||
SIGNAL i_hdown,i_vdown : std_logic;
|
SIGNAL i_hdown,i_vdown : std_logic;
|
||||||
SIGNAL i_divcpt : natural RANGE 0 TO 36;
|
SIGNAL i_divcpt : natural RANGE 0 TO 36;
|
||||||
SIGNAL i_lwad,i_lrad : natural RANGE 0 TO OHRESH-1;
|
SIGNAL i_lwad,i_lrad : natural RANGE 0 TO OHRES-1;
|
||||||
SIGNAL i_lwr,i_bil : std_logic;
|
SIGNAL i_lwr,i_bil : std_logic;
|
||||||
SIGNAL i_ldw,i_ldrm : type_pix;
|
SIGNAL i_ldw,i_ldrm : type_pix;
|
||||||
SIGNAL i_hpixp,i_hpix0,i_hpix1,i_hpix2,i_hpix3,i_hpix4 : type_pix;
|
SIGNAL i_hpixp,i_hpix0,i_hpix1,i_hpix2,i_hpix3,i_hpix4 : type_pix;
|
||||||
@@ -446,8 +410,6 @@ ARCHITECTURE rtl OF ascal IS
|
|||||||
-- Output
|
-- Output
|
||||||
SIGNAL o_run : std_logic;
|
SIGNAL o_run : std_logic;
|
||||||
SIGNAL o_freeze : std_logic;
|
SIGNAL o_freeze : std_logic;
|
||||||
SIGNAL o_bob_deint : std_logic;
|
|
||||||
SIGNAL o_iwfl : std_logic_vector(2 DOWNTO 0);
|
|
||||||
SIGNAL o_mode,o_hmode,o_vmode : unsigned(4 DOWNTO 0);
|
SIGNAL o_mode,o_hmode,o_vmode : unsigned(4 DOWNTO 0);
|
||||||
SIGNAL o_format : unsigned(5 DOWNTO 0);
|
SIGNAL o_format : unsigned(5 DOWNTO 0);
|
||||||
SIGNAL o_fb_pal_dr : unsigned(23 DOWNTO 0);
|
SIGNAL o_fb_pal_dr : unsigned(23 DOWNTO 0);
|
||||||
@@ -494,21 +456,13 @@ ARCHITECTURE rtl OF ascal IS
|
|||||||
SIGNAL o_reset_na : std_logic;
|
SIGNAL o_reset_na : std_logic;
|
||||||
SIGNAL o_dpram : arr_dw(0 TO BLEN*2-1);
|
SIGNAL o_dpram : arr_dw(0 TO BLEN*2-1);
|
||||||
ATTRIBUTE ramstyle OF o_dpram : SIGNAL IS "no_rw_check";
|
ATTRIBUTE ramstyle OF o_dpram : SIGNAL IS "no_rw_check";
|
||||||
SIGNAL o_line0,o_line1,o_line2,o_line3 : arr_pix(0 TO OHRESL-1);
|
SIGNAL o_line0,o_line1,o_line2,o_line3 : arr_pix(0 TO OHRES-1);
|
||||||
SIGNAL o_linf0,o_linf1,o_linf2,o_linf3 : arr_pix(0 TO OHRESM-1);
|
|
||||||
|
|
||||||
ATTRIBUTE ramstyle OF o_line0 : SIGNAL IS "no_rw_check";
|
ATTRIBUTE ramstyle OF o_line0 : SIGNAL IS "no_rw_check";
|
||||||
ATTRIBUTE ramstyle OF o_line1 : SIGNAL IS "no_rw_check";
|
ATTRIBUTE ramstyle OF o_line1 : SIGNAL IS "no_rw_check";
|
||||||
ATTRIBUTE ramstyle OF o_line2 : SIGNAL IS "no_rw_check";
|
ATTRIBUTE ramstyle OF o_line2 : SIGNAL IS "no_rw_check";
|
||||||
ATTRIBUTE ramstyle OF o_line3 : SIGNAL IS "no_rw_check";
|
ATTRIBUTE ramstyle OF o_line3 : SIGNAL IS "no_rw_check";
|
||||||
ATTRIBUTE ramstyle OF o_linf0 : SIGNAL IS "no_rw_check";
|
SIGNAL o_wadl,o_radl0,o_radl1,o_radl2,o_radl3 : natural RANGE 0 TO OHRES-1;
|
||||||
ATTRIBUTE ramstyle OF o_linf1 : SIGNAL IS "no_rw_check";
|
SIGNAL o_ldw,o_ldr0,o_ldr1,o_ldr2,o_ldr3 : type_pix;
|
||||||
ATTRIBUTE ramstyle OF o_linf2 : SIGNAL IS "no_rw_check";
|
|
||||||
ATTRIBUTE ramstyle OF o_linf3 : SIGNAL IS "no_rw_check";
|
|
||||||
SIGNAL o_wadl,o_radl0,o_radl1,o_radl2,o_radl3 : natural RANGE 0 TO OHRESH-1;
|
|
||||||
SIGNAL o_ldr0,o_ldr1,o_ldr2,o_ldr3,o_ldw : type_pix;
|
|
||||||
SIGNAL o_ler0,o_ler1,o_ler2,o_ler3 : type_pix;
|
|
||||||
SIGNAL o_lex0,o_lex1,o_lex2,o_lex3 : std_logic;
|
|
||||||
SIGNAL o_wr : unsigned(3 DOWNTO 0);
|
SIGNAL o_wr : unsigned(3 DOWNTO 0);
|
||||||
SIGNAL o_hcpt,o_vcpt,o_vcpt_pre,o_vcpt_pre2,o_vcpt_pre3,o_vcpt2 : uint12;
|
SIGNAL o_hcpt,o_vcpt,o_vcpt_pre,o_vcpt_pre2,o_vcpt_pre3,o_vcpt2 : uint12;
|
||||||
SIGNAL o_ihsize,o_ihsizem,o_ivsize : uint12;
|
SIGNAL o_ihsize,o_ihsizem,o_ivsize : uint12;
|
||||||
@@ -518,7 +472,7 @@ ARCHITECTURE rtl OF ascal IS
|
|||||||
SIGNAL o_hfrac : arr_frac(0 TO 9);
|
SIGNAL o_hfrac : arr_frac(0 TO 9);
|
||||||
ATTRIBUTE ramstyle OF o_hfrac : SIGNAL IS "logic"; -- avoid blockram shift register
|
ATTRIBUTE ramstyle OF o_hfrac : SIGNAL IS "logic"; -- avoid blockram shift register
|
||||||
|
|
||||||
SIGNAL o_hacc,o_hacc_ini,o_hacc_next,o_vacc,o_vacc_next,o_vacc_ini : natural RANGE 0 TO 4*OHRESH-1;
|
SIGNAL o_hacc,o_hacc_ini,o_hacc_next,o_vacc,o_vacc_next,o_vacc_ini : natural RANGE 0 TO 4*OHRES-1;
|
||||||
SIGNAL o_hsv,o_vsv,o_dev,o_pev,o_end : unsigned(0 TO 11);
|
SIGNAL o_hsv,o_vsv,o_dev,o_pev,o_end : unsigned(0 TO 11);
|
||||||
SIGNAL o_hsp,o_vss : std_logic;
|
SIGNAL o_hsp,o_vss : std_logic;
|
||||||
SIGNAL o_vcarrym,o_prim : boolean;
|
SIGNAL o_vcarrym,o_prim : boolean;
|
||||||
@@ -536,9 +490,8 @@ ARCHITECTURE rtl OF ascal IS
|
|||||||
TYPE arr_uint4 IS ARRAY (natural RANGE <>) OF natural RANGE 0 TO 15;
|
TYPE arr_uint4 IS ARRAY (natural RANGE <>) OF natural RANGE 0 TO 15;
|
||||||
SIGNAL o_off : arr_uint4(0 TO 2);
|
SIGNAL o_off : arr_uint4(0 TO 2);
|
||||||
SIGNAL o_bibu : std_logic :='0';
|
SIGNAL o_bibu : std_logic :='0';
|
||||||
SIGNAL o_dcptv : arr_uint12(13 TO 14);
|
SIGNAL o_dcptv : arr_uint12(1 TO 14);
|
||||||
SIGNAL o_dcpt_clr, o_dcpt_inc : std_logic;
|
SIGNAL o_dcpt : uint12;
|
||||||
SIGNAL o_dcptv_clr, o_dcptv_inc : std_logic_vector(1 TO 12);
|
|
||||||
SIGNAL o_hpixs,o_hpix0,o_hpix1,o_hpix2,o_hpix3 : type_pix;
|
SIGNAL o_hpixs,o_hpix0,o_hpix1,o_hpix2,o_hpix3 : type_pix;
|
||||||
SIGNAL o_hpixq : arr_pixq(2 TO 8);
|
SIGNAL o_hpixq : arr_pixq(2 TO 8);
|
||||||
ATTRIBUTE ramstyle OF o_hpixq : SIGNAL IS "logic"; -- avoid blockram shift register
|
ATTRIBUTE ramstyle OF o_hpixq : SIGNAL IS "logic"; -- avoid blockram shift register
|
||||||
@@ -546,6 +499,7 @@ ARCHITECTURE rtl OF ascal IS
|
|||||||
SIGNAL o_vpix_outer : arr_pix(0 TO 2);
|
SIGNAL o_vpix_outer : arr_pix(0 TO 2);
|
||||||
SIGNAL o_vpix_inner : arr_pix(0 TO 6);
|
SIGNAL o_vpix_inner : arr_pix(0 TO 6);
|
||||||
|
|
||||||
|
|
||||||
SIGNAL o_vpe : std_logic;
|
SIGNAL o_vpe : std_logic;
|
||||||
SIGNAL o_div : arr_div(0 TO 2); --uint12;
|
SIGNAL o_div : arr_div(0 TO 2); --uint12;
|
||||||
SIGNAL o_dir : arr_frac(0 TO 2);
|
SIGNAL o_dir : arr_frac(0 TO 2);
|
||||||
@@ -556,7 +510,6 @@ ARCHITECTURE rtl OF ascal IS
|
|||||||
SIGNAL o_divrun : std_logic;
|
SIGNAL o_divrun : std_logic;
|
||||||
SIGNAL o_hacpt,o_vacpt : unsigned(11 DOWNTO 0);
|
SIGNAL o_hacpt,o_vacpt : unsigned(11 DOWNTO 0);
|
||||||
SIGNAL o_vacptl : unsigned(1 DOWNTO 0);
|
SIGNAL o_vacptl : unsigned(1 DOWNTO 0);
|
||||||
signal o_newres : integer range 0 to 3;
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
FUNCTION shift_ishift(shift : unsigned(0 TO 119);
|
FUNCTION shift_ishift(shift : unsigned(0 TO 119);
|
||||||
@@ -575,7 +528,7 @@ ARCHITECTURE rtl OF ascal IS
|
|||||||
END CASE;
|
END CASE;
|
||||||
END FUNCTION;
|
END FUNCTION;
|
||||||
|
|
||||||
FUNCTION shift_ipack(i_dw : unsigned(N_DW-1 DOWNTO 0);
|
FUNCTION shift_ipack( i_dw : unsigned(N_DW-1 DOWNTO 0);
|
||||||
acpt : natural RANGE 0 TO 15;
|
acpt : natural RANGE 0 TO 15;
|
||||||
shift : unsigned(0 TO 119);
|
shift : unsigned(0 TO 119);
|
||||||
pix : type_pix;
|
pix : type_pix;
|
||||||
@@ -1177,7 +1130,6 @@ BEGIN
|
|||||||
i_pushhead<='0';
|
i_pushhead<='0';
|
||||||
i_eol<='0'; -- End Of Line
|
i_eol<='0'; -- End Of Line
|
||||||
i_freeze <=freeze; -- <ASYNC>
|
i_freeze <=freeze; -- <ASYNC>
|
||||||
i_bob_deint <= bob_deint;
|
|
||||||
i_iauto<=iauto; -- <ASYNC>
|
i_iauto<=iauto; -- <ASYNC>
|
||||||
i_wreq<='0';
|
i_wreq<='0';
|
||||||
i_wr<='0';
|
i_wr<='0';
|
||||||
@@ -1238,13 +1190,11 @@ BEGIN
|
|||||||
i_vcpt<=0;
|
i_vcpt<=0;
|
||||||
IF i_inter='1' AND i_flm='0' AND i_half='0' AND INTER THEN
|
IF i_inter='1' AND i_flm='0' AND i_half='0' AND INTER THEN
|
||||||
i_line<='1';
|
i_line<='1';
|
||||||
i_wfl(o_ibuf1) <= '0';
|
|
||||||
i_adrsi<=to_unsigned(N_BURST * i_hburst,32) +
|
i_adrsi<=to_unsigned(N_BURST * i_hburst,32) +
|
||||||
to_unsigned(N_BURST * to_integer(
|
to_unsigned(N_BURST * to_integer(
|
||||||
unsigned'("00") & to_std_logic(HEADER)),32);
|
unsigned'("00") & to_std_logic(HEADER)),32);
|
||||||
ELSE
|
ELSE
|
||||||
i_line<='0';
|
i_line<='0';
|
||||||
i_wfl(o_ibuf0) <= '1';
|
|
||||||
i_adrsi<=to_unsigned(N_BURST * to_integer(
|
i_adrsi<=to_unsigned(N_BURST * to_integer(
|
||||||
unsigned'("00") & to_std_logic(HEADER)),32);
|
unsigned'("00") & to_std_logic(HEADER)),32);
|
||||||
END IF;
|
END IF;
|
||||||
@@ -1254,8 +1204,8 @@ BEGIN
|
|||||||
i_vcpt>=i_vmin AND i_vcpt<=i_vmax);
|
i_vcpt>=i_vmin AND i_vcpt<=i_vmax);
|
||||||
|
|
||||||
-- Detects end of frame for triple buffering.
|
-- Detects end of frame for triple buffering.
|
||||||
i_endframe0<=i_vs AND (NOT i_inter OR i_flm OR i_bob_deint);
|
i_endframe0<=i_vs AND (NOT i_inter OR i_flm);
|
||||||
i_endframe1<=i_vs AND (NOT i_inter OR NOT i_flm OR i_bob_deint);
|
i_endframe1<=i_vs AND (NOT i_inter OR NOT i_flm);
|
||||||
|
|
||||||
i_vss<=to_std_logic(i_vcpt>=i_vmin AND i_vcpt<=i_vmax);
|
i_vss<=to_std_logic(i_vcpt>=i_vmin AND i_vcpt<=i_vmax);
|
||||||
|
|
||||||
@@ -1503,12 +1453,12 @@ BEGIN
|
|||||||
-- Push pixels to downscaling line buffer
|
-- Push pixels to downscaling line buffer
|
||||||
i_lwr<=i_hnp4 AND i_ven5 AND i_pce;
|
i_lwr<=i_hnp4 AND i_ven5 AND i_pce;
|
||||||
IF i_lwr='1' THEN
|
IF i_lwr='1' THEN
|
||||||
i_lwad<=(i_lwad+1) MOD OHRESH;
|
i_lwad<=(i_lwad+1) MOD OHRES;
|
||||||
END IF;
|
END IF;
|
||||||
i_ldw<=i_hpix;
|
i_ldw<=i_hpix;
|
||||||
|
|
||||||
IF i_hnp3='1' AND i_ven4='1' AND i_pce='1' THEN
|
IF i_hnp3='1' AND i_ven4='1' AND i_pce='1' THEN
|
||||||
i_lrad<=(i_lrad+1) MOD OHRESH;
|
i_lrad<=(i_lrad+1) MOD OHRES;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
------------------------------------------------------
|
------------------------------------------------------
|
||||||
@@ -1867,7 +1817,7 @@ BEGIN
|
|||||||
VARIABLE shift_v : unsigned(0 TO N_DW+15);
|
VARIABLE shift_v : unsigned(0 TO N_DW+15);
|
||||||
VARIABLE hpix_v : type_pix;
|
VARIABLE hpix_v : type_pix;
|
||||||
VARIABLE hcarry_v,vcarry_v : boolean;
|
VARIABLE hcarry_v,vcarry_v : boolean;
|
||||||
VARIABLE dif_v : natural RANGE 0 TO 8*OHRESH-1;
|
VARIABLE dif_v : natural RANGE 0 TO 8*OHRES-1;
|
||||||
VARIABLE off_v : natural RANGE 0 TO 15;
|
VARIABLE off_v : natural RANGE 0 TO 15;
|
||||||
BEGIN
|
BEGIN
|
||||||
IF o_reset_na='0' THEN
|
IF o_reset_na='0' THEN
|
||||||
@@ -1912,8 +1862,6 @@ BEGIN
|
|||||||
o_isync <= '0';
|
o_isync <= '0';
|
||||||
o_isync2 <= o_isync;
|
o_isync2 <= o_isync;
|
||||||
o_freeze <= freeze;
|
o_freeze <= freeze;
|
||||||
o_bob_deint <= bob_deint;
|
|
||||||
o_iwfl <= i_wfl;
|
|
||||||
o_inter <=i_inter; -- <ASYNC>
|
o_inter <=i_inter; -- <ASYNC>
|
||||||
o_iendframe0<=i_endframe0; -- <ASYNC>
|
o_iendframe0<=i_endframe0; -- <ASYNC>
|
||||||
o_iendframe02<=o_iendframe0;
|
o_iendframe02<=o_iendframe0;
|
||||||
@@ -1942,14 +1890,6 @@ BEGIN
|
|||||||
o_ivsize<=i_vrsize; -- <ASYNC>
|
o_ivsize<=i_vrsize; -- <ASYNC>
|
||||||
o_hdown<=i_hdown; -- <ASYNC>
|
o_hdown<=i_hdown; -- <ASYNC>
|
||||||
o_vdown<=i_vdown; -- <ASYNC>
|
o_vdown<=i_vdown; -- <ASYNC>
|
||||||
|
|
||||||
IF (o_newres > 0) then
|
|
||||||
o_newres <= o_newres- 1;
|
|
||||||
END IF;
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
IF (swblack = '1' and o_fb_ena = '0' and (o_ihsize /= i_hrsize or o_ivsize /= i_vrsize)) then
|
|
||||||
o_newres <= 3;
|
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
-- Simultaneous change of input and output framebuffers
|
-- Simultaneous change of input and output framebuffers
|
||||||
@@ -2146,26 +2086,7 @@ BEGIN
|
|||||||
o_read<=o_read_pre AND o_run;
|
o_read<=o_read_pre AND o_run;
|
||||||
o_rline<=o_vacpt(0); -- Even/Odd line for interlaced video
|
o_rline<=o_vacpt(0); -- Even/Odd line for interlaced video
|
||||||
|
|
||||||
----
|
|
||||||
-- When bob deinterlacing we read lines from one buffer (the most current) but we read them twice
|
|
||||||
-- (in contrast to weave deinterlacing where we read each 480p line from alternating buffers)
|
|
||||||
-- To counteract the severe vibrating/motion with bob deinterlacing, we need to offset one field
|
|
||||||
-- by a half-line. This is done by only reading the first line of the 'even' frame once
|
|
||||||
|
|
||||||
IF o_inter='1' AND o_bob_deint='1' THEN
|
|
||||||
IF o_iwfl(o_obuf0)='0' THEN
|
|
||||||
IF o_vacpt=0 OR o_rline='1' THEN
|
|
||||||
o_adrs_pre <= to_integer(o_vacpt) * to_integer(o_stride);
|
|
||||||
ELSE
|
|
||||||
o_adrs_pre <= (to_integer(o_vacpt)-1) * to_integer(o_stride);
|
|
||||||
END IF;
|
|
||||||
ELSE
|
|
||||||
o_adrs_pre <= to_integer(o_vacpt(11 DOWNTO 1) & "0") * to_integer(o_stride);
|
|
||||||
END IF;
|
|
||||||
ELSE
|
|
||||||
o_adrs_pre<=to_integer(o_vacpt) * to_integer(o_stride);
|
o_adrs_pre<=to_integer(o_vacpt) * to_integer(o_stride);
|
||||||
END IF;
|
|
||||||
|
|
||||||
IF o_adrsa='1' THEN
|
IF o_adrsa='1' THEN
|
||||||
IF o_fload=2 THEN
|
IF o_fload=2 THEN
|
||||||
o_adrs<=to_unsigned(o_hbcpt * N_BURST,32);
|
o_adrs<=to_unsigned(o_hbcpt * N_BURST,32);
|
||||||
@@ -2182,9 +2103,6 @@ BEGIN
|
|||||||
------------------------------------------------------
|
------------------------------------------------------
|
||||||
-- Copy from buffered memory to pixel lines
|
-- Copy from buffered memory to pixel lines
|
||||||
o_sh<='0';
|
o_sh<='0';
|
||||||
o_dcpt_clr <= '0';
|
|
||||||
o_dcpt_inc <= '0';
|
|
||||||
|
|
||||||
CASE o_copy IS
|
CASE o_copy IS
|
||||||
WHEN sWAIT =>
|
WHEN sWAIT =>
|
||||||
o_copyv(0)<='0';
|
o_copyv(0)<='0';
|
||||||
@@ -2203,7 +2121,7 @@ BEGIN
|
|||||||
o_hacc <=o_hacc_ini;
|
o_hacc <=o_hacc_ini;
|
||||||
o_hacc_next<=o_hacc_ini + 2*o_ihsize;
|
o_hacc_next<=o_hacc_ini + 2*o_ihsize;
|
||||||
o_hacpt <=x"000";
|
o_hacpt <=x"000";
|
||||||
o_dcpt_clr <= '1';
|
o_dcpt<=0;
|
||||||
o_dshi<=2;
|
o_dshi<=2;
|
||||||
o_acpt<=0;
|
o_acpt<=0;
|
||||||
o_first<='1';
|
o_first<='1';
|
||||||
@@ -2231,17 +2149,17 @@ BEGIN
|
|||||||
WHEN sCOPY =>
|
WHEN sCOPY =>
|
||||||
-- dshi : Force shift first two or three pixels of each line
|
-- dshi : Force shift first two or three pixels of each line
|
||||||
IF o_dshi=0 THEN
|
IF o_dshi=0 THEN
|
||||||
dif_v:=(o_hacc_next - 2*o_hsize + (8*OHRESH)) MOD (8*OHRESH);
|
dif_v:=(o_hacc_next - 2*o_hsize + (8*OHRES)) MOD (8*OHRES);
|
||||||
IF dif_v>=4*OHRESH THEN
|
IF dif_v>=4*OHRES THEN
|
||||||
o_hacc<=o_hacc_next;
|
o_hacc<=o_hacc_next;
|
||||||
o_hacc_next<=o_hacc_next + 2*o_ihsize;
|
o_hacc_next<=o_hacc_next + 2*o_ihsize;
|
||||||
hcarry_v:=false;
|
hcarry_v:=false;
|
||||||
ELSE
|
ELSE
|
||||||
o_hacc<=dif_v;
|
o_hacc<=dif_v;
|
||||||
o_hacc_next<=(dif_v + 2*o_ihsize + (4*OHRESH)) MOD (4*OHRESH);
|
o_hacc_next<=(dif_v + 2*o_ihsize + (4*OHRES)) MOD (4*OHRES);
|
||||||
hcarry_v:=true;
|
hcarry_v:=true;
|
||||||
END IF;
|
END IF;
|
||||||
o_dcpt_inc <= '1';
|
o_dcpt<=(o_dcpt+1) MOD 4096;
|
||||||
ELSE
|
ELSE
|
||||||
o_dshi<=o_dshi-1;
|
o_dshi<=o_dshi-1;
|
||||||
hcarry_v:=false;
|
hcarry_v:=false;
|
||||||
@@ -2301,9 +2219,6 @@ BEGIN
|
|||||||
hpix_v:=(r=>o_fb_pal_dr(23 DOWNTO 16),g=>o_fb_pal_dr(15 DOWNTO 8),
|
hpix_v:=(r=>o_fb_pal_dr(23 DOWNTO 16),g=>o_fb_pal_dr(15 DOWNTO 8),
|
||||||
b=>o_fb_pal_dr(7 DOWNTO 0));
|
b=>o_fb_pal_dr(7 DOWNTO 0));
|
||||||
END IF;
|
END IF;
|
||||||
IF (o_newres > 0) then
|
|
||||||
hpix_v := (others => (others => '0'));
|
|
||||||
END IF;
|
|
||||||
o_hpix0<=hpix_v;
|
o_hpix0<=hpix_v;
|
||||||
o_hpix1<=o_hpix0;
|
o_hpix1<=o_hpix0;
|
||||||
o_hpix2<=o_hpix1;
|
o_hpix2<=o_hpix1;
|
||||||
@@ -2611,19 +2526,13 @@ BEGIN
|
|||||||
o_hfrac(2 TO 9) <= o_hfrac(1 TO 8);
|
o_hfrac(2 TO 9) <= o_hfrac(1 TO 8);
|
||||||
|
|
||||||
o_copyv(1 TO 14)<=o_copyv(0 TO 13);
|
o_copyv(1 TO 14)<=o_copyv(0 TO 13);
|
||||||
o_dcptv_clr(1 TO 12)<=o_dcpt_clr & o_dcptv_clr(1 TO 11);
|
|
||||||
o_dcptv_inc(1 TO 12)<=o_dcpt_inc & o_dcptv_inc(1 TO 11);
|
|
||||||
|
|
||||||
IF o_dcptv_clr(12)='1' THEN
|
o_dcptv(1)<=o_dcpt;
|
||||||
o_dcptv(13) <= 0;
|
IF o_dcptv(1)>=o_hsize THEN
|
||||||
ELSIF o_dcptv_inc(12)='1' THEN
|
o_copyv(2)<='0';
|
||||||
o_dcptv(13) <= (o_dcptv(13) + 1) MOD OHRESH;
|
|
||||||
END IF;
|
|
||||||
o_dcptv(14)<=o_dcptv(13);
|
|
||||||
|
|
||||||
IF o_dcptv(13)>=o_hsize THEN
|
|
||||||
o_copyv(14)<='0';
|
|
||||||
END IF;
|
END IF;
|
||||||
|
o_dcptv(2)<=o_dcptv(1) MOD OHRES;
|
||||||
|
o_dcptv(3 TO 14)<=o_dcptv(2 TO 13);
|
||||||
|
|
||||||
-- C2
|
-- C2
|
||||||
o_hpixq(2)<=(o_hpix3,o_hpix2,o_hpix1,o_hpix0);
|
o_hpixq(2)<=(o_hpix3,o_hpix2,o_hpix1,o_hpix0);
|
||||||
@@ -2716,39 +2625,17 @@ BEGIN
|
|||||||
OLBUF:PROCESS(o_clk) IS
|
OLBUF:PROCESS(o_clk) IS
|
||||||
BEGIN
|
BEGIN
|
||||||
IF rising_edge(o_clk) THEN
|
IF rising_edge(o_clk) THEN
|
||||||
-----------------------------------------------
|
|
||||||
-- WRITES
|
-- WRITES
|
||||||
IF o_wr(0)='1' AND o_wadl < OHRESL THEN o_line0(o_wadl MOD OHRESL)<=o_ldw; END IF;
|
IF o_wr(0)='1' THEN o_line0(o_wadl)<=o_ldw; END IF;
|
||||||
IF o_wr(1)='1' AND o_wadl < OHRESL THEN o_line1(o_wadl MOD OHRESL)<=o_ldw; END IF;
|
IF o_wr(1)='1' THEN o_line1(o_wadl)<=o_ldw; END IF;
|
||||||
IF o_wr(2)='1' AND o_wadl < OHRESL THEN o_line2(o_wadl MOD OHRESL)<=o_ldw; END IF;
|
IF o_wr(2)='1' THEN o_line2(o_wadl)<=o_ldw; END IF;
|
||||||
IF o_wr(3)='1' AND o_wadl < OHRESL THEN o_line3(o_wadl MOD OHRESL)<=o_ldw; END IF;
|
IF o_wr(3)='1' THEN o_line3(o_wadl)<=o_ldw; END IF;
|
||||||
IF OHRES = 2304 OR OHRES = 2560 THEN
|
|
||||||
IF o_wr(0)='1' AND o_wadl >= OHRESL THEN o_linf0(o_wadl MOD OHRESM)<=o_ldw; END IF;
|
|
||||||
IF o_wr(1)='1' AND o_wadl >= OHRESL THEN o_linf1(o_wadl MOD OHRESM)<=o_ldw; END IF;
|
|
||||||
IF o_wr(2)='1' AND o_wadl >= OHRESL THEN o_linf2(o_wadl MOD OHRESM)<=o_ldw; END IF;
|
|
||||||
IF o_wr(3)='1' AND o_wadl >= OHRESL THEN o_linf3(o_wadl MOD OHRESM)<=o_ldw; END IF;
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
-----------------------------------------------
|
|
||||||
-- READS
|
-- READS
|
||||||
o_ldr0<=o_line0(o_radl0 MOD OHRESL);
|
o_ldr0<=o_line0(o_radl0);
|
||||||
o_ldr1<=o_line1(o_radl1 MOD OHRESL);
|
o_ldr1<=o_line1(o_radl1);
|
||||||
o_ldr2<=o_line2(o_radl2 MOD OHRESL);
|
o_ldr2<=o_line2(o_radl2);
|
||||||
o_ldr3<=o_line3(o_radl3 MOD OHRESL);
|
o_ldr3<=o_line3(o_radl3);
|
||||||
|
|
||||||
IF OHRES = 2304 OR OHRES = 2560 THEN
|
|
||||||
o_ler0<=o_linf0(o_radl0 MOD OHRESM);
|
|
||||||
o_ler1<=o_linf1(o_radl1 MOD OHRESM);
|
|
||||||
o_ler2<=o_linf2(o_radl2 MOD OHRESM);
|
|
||||||
o_ler3<=o_linf3(o_radl3 MOD OHRESM);
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
o_lex0 <= to_std_logic(o_radl0 >= OHRESL);
|
|
||||||
o_lex1 <= to_std_logic(o_radl1 >= OHRESL);
|
|
||||||
o_lex2 <= to_std_logic(o_radl2 >= OHRESL);
|
|
||||||
o_lex3 <= to_std_logic(o_radl3 >= OHRESL);
|
|
||||||
-----------------------------------------------
|
|
||||||
|
|
||||||
END IF;
|
END IF;
|
||||||
END PROCESS OLBUF;
|
END PROCESS OLBUF;
|
||||||
|
|
||||||
@@ -2834,17 +2721,16 @@ BEGIN
|
|||||||
VSCAL:PROCESS(o_clk) IS
|
VSCAL:PROCESS(o_clk) IS
|
||||||
VARIABLE pixq_v : arr_pix(0 TO 3);
|
VARIABLE pixq_v : arr_pix(0 TO 3);
|
||||||
VARIABLE vlumpix_v : type_pix;
|
VARIABLE vlumpix_v : type_pix;
|
||||||
VARIABLE r1_v, r2_v : natural RANGE 0 TO OHRESH-1;
|
VARIABLE r1_v, r2_v : natural RANGE 0 TO OHRES-1;
|
||||||
VARIABLE fracnn_v : std_logic;
|
VARIABLE fracnn_v : std_logic;
|
||||||
VARIABLE o_l0_v, o_l1_v, o_l2_v, o_l3_v : type_pix;
|
|
||||||
BEGIN
|
BEGIN
|
||||||
IF rising_edge(o_clk) THEN
|
IF rising_edge(o_clk) THEN
|
||||||
IF o_ce='1' THEN
|
IF o_ce='1' THEN
|
||||||
o_v_hmin_adj<=o_hmin + 5;
|
o_v_hmin_adj<=o_hmin + 5;
|
||||||
|
|
||||||
fracnn_v := o_vfrac(o_vfrac'left);
|
fracnn_v := o_vfrac(o_vfrac'left);
|
||||||
r1_v := (o_hcpt - o_v_hmin_adj + OHRESH) MOD OHRESH;
|
r1_v := (o_hcpt - o_v_hmin_adj + OHRES) MOD OHRES;
|
||||||
r2_v := (o_hcpt - o_hmin + OHRESH) MOD OHRESH;
|
r2_v := (o_hcpt - o_hmin + OHRES) MOD OHRES;
|
||||||
|
|
||||||
-- CYCLE 1 -----------------------------------------
|
-- CYCLE 1 -----------------------------------------
|
||||||
-- Read mem
|
-- Read mem
|
||||||
@@ -2871,16 +2757,11 @@ BEGIN
|
|||||||
|
|
||||||
-- CYCLE 2 -----------------------------------------
|
-- CYCLE 2 -----------------------------------------
|
||||||
-- Lines reordering
|
-- Lines reordering
|
||||||
IF o_lex0='0' THEN o_l0_v := o_ldr0; ELSE o_l0_v := o_ler0; END IF;
|
|
||||||
IF o_lex1='0' THEN o_l1_v := o_ldr1; ELSE o_l1_v := o_ler1; END IF;
|
|
||||||
IF o_lex2='0' THEN o_l2_v := o_ldr2; ELSE o_l2_v := o_ler2; END IF;
|
|
||||||
IF o_lex3='0' THEN o_l3_v := o_ldr3; ELSE o_l3_v := o_ler3; END IF;
|
|
||||||
|
|
||||||
CASE o_vacptl IS
|
CASE o_vacptl IS
|
||||||
WHEN "10" => pixq_v:=(o_l0_v,o_l1_v,o_l2_v,o_l3_v);
|
WHEN "10" => pixq_v:=(o_ldr0,o_ldr1,o_ldr2,o_ldr3);
|
||||||
WHEN "11" => pixq_v:=(o_l1_v,o_l2_v,o_l3_v,o_l0_v);
|
WHEN "11" => pixq_v:=(o_ldr1,o_ldr2,o_ldr3,o_ldr0);
|
||||||
WHEN "00" => pixq_v:=(o_l2_v,o_l3_v,o_l0_v,o_l1_v);
|
WHEN "00" => pixq_v:=(o_ldr2,o_ldr3,o_ldr0,o_ldr1);
|
||||||
WHEN OTHERS => pixq_v:=(o_l3_v,o_l0_v,o_l1_v,o_l2_v);
|
WHEN OTHERS => pixq_v:=(o_ldr3,o_ldr0,o_ldr1,o_ldr2);
|
||||||
END CASE;
|
END CASE;
|
||||||
|
|
||||||
IF fracnn_v = '0' THEN
|
IF fracnn_v = '0' THEN
|
||||||
|
|||||||
+5
-11
@@ -27,7 +27,7 @@
|
|||||||
// VDNUM 1..10
|
// VDNUM 1..10
|
||||||
// BLKSZ 0..7: 0 = 128, 1 = 256, 2 = 512(default), .. 7 = 16384
|
// BLKSZ 0..7: 0 = 128, 1 = 256, 2 = 512(default), .. 7 = 16384
|
||||||
//
|
//
|
||||||
module hps_io #(parameter CONF_STR, CONF_STR_BRAM=0, PS2DIV=0, WIDE=0, VDNUM=1, BLKSZ=2, PS2WE=0, STRLEN=$size(CONF_STR)>>3)
|
module hps_io #(parameter CONF_STR, CONF_STR_BRAM=1, PS2DIV=0, WIDE=0, VDNUM=1, BLKSZ=2, PS2WE=0)
|
||||||
(
|
(
|
||||||
input clk_sys,
|
input clk_sys,
|
||||||
inout [48:0] HPS_BUS,
|
inout [48:0] HPS_BUS,
|
||||||
@@ -232,7 +232,8 @@ video_calc video_calc
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////
|
||||||
|
|
||||||
localparam MAX_W = $clog2((64 > (STRLEN+2)) ? 64 : (STRLEN+2))-1;
|
localparam STRLEN = $size(CONF_STR)>>3;
|
||||||
|
localparam MAX_W = $clog2((32 > (STRLEN+2)) ? 32 : (STRLEN+2))-1;
|
||||||
|
|
||||||
wire [7:0] conf_byte;
|
wire [7:0] conf_byte;
|
||||||
generate
|
generate
|
||||||
@@ -1031,15 +1032,8 @@ module confstr_rom #(parameter CONF_STR, STRLEN)
|
|||||||
output reg [7:0] conf_byte
|
output reg [7:0] conf_byte
|
||||||
);
|
);
|
||||||
|
|
||||||
reg [7:0] rom[STRLEN];
|
wire [7:0] rom[STRLEN];
|
||||||
|
initial for(int i = 0; i < STRLEN; i++) rom[i] = CONF_STR[((STRLEN-i)*8)-1 -:8];
|
||||||
initial begin
|
|
||||||
if( CONF_STR=="" )
|
|
||||||
$readmemh("cfgstr.hex",rom);
|
|
||||||
else
|
|
||||||
for(int i = 0; i < STRLEN; i++) rom[i] = CONF_STR[((STRLEN-i)*8)-1 -:8];
|
|
||||||
end
|
|
||||||
|
|
||||||
always @ (posedge clk_sys) conf_byte <= rom[conf_addr];
|
always @ (posedge clk_sys) conf_byte <= rom[conf_addr];
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
@@ -75,7 +75,7 @@ always @(posedge CLK) begin
|
|||||||
END <= 0;
|
END <= 0;
|
||||||
rd <= READ;
|
rd <= READ;
|
||||||
len <= I2C_WLEN;
|
len <= I2C_WLEN;
|
||||||
if(READ) SD <= {2'b10, I2C_ADDR, 1'b1, 1'b1, 8'b11111111, 1'b1, 3'b011, 9'b111111111};
|
if(READ) SD <= {2'b10, I2C_ADDR, 1'b1, 1'b1, 8'b11111111, 1'b0, 3'b011, 9'b111111111};
|
||||||
else SD <= {2'b10, I2C_ADDR, 1'b0, 1'b1, I2C_WDATA1, 1'b1, I2C_WDATA2, 4'b1011};
|
else SD <= {2'b10, I2C_ADDR, 1'b0, 1'b1, I2C_WDATA1, 1'b1, I2C_WDATA2, 4'b1011};
|
||||||
SD_COUNTER <= 0;
|
SD_COUNTER <= 0;
|
||||||
end else begin
|
end else begin
|
||||||
|
|||||||
+3
-10
@@ -8,9 +8,7 @@ module mcp23009
|
|||||||
|
|
||||||
output reg [2:0] btn,
|
output reg [2:0] btn,
|
||||||
input [2:0] led,
|
input [2:0] led,
|
||||||
output reg flg_sd_cd,
|
output reg sd_cd,
|
||||||
output reg flg_present,
|
|
||||||
output reg flg_mode,
|
|
||||||
|
|
||||||
output scl,
|
output scl,
|
||||||
inout sda
|
inout sda
|
||||||
@@ -52,9 +50,7 @@ always@(posedge clk) begin
|
|||||||
idx <= 0;
|
idx <= 0;
|
||||||
btn <= 0;
|
btn <= 0;
|
||||||
rw <= 0;
|
rw <= 0;
|
||||||
flg_sd_cd <= 1;
|
sd_cd <= 1;
|
||||||
flg_present <= 0;
|
|
||||||
flg_mode <= 1;
|
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
if(~&init_data[idx]) begin
|
if(~&init_data[idx]) begin
|
||||||
@@ -88,10 +84,7 @@ always@(posedge clk) begin
|
|||||||
state <= 0;
|
state <= 0;
|
||||||
rw <= 0;
|
rw <= 0;
|
||||||
if(!error) begin
|
if(!error) begin
|
||||||
if(rw) begin
|
if(rw) {sd_cd, btn} <= {dout[7], dout[5:3]};
|
||||||
{flg_sd_cd, flg_mode, btn} <= {dout[7:3]};
|
|
||||||
flg_present <= 1;
|
|
||||||
end
|
|
||||||
rw <= ~rw;
|
rw <= ~rw;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+41
-2
@@ -1,5 +1,44 @@
|
|||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_TOOL_NAME "altera_pll_reconfig"
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_TOOL_VERSION "17.0"
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_TOOL_ENV "mwpim"
|
||||||
|
set_global_assignment -library "pll_cfg" -name MISC_FILE [file join $::quartus(qip_path) "pll_cfg.cmp"]
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_TARGETED_DEVICE_FAMILY "Cyclone V"
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_GENERATED_DEVICE_FAMILY "{Cyclone V}"
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_QSYS_MODE "UNKNOWN"
|
||||||
set_global_assignment -name SYNTHESIS_ONLY_QIP ON
|
set_global_assignment -name SYNTHESIS_ONLY_QIP ON
|
||||||
set_global_assignment -library "pll_cfg" -name VERILOG_FILE [file join $::quartus(qip_path) "pll_cfg/pll_cfg.v"]
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_COMPONENT_NAME "cGxsX2hkbWlfY2Zn"
|
||||||
set_global_assignment -library "pll_cfg" -name VERILOG_FILE [file join $::quartus(qip_path) "pll_cfg/pll_cfg_hdmi.v"]
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_COMPONENT_DISPLAY_NAME "QWx0ZXJhIFBMTCBSZWNvbmZpZw=="
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_COMPONENT_REPORT_HIERARCHY "Off"
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_COMPONENT_INTERNAL "Off"
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_COMPONENT_AUTHOR "QWx0ZXJhIENvcnBvcmF0aW9u"
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_COMPONENT_VERSION "MTcuMA=="
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_COMPONENT_DESCRIPTION "QWx0ZXJhIFBoYXNlLUxvY2tlZCBMb29wIFJlY29uZmlndXJhdGlvbiBCbG9jayhBTFRFUkFfUExMX1JFQ09ORklHKQ=="
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_COMPONENT_PARAMETER "RU5BQkxFX0JZVEVFTkFCTEU=::ZmFsc2U=::QWRkIGJ5dGVlbmFibGUgcG9ydA=="
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_COMPONENT_PARAMETER "QllURUVOQUJMRV9XSURUSA==::NA==::QllURUVOQUJMRV9XSURUSA=="
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_COMPONENT_PARAMETER "UkVDT05GSUdfQUREUl9XSURUSA==::Ng==::UkVDT05GSUdfQUREUl9XSURUSA=="
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_COMPONENT_PARAMETER "UkVDT05GSUdfREFUQV9XSURUSA==::MzI=::UkVDT05GSUdfREFUQV9XSURUSA=="
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_COMPONENT_PARAMETER "cmVjb25mX3dpZHRo::NjQ=::cmVjb25mX3dpZHRo"
|
||||||
|
set_global_assignment -entity "pll_cfg" -library "pll_cfg" -name IP_COMPONENT_PARAMETER "V0FJVF9GT1JfTE9DSw==::dHJ1ZQ==::V0FJVF9GT1JfTE9DSw=="
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_NAME "YWx0ZXJhX3BsbF9yZWNvbmZpZ190b3A="
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_DISPLAY_NAME "QWx0ZXJhIFBMTCBSZWNvbmZpZw=="
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_REPORT_HIERARCHY "Off"
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_INTERNAL "Off"
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_AUTHOR "QWx0ZXJhIENvcnBvcmF0aW9u"
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_VERSION "MTcuMA=="
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_DESCRIPTION "QWx0ZXJhIFBoYXNlLUxvY2tlZCBMb29wIFJlY29uZmlndXJhdGlvbiBCbG9jayhBTFRFUkFfUExMX1JFQ09ORklHKQ=="
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_PARAMETER "ZGV2aWNlX2ZhbWlseQ==::Q3ljbG9uZSBW::ZGV2aWNlX2ZhbWlseQ=="
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_PARAMETER "RU5BQkxFX01JRg==::ZmFsc2U=::RW5hYmxlIE1JRiBTdHJlYW1pbmc="
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_PARAMETER "RU5BQkxFX0JZVEVFTkFCTEU=::ZmFsc2U=::QWRkIGJ5dGVlbmFibGUgcG9ydA=="
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_PARAMETER "QllURUVOQUJMRV9XSURUSA==::NA==::QllURUVOQUJMRV9XSURUSA=="
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_PARAMETER "UkVDT05GSUdfQUREUl9XSURUSA==::Ng==::UkVDT05GSUdfQUREUl9XSURUSA=="
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_PARAMETER "UkVDT05GSUdfREFUQV9XSURUSA==::MzI=::UkVDT05GSUdfREFUQV9XSURUSA=="
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_PARAMETER "cmVjb25mX3dpZHRo::NjQ=::cmVjb25mX3dpZHRo"
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_COMPONENT_PARAMETER "V0FJVF9GT1JfTE9DSw==::dHJ1ZQ==::V0FJVF9GT1JfTE9DSw=="
|
||||||
|
|
||||||
|
set_global_assignment -library "pll_cfg" -name VERILOG_FILE [file join $::quartus(qip_path) "pll_cfg.v"]
|
||||||
set_global_assignment -library "pll_cfg" -name VERILOG_FILE [file join $::quartus(qip_path) "pll_cfg/altera_pll_reconfig_top.v"]
|
set_global_assignment -library "pll_cfg" -name VERILOG_FILE [file join $::quartus(qip_path) "pll_cfg/altera_pll_reconfig_top.v"]
|
||||||
set_global_assignment -library "pll_cfg" -name VERILOG_FILE [file join $::quartus(qip_path) "pll_cfg/altera_pll_reconfig_core.v"]
|
set_global_assignment -library "pll_cfg" -name VERILOG_FILE [file join $::quartus(qip_path) "pll_cfg/altera_pll_reconfig_core.v"]
|
||||||
|
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_TOOL_NAME "altera_pll_reconfig"
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_TOOL_VERSION "17.0"
|
||||||
|
set_global_assignment -entity "altera_pll_reconfig_top" -library "pll_cfg" -name IP_TOOL_ENV "mwpim"
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
module altera_pll_reconfig_core
|
module altera_pll_reconfig_core
|
||||||
#(
|
#(
|
||||||
parameter reconf_width = 64,
|
parameter reconf_width = 64,
|
||||||
parameter device_family = "Cyclone V",
|
parameter device_family = "Stratix V",
|
||||||
// MIF Streaming parameters
|
// MIF Streaming parameters
|
||||||
parameter RECONFIG_ADDR_WIDTH = 6,
|
parameter RECONFIG_ADDR_WIDTH = 6,
|
||||||
parameter RECONFIG_DATA_WIDTH = 32,
|
parameter RECONFIG_DATA_WIDTH = 32,
|
||||||
@@ -1883,7 +1883,7 @@ module fpll_dprio_init (
|
|||||||
endmodule
|
endmodule
|
||||||
module dyn_phase_shift
|
module dyn_phase_shift
|
||||||
#(
|
#(
|
||||||
parameter device_family = "Cyclone V"
|
parameter device_family = "Stratix V"
|
||||||
) (
|
) (
|
||||||
|
|
||||||
input wire clk,
|
input wire clk,
|
||||||
@@ -2112,7 +2112,7 @@ endmodule
|
|||||||
module generic_lcell_comb
|
module generic_lcell_comb
|
||||||
#(
|
#(
|
||||||
//parameter
|
//parameter
|
||||||
parameter family = "Cyclone V",
|
parameter family = "Stratix V",
|
||||||
parameter lut_mask = 64'hAAAAAAAAAAAAAAAA,
|
parameter lut_mask = 64'hAAAAAAAAAAAAAAAA,
|
||||||
parameter dont_touch = "on"
|
parameter dont_touch = "on"
|
||||||
) (
|
) (
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
module altera_pll_reconfig_top
|
module altera_pll_reconfig_top
|
||||||
#(
|
#(
|
||||||
parameter reconf_width = 64,
|
parameter reconf_width = 64,
|
||||||
parameter device_family = "Cyclone V",
|
parameter device_family = "Stratix V",
|
||||||
parameter RECONFIG_ADDR_WIDTH = 6,
|
parameter RECONFIG_ADDR_WIDTH = 6,
|
||||||
parameter RECONFIG_DATA_WIDTH = 32,
|
parameter RECONFIG_DATA_WIDTH = 32,
|
||||||
|
|
||||||
|
|||||||
@@ -1,86 +0,0 @@
|
|||||||
// megafunction wizard: %Altera PLL Reconfig v17.0%
|
|
||||||
// GENERATION: XML
|
|
||||||
// pll_cfg.v
|
|
||||||
|
|
||||||
// Generated using ACDS version 17.0 598
|
|
||||||
|
|
||||||
`timescale 1 ps / 1 ps
|
|
||||||
module pll_cfg #(
|
|
||||||
parameter ENABLE_BYTEENABLE = 0,
|
|
||||||
parameter BYTEENABLE_WIDTH = 4,
|
|
||||||
parameter RECONFIG_ADDR_WIDTH = 6,
|
|
||||||
parameter RECONFIG_DATA_WIDTH = 32,
|
|
||||||
parameter reconf_width = 64,
|
|
||||||
parameter WAIT_FOR_LOCK = 1
|
|
||||||
) (
|
|
||||||
input wire mgmt_clk, // mgmt_clk.clk
|
|
||||||
input wire mgmt_reset, // mgmt_reset.reset
|
|
||||||
output wire mgmt_waitrequest, // mgmt_avalon_slave.waitrequest
|
|
||||||
input wire mgmt_read, // .read
|
|
||||||
input wire mgmt_write, // .write
|
|
||||||
output wire [31:0] mgmt_readdata, // .readdata
|
|
||||||
input wire [5:0] mgmt_address, // .address
|
|
||||||
input wire [31:0] mgmt_writedata, // .writedata
|
|
||||||
output wire [63:0] reconfig_to_pll, // reconfig_to_pll.reconfig_to_pll
|
|
||||||
input wire [63:0] reconfig_from_pll // reconfig_from_pll.reconfig_from_pll
|
|
||||||
);
|
|
||||||
|
|
||||||
altera_pll_reconfig_top #(
|
|
||||||
.device_family ("Cyclone V"),
|
|
||||||
.ENABLE_MIF (0),
|
|
||||||
.MIF_FILE_NAME ("sys/pll_cfg.mif"),
|
|
||||||
.ENABLE_BYTEENABLE (ENABLE_BYTEENABLE),
|
|
||||||
.BYTEENABLE_WIDTH (BYTEENABLE_WIDTH),
|
|
||||||
.RECONFIG_ADDR_WIDTH (RECONFIG_ADDR_WIDTH),
|
|
||||||
.RECONFIG_DATA_WIDTH (RECONFIG_DATA_WIDTH),
|
|
||||||
.reconf_width (reconf_width),
|
|
||||||
.WAIT_FOR_LOCK (WAIT_FOR_LOCK)
|
|
||||||
) pll_cfg_inst (
|
|
||||||
.mgmt_clk (mgmt_clk), // mgmt_clk.clk
|
|
||||||
.mgmt_reset (mgmt_reset), // mgmt_reset.reset
|
|
||||||
.mgmt_waitrequest (mgmt_waitrequest), // mgmt_avalon_slave.waitrequest
|
|
||||||
.mgmt_read (mgmt_read), // .read
|
|
||||||
.mgmt_write (mgmt_write), // .write
|
|
||||||
.mgmt_readdata (mgmt_readdata), // .readdata
|
|
||||||
.mgmt_address (mgmt_address), // .address
|
|
||||||
.mgmt_writedata (mgmt_writedata), // .writedata
|
|
||||||
.reconfig_to_pll (reconfig_to_pll), // reconfig_to_pll.reconfig_to_pll
|
|
||||||
.reconfig_from_pll (reconfig_from_pll), // reconfig_from_pll.reconfig_from_pll
|
|
||||||
.mgmt_byteenable (4'b0000) // (terminated)
|
|
||||||
);
|
|
||||||
|
|
||||||
endmodule
|
|
||||||
// Retrieval info: <?xml version="1.0"?>
|
|
||||||
//<!--
|
|
||||||
// Generated by Altera MegaWizard Launcher Utility version 1.0
|
|
||||||
// ************************************************************
|
|
||||||
// THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
|
|
||||||
// ************************************************************
|
|
||||||
// Copyright (C) 1991-2018 Altera Corporation
|
|
||||||
// Any megafunction design, and related net list (encrypted or decrypted),
|
|
||||||
// support information, device programming or simulation file, and any other
|
|
||||||
// associated documentation or information provided by Altera or a partner
|
|
||||||
// under Altera's Megafunction Partnership Program may be used only to
|
|
||||||
// program PLD devices (but not masked PLD devices) from Altera. Any other
|
|
||||||
// use of such megafunction design, net list, support information, device
|
|
||||||
// programming or simulation file, or any other related documentation or
|
|
||||||
// information is prohibited for any other purpose, including, but not
|
|
||||||
// limited to modification, reverse engineering, de-compiling, or use with
|
|
||||||
// any other silicon devices, unless such use is explicitly licensed under
|
|
||||||
// a separate agreement with Altera or a megafunction partner. Title to
|
|
||||||
// the intellectual property, including patents, copyrights, trademarks,
|
|
||||||
// trade secrets, or maskworks, embodied in any such megafunction design,
|
|
||||||
// net list, support information, device programming or simulation file, or
|
|
||||||
// any other related documentation or information provided by Altera or a
|
|
||||||
// megafunction partner, remains with Altera, the megafunction partner, or
|
|
||||||
// their respective licensors. No other licenses, including any licenses
|
|
||||||
// needed under any third party's intellectual property, are provided herein.
|
|
||||||
//-->
|
|
||||||
// Retrieval info: <instance entity-name="altera_pll_reconfig" version="17.0" >
|
|
||||||
// Retrieval info: <generic name="device_family" value="Cyclone V" />
|
|
||||||
// Retrieval info: <generic name="ENABLE_MIF" value="false" />
|
|
||||||
// Retrieval info: <generic name="MIF_FILE_NAME" value="sys/pll_cfg.mif" />
|
|
||||||
// Retrieval info: <generic name="ENABLE_BYTEENABLE" value="false" />
|
|
||||||
// Retrieval info: </instance>
|
|
||||||
// IPFS_FILES : pll_cfg.vo
|
|
||||||
// RELATED_FILES: pll_cfg.v, altera_pll_reconfig_top.v, altera_pll_reconfig_core.v, altera_std_synchronizer.v
|
|
||||||
File diff suppressed because it is too large.
Load diff
+4
-1
@@ -1,4 +1,7 @@
|
|||||||
set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) pll.13.qip ]
|
set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) pll.13.qip ]
|
||||||
set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) pll_hdmi.13.qip ]
|
set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) pll_hdmi.13.qip ]
|
||||||
set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) pll_audio.13.qip ]
|
set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) pll_audio.13.qip ]
|
||||||
set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) pll_cfg.qip ]
|
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) pll_cfg.v ]
|
||||||
|
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) pll_cfg/altera_pll_reconfig_core.v ]
|
||||||
|
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) pll_cfg/altera_pll_reconfig_top.v ]
|
||||||
|
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) pll_cfg_hdmi.v ]
|
||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
set_global_assignment -name QIP_FILE rtl/pll.qip
|
set_global_assignment -name QIP_FILE rtl/pll.qip
|
||||||
set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) pll_hdmi.qip ]
|
set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) pll_hdmi.qip ]
|
||||||
set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) pll_audio.qip ]
|
set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) pll_audio.qip ]
|
||||||
set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) pll_cfg.qip ]
|
#set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) pll_cfg.qip ]
|
||||||
|
set_global_assignment -name VERILOG_FILE [file join $::quartus(qip_path) pll_cfg_hdmi.v ]
|
||||||
+4
-4
@@ -58,10 +58,10 @@ localparam DW = WIDE ? 15 : 7;
|
|||||||
localparam SZ = OCTAL ? 8 : 1;
|
localparam SZ = OCTAL ? 8 : 1;
|
||||||
localparam SW = SZ-1;
|
localparam SW = SZ-1;
|
||||||
|
|
||||||
localparam DATA_TOKEN_CMD25 = 8'hfc;
|
wire [7:0] DATA_TOKEN_CMD25 = 8'hfc;
|
||||||
localparam STOP_TRAN = 8'hfd;
|
wire [7:0] STOP_TRAN = 8'hfd;
|
||||||
localparam DATA_TOKEN = 8'hfe;
|
wire [7:0] DATA_TOKEN = 8'hfe;
|
||||||
localparam WRITE_DATA_RESPONSE = 8'he5;
|
wire [7:0] WRITE_DATA_RESPONSE = 8'h05;
|
||||||
|
|
||||||
// number of bytes to wait after a command before sending the reply
|
// number of bytes to wait after a command before sending the reply
|
||||||
localparam NCR = 5+3; // 5 bytes are required (command length)
|
localparam NCR = 5+3; // 5 bytes are required (command length)
|
||||||
|
|||||||
+9
-2
@@ -16,6 +16,13 @@ set_location_assignment PIN_V10 -to ADC_SCK
|
|||||||
set_location_assignment PIN_AC4 -to ADC_SDI
|
set_location_assignment PIN_AC4 -to ADC_SDI
|
||||||
set_location_assignment PIN_AD4 -to ADC_SDO
|
set_location_assignment PIN_AD4 -to ADC_SDO
|
||||||
|
|
||||||
|
#============================================================
|
||||||
|
# ARDUINO
|
||||||
|
#============================================================
|
||||||
|
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[*]
|
||||||
|
|
||||||
#============================================================
|
#============================================================
|
||||||
# I2C LEDS/BUTTONS
|
# I2C LEDS/BUTTONS
|
||||||
#============================================================
|
#============================================================
|
||||||
@@ -65,8 +72,8 @@ set_location_assignment PIN_AD17 -to SDRAM_A[11]
|
|||||||
set_location_assignment PIN_D12 -to SDRAM_A[12]
|
set_location_assignment PIN_D12 -to SDRAM_A[12]
|
||||||
set_location_assignment PIN_Y17 -to SDRAM_BA[0]
|
set_location_assignment PIN_Y17 -to SDRAM_BA[0]
|
||||||
set_location_assignment PIN_AB25 -to SDRAM_BA[1]
|
set_location_assignment PIN_AB25 -to SDRAM_BA[1]
|
||||||
set_location_assignment PIN_V12 -to SDRAM_DQ[0]
|
set_location_assignment PIN_E8 -to SDRAM_DQ[0]
|
||||||
set_location_assignment PIN_E8 -to SDRAM_DQ[1]
|
set_location_assignment PIN_V12 -to SDRAM_DQ[1]
|
||||||
set_location_assignment PIN_D11 -to SDRAM_DQ[2]
|
set_location_assignment PIN_D11 -to SDRAM_DQ[2]
|
||||||
set_location_assignment PIN_W12 -to SDRAM_DQ[3]
|
set_location_assignment PIN_W12 -to SDRAM_DQ[3]
|
||||||
set_location_assignment PIN_AH13 -to SDRAM_DQ[4]
|
set_location_assignment PIN_AH13 -to SDRAM_DQ[4]
|
||||||
|
|||||||
+1
-5
@@ -25,7 +25,6 @@ set_false_path -from [get_ports {KEY*}]
|
|||||||
set_false_path -from [get_ports {BTN_*}]
|
set_false_path -from [get_ports {BTN_*}]
|
||||||
set_false_path -to [get_ports {LED_*}]
|
set_false_path -to [get_ports {LED_*}]
|
||||||
set_false_path -to [get_ports {VGA_*}]
|
set_false_path -to [get_ports {VGA_*}]
|
||||||
set_false_path -from [get_ports {VGA_EN}]
|
|
||||||
set_false_path -to [get_ports {AUDIO_SPDIF}]
|
set_false_path -to [get_ports {AUDIO_SPDIF}]
|
||||||
set_false_path -to [get_ports {AUDIO_L}]
|
set_false_path -to [get_ports {AUDIO_L}]
|
||||||
set_false_path -to [get_ports {AUDIO_R}]
|
set_false_path -to [get_ports {AUDIO_R}]
|
||||||
@@ -35,7 +34,6 @@ set_false_path -from {cfg[*]}
|
|||||||
set_false_path -from {VSET[*]}
|
set_false_path -from {VSET[*]}
|
||||||
set_false_path -to {wcalc[*] hcalc[*]}
|
set_false_path -to {wcalc[*] hcalc[*]}
|
||||||
set_false_path -to {hdmi_width[*] hdmi_height[*]}
|
set_false_path -to {hdmi_width[*] hdmi_height[*]}
|
||||||
set_false_path -to {deb_* btn_en btn_up}
|
|
||||||
|
|
||||||
set_multicycle_path -to {*_osd|osd_vcnt*} -setup 2
|
set_multicycle_path -to {*_osd|osd_vcnt*} -setup 2
|
||||||
set_multicycle_path -to {*_osd|osd_vcnt*} -hold 1
|
set_multicycle_path -to {*_osd|osd_vcnt*} -hold 1
|
||||||
@@ -60,7 +58,6 @@ set_false_path -from {vol_att[*] scaler_flt[*] led_overtake[*] led_state[*]}
|
|||||||
set_false_path -from {aflt_* acx* acy* areset* arc*}
|
set_false_path -from {aflt_* acx* acy* areset* arc*}
|
||||||
set_false_path -from {arx* ary*}
|
set_false_path -from {arx* ary*}
|
||||||
set_false_path -from {vs_line*}
|
set_false_path -from {vs_line*}
|
||||||
set_false_path -from {ColorBurst_Range* PhaseInc* pal_en cvbs yc_en}
|
|
||||||
|
|
||||||
set_false_path -from {ascal|o_ihsize*}
|
set_false_path -from {ascal|o_ihsize*}
|
||||||
set_false_path -from {ascal|o_ivsize*}
|
set_false_path -from {ascal|o_ivsize*}
|
||||||
@@ -73,5 +70,4 @@ set_false_path -from {ascal|o_htotal* ascal|o_vtotal*}
|
|||||||
set_false_path -from {ascal|o_hsstart* ascal|o_vsstart* ascal|o_hsend* ascal|o_vsend*}
|
set_false_path -from {ascal|o_hsstart* ascal|o_vsstart* ascal|o_hsend* ascal|o_vsend*}
|
||||||
set_false_path -from {ascal|o_hsize* ascal|o_vsize*}
|
set_false_path -from {ascal|o_hsize* ascal|o_vsize*}
|
||||||
|
|
||||||
set_false_path -from {mcp23009|flg_*}
|
set_false_path -from {mcp23009|sd_cd}
|
||||||
set_false_path -to {sysmem|fpga_interfaces|clocks_resets|f2h*}
|
|
||||||
+175
-270
@@ -72,7 +72,7 @@ module sys_top
|
|||||||
output [5:0] VGA_R,
|
output [5:0] VGA_R,
|
||||||
output [5:0] VGA_G,
|
output [5:0] VGA_G,
|
||||||
output [5:0] VGA_B,
|
output [5:0] VGA_B,
|
||||||
inout VGA_HS,
|
inout VGA_HS, // VGA_HS is secondary SD card detect when VGA_EN = 1 (inactive)
|
||||||
output VGA_VS,
|
output VGA_VS,
|
||||||
input VGA_EN, // active low
|
input VGA_EN, // active low
|
||||||
|
|
||||||
@@ -125,23 +125,27 @@ module sys_top
|
|||||||
);
|
);
|
||||||
|
|
||||||
////////////////////// Secondary SD ///////////////////////////////////
|
////////////////////// Secondary SD ///////////////////////////////////
|
||||||
wire SD_CS, SD_CLK, SD_MOSI, SD_MISO, SD_CD;
|
wire SD_CS, SD_CLK, SD_MOSI;
|
||||||
|
|
||||||
`ifndef MISTER_DUAL_SDRAM
|
`ifndef MISTER_DUAL_SDRAM
|
||||||
wire sd_cd = SDCD_SPDIF & ~SW[2]; // SW[2]=ON workaround for faulty boards without SD card detect pin.
|
wire sd_miso = SW[3] | SDIO_DAT[0];
|
||||||
assign SD_CD = mcp_en ? mcp_sdcd : sd_cd;
|
|
||||||
assign SD_MISO = SD_CD | (mcp_en ? SD_SPI_MISO : (VGA_EN | SDIO_DAT[0]));
|
|
||||||
assign SD_SPI_CS = mcp_en ? (mcp_sdcd ? 1'bZ : SD_CS) : (sog & ~cs1 & ~VGA_EN) ? 1'b1 : 1'bZ;
|
|
||||||
assign SD_SPI_CLK = (~mcp_en | mcp_sdcd) ? 1'bZ : SD_CLK;
|
|
||||||
assign SD_SPI_MOSI = (~mcp_en | mcp_sdcd) ? 1'bZ : SD_MOSI;
|
|
||||||
assign {SDIO_CLK,SDIO_CMD,SDIO_DAT} = av_dis ? 6'bZZZZZZ : (mcp_en | sd_cd) ? {vga_g,vga_r,vga_b} : {SD_CLK,SD_MOSI,SD_CS,3'bZZZ};
|
|
||||||
`else
|
`else
|
||||||
assign SD_CD = mcp_sdcd;
|
wire sd_miso = 1;
|
||||||
assign SD_MISO = mcp_sdcd | SD_SPI_MISO;
|
|
||||||
assign SD_SPI_CS = mcp_sdcd ? 1'bZ : SD_CS;
|
|
||||||
assign SD_SPI_CLK = mcp_sdcd ? 1'bZ : SD_CLK;
|
|
||||||
assign SD_SPI_MOSI = mcp_sdcd ? 1'bZ : SD_MOSI;
|
|
||||||
`endif
|
`endif
|
||||||
|
wire SD_MISO = mcp_sdcd ? sd_miso : SD_SPI_MISO;
|
||||||
|
|
||||||
|
`ifndef MISTER_DUAL_SDRAM
|
||||||
|
assign SDIO_DAT[2:1]= 2'bZZ;
|
||||||
|
assign SDIO_DAT[3] = SW[3] ? 1'bZ : SD_CS;
|
||||||
|
assign SDIO_CLK = SW[3] ? 1'bZ : SD_CLK;
|
||||||
|
assign SDIO_CMD = SW[3] ? 1'bZ : SD_MOSI;
|
||||||
|
assign SD_SPI_CS = mcp_sdcd ? ((~VGA_EN & sog & ~cs1) ? 1'b1 : 1'bZ) : SD_CS;
|
||||||
|
`else
|
||||||
|
assign SD_SPI_CS = mcp_sdcd ? 1'bZ : SD_CS;
|
||||||
|
`endif
|
||||||
|
|
||||||
|
assign SD_SPI_CLK = mcp_sdcd ? 1'bZ : SD_CLK;
|
||||||
|
assign SD_SPI_MOSI = mcp_sdcd ? 1'bZ : SD_MOSI;
|
||||||
|
|
||||||
////////////////////// LEDs/Buttons ///////////////////////////////////
|
////////////////////// LEDs/Buttons ///////////////////////////////////
|
||||||
|
|
||||||
@@ -153,59 +157,36 @@ wire led_d = led_disk[1] ? ~led_disk[0] : ~(led_disk[0] | gp_out[29]);
|
|||||||
wire led_u = ~led_user;
|
wire led_u = ~led_user;
|
||||||
wire led_locked;
|
wire led_locked;
|
||||||
|
|
||||||
//LEDs on de10-nano board
|
`ifndef MISTER_DUAL_SDRAM
|
||||||
|
assign LED_POWER = (SW[3] | led_p) ? 1'bZ : 1'b0;
|
||||||
|
assign LED_HDD = (SW[3] | led_d) ? 1'bZ : 1'b0;
|
||||||
|
assign LED_USER = (SW[3] | led_u) ? 1'bZ : 1'b0;
|
||||||
|
`endif
|
||||||
|
|
||||||
|
//LEDs on main board
|
||||||
assign LED = (led_overtake & led_state) | (~led_overtake & {1'b0,led_locked,1'b0, ~led_p, 1'b0, ~led_d, 1'b0, ~led_u});
|
assign LED = (led_overtake & led_state) | (~led_overtake & {1'b0,led_locked,1'b0, ~led_p, 1'b0, ~led_d, 1'b0, ~led_u});
|
||||||
|
|
||||||
|
wire btn_r, btn_o, btn_u;
|
||||||
|
`ifdef MISTER_DUAL_SDRAM
|
||||||
|
assign {btn_r,btn_o,btn_u} = SW[3] ? {mcp_btn[1],mcp_btn[2],mcp_btn[0]} : ~{SDRAM2_DQ[9],SDRAM2_DQ[13],SDRAM2_DQ[11]};
|
||||||
|
`else
|
||||||
|
assign {btn_r,btn_o,btn_u} = ~{BTN_RESET,BTN_OSD,BTN_USER} | {mcp_btn[1],mcp_btn[2],mcp_btn[0]};
|
||||||
|
`endif
|
||||||
|
|
||||||
wire [2:0] mcp_btn;
|
wire [2:0] mcp_btn;
|
||||||
wire mcp_sdcd;
|
wire mcp_sdcd;
|
||||||
wire mcp_en;
|
|
||||||
wire mcp_mode;
|
|
||||||
mcp23009 mcp23009
|
mcp23009 mcp23009
|
||||||
(
|
(
|
||||||
.clk(FPGA_CLK2_50),
|
.clk(FPGA_CLK2_50),
|
||||||
|
|
||||||
.btn(mcp_btn),
|
.btn(mcp_btn),
|
||||||
.led({led_p, led_d, led_u}),
|
.led({led_p, led_d, led_u}),
|
||||||
.flg_sd_cd(mcp_sdcd),
|
.sd_cd(mcp_sdcd),
|
||||||
.flg_present(mcp_en),
|
|
||||||
.flg_mode(mcp_mode),
|
|
||||||
|
|
||||||
.scl(IO_SCL),
|
.scl(IO_SCL),
|
||||||
.sda(IO_SDA)
|
.sda(IO_SDA)
|
||||||
);
|
);
|
||||||
|
|
||||||
wire io_dig = mcp_en ? mcp_mode : SW[3];
|
|
||||||
|
|
||||||
`ifndef MISTER_DUAL_SDRAM
|
|
||||||
wire av_dis = io_dig | VGA_EN;
|
|
||||||
assign LED_POWER = av_dis ? 1'bZ : mcp_en ? de1 : led_p ? 1'bZ : 1'b0;
|
|
||||||
assign LED_HDD = av_dis ? 1'bZ : mcp_en ? (sog & ~cs1) : led_d ? 1'bZ : 1'b0;
|
|
||||||
//assign LED_USER = av_dis ? 1'bZ : mcp_en ? ~vga_tx_clk : led_u ? 1'bZ : 1'b0;
|
|
||||||
assign LED_USER = VGA_TX_CLK;
|
|
||||||
wire BTN_DIS = VGA_EN;
|
|
||||||
`else
|
|
||||||
wire BTN_RESET = 1'b1;
|
|
||||||
wire BTN_OSD = 1'b1;
|
|
||||||
wire BTN_USER = 1'b1;
|
|
||||||
wire BTN_DIS = 1'b1;
|
|
||||||
`endif
|
|
||||||
|
|
||||||
reg BTN_EN = 0;
|
|
||||||
reg [25:0] btn_timeout = 0;
|
|
||||||
initial btn_timeout = 0;
|
|
||||||
always @(posedge FPGA_CLK2_50) begin
|
|
||||||
reg btn_up = 0;
|
|
||||||
reg btn_en = 0;
|
|
||||||
|
|
||||||
btn_up <= BTN_RESET & BTN_OSD & BTN_USER;
|
|
||||||
if(~reset & btn_up & ~&btn_timeout) btn_timeout <= btn_timeout + 1'd1;
|
|
||||||
btn_en <= ~BTN_DIS;
|
|
||||||
BTN_EN <= &btn_timeout & btn_en;
|
|
||||||
end
|
|
||||||
|
|
||||||
wire btn_r = (mcp_en | SW[3]) ? mcp_btn[1] : (BTN_EN & ~BTN_RESET);
|
|
||||||
wire btn_o = (mcp_en | SW[3]) ? mcp_btn[2] : (BTN_EN & ~BTN_OSD );
|
|
||||||
wire btn_u = (mcp_en | SW[3]) ? mcp_btn[0] : (BTN_EN & ~BTN_USER );
|
|
||||||
|
|
||||||
reg btn_user, btn_osd;
|
reg btn_user, btn_osd;
|
||||||
always @(posedge FPGA_CLK2_50) begin
|
always @(posedge FPGA_CLK2_50) begin
|
||||||
@@ -231,7 +212,7 @@ end
|
|||||||
|
|
||||||
// gp_in[31] = 0 - quick flag that FPGA is initialized (HPS reads 1 when FPGA is not in user mode)
|
// gp_in[31] = 0 - quick flag that FPGA is initialized (HPS reads 1 when FPGA is not in user mode)
|
||||||
// used to avoid lockups while JTAG loading
|
// used to avoid lockups while JTAG loading
|
||||||
wire [31:0] gp_in = {1'b0, btn_user | btn[1], btn_osd | btn[0], io_dig, 8'd0, io_ver, io_ack, io_wide, io_dout | io_dout_sys};
|
wire [31:0] gp_in = {1'b0, btn_user | btn[1], btn_osd | btn[0], SW[3], 8'd0, io_ver, io_ack, io_wide, io_dout | io_dout_sys};
|
||||||
wire [31:0] gp_out;
|
wire [31:0] gp_out;
|
||||||
|
|
||||||
wire [1:0] io_ver = 1; // 0 - obsolete. 1 - optimized HPS I/O. 2,3 - reserved for future.
|
wire [1:0] io_ver = 1; // 0 - obsolete. 1 - optimized HPS I/O. 2,3 - reserved for future.
|
||||||
@@ -245,7 +226,7 @@ wire io_ss1 = gp_outr[19];
|
|||||||
wire io_ss2 = gp_outr[20];
|
wire io_ss2 = gp_outr[20];
|
||||||
|
|
||||||
`ifndef MISTER_DEBUG_NOHDMI
|
`ifndef MISTER_DEBUG_NOHDMI
|
||||||
wire io_osd_hdmi = io_ss1 & ~io_ss0;
|
wire io_osd_hdmi = io_ss1 & ~io_ss0;
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
wire io_fpga = ~io_ss1 & io_ss0;
|
wire io_fpga = ~io_ss1 & io_ss0;
|
||||||
@@ -286,28 +267,23 @@ cyclonev_hps_interface_mpu_general_purpose h2f_gp
|
|||||||
|
|
||||||
|
|
||||||
reg [15:0] cfg;
|
reg [15:0] cfg;
|
||||||
|
|
||||||
reg cfg_set = 0;
|
reg cfg_set = 0;
|
||||||
|
wire vga_fb = cfg[12] | vga_force_scaler;
|
||||||
|
|
||||||
`ifdef MISTER_DEBUG_NOHDMI
|
`ifdef MISTER_DEBUG_NOHDMI
|
||||||
wire vga_fb = 0;
|
wire direct_video = 1;
|
||||||
wire direct_video = 1;
|
|
||||||
`else
|
`else
|
||||||
wire vga_fb = cfg[12] | vga_force_scaler;
|
wire direct_video = cfg[10];
|
||||||
wire direct_video = cfg[10];
|
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
wire audio_96k = cfg[6];
|
wire audio_96k = cfg[6];
|
||||||
wire csync_en = cfg[3];
|
wire csync_en = cfg[3];
|
||||||
wire io_osd_vga = io_ss1 & ~io_ss2;
|
wire io_osd_vga = io_ss1 & ~io_ss2;
|
||||||
`ifndef MISTER_DUAL_SDRAM
|
`ifndef MISTER_DUAL_SDRAM
|
||||||
wire forced_scandoubler = cfg[4];
|
|
||||||
wire ypbpr_en = cfg[5];
|
wire ypbpr_en = cfg[5];
|
||||||
wire sog = cfg[9];
|
wire sog = cfg[9];
|
||||||
`ifdef MISTER_DEBUG_NOHDMI
|
|
||||||
wire vga_scaler = 0;
|
|
||||||
`else
|
|
||||||
wire vga_scaler = cfg[2] | vga_force_scaler;
|
wire vga_scaler = cfg[2] | vga_force_scaler;
|
||||||
`endif
|
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
reg cfg_custom_t = 0;
|
reg cfg_custom_t = 0;
|
||||||
@@ -333,7 +309,6 @@ reg [11:0] vs_line = 0;
|
|||||||
|
|
||||||
reg scaler_out = 0;
|
reg scaler_out = 0;
|
||||||
reg vrr_mode = 0;
|
reg vrr_mode = 0;
|
||||||
wire hdmi_blackout;
|
|
||||||
|
|
||||||
reg [31:0] aflt_rate = 7056000;
|
reg [31:0] aflt_rate = 7056000;
|
||||||
reg [39:0] acx = 4258969;
|
reg [39:0] acx = 4258969;
|
||||||
@@ -395,7 +370,6 @@ always@(posedge clk_sys) begin
|
|||||||
`ifndef MISTER_DEBUG_NOHDMI
|
`ifndef MISTER_DEBUG_NOHDMI
|
||||||
if(io_din[7:0] == 'h40) io_dout_sys <= fb_crc;
|
if(io_din[7:0] == 'h40) io_dout_sys <= fb_crc;
|
||||||
`endif
|
`endif
|
||||||
if(io_din[7:0] == 'h42) io_dout_sys <= {1'b1, frame_cnt};
|
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
cnt <= cnt + 1'd1;
|
cnt <= cnt + 1'd1;
|
||||||
@@ -502,22 +476,18 @@ always@(posedge clk_sys) begin
|
|||||||
endcase
|
endcase
|
||||||
end
|
end
|
||||||
`endif
|
`endif
|
||||||
|
`ifndef MISTER_DISABLE_YC
|
||||||
if(cmd == 'h41) begin
|
if(cmd == 'h41) begin
|
||||||
case(cnt[3:0])
|
case(cnt[3:0])
|
||||||
`ifndef MISTER_DISABLE_YC
|
|
||||||
0: {pal_en,cvbs,yc_en} <= io_din[2:0];
|
0: {pal_en,cvbs,yc_en} <= io_din[2:0];
|
||||||
4: ColorBurst_Range[15:0] <= io_din;
|
|
||||||
5: ColorBurst_Range[16] <= io_din[0];
|
|
||||||
`endif
|
|
||||||
// Subcarrier commands (independent of YC module)
|
|
||||||
1: PhaseInc[15:0] <= io_din;
|
1: PhaseInc[15:0] <= io_din;
|
||||||
2: PhaseInc[31:16] <= io_din;
|
2: PhaseInc[31:16] <= io_din;
|
||||||
3: PhaseInc[39:32] <= io_din[7:0];
|
3: PhaseInc[39:32] <= io_din[7:0];
|
||||||
`ifndef MISTER_DUAL_SDRAM
|
4: ColorBurst_Range[15:0] <= io_din;
|
||||||
6: subcarrier <= io_din[0];
|
5: ColorBurst_Range[16] <= io_din[0];
|
||||||
`endif
|
|
||||||
endcase
|
endcase
|
||||||
end
|
end
|
||||||
|
`endif
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -536,15 +506,6 @@ always@(posedge clk_sys) begin
|
|||||||
if(~vs_d2 & vs_d1) vs_wait <= 0;
|
if(~vs_d2 & vs_d1) vs_wait <= 0;
|
||||||
end
|
end
|
||||||
|
|
||||||
reg [7:0] frame_cnt;
|
|
||||||
always @(posedge clk_sys) begin
|
|
||||||
reg vs_r, vs_old;
|
|
||||||
|
|
||||||
vs_r <= vs_fix;
|
|
||||||
if(vs_r == vs_fix) vs_old <= vs_r;
|
|
||||||
if(~vs_old & vs_r) frame_cnt <= frame_cnt + 1'd1;
|
|
||||||
end
|
|
||||||
|
|
||||||
cyclonev_hps_interface_peripheral_uart uart
|
cyclonev_hps_interface_peripheral_uart uart
|
||||||
(
|
(
|
||||||
.ri(0),
|
.ri(0),
|
||||||
@@ -694,42 +655,40 @@ wire vbuf_write;
|
|||||||
wire [23:0] hdmi_data;
|
wire [23:0] hdmi_data;
|
||||||
wire hdmi_vs, hdmi_hs, hdmi_de, hdmi_vbl, hdmi_brd;
|
wire hdmi_vs, hdmi_hs, hdmi_de, hdmi_vbl, hdmi_brd;
|
||||||
wire freeze;
|
wire freeze;
|
||||||
wire bob_deint;
|
|
||||||
|
|
||||||
`ifndef MISTER_DEBUG_NOHDMI
|
`ifndef MISTER_DEBUG_NOHDMI
|
||||||
wire clk_hdmi = hdmi_clk_out;
|
wire clk_hdmi = hdmi_clk_out;
|
||||||
|
|
||||||
ascal
|
ascal
|
||||||
#(
|
#(
|
||||||
.RAMBASE(32'h20000000),
|
.RAMBASE(32'h20000000),
|
||||||
`ifdef MISTER_SMALL_VBUF
|
`ifdef MISTER_SMALL_VBUF
|
||||||
.RAMSIZE(32'h00200000),
|
.RAMSIZE(32'h00200000),
|
||||||
`else
|
`else
|
||||||
.RAMSIZE(32'h00800000),
|
.RAMSIZE(32'h00800000),
|
||||||
`endif
|
`endif
|
||||||
`ifndef MISTER_FB
|
`ifndef MISTER_FB
|
||||||
.PALETTE2("false"),
|
.PALETTE2("false"),
|
||||||
`else
|
`else
|
||||||
`ifndef MISTER_FB_PALETTE
|
`ifndef MISTER_FB_PALETTE
|
||||||
.PALETTE2("false"),
|
.PALETTE2("false"),
|
||||||
`endif
|
`endif
|
||||||
`endif
|
`endif
|
||||||
`ifdef MISTER_DISABLE_ADAPTIVE
|
`ifdef MISTER_DISABLE_ADAPTIVE
|
||||||
.ADAPTIVE("false"),
|
.ADAPTIVE("false"),
|
||||||
`endif
|
`endif
|
||||||
`ifdef MISTER_DOWNSCALE_NN
|
`ifdef MISTER_DOWNSCALE_NN
|
||||||
.DOWNSCALE_NN("true"),
|
.DOWNSCALE_NN("true"),
|
||||||
`endif
|
`endif
|
||||||
.FRAC(8),
|
.FRAC(8),
|
||||||
.N_DW(128),
|
.N_DW(128),
|
||||||
.N_AW(28)
|
.N_AW(28)
|
||||||
)
|
)
|
||||||
ascal
|
ascal
|
||||||
(
|
(
|
||||||
.reset_na (~reset_req),
|
.reset_na (~reset_req),
|
||||||
.run (1),
|
.run (1),
|
||||||
.freeze (freeze),
|
.freeze (freeze),
|
||||||
.bob_deint (bob_deint),
|
|
||||||
|
|
||||||
.i_clk (clk_ihdmi),
|
.i_clk (clk_ihdmi),
|
||||||
.i_ce (ce_hpix),
|
.i_ce (ce_hpix),
|
||||||
@@ -771,7 +730,6 @@ wire bob_deint;
|
|||||||
.vmax (vmax),
|
.vmax (vmax),
|
||||||
.vrr (vrr_mode),
|
.vrr (vrr_mode),
|
||||||
.vrrmax (HEIGHT + VBP + VS[11:0] + 12'd1),
|
.vrrmax (HEIGHT + VBP + VS[11:0] + 12'd1),
|
||||||
.swblack (hdmi_blackout),
|
|
||||||
|
|
||||||
.mode ({~lowlat,LFB_EN ? LFB_FLT : |scaler_flt,2'b00}),
|
.mode ({~lowlat,LFB_EN ? LFB_FLT : |scaler_flt,2'b00}),
|
||||||
.poly_clk (clk_sys),
|
.poly_clk (clk_sys),
|
||||||
@@ -784,7 +742,7 @@ wire bob_deint;
|
|||||||
.pal1_a (pal_a),
|
.pal1_a (pal_a),
|
||||||
.pal1_wr (pal_wr),
|
.pal1_wr (pal_wr),
|
||||||
|
|
||||||
`ifdef MISTER_FB
|
`ifdef MISTER_FB
|
||||||
`ifdef MISTER_FB_PALETTE
|
`ifdef MISTER_FB_PALETTE
|
||||||
.pal2_clk (fb_pal_clk),
|
.pal2_clk (fb_pal_clk),
|
||||||
.pal2_dw (fb_pal_d),
|
.pal2_dw (fb_pal_d),
|
||||||
@@ -793,7 +751,7 @@ wire bob_deint;
|
|||||||
.pal2_wr (fb_pal_wr),
|
.pal2_wr (fb_pal_wr),
|
||||||
.pal_n (fb_en),
|
.pal_n (fb_en),
|
||||||
`endif
|
`endif
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
.o_fb_ena (FB_EN),
|
.o_fb_ena (FB_EN),
|
||||||
.o_fb_hsize (FB_WIDTH),
|
.o_fb_hsize (FB_WIDTH),
|
||||||
@@ -812,7 +770,7 @@ wire bob_deint;
|
|||||||
.avl_write (vbuf_write),
|
.avl_write (vbuf_write),
|
||||||
.avl_read (vbuf_read),
|
.avl_read (vbuf_read),
|
||||||
.avl_byteenable (vbuf_byteenable)
|
.avl_byteenable (vbuf_byteenable)
|
||||||
);
|
);
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
reg LFB_EN = 0;
|
reg LFB_EN = 0;
|
||||||
@@ -853,8 +811,8 @@ always @(posedge clk_sys) begin
|
|||||||
end
|
end
|
||||||
|
|
||||||
`ifdef MISTER_FB
|
`ifdef MISTER_FB
|
||||||
reg fb_vbl;
|
reg fb_vbl;
|
||||||
always @(posedge clk_vid) fb_vbl <= hdmi_vbl;
|
always @(posedge clk_vid) fb_vbl <= hdmi_vbl;
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
reg ar_md_start;
|
reg ar_md_start;
|
||||||
@@ -980,9 +938,9 @@ always @(posedge clk_vid) begin
|
|||||||
end
|
end
|
||||||
|
|
||||||
`ifndef MISTER_DEBUG_NOHDMI
|
`ifndef MISTER_DEBUG_NOHDMI
|
||||||
wire [15:0] lltune;
|
wire [15:0] lltune;
|
||||||
pll_hdmi_adj pll_hdmi_adj
|
pll_hdmi_adj pll_hdmi_adj
|
||||||
(
|
(
|
||||||
.clk(FPGA_CLK1_50),
|
.clk(FPGA_CLK1_50),
|
||||||
.reset_na(~reset_req),
|
.reset_na(~reset_req),
|
||||||
|
|
||||||
@@ -997,7 +955,7 @@ end
|
|||||||
.o_write(cfg_write),
|
.o_write(cfg_write),
|
||||||
.o_address(cfg_address),
|
.o_address(cfg_address),
|
||||||
.o_writedata(cfg_data)
|
.o_writedata(cfg_data)
|
||||||
);
|
);
|
||||||
`else
|
`else
|
||||||
assign led_locked = 0;
|
assign led_locked = 0;
|
||||||
`endif
|
`endif
|
||||||
@@ -1023,15 +981,15 @@ end
|
|||||||
|
|
||||||
///////////////////////// HDMI output /////////////////////////////////
|
///////////////////////// HDMI output /////////////////////////////////
|
||||||
`ifndef MISTER_DEBUG_NOHDMI
|
`ifndef MISTER_DEBUG_NOHDMI
|
||||||
wire hdmi_clk_out;
|
wire hdmi_clk_out;
|
||||||
pll_hdmi pll_hdmi
|
pll_hdmi pll_hdmi
|
||||||
(
|
(
|
||||||
.refclk(FPGA_CLK1_50),
|
.refclk(FPGA_CLK1_50),
|
||||||
.rst(reset_req),
|
.rst(reset_req),
|
||||||
.reconfig_to_pll(reconfig_to_pll),
|
.reconfig_to_pll(reconfig_to_pll),
|
||||||
.reconfig_from_pll(reconfig_from_pll),
|
.reconfig_from_pll(reconfig_from_pll),
|
||||||
.outclk_0(hdmi_clk_out)
|
.outclk_0(hdmi_clk_out)
|
||||||
);
|
);
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
//1920x1080@60 PCLK=148.5MHz CEA
|
//1920x1080@60 PCLK=148.5MHz CEA
|
||||||
@@ -1056,8 +1014,8 @@ reg [5:0] adj_address;
|
|||||||
reg [31:0] adj_data;
|
reg [31:0] adj_data;
|
||||||
|
|
||||||
`ifndef MISTER_DEBUG_NOHDMI
|
`ifndef MISTER_DEBUG_NOHDMI
|
||||||
pll_cfg_hdmi pll_cfg_hdmi
|
pll_cfg_hdmi pll_cfg_hdmi
|
||||||
(
|
(
|
||||||
.mgmt_clk(FPGA_CLK1_50),
|
.mgmt_clk(FPGA_CLK1_50),
|
||||||
.mgmt_reset(reset_req),
|
.mgmt_reset(reset_req),
|
||||||
.mgmt_waitrequest(cfg_waitrequest),
|
.mgmt_waitrequest(cfg_waitrequest),
|
||||||
@@ -1066,10 +1024,10 @@ reg [31:0] adj_data;
|
|||||||
.mgmt_writedata(cfg_data),
|
.mgmt_writedata(cfg_data),
|
||||||
.reconfig_to_pll(reconfig_to_pll),
|
.reconfig_to_pll(reconfig_to_pll),
|
||||||
.reconfig_from_pll(reconfig_from_pll)
|
.reconfig_from_pll(reconfig_from_pll)
|
||||||
);
|
);
|
||||||
|
|
||||||
reg cfg_got = 0;
|
reg cfg_got = 0;
|
||||||
always @(posedge clk_sys) begin
|
always @(posedge clk_sys) begin
|
||||||
reg vsd, vsd2;
|
reg vsd, vsd2;
|
||||||
if(~cfg_ready || ~cfg_set) cfg_got <= cfg_set;
|
if(~cfg_ready || ~cfg_set) cfg_got <= cfg_set;
|
||||||
else begin
|
else begin
|
||||||
@@ -1077,10 +1035,10 @@ reg [31:0] adj_data;
|
|||||||
vsd2 <= vsd;
|
vsd2 <= vsd;
|
||||||
if(~vsd2 & vsd) cfg_got <= cfg_set;
|
if(~vsd2 & vsd) cfg_got <= cfg_set;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
reg cfg_ready = 0;
|
reg cfg_ready = 0;
|
||||||
always @(posedge FPGA_CLK1_50) begin
|
always @(posedge FPGA_CLK1_50) begin
|
||||||
reg gotd = 0, gotd2 = 0;
|
reg gotd = 0, gotd2 = 0;
|
||||||
reg custd = 0, custd2 = 0;
|
reg custd = 0, custd2 = 0;
|
||||||
reg old_wait = 0;
|
reg old_wait = 0;
|
||||||
@@ -1106,9 +1064,12 @@ reg [31:0] adj_data;
|
|||||||
|
|
||||||
old_wait <= adj_waitrequest;
|
old_wait <= adj_waitrequest;
|
||||||
if(old_wait & ~adj_waitrequest & gotd) cfg_ready <= 1;
|
if(old_wait & ~adj_waitrequest & gotd) cfg_ready <= 1;
|
||||||
end
|
end
|
||||||
|
|
||||||
`else
|
`else
|
||||||
wire cfg_ready = 1;
|
|
||||||
|
wire cfg_ready = 1;
|
||||||
|
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
assign HDMI_I2C_SCL = hdmi_scl_en ? 1'b0 : 1'bZ;
|
assign HDMI_I2C_SCL = hdmi_scl_en ? 1'b0 : 1'bZ;
|
||||||
@@ -1124,25 +1085,26 @@ cyclonev_hps_interface_peripheral_i2c hdmi_i2c
|
|||||||
);
|
);
|
||||||
|
|
||||||
`ifndef MISTER_DEBUG_NOHDMI
|
`ifndef MISTER_DEBUG_NOHDMI
|
||||||
`ifdef MISTER_FB
|
|
||||||
reg dis_output;
|
`ifdef MISTER_FB
|
||||||
always @(posedge clk_hdmi) begin
|
reg dis_output;
|
||||||
|
always @(posedge clk_hdmi) begin
|
||||||
reg dis;
|
reg dis;
|
||||||
dis <= fb_force_blank & ~LFB_EN;
|
dis <= fb_force_blank & ~LFB_EN;
|
||||||
dis_output <= dis;
|
dis_output <= dis;
|
||||||
end
|
end
|
||||||
`else
|
`else
|
||||||
wire dis_output = 0;
|
wire dis_output = 0;
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
wire [23:0] hdmi_data_mask;
|
wire [23:0] hdmi_data_mask;
|
||||||
wire hdmi_de_mask, hdmi_vs_mask, hdmi_hs_mask;
|
wire hdmi_de_mask, hdmi_vs_mask, hdmi_hs_mask;
|
||||||
|
|
||||||
reg [15:0] shadowmask_data;
|
reg [15:0] shadowmask_data;
|
||||||
reg shadowmask_wr = 0;
|
reg shadowmask_wr = 0;
|
||||||
|
|
||||||
shadowmask HDMI_shadowmask
|
shadowmask HDMI_shadowmask
|
||||||
(
|
(
|
||||||
.clk(clk_hdmi),
|
.clk(clk_hdmi),
|
||||||
.clk_sys(clk_sys),
|
.clk_sys(clk_sys),
|
||||||
|
|
||||||
@@ -1160,13 +1122,13 @@ cyclonev_hps_interface_peripheral_i2c hdmi_i2c
|
|||||||
.hs_out(hdmi_hs_mask),
|
.hs_out(hdmi_hs_mask),
|
||||||
.vs_out(hdmi_vs_mask),
|
.vs_out(hdmi_vs_mask),
|
||||||
.de_out(hdmi_de_mask)
|
.de_out(hdmi_de_mask)
|
||||||
);
|
);
|
||||||
|
|
||||||
wire [23:0] hdmi_data_osd;
|
wire [23:0] hdmi_data_osd;
|
||||||
wire hdmi_de_osd, hdmi_vs_osd, hdmi_hs_osd;
|
wire hdmi_de_osd, hdmi_vs_osd, hdmi_hs_osd;
|
||||||
|
|
||||||
osd hdmi_osd
|
osd hdmi_osd
|
||||||
(
|
(
|
||||||
.clk_sys(clk_sys),
|
.clk_sys(clk_sys),
|
||||||
|
|
||||||
.io_osd(io_osd_hdmi),
|
.io_osd(io_osd_hdmi),
|
||||||
@@ -1183,12 +1145,12 @@ cyclonev_hps_interface_peripheral_i2c hdmi_i2c
|
|||||||
.hs_out(hdmi_hs_osd),
|
.hs_out(hdmi_hs_osd),
|
||||||
.vs_out(hdmi_vs_osd),
|
.vs_out(hdmi_vs_osd),
|
||||||
.de_out(hdmi_de_osd)
|
.de_out(hdmi_de_osd)
|
||||||
);
|
);
|
||||||
|
|
||||||
wire hdmi_cs_osd;
|
|
||||||
csync csync_hdmi(clk_hdmi, hdmi_hs_osd, hdmi_vs_osd, hdmi_cs_osd);
|
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
|
wire hdmi_cs_osd;
|
||||||
|
csync csync_hdmi(clk_hdmi, hdmi_hs_osd, hdmi_vs_osd, hdmi_cs_osd);
|
||||||
|
|
||||||
reg [23:0] dv_data;
|
reg [23:0] dv_data;
|
||||||
reg dv_hs, dv_vs, dv_de;
|
reg dv_hs, dv_vs, dv_de;
|
||||||
wire [23:0] dv_data_osd;
|
wire [23:0] dv_data_osd;
|
||||||
@@ -1239,21 +1201,21 @@ always @(posedge clk_vid) begin
|
|||||||
end
|
end
|
||||||
|
|
||||||
`ifndef MISTER_DISABLE_YC
|
`ifndef MISTER_DISABLE_YC
|
||||||
assign {dv_data_osd, dv_hs_osd, dv_vs_osd, dv_cs_osd } = ~yc_en ? {vga_data_osd, vga_hs_osd, vga_vs_osd, vga_cs_osd } : {yc_o, yc_hs, yc_vs, yc_cs };
|
assign {dv_data_osd, dv_hs_osd, dv_vs_osd, dv_cs_osd } = ~yc_en ? {vga_data_osd, vga_hs_osd, vga_vs_osd, vga_cs_osd } : {yc_o, yc_hs, yc_vs, yc_cs };
|
||||||
`else
|
`else
|
||||||
assign {dv_data_osd, dv_hs_osd, dv_vs_osd, dv_cs_osd } = {vga_data_osd, vga_hs_osd, vga_vs_osd, vga_cs_osd };
|
assign {dv_data_osd, dv_hs_osd, dv_vs_osd, dv_cs_osd } = {vga_data_osd, vga_hs_osd, vga_vs_osd, vga_cs_osd };
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
wire hdmi_tx_clk;
|
wire hdmi_tx_clk;
|
||||||
`ifndef MISTER_DEBUG_NOHDMI
|
`ifndef MISTER_DEBUG_NOHDMI
|
||||||
cyclonev_clkselect hdmi_clk_sw
|
cyclonev_clkselect hdmi_clk_sw
|
||||||
(
|
(
|
||||||
.clkselect({1'b1, ~vga_fb & direct_video}),
|
.clkselect({1'b1, ~vga_fb & direct_video}),
|
||||||
.inclk({clk_vid, hdmi_clk_out, 2'b00}),
|
.inclk({clk_vid, hdmi_clk_out, 2'b00}),
|
||||||
.outclk(hdmi_tx_clk)
|
.outclk(hdmi_tx_clk)
|
||||||
);
|
);
|
||||||
`else
|
`else
|
||||||
assign hdmi_tx_clk = clk_vid;
|
assign hdmi_tx_clk = clk_vid;
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
altddio_out
|
altddio_out
|
||||||
@@ -1298,17 +1260,10 @@ always @(posedge hdmi_tx_clk) begin
|
|||||||
hdmi_dv_vs <= dv_vs;
|
hdmi_dv_vs <= dv_vs;
|
||||||
hdmi_dv_de <= dv_de;
|
hdmi_dv_de <= dv_de;
|
||||||
|
|
||||||
`ifndef MISTER_DEBUG_NOHDMI
|
|
||||||
hs <= (~vga_fb & direct_video) ? hdmi_dv_hs : (direct_video & csync_en) ? hdmi_cs_osd : hdmi_hs_osd;
|
hs <= (~vga_fb & direct_video) ? hdmi_dv_hs : (direct_video & csync_en) ? hdmi_cs_osd : hdmi_hs_osd;
|
||||||
vs <= (~vga_fb & direct_video) ? hdmi_dv_vs : hdmi_vs_osd;
|
vs <= (~vga_fb & direct_video) ? hdmi_dv_vs : hdmi_vs_osd;
|
||||||
de <= (~vga_fb & direct_video) ? hdmi_dv_de : hdmi_de_osd;
|
de <= (~vga_fb & direct_video) ? hdmi_dv_de : hdmi_de_osd;
|
||||||
d <= (~vga_fb & direct_video) ? hdmi_dv_data : hdmi_data_osd;
|
d <= (~vga_fb & direct_video) ? hdmi_dv_data : hdmi_data_osd;
|
||||||
`else
|
|
||||||
hs <= hdmi_dv_hs;
|
|
||||||
vs <= hdmi_dv_vs;
|
|
||||||
de <= hdmi_dv_de;
|
|
||||||
d <= hdmi_dv_data;
|
|
||||||
`endif
|
|
||||||
|
|
||||||
hdmi_out_hs <= hs;
|
hdmi_out_hs <= hs;
|
||||||
hdmi_out_vs <= vs;
|
hdmi_out_vs <= vs;
|
||||||
@@ -1323,46 +1278,6 @@ assign HDMI_TX_D = hdmi_out_d;
|
|||||||
|
|
||||||
///////////////////////// VGA output //////////////////////////////////
|
///////////////////////// VGA output //////////////////////////////////
|
||||||
|
|
||||||
`ifndef MISTER_DUAL_SDRAM
|
|
||||||
wire vga_tx_clk;
|
|
||||||
`ifndef MISTER_DEBUG_NOHDMI
|
|
||||||
cyclonev_clkselect vga_clk_sw
|
|
||||||
(
|
|
||||||
.clkselect({1'b1, ~vga_fb & ~vga_scaler}),
|
|
||||||
.inclk({clk_vid, hdmi_clk_out, 2'b00}),
|
|
||||||
.outclk(vga_tx_clk)
|
|
||||||
);
|
|
||||||
`else
|
|
||||||
assign vga_tx_clk = clk_vid;
|
|
||||||
`endif
|
|
||||||
|
|
||||||
wire VGA_TX_CLK;
|
|
||||||
altddio_out
|
|
||||||
#(
|
|
||||||
.extend_oe_disable("OFF"),
|
|
||||||
.intended_device_family("Cyclone V"),
|
|
||||||
.invert_output("OFF"),
|
|
||||||
.lpm_hint("UNUSED"),
|
|
||||||
.lpm_type("altddio_out"),
|
|
||||||
.oe_reg("UNREGISTERED"),
|
|
||||||
.power_up_high("OFF"),
|
|
||||||
.width(1)
|
|
||||||
)
|
|
||||||
vgaclk_ddr
|
|
||||||
(
|
|
||||||
.datain_h(1'b0),
|
|
||||||
.datain_l(1'b1),
|
|
||||||
.outclock(vga_tx_clk),
|
|
||||||
.dataout(VGA_TX_CLK),
|
|
||||||
.aclr(~mcp_en & ~av_dis),
|
|
||||||
.aset(1'b0),
|
|
||||||
.oe(~av_dis & (mcp_en | ~led_u)),
|
|
||||||
.outclocken(1'b1),
|
|
||||||
.sclr(1'b0),
|
|
||||||
.sset(1'b0)
|
|
||||||
);
|
|
||||||
`endif
|
|
||||||
|
|
||||||
wire [23:0] vga_data_sl;
|
wire [23:0] vga_data_sl;
|
||||||
wire vga_de_sl, vga_ce_sl, vga_vs_sl, vga_hs_sl;
|
wire vga_de_sl, vga_ce_sl, vga_vs_sl, vga_hs_sl;
|
||||||
scanlines #(0) VGA_scanlines
|
scanlines #(0) VGA_scanlines
|
||||||
@@ -1384,7 +1299,7 @@ scanlines #(0) VGA_scanlines
|
|||||||
);
|
);
|
||||||
|
|
||||||
wire [23:0] vga_data_osd;
|
wire [23:0] vga_data_osd;
|
||||||
wire vga_vs_osd, vga_hs_osd, vga_de_osd;
|
wire vga_vs_osd, vga_hs_osd;
|
||||||
osd vga_osd
|
osd vga_osd
|
||||||
(
|
(
|
||||||
.clk_sys(clk_sys),
|
.clk_sys(clk_sys),
|
||||||
@@ -1402,8 +1317,7 @@ osd vga_osd
|
|||||||
|
|
||||||
.dout(vga_data_osd),
|
.dout(vga_data_osd),
|
||||||
.hs_out(vga_hs_osd),
|
.hs_out(vga_hs_osd),
|
||||||
.vs_out(vga_vs_osd),
|
.vs_out(vga_vs_osd)
|
||||||
.de_out(vga_de_osd)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
wire vga_cs_osd;
|
wire vga_cs_osd;
|
||||||
@@ -1414,8 +1328,9 @@ csync csync_vga(clk_vid, vga_hs_osd, vga_vs_osd, vga_cs_osd);
|
|||||||
reg yc_en;
|
reg yc_en;
|
||||||
reg cvbs;
|
reg cvbs;
|
||||||
reg [16:0] ColorBurst_Range;
|
reg [16:0] ColorBurst_Range;
|
||||||
|
reg [39:0] PhaseInc;
|
||||||
wire [23:0] yc_o;
|
wire [23:0] yc_o;
|
||||||
wire yc_hs, yc_vs, yc_cs, yc_de;
|
wire yc_hs, yc_vs, yc_cs;
|
||||||
|
|
||||||
yc_out yc_out
|
yc_out yc_out
|
||||||
(
|
(
|
||||||
@@ -1427,34 +1342,18 @@ csync csync_vga(clk_vid, vga_hs_osd, vga_vs_osd, vga_cs_osd);
|
|||||||
.hsync(vga_hs_osd),
|
.hsync(vga_hs_osd),
|
||||||
.vsync(vga_vs_osd),
|
.vsync(vga_vs_osd),
|
||||||
.csync(vga_cs_osd),
|
.csync(vga_cs_osd),
|
||||||
.de(vga_de_osd),
|
|
||||||
.dout(yc_o),
|
.dout(yc_o),
|
||||||
.din(vga_data_osd),
|
.din(vga_data_osd),
|
||||||
.hsync_o(yc_hs),
|
.hsync_o(yc_hs),
|
||||||
.vsync_o(yc_vs),
|
.vsync_o(yc_vs),
|
||||||
.csync_o(yc_cs),
|
.csync_o(yc_cs)
|
||||||
.de_o(yc_de)
|
|
||||||
);
|
);
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
reg [39:0] PhaseInc;
|
|
||||||
|
|
||||||
`ifndef MISTER_DUAL_SDRAM
|
`ifndef MISTER_DUAL_SDRAM
|
||||||
// Subcarrier generation for external encoders (independent of YC module)
|
|
||||||
reg subcarrier;
|
|
||||||
|
|
||||||
reg [39:0] sub_accum;
|
|
||||||
always @(posedge clk_vid) sub_accum <= sub_accum + PhaseInc;
|
|
||||||
|
|
||||||
// 1-bit output for positive/negative of wave, no LUT required. Output 1 if disabled for further logic
|
|
||||||
reg subcarrier_out;
|
|
||||||
always @(posedge clk_vid) subcarrier_out <= ~(subcarrier & csync_en & ~ypbpr_en & ~forced_scandoubler & ~vgas_en) | sub_accum[39];
|
|
||||||
|
|
||||||
|
|
||||||
wire VGA_DISABLE;
|
wire VGA_DISABLE;
|
||||||
wire [23:0] vgas_o;
|
wire [23:0] vgas_o;
|
||||||
wire vgas_hs, vgas_vs, vgas_cs, vgas_de;
|
wire vgas_hs, vgas_vs, vgas_cs;
|
||||||
`ifndef MISTER_DEBUG_NOHDMI
|
|
||||||
vga_out vga_scaler_out
|
vga_out vga_scaler_out
|
||||||
(
|
(
|
||||||
.clk(clk_hdmi),
|
.clk(clk_hdmi),
|
||||||
@@ -1462,20 +1361,15 @@ reg [39:0] PhaseInc;
|
|||||||
.hsync(hdmi_hs_osd),
|
.hsync(hdmi_hs_osd),
|
||||||
.vsync(hdmi_vs_osd),
|
.vsync(hdmi_vs_osd),
|
||||||
.csync(hdmi_cs_osd),
|
.csync(hdmi_cs_osd),
|
||||||
.de(hdmi_de_osd),
|
|
||||||
.dout(vgas_o),
|
.dout(vgas_o),
|
||||||
.din({24{hdmi_de_osd}} & hdmi_data_osd),
|
.din({24{hdmi_de_osd}} & hdmi_data_osd),
|
||||||
.hsync_o(vgas_hs),
|
.hsync_o(vgas_hs),
|
||||||
.vsync_o(vgas_vs),
|
.vsync_o(vgas_vs),
|
||||||
.csync_o(vgas_cs),
|
.csync_o(vgas_cs)
|
||||||
.de_o(vgas_de)
|
|
||||||
);
|
);
|
||||||
`else
|
|
||||||
assign {vgas_o, vgas_hs, vgas_vs, vgas_cs, vgas_de} = 0;
|
|
||||||
`endif
|
|
||||||
|
|
||||||
wire [23:0] vga_o, vga_o_t;
|
wire [23:0] vga_o, vga_o_t;
|
||||||
wire vga_hs, vga_vs, vga_cs, vga_de, vga_hs_t, vga_vs_t, vga_cs_t, vga_de_t;
|
wire vga_hs, vga_vs, vga_cs, vga_hs_t, vga_vs_t, vga_cs_t;
|
||||||
vga_out vga_out
|
vga_out vga_out
|
||||||
(
|
(
|
||||||
.clk(clk_vid),
|
.clk(clk_vid),
|
||||||
@@ -1483,35 +1377,26 @@ reg [39:0] PhaseInc;
|
|||||||
.hsync(vga_hs_osd),
|
.hsync(vga_hs_osd),
|
||||||
.vsync(vga_vs_osd),
|
.vsync(vga_vs_osd),
|
||||||
.csync(vga_cs_osd),
|
.csync(vga_cs_osd),
|
||||||
.de(vga_de_osd),
|
|
||||||
.dout(vga_o_t),
|
.dout(vga_o_t),
|
||||||
.din(vga_data_osd),
|
.din(vga_data_osd),
|
||||||
.hsync_o(vga_hs_t),
|
.hsync_o(vga_hs_t),
|
||||||
.vsync_o(vga_vs_t),
|
.vsync_o(vga_vs_t),
|
||||||
.csync_o(vga_cs_t),
|
.csync_o(vga_cs_t)
|
||||||
.de_o(vga_de_t)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
`ifndef MISTER_DISABLE_YC
|
`ifndef MISTER_DISABLE_YC
|
||||||
assign {vga_o, vga_hs, vga_vs, vga_cs, vga_de } = ~yc_en ? {vga_o_t, vga_hs_t, vga_vs_t, vga_cs_t, vga_de_t } : {yc_o, yc_hs, yc_vs, yc_cs, yc_de };
|
assign {vga_o, vga_hs, vga_vs, vga_cs } = ~yc_en ? {vga_o_t, vga_hs_t, vga_vs_t, vga_cs_t } : {yc_o, yc_hs, yc_vs, yc_cs };
|
||||||
`else
|
`else
|
||||||
assign {vga_o, vga_hs, vga_vs, vga_cs, vga_de } = {vga_o_t, vga_hs_t, vga_vs_t, vga_cs_t, vga_de_t } ;
|
assign {vga_o, vga_hs, vga_vs, vga_cs } = {vga_o_t, vga_hs_t, vga_vs_t, vga_cs_t } ;
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
wire vgas_en = vga_fb | vga_scaler;
|
wire cs1 = (vga_fb | vga_scaler) ? vgas_cs : vga_cs;
|
||||||
|
|
||||||
wire cs1 = vgas_en ? vgas_cs : vga_cs;
|
assign VGA_VS = (VGA_EN | SW[3]) ? 1'bZ : (((vga_fb | vga_scaler) ? (~vgas_vs ^ VS[12]) : VGA_DISABLE ? 1'd1 : ~vga_vs) | csync_en);
|
||||||
wire de1 = vgas_en ? vgas_de : vga_de;
|
assign VGA_HS = (VGA_EN | SW[3]) ? 1'bZ : ((vga_fb | vga_scaler) ? ((csync_en ? ~vgas_cs : ~vgas_hs) ^ HS[12]) : VGA_DISABLE ? 1'd1 : (csync_en ? ~vga_cs : ~vga_hs));
|
||||||
|
assign VGA_R = (VGA_EN | SW[3]) ? 6'bZZZZZZ : (vga_fb | vga_scaler) ? vgas_o[23:18] : VGA_DISABLE ? 6'd0 : vga_o[23:18];
|
||||||
assign VGA_VS = av_dis ? 1'bZ :(((vgas_en ? (~vgas_vs ^ VS[12]) : VGA_DISABLE ? 1'd1 : ~vga_vs) | csync_en) & subcarrier_out);
|
assign VGA_G = (VGA_EN | SW[3]) ? 6'bZZZZZZ : (vga_fb | vga_scaler) ? vgas_o[15:10] : VGA_DISABLE ? 6'd0 : vga_o[15:10];
|
||||||
assign VGA_HS = av_dis ? 1'bZ : (vgas_en ? ((csync_en ? ~vgas_cs : ~vgas_hs) ^ HS[12]) : VGA_DISABLE ? 1'd1 : (csync_en ? ~vga_cs : ~vga_hs));
|
assign VGA_B = (VGA_EN | SW[3]) ? 6'bZZZZZZ : (vga_fb | vga_scaler) ? vgas_o[7:2] : VGA_DISABLE ? 6'd0 : vga_o[7:2] ;
|
||||||
assign VGA_R = av_dis ? 6'bZZZZZZ : vgas_en ? vgas_o[23:18] : VGA_DISABLE ? 6'd0 : vga_o[23:18];
|
|
||||||
assign VGA_G = av_dis ? 6'bZZZZZZ : vgas_en ? vgas_o[15:10] : VGA_DISABLE ? 6'd0 : vga_o[15:10];
|
|
||||||
assign VGA_B = av_dis ? 6'bZZZZZZ : vgas_en ? vgas_o[7:2] : VGA_DISABLE ? 6'd0 : vga_o[7:2] ;
|
|
||||||
|
|
||||||
wire [1:0] vga_r = vgas_en ? vgas_o[17:16] : VGA_DISABLE ? 2'd0 : vga_o[17:16];
|
|
||||||
wire [1:0] vga_g = vgas_en ? vgas_o[9:8] : VGA_DISABLE ? 2'd0 : vga_o[9:8];
|
|
||||||
wire [1:0] vga_b = vgas_en ? vgas_o[1:0] : VGA_DISABLE ? 2'd0 : vga_o[1:0];
|
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
reg video_sync = 0;
|
reg video_sync = 0;
|
||||||
@@ -1541,14 +1426,14 @@ end
|
|||||||
|
|
||||||
///////////////////////// Audio output ////////////////////////////////
|
///////////////////////// Audio output ////////////////////////////////
|
||||||
|
|
||||||
assign SDCD_SPDIF = (mcp_en & ~spdif) ? 1'b0 : 1'bZ;
|
assign SDCD_SPDIF =(SW[3] & ~spdif) ? 1'b0 : 1'bZ;
|
||||||
|
|
||||||
`ifndef MISTER_DUAL_SDRAM
|
`ifndef MISTER_DUAL_SDRAM
|
||||||
wire analog_l, analog_r;
|
wire analog_l, analog_r;
|
||||||
|
|
||||||
assign AUDIO_SPDIF = av_dis ? 1'bZ : (SW[0] | mcp_en) ? HDMI_LRCLK : spdif;
|
assign AUDIO_SPDIF = SW[3] ? 1'bZ : SW[0] ? HDMI_LRCLK : spdif;
|
||||||
assign AUDIO_R = av_dis ? 1'bZ : (SW[0] | mcp_en) ? HDMI_I2S : analog_r;
|
assign AUDIO_R = SW[3] ? 1'bZ : SW[0] ? HDMI_I2S : analog_r;
|
||||||
assign AUDIO_L = av_dis ? 1'bZ : (SW[0] | mcp_en) ? HDMI_SCLK : analog_l;
|
assign AUDIO_L = SW[3] ? 1'bZ : SW[0] ? HDMI_SCLK : analog_l;
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
assign HDMI_MCLK = clk_audio;
|
assign HDMI_MCLK = clk_audio;
|
||||||
@@ -1601,27 +1486,27 @@ audio_out audio_out
|
|||||||
|
|
||||||
|
|
||||||
`ifndef MISTER_DISABLE_ALSA
|
`ifndef MISTER_DISABLE_ALSA
|
||||||
wire aspi_sck,aspi_mosi,aspi_ss,aspi_miso;
|
wire aspi_sck,aspi_mosi,aspi_ss,aspi_miso;
|
||||||
cyclonev_hps_interface_peripheral_spi_master spi
|
cyclonev_hps_interface_peripheral_spi_master spi
|
||||||
(
|
(
|
||||||
.sclk_out(aspi_sck),
|
.sclk_out(aspi_sck),
|
||||||
.txd(aspi_mosi), // mosi
|
.txd(aspi_mosi), // mosi
|
||||||
.rxd(aspi_miso), // miso
|
.rxd(aspi_miso), // miso
|
||||||
|
|
||||||
.ss_0_n(aspi_ss),
|
.ss_0_n(aspi_ss),
|
||||||
.ss_in_n(1)
|
.ss_in_n(1)
|
||||||
);
|
);
|
||||||
|
|
||||||
wire [28:0] alsa_address;
|
wire [28:0] alsa_address;
|
||||||
wire [63:0] alsa_readdata;
|
wire [63:0] alsa_readdata;
|
||||||
wire alsa_ready;
|
wire alsa_ready;
|
||||||
wire alsa_req;
|
wire alsa_req;
|
||||||
wire alsa_late;
|
wire alsa_late;
|
||||||
|
|
||||||
wire [15:0] alsa_l, alsa_r;
|
wire [15:0] alsa_l, alsa_r;
|
||||||
|
|
||||||
alsa alsa
|
alsa alsa
|
||||||
(
|
(
|
||||||
.reset(reset),
|
.reset(reset),
|
||||||
.clk(clk_audio),
|
.clk(clk_audio),
|
||||||
|
|
||||||
@@ -1637,7 +1522,7 @@ audio_out audio_out
|
|||||||
|
|
||||||
.pcm_l(alsa_l),
|
.pcm_l(alsa_l),
|
||||||
.pcm_r(alsa_r)
|
.pcm_r(alsa_r)
|
||||||
);
|
);
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
//////////////// User I/O (USB 3.0 connector) /////////////////////////
|
//////////////// User I/O (USB 3.0 connector) /////////////////////////
|
||||||
@@ -1766,8 +1651,6 @@ emu emu
|
|||||||
.HDMI_WIDTH(direct_video ? 12'd0 : hdmi_width),
|
.HDMI_WIDTH(direct_video ? 12'd0 : hdmi_width),
|
||||||
.HDMI_HEIGHT(direct_video ? 12'd0 : hdmi_height),
|
.HDMI_HEIGHT(direct_video ? 12'd0 : hdmi_height),
|
||||||
.HDMI_FREEZE(freeze),
|
.HDMI_FREEZE(freeze),
|
||||||
.HDMI_BLACKOUT(hdmi_blackout),
|
|
||||||
.HDMI_BOB_DEINT(bob_deint),
|
|
||||||
|
|
||||||
.CLK_VIDEO(clk_vid),
|
.CLK_VIDEO(clk_vid),
|
||||||
.CE_PIXEL(ce_pix),
|
.CE_PIXEL(ce_pix),
|
||||||
@@ -1840,7 +1723,7 @@ emu emu
|
|||||||
.SDRAM2_nRAS(SDRAM2_nRAS),
|
.SDRAM2_nRAS(SDRAM2_nRAS),
|
||||||
.SDRAM2_nCAS(SDRAM2_nCAS),
|
.SDRAM2_nCAS(SDRAM2_nCAS),
|
||||||
.SDRAM2_CLK(SDRAM2_CLK),
|
.SDRAM2_CLK(SDRAM2_CLK),
|
||||||
.SDRAM2_EN(io_dig),
|
.SDRAM2_EN(SW[3]),
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
.BUTTONS(btn),
|
.BUTTONS(btn),
|
||||||
@@ -1850,7 +1733,11 @@ emu emu
|
|||||||
.SD_MOSI(SD_MOSI),
|
.SD_MOSI(SD_MOSI),
|
||||||
.SD_MISO(SD_MISO),
|
.SD_MISO(SD_MISO),
|
||||||
.SD_CS(SD_CS),
|
.SD_CS(SD_CS),
|
||||||
.SD_CD(SD_CD),
|
`ifdef MISTER_DUAL_SDRAM
|
||||||
|
.SD_CD(mcp_sdcd),
|
||||||
|
`else
|
||||||
|
.SD_CD(mcp_sdcd & (SW[0] ? VGA_HS : (SW[3] | SDCD_SPDIF))),
|
||||||
|
`endif
|
||||||
|
|
||||||
.UART_CTS(uart_rts),
|
.UART_CTS(uart_rts),
|
||||||
.UART_RTS(uart_cts),
|
.UART_RTS(uart_cts),
|
||||||
@@ -1892,6 +1779,24 @@ always @(posedge clk) begin
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
/*
|
||||||
|
always @(posedge clk) begin
|
||||||
|
integer pos = 0, neg = 0, cnt = 0;
|
||||||
|
reg s1,s2;
|
||||||
|
|
||||||
|
s1 <= sync_in;
|
||||||
|
s2 <= s1;
|
||||||
|
|
||||||
|
if(~s2 & s1) neg <= cnt;
|
||||||
|
if(s2 & ~s1) pos <= cnt;
|
||||||
|
|
||||||
|
cnt <= cnt + 1;
|
||||||
|
if(s2 != s1) cnt <= 0;
|
||||||
|
|
||||||
|
pol <= pos > neg;
|
||||||
|
end
|
||||||
|
*/
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
+3
-6
@@ -7,15 +7,13 @@ module vga_out
|
|||||||
input hsync,
|
input hsync,
|
||||||
input vsync,
|
input vsync,
|
||||||
input csync,
|
input csync,
|
||||||
input de,
|
|
||||||
|
|
||||||
input [23:0] din,
|
input [23:0] din,
|
||||||
output [23:0] dout,
|
output [23:0] dout,
|
||||||
|
|
||||||
output reg hsync_o,
|
output reg hsync_o,
|
||||||
output reg vsync_o,
|
output reg vsync_o,
|
||||||
output reg csync_o,
|
output reg csync_o
|
||||||
output reg de_o
|
|
||||||
);
|
);
|
||||||
|
|
||||||
wire [7:0] red = din[23:16];
|
wire [7:0] red = din[23:16];
|
||||||
@@ -37,8 +35,8 @@ always @(posedge clk) begin
|
|||||||
reg [18:0] y_1b, pb_1b, pr_1b;
|
reg [18:0] y_1b, pb_1b, pr_1b;
|
||||||
reg [18:0] y_2, pb_2, pr_2;
|
reg [18:0] y_2, pb_2, pr_2;
|
||||||
reg [23:0] din1, din2;
|
reg [23:0] din1, din2;
|
||||||
reg hsync2, vsync2, csync2, de2;
|
reg hsync2, vsync2, csync2;
|
||||||
reg hsync1, vsync1, csync1, de1;
|
reg hsync1, vsync1, csync1;
|
||||||
|
|
||||||
y_1r <= {red, 6'd0} + {red, 3'd0} + {red, 2'd0} + red;
|
y_1r <= {red, 6'd0} + {red, 3'd0} + {red, 2'd0} + red;
|
||||||
pb_1r <= 19'd32768 - ({red, 5'd0} + {red, 3'd0} + {red, 1'd0});
|
pb_1r <= 19'd32768 - ({red, 5'd0} + {red, 3'd0} + {red, 1'd0});
|
||||||
@@ -63,7 +61,6 @@ always @(posedge clk) begin
|
|||||||
hsync_o <= hsync2; hsync2 <= hsync1; hsync1 <= hsync;
|
hsync_o <= hsync2; hsync2 <= hsync1; hsync1 <= hsync;
|
||||||
vsync_o <= vsync2; vsync2 <= vsync1; vsync1 <= vsync;
|
vsync_o <= vsync2; vsync2 <= vsync1; vsync1 <= vsync;
|
||||||
csync_o <= csync2; csync2 <= csync1; csync1 <= csync;
|
csync_o <= csync2; csync2 <= csync1; csync1 <= csync;
|
||||||
de_o <= de2; de2 <= de1; de1 <= de;
|
|
||||||
|
|
||||||
rgb <= din2; din2 <= din1; din1 <= din;
|
rgb <= din2; din2 <= din1; din1 <= din;
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-10
@@ -26,10 +26,6 @@ module video_cleaner
|
|||||||
//optional de
|
//optional de
|
||||||
input DE_in,
|
input DE_in,
|
||||||
|
|
||||||
//optional interlace support
|
|
||||||
input interlace,
|
|
||||||
input f1,
|
|
||||||
|
|
||||||
// video output signals
|
// video output signals
|
||||||
output reg [7:0] VGA_R,
|
output reg [7:0] VGA_R,
|
||||||
output reg [7:0] VGA_G,
|
output reg [7:0] VGA_G,
|
||||||
@@ -60,20 +56,15 @@ always @(posedge clk_vid) begin
|
|||||||
HBlank_out <= hbl;
|
HBlank_out <= hbl;
|
||||||
|
|
||||||
VGA_HS <= hs;
|
VGA_HS <= hs;
|
||||||
|
if(~VGA_HS & hs) VGA_VS <= vs;
|
||||||
|
|
||||||
VGA_R <= R;
|
VGA_R <= R;
|
||||||
VGA_G <= G;
|
VGA_G <= G;
|
||||||
VGA_B <= B;
|
VGA_B <= B;
|
||||||
DE_out <= DE_in;
|
DE_out <= DE_in;
|
||||||
|
|
||||||
if (interlace & f1) begin
|
|
||||||
VGA_VS <= vs;
|
|
||||||
VBlank_out <= vbl;
|
|
||||||
end else begin
|
|
||||||
if(~VGA_HS & hs) VGA_VS <= vs;
|
|
||||||
if(HBlank_out & ~hbl) VBlank_out <= vbl;
|
if(HBlank_out & ~hbl) VBlank_out <= vbl;
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
|||||||
+10
-21
@@ -170,8 +170,10 @@ reg [11:0] mul_arg1, mul_arg2;
|
|||||||
wire [23:0] mul_res;
|
wire [23:0] mul_res;
|
||||||
sys_umul #(12,12) mul(CLK_VIDEO,mul_start,mul_run, mul_arg1,mul_arg2,mul_res);
|
sys_umul #(12,12) mul(CLK_VIDEO,mul_start,mul_run, mul_arg1,mul_arg2,mul_res);
|
||||||
|
|
||||||
|
wire [11:0] wideres = mul_res[11:0] + hsize;
|
||||||
|
|
||||||
always @(posedge CLK_VIDEO) begin
|
always @(posedge CLK_VIDEO) begin
|
||||||
reg [11:0] oheight,htarget,wres,hinteger,wideres;
|
reg [11:0] oheight,htarget,wres;
|
||||||
reg [12:0] arxf,aryf;
|
reg [12:0] arxf,aryf;
|
||||||
reg [3:0] cnt;
|
reg [3:0] cnt;
|
||||||
reg narrow;
|
reg narrow;
|
||||||
@@ -262,8 +264,7 @@ always @(posedge CLK_VIDEO) begin
|
|||||||
// [3] 1080 / 512 * 512 * 4 / 3 / 512 * 512 -> 1024
|
// [3] 1080 / 512 * 512 * 4 / 3 / 512 * 512 -> 1024
|
||||||
|
|
||||||
7: if(mul_res <= HDMI_WIDTH) begin
|
7: if(mul_res <= HDMI_WIDTH) begin
|
||||||
hinteger = mul_res[11:0];
|
cnt <= 10;
|
||||||
cnt <= 12;
|
|
||||||
end
|
end
|
||||||
|
|
||||||
8: begin
|
8: begin
|
||||||
@@ -285,20 +286,8 @@ always @(posedge CLK_VIDEO) begin
|
|||||||
// [3] 1920 / 512 * 512 -> 1536
|
// [3] 1920 / 512 * 512 -> 1536
|
||||||
|
|
||||||
10: begin
|
10: begin
|
||||||
hinteger <= mul_res[11:0];
|
narrow <= ((htarget - mul_res[11:0]) <= (wideres - htarget)) || (wideres > HDMI_WIDTH);
|
||||||
mul_arg1 <= vsize;
|
wres <= mul_res[11:0] == htarget ? mul_res[11:0] : wideres;
|
||||||
mul_arg2 <= div_res[11:0] ? div_res[11:0] : 12'd1;
|
|
||||||
mul_start <= 1;
|
|
||||||
end
|
|
||||||
|
|
||||||
11: begin
|
|
||||||
oheight <= mul_res[11:0];
|
|
||||||
end
|
|
||||||
|
|
||||||
12: begin
|
|
||||||
wideres <= hinteger + hsize;
|
|
||||||
narrow <= ((htarget - hinteger) <= (wideres - htarget)) || (wideres > HDMI_WIDTH);
|
|
||||||
wres <= hinteger == htarget ? hinteger : wideres;
|
|
||||||
end
|
end
|
||||||
// [1] 1066 - 720 = 346 <= 1440 - 1066 = 374 || 1440 > 1920 -> true
|
// [1] 1066 - 720 = 346 <= 1440 - 1066 = 374 || 1440 > 1920 -> true
|
||||||
// [2] 1280 - 1280 = 0 <= 1920 - 1280 = 640 || 1920 > 1920 -> true
|
// [2] 1280 - 1280 = 0 <= 1920 - 1280 = 640 || 1920 > 1920 -> true
|
||||||
@@ -310,11 +299,11 @@ always @(posedge CLK_VIDEO) begin
|
|||||||
// to target width, meaning it is not optimal for source aspect ratio.
|
// to target width, meaning it is not optimal for source aspect ratio.
|
||||||
// otherwise it is set to narrow width that is optimal.
|
// otherwise it is set to narrow width that is optimal.
|
||||||
|
|
||||||
13: begin
|
11: begin
|
||||||
case(SCALE)
|
case(SCALE)
|
||||||
2: arxf <= {1'b1, hinteger};
|
2: arxf <= {1'b1, mul_res[11:0]};
|
||||||
3: arxf <= {1'b1, (wres > HDMI_WIDTH) ? hinteger : wres};
|
3: arxf <= {1'b1, (wres > HDMI_WIDTH) ? mul_res[11:0] : wres};
|
||||||
4: arxf <= {1'b1, narrow ? hinteger : wres};
|
4: arxf <= {1'b1, narrow ? mul_res[11:0] : wres};
|
||||||
default: arxf <= {1'b1, div_num[11:0]};
|
default: arxf <= {1'b1, div_num[11:0]};
|
||||||
endcase
|
endcase
|
||||||
aryf <= {1'b1, oheight};
|
aryf <= {1'b1, oheight};
|
||||||
|
|||||||
+6
-9
@@ -36,15 +36,13 @@ module yc_out
|
|||||||
input hsync,
|
input hsync,
|
||||||
input vsync,
|
input vsync,
|
||||||
input csync,
|
input csync,
|
||||||
input de,
|
|
||||||
|
|
||||||
input [23:0] din,
|
input [23:0] din,
|
||||||
output [23:0] dout,
|
output [23:0] dout,
|
||||||
|
|
||||||
output reg hsync_o,
|
output reg hsync_o,
|
||||||
output reg vsync_o,
|
output reg vsync_o,
|
||||||
output reg csync_o,
|
output reg csync_o
|
||||||
output reg de_o
|
|
||||||
);
|
);
|
||||||
|
|
||||||
wire [7:0] red = din[23:16];
|
wire [7:0] red = din[23:16];
|
||||||
@@ -63,7 +61,6 @@ typedef struct {
|
|||||||
logic hsync;
|
logic hsync;
|
||||||
logic vsync;
|
logic vsync;
|
||||||
logic csync;
|
logic csync;
|
||||||
logic de;
|
|
||||||
} phase_t;
|
} phase_t;
|
||||||
|
|
||||||
localparam MAX_PHASES = 7'd8;
|
localparam MAX_PHASES = 7'd8;
|
||||||
@@ -214,11 +211,11 @@ always_ff @(posedge clk) begin
|
|||||||
end
|
end
|
||||||
|
|
||||||
// Adjust sync timing correctly
|
// Adjust sync timing correctly
|
||||||
phase[1].hsync <= hsync; phase[1].vsync <= vsync; phase[1].csync <= csync; phase[1].de <= de;
|
phase[1].hsync <= hsync; phase[1].vsync <= vsync; phase[1].csync <= csync;
|
||||||
phase[2].hsync <= phase[1].hsync; phase[2].vsync <= phase[1].vsync; phase[2].csync <= phase[1].csync; phase[2].de <= phase[1].de;
|
phase[2].hsync <= phase[1].hsync; phase[2].vsync <= phase[1].vsync; phase[2].csync <= phase[1].csync;
|
||||||
phase[3].hsync <= phase[2].hsync; phase[3].vsync <= phase[2].vsync; phase[3].csync <= phase[2].csync; phase[3].de <= phase[2].de;
|
phase[3].hsync <= phase[2].hsync; phase[3].vsync <= phase[2].vsync; phase[3].csync <= phase[2].csync;
|
||||||
phase[4].hsync <= phase[3].hsync; phase[4].vsync <= phase[3].vsync; phase[4].csync <= phase[3].csync; phase[4].de <= phase[3].de;
|
phase[4].hsync <= phase[3].hsync; phase[4].vsync <= phase[3].vsync; phase[4].csync <= phase[3].csync;
|
||||||
hsync_o <= phase[4].hsync; vsync_o <= phase[4].vsync; csync_o <= phase[4].csync; de_o <= phase[4].de;
|
hsync_o <= phase[4].hsync; vsync_o <= phase[4].vsync; csync_o <= phase[4].csync;
|
||||||
|
|
||||||
phase[1].y <= phase[0].y; phase[2].y <= phase[1].y; phase[3].y <= phase[2].y; phase[4].y <= phase[3].y; phase[5].y <= phase[4].y;
|
phase[1].y <= phase[0].y; phase[2].y <= phase[1].y; phase[3].y <= phase[2].y; phase[4].y <= phase[3].y; phase[5].y <= phase[4].y;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user