From 43bf7ecbd17eb899ab14959274fa952beaa8e850 Mon Sep 17 00:00:00 2001 From: Polprzewodnikowy Date: Thu, 26 Aug 2021 00:43:29 +0200 Subject: [PATCH] cleanup123 --- fw/SummerCart64.qsf | 110 +++++++++++++++++----------------- fw/rtl/SummerCart64.sv | 15 +++-- fw/rtl/cpu/cpu_dma.sv | 1 + fw/rtl/memory/memory_sdram.sv | 2 +- fw/rtl/n64/n64_cfg.sv | 1 + fw/rtl/system/system.sv | 4 +- 6 files changed, 69 insertions(+), 64 deletions(-) diff --git a/fw/SummerCart64.qsf b/fw/SummerCart64.qsf index bf158ab..159714b 100644 --- a/fw/SummerCart64.qsf +++ b/fw/SummerCart64.qsf @@ -19,7 +19,7 @@ # # Quartus Prime # Version 20.1.1 Build 720 11/11/2020 SJ Lite Edition -# Date created = 23:35:14 August 23, 2021 +# Date created = 00:43:07 August 26, 2021 # # -------------------------------------------------------------------------- # # @@ -79,6 +79,7 @@ set_global_assignment -name SYSTEMVERILOG_FILE rtl/system/config.sv set_global_assignment -name SYSTEMVERILOG_FILE rtl/system/sc64.sv set_global_assignment -name SYSTEMVERILOG_FILE rtl/system/system.sv set_global_assignment -name SYSTEMVERILOG_FILE rtl/usb/usb_ft1248.sv +set_global_assignment -name SIGNALTAP_FILE output_files/signaltap.stp # Pin & Location Assignments # ========================== @@ -237,66 +238,67 @@ set_global_assignment -name OUTPUT_IO_TIMING_FAR_END_VMEAS "HALF SIGNAL SWING" - # Pin & Location Assignments # ========================== -set_instance_assignment -name FAST_INPUT_REGISTER ON -to io_usb_miosi[*] -set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_uart_rxd -set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_uart_cts -set_instance_assignment -name FAST_INPUT_REGISTER ON -to io_rtc_sda -set_instance_assignment -name FAST_INPUT_REGISTER ON -to io_n64_si_dq -set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_n64_nmi -set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_n64_reset -set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_n64_si_clk -set_instance_assignment -name FAST_INPUT_REGISTER ON -to io_n64_pi_ad[*] -set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_n64_pi_aleh -set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_n64_pi_read -set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_n64_pi_write -set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_n64_pi_alel -set_instance_assignment -name FAST_INPUT_REGISTER ON -to io_sdram_dq[*] -set_instance_assignment -name FAST_INPUT_REGISTER ON -to io_sd_* -set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_usb_pwren -set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_usb_miso -set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to o_usb_clk -set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to io_usb_miosi[*] -set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to o_uart_txd -set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to o_uart_rts -set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to o_rtc_scl -set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to io_rtc_sda -set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to io_n64_pi_ad[*] -set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to o_sdram_* -set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to io_sdram_dq[*] -set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to o_sd_clk -set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to io_sd_* -set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to o_usb_cs -set_instance_assignment -name FAST_OUTPUT_ENABLE_REGISTER ON -to io_usb_miosi[*] -set_instance_assignment -name FAST_OUTPUT_ENABLE_REGISTER ON -to io_n64_pi_ad[*] -set_instance_assignment -name FAST_OUTPUT_ENABLE_REGISTER ON -to io_sdram_dq[*] -set_instance_assignment -name FAST_OUTPUT_ENABLE_REGISTER ON -to io_sd_* -set_instance_assignment -name FAST_OUTPUT_ENABLE_REGISTER ON -to io_rtc_sda + set_instance_assignment -name FAST_INPUT_REGISTER ON -to io_usb_miosi[*] + set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_uart_rxd + set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_uart_cts + set_instance_assignment -name FAST_INPUT_REGISTER ON -to io_rtc_sda + set_instance_assignment -name FAST_INPUT_REGISTER ON -to io_n64_si_dq + set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_n64_nmi + set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_n64_reset + set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_n64_si_clk + set_instance_assignment -name FAST_INPUT_REGISTER ON -to io_n64_pi_ad[*] + set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_n64_pi_aleh + set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_n64_pi_read + set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_n64_pi_write + set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_n64_pi_alel + set_instance_assignment -name FAST_INPUT_REGISTER ON -to io_sdram_dq[*] + set_instance_assignment -name FAST_INPUT_REGISTER ON -to io_sd_* + set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_usb_pwren + set_instance_assignment -name FAST_INPUT_REGISTER ON -to i_usb_miso + set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to o_usb_clk + set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to io_usb_miosi[*] + set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to o_uart_txd + set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to o_uart_rts + set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to o_rtc_scl + set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to io_rtc_sda + set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to io_n64_pi_ad[*] + set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to o_sdram_* + set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to io_sdram_dq[*] + set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to o_sd_clk + set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to io_sd_* + set_instance_assignment -name FAST_OUTPUT_REGISTER ON -to o_usb_cs + set_instance_assignment -name FAST_OUTPUT_ENABLE_REGISTER ON -to io_usb_miosi[*] + set_instance_assignment -name FAST_OUTPUT_ENABLE_REGISTER ON -to io_n64_pi_ad[*] + set_instance_assignment -name FAST_OUTPUT_ENABLE_REGISTER ON -to io_sdram_dq[*] + set_instance_assignment -name FAST_OUTPUT_ENABLE_REGISTER ON -to io_sd_* + set_instance_assignment -name FAST_OUTPUT_ENABLE_REGISTER ON -to io_rtc_sda # Fitter Assignments # ================== -set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to io_usb_miosi[*] -set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_n64_nmi -set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_uart_rxd -set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_uart_cts -set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to io_n64_si_dq -set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_n64_reset -set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_n64_si_clk -set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_n64_pi_aleh -set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_n64_pi_read -set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_n64_pi_write -set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_n64_pi_alel -set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to o_n64_irq -set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_usb_pwren -set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_usb_miso + set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to io_usb_miosi[*] + set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_n64_nmi + set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_uart_rxd + set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_uart_cts + set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to io_n64_si_dq + set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_n64_reset + set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_n64_si_clk + set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_n64_pi_aleh + set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_n64_pi_read + set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_n64_pi_write + set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_n64_pi_alel + set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to o_n64_irq + set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_usb_pwren + set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to i_usb_miso # start DESIGN_PARTITION(Top) # --------------------------- # Incremental Compilation Assignments # =================================== -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 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_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top # end DESIGN_PARTITION(Top) # ------------------------- @@ -320,6 +322,4 @@ set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top # ======================== # end ENTITY(intel_gpio_ddro) -# --------------------------- -set_global_assignment -name SIGNALTAP_FILE output_files/signaltap.stp -set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top \ No newline at end of file +# --------------------------- \ No newline at end of file diff --git a/fw/rtl/SummerCart64.sv b/fw/rtl/SummerCart64.sv index d6257d5..ac4e4a4 100644 --- a/fw/rtl/SummerCart64.sv +++ b/fw/rtl/SummerCart64.sv @@ -48,12 +48,6 @@ module SummerCart64 ( logic [7:0] gpio_i; logic [7:0] gpio_oe; - always_comb begin - o_led = gpio_oe[0] ? gpio_o[0] : 1'bZ; - o_n64_irq = gpio_oe[1] ? gpio_o[1] : 1'bZ; - gpio_i = {4'b0000, i_n64_nmi, i_n64_reset, o_n64_irq, o_led}; - end - if_system sys ( .in_clk(i_clk), .n64_reset(i_n64_reset), @@ -125,4 +119,13 @@ module SummerCart64 ( .sd_dat(io_sd_dat) ); + always_comb begin + o_led = gpio_oe[0] ? gpio_o[0] : 1'bZ; + o_n64_irq = gpio_oe[1] ? gpio_o[1] : 1'bZ; + end + + always_ff @(posedge sys.clk) begin + gpio_i <= {4'b0000, i_n64_nmi, i_n64_reset, o_n64_irq, o_led}; + end + endmodule diff --git a/fw/rtl/cpu/cpu_dma.sv b/fw/rtl/cpu/cpu_dma.sv index 0000e7e..f70e092 100644 --- a/fw/rtl/cpu/cpu_dma.sv +++ b/fw/rtl/cpu/cpu_dma.sv @@ -113,6 +113,7 @@ module cpu_dma ( 0: bus.rdata = {28'd0, state != S_IDLE, direction, 2'b00}; 1: bus.rdata = dma.address; 2: bus.rdata = {2'b00, dma.id, length}; + default: bus.rdata = 32'd0; endcase end end diff --git a/fw/rtl/memory/memory_sdram.sv b/fw/rtl/memory/memory_sdram.sv index 6719ef3..0839dc1 100644 --- a/fw/rtl/memory/memory_sdram.sv +++ b/fw/rtl/memory/memory_sdram.sv @@ -203,7 +203,7 @@ module memory_sdram ( S_BUSY: begin if (ack) begin - next_state <= S_ACTIVE; + next_state = S_ACTIVE; end end diff --git a/fw/rtl/n64/n64_cfg.sv b/fw/rtl/n64/n64_cfg.sv index fec81c7..aee93ce 100644 --- a/fw/rtl/n64/n64_cfg.sv +++ b/fw/rtl/n64/n64_cfg.sv @@ -26,6 +26,7 @@ module n64_cfg ( 9: bus.rdata = cfg.response[15:0]; 10: bus.rdata = cfg.arg[0][31:16]; 11: bus.rdata = cfg.arg[0][15:0]; + default: bus.rdata = 16'd0; endcase end end diff --git a/fw/rtl/system/system.sv b/fw/rtl/system/system.sv index a35f333..c152083 100644 --- a/fw/rtl/system/system.sv +++ b/fw/rtl/system/system.sv @@ -65,8 +65,8 @@ module system (if_system.internal sys); always_comb begin sys.reset = ~locked | external_reset; - sys.n64_hard_reset <= ~n64_reset_ff[1]; - sys.n64_soft_reset <= ~n64_nmi_ff[1]; + sys.n64_hard_reset = ~n64_reset_ff[1]; + sys.n64_soft_reset = ~n64_nmi_ff[1]; end endmodule