From 7d1198ee1b171ee5e3c1b19047d967e17c2f487c Mon Sep 17 00:00:00 2001 From: Niels Moseley Date: Thu, 26 Oct 2017 00:47:50 +0200 Subject: [PATCH] Almost working DE0 board version --- boards/Digilent DE0/Speech256_DE0.qsf | 296 +++++++++++++- boards/Digilent DE0/Speech256_DE0.sdc | 107 +++++ boards/Digilent DE0/Speech256_de0.pin | 558 ++++++++++++++++++++++++++ boards/Digilent DE0/speech256_de0.v | 109 +++++ verilog/controller/controller.v | 12 +- verilog/filter/filter.v | 7 - verilog/speech256_top/speech256_top.v | 3 +- verilog/spmul/spmul.v | 225 ++++++----- verilog/spmul/spmul_tb.v | 15 +- 9 files changed, 1205 insertions(+), 127 deletions(-) create mode 100644 boards/Digilent DE0/Speech256_DE0.sdc create mode 100644 boards/Digilent DE0/Speech256_de0.pin create mode 100644 boards/Digilent DE0/speech256_de0.v diff --git a/boards/Digilent DE0/Speech256_DE0.qsf b/boards/Digilent DE0/Speech256_DE0.qsf index ae983c3..2848622 100644 --- a/boards/Digilent DE0/Speech256_DE0.qsf +++ b/boards/Digilent DE0/Speech256_DE0.qsf @@ -42,6 +42,41 @@ set_global_assignment -name TOP_LEVEL_ENTITY Speech256_DE0 set_global_assignment -name ORIGINAL_QUARTUS_VERSION 13.1 set_global_assignment -name PROJECT_CREATION_TIME_DATE "19:34:27 OCTOBER 25, 2017" set_global_assignment -name LAST_QUARTUS_VERSION 13.1 +set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files +set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0 +set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85 +set_global_assignment -name DEVICE_FILTER_SPEED_GRADE 6 +set_global_assignment -name ERROR_CHECK_FREQUENCY_DIVISOR 1 +set_global_assignment -name NOMINAL_CORE_SUPPLY_VOLTAGE 1.2V +set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "23 MM HEAT SINK WITH 200 LFPM AIRFLOW" +set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)" +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 STRATIX_DEVICE_IO_STANDARD "2.5 V" +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LEDG[8] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to CLOCK_50 +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to BUTTON[0] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to BUTTON[1] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to BUTTON[2] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LEDG[9] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LEDG[7] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LEDG[6] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LEDG[5] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LEDG[4] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LEDG[3] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LEDG[2] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LEDG[1] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to LEDG[0] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SW[0] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SW[1] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SW[2] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SW[3] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SW[4] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SW[5] +set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to UART_TXD +set_global_assignment -name PIN_FILE Speech256_de0.pin +set_global_assignment -name VERILOG_FILE speech256_de0.v set_global_assignment -name VERILOG_FILE ../../verilog/controller/xlat.v set_global_assignment -name VERILOG_FILE ../../verilog/controller/ctrlrom.v set_global_assignment -name VERILOG_FILE ../../verilog/controller/controller.v @@ -50,13 +85,256 @@ set_global_assignment -name VERILOG_FILE ../../verilog/pwmdac/pwmdac.v set_global_assignment -name VERILOG_FILE ../../verilog/source/source.v set_global_assignment -name VERILOG_FILE ../../verilog/spmul/spmul.v set_global_assignment -name VERILOG_FILE ../../verilog/speech256_top/speech256_top.v -set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files -set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0 -set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85 -set_global_assignment -name DEVICE_FILTER_SPEED_GRADE 6 -set_global_assignment -name ERROR_CHECK_FREQUENCY_DIVISOR 1 -set_global_assignment -name NOMINAL_CORE_SUPPLY_VOLTAGE 1.2V -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_location_assignment PIN_B1 -to LEDG[9] +set_location_assignment PIN_B2 -to LEDG[8] +set_location_assignment PIN_C2 -to LEDG[7] +set_location_assignment PIN_C1 -to LEDG[6] +set_location_assignment PIN_E1 -to LEDG[5] +set_location_assignment PIN_F2 -to LEDG[4] +set_location_assignment PIN_H1 -to LEDG[3] +set_location_assignment PIN_J3 -to LEDG[2] +set_location_assignment PIN_J2 -to LEDG[1] +set_location_assignment PIN_J1 -to LEDG[0] +set_location_assignment PIN_D2 -to SW[9] +set_location_assignment PIN_E4 -to SW[8] +set_location_assignment PIN_E3 -to SW[7] +set_location_assignment PIN_H7 -to SW[6] +set_location_assignment PIN_J7 -to SW[5] +set_location_assignment PIN_G5 -to SW[4] +set_location_assignment PIN_G4 -to SW[3] +set_location_assignment PIN_H6 -to SW[2] +set_location_assignment PIN_H5 -to SW[1] +set_location_assignment PIN_J6 -to SW[0] +set_location_assignment PIN_F1 -to BUTTON[2] +set_location_assignment PIN_G3 -to BUTTON[1] +set_location_assignment PIN_H2 -to BUTTON[0] +set_location_assignment PIN_R2 -to FL_ADDR[21] +set_location_assignment PIN_P3 -to FL_ADDR[20] +set_location_assignment PIN_P1 -to FL_ADDR[19] +set_location_assignment PIN_M6 -to FL_ADDR[18] +set_location_assignment PIN_M5 -to FL_ADDR[17] +set_location_assignment PIN_AA2 -to FL_ADDR[16] +set_location_assignment PIN_L6 -to FL_ADDR[15] +set_location_assignment PIN_L7 -to FL_ADDR[14] +set_location_assignment PIN_M1 -to FL_ADDR[13] +set_location_assignment PIN_M2 -to FL_ADDR[12] +set_location_assignment PIN_M3 -to FL_ADDR[11] +set_location_assignment PIN_N1 -to FL_ADDR[10] +set_location_assignment PIN_N2 -to FL_ADDR[9] +set_location_assignment PIN_P2 -to FL_ADDR[8] +set_location_assignment PIN_M4 -to FL_ADDR[7] +set_location_assignment PIN_M8 -to FL_ADDR[6] +set_location_assignment PIN_N6 -to FL_ADDR[5] +set_location_assignment PIN_N5 -to FL_ADDR[4] +set_location_assignment PIN_N7 -to FL_ADDR[3] +set_location_assignment PIN_P6 -to FL_ADDR[2] +set_location_assignment PIN_P5 -to FL_ADDR[1] +set_location_assignment PIN_P7 -to FL_ADDR[0] +set_location_assignment PIN_AA1 -to FL_BYTE_N +set_location_assignment PIN_N8 -to FL_CE_N +set_location_assignment PIN_R7 -to FL_DQ[0] +set_location_assignment PIN_P8 -to FL_DQ[1] +set_location_assignment PIN_R8 -to FL_DQ[2] +set_location_assignment PIN_U1 -to FL_DQ[3] +set_location_assignment PIN_V2 -to FL_DQ[4] +set_location_assignment PIN_V3 -to FL_DQ[5] +set_location_assignment PIN_W1 -to FL_DQ[6] +set_location_assignment PIN_Y1 -to FL_DQ[7] +set_location_assignment PIN_T5 -to FL_DQ[8] +set_location_assignment PIN_T7 -to FL_DQ[9] +set_location_assignment PIN_T4 -to FL_DQ[10] +set_location_assignment PIN_U2 -to FL_DQ[11] +set_location_assignment PIN_V1 -to FL_DQ[12] +set_location_assignment PIN_V4 -to FL_DQ[13] +set_location_assignment PIN_W2 -to FL_DQ[14] +set_location_assignment PIN_R6 -to FL_OE_N +set_location_assignment PIN_R1 -to FL_RST_N +set_location_assignment PIN_M7 -to FL_RY +set_location_assignment PIN_P4 -to FL_WE_N +set_location_assignment PIN_T3 -to FL_WP_N +set_location_assignment PIN_Y2 -to FL_DQ15_AM1 +set_location_assignment PIN_U7 -to SRAM_DATA[5] +set_location_assignment PIN_V5 -to SRAM_DATA[4] +set_location_assignment PIN_W6 -to SRAM_ADDR[14] +set_location_assignment PIN_W7 -to SRAM_ADDR[13] +set_location_assignment PIN_V8 -to SRAM_ADDR[12] +set_location_assignment PIN_T8 -to SRAM_ADDR[11] +set_location_assignment PIN_W10 -to SRAM_ADDR[10] +set_location_assignment PIN_Y10 -to GPIO0_D[24] +set_location_assignment PIN_V11 -to SRAM_ADDR[9] +set_location_assignment PIN_R10 -to GPIO0_D[22] +set_location_assignment PIN_V12 -to SRAM_ADDR[8] +set_location_assignment PIN_U13 -to SRAM_ADDR[7] +set_location_assignment PIN_W13 -to SRAM_ADDR[6] +set_location_assignment PIN_Y13 -to SRAM_ADDR[5] +set_location_assignment PIN_U14 -to SRAM_WE_N +set_location_assignment PIN_V14 -to SRAM_DATA[3] +set_location_assignment PIN_AA4 -to SRAM_DATA[2] +set_location_assignment PIN_AB4 -to SRAM_DATA[1] +set_location_assignment PIN_AA5 -to SRAM_DATA[0] +set_location_assignment PIN_AB5 -to SRAM_CE_N +set_location_assignment PIN_AA8 -to SRAM_ADDR[4] +set_location_assignment PIN_AB8 -to SRAM_ADDR[3] +set_location_assignment PIN_AA10 -to SRAM_ADDR[2] +set_location_assignment PIN_AB10 -to SRAM_ADDR[1] +set_location_assignment PIN_AA13 -to SRAM_ADDR[0] +set_location_assignment PIN_AB13 -to SRAM_ADDR[18] +set_location_assignment PIN_AB14 -to SRAM_ADDR[17] +set_location_assignment PIN_AA14 -to SRAM_ADDR[16] +set_location_assignment PIN_AB15 -to SRAM_ADDR[15] +set_location_assignment PIN_AA15 -to SRAM_OE_N +set_location_assignment PIN_AA16 -to SRAM_DATA[7] +set_location_assignment PIN_AB16 -to SRAM_DATA[6] +set_location_assignment PIN_AB12 -to GPIO0_CLKIN[0] +set_location_assignment PIN_AA12 -to GPIO0_CLKIN[1] +set_location_assignment PIN_AB3 -to GPIO0_CLKOUT[0] +set_location_assignment PIN_AA3 -to GPIO0_CLKOUT[1] +set_location_assignment PIN_AA11 -to GPIO1_CLKIN[1] +set_location_assignment PIN_AB11 -to GPIO1_CLKIN[0] +set_location_assignment PIN_T16 -to GPIO1_CLKOUT[1] +set_location_assignment PIN_R16 -to GPIO1_CLKOUT[0] +set_location_assignment PIN_V7 -to GPIO1_D[31] +set_location_assignment PIN_V6 -to GPIO1_D[30] +set_location_assignment PIN_U8 -to GPIO1_D[29] +set_location_assignment PIN_Y7 -to GPIO1_D[28] +set_location_assignment PIN_T9 -to GPIO1_D[27] +set_location_assignment PIN_U9 -to GPIO1_D[26] +set_location_assignment PIN_T10 -to GPIO1_D[25] +set_location_assignment PIN_U10 -to GPIO1_D[24] +set_location_assignment PIN_R12 -to GPIO1_D[23] +set_location_assignment PIN_R11 -to GPIO1_D[22] +set_location_assignment PIN_T12 -to GPIO1_D[21] +set_location_assignment PIN_U12 -to GPIO1_D[20] +set_location_assignment PIN_R14 -to GPIO1_D[19] +set_location_assignment PIN_T14 -to GPIO1_D[18] +set_location_assignment PIN_AB7 -to GPIO1_D[17] +set_location_assignment PIN_AA7 -to GPIO1_D[16] +set_location_assignment PIN_AA9 -to GPIO1_D[15] +set_location_assignment PIN_AB9 -to GPIO1_D[14] +set_location_assignment PIN_V15 -to GPIO1_D[13] +set_location_assignment PIN_W15 -to GPIO1_D[12] +set_location_assignment PIN_T15 -to GPIO1_D[11] +set_location_assignment PIN_U15 -to GPIO1_D[10] +set_location_assignment PIN_W17 -to GPIO1_D[9] +set_location_assignment PIN_Y17 -to GPIO1_D[8] +set_location_assignment PIN_AB17 -to GPIO1_D[7] +set_location_assignment PIN_AA17 -to GPIO1_D[6] +set_location_assignment PIN_AA18 -to GPIO1_D[5] +set_location_assignment PIN_AB18 -to GPIO1_D[4] +set_location_assignment PIN_AB19 -to GPIO1_D[3] +set_location_assignment PIN_AA19 -to GPIO1_D[2] +set_location_assignment PIN_AB20 -to GPIO1_D[1] +set_location_assignment PIN_AA20 -to GPIO1_D[0] +set_location_assignment PIN_P22 -to PS2_KBCLK +set_location_assignment PIN_P21 -to PS2_KBDAT +set_location_assignment PIN_R21 -to PS2_MSCLK +set_location_assignment PIN_R22 -to PS2_MSDAT +set_location_assignment PIN_U22 -to UART_RXD +set_location_assignment PIN_U21 -to UART_TXD +set_location_assignment PIN_V22 -to UART_RTS +set_location_assignment PIN_V21 -to UART_CTS +set_location_assignment PIN_Y21 -to SD_CLK +set_location_assignment PIN_Y22 -to SD_CMD +set_location_assignment PIN_AA22 -to SD_DAT0 +set_location_assignment PIN_W21 -to SD_DAT3 +set_location_assignment PIN_W20 -to SD_WP_N +set_location_assignment PIN_C20 -to LCD_DATA[7] +set_location_assignment PIN_D20 -to LCD_DATA[6] +set_location_assignment PIN_B21 -to LCD_DATA[5] +set_location_assignment PIN_B22 -to LCD_DATA[4] +set_location_assignment PIN_C21 -to LCD_DATA[3] +set_location_assignment PIN_C22 -to LCD_DATA[2] +set_location_assignment PIN_D21 -to LCD_DATA[1] +set_location_assignment PIN_D22 -to LCD_DATA[0] +set_location_assignment PIN_E22 -to LCD_RW +set_location_assignment PIN_F22 -to LCD_RS +set_location_assignment PIN_E21 -to LCD_EN +set_location_assignment PIN_F21 -to LCD_BLON +set_location_assignment PIN_J21 -to VGA_G[3] +set_location_assignment PIN_K17 -to VGA_G[2] +set_location_assignment PIN_J17 -to VGA_G[1] +set_location_assignment PIN_H22 -to VGA_G[0] +set_location_assignment PIN_L21 -to VGA_HS +set_location_assignment PIN_L22 -to VGA_VS +set_location_assignment PIN_H21 -to VGA_R[3] +set_location_assignment PIN_H20 -to VGA_R[2] +set_location_assignment PIN_H17 -to VGA_R[1] +set_location_assignment PIN_H19 -to VGA_R[0] +set_location_assignment PIN_K18 -to VGA_B[3] +set_location_assignment PIN_J22 -to VGA_B[2] +set_location_assignment PIN_K21 -to VGA_B[1] +set_location_assignment PIN_K22 -to VGA_B[0] +set_location_assignment PIN_G21 -to CLOCK_50 +set_location_assignment PIN_E11 -to HEX0_D[0] +set_location_assignment PIN_F11 -to HEX0_D[1] +set_location_assignment PIN_H12 -to HEX0_D[2] +set_location_assignment PIN_H13 -to HEX0_D[3] +set_location_assignment PIN_G12 -to HEX0_D[4] +set_location_assignment PIN_F12 -to HEX0_D[5] +set_location_assignment PIN_F13 -to HEX0_D[6] +set_location_assignment PIN_D13 -to HEX0_DP +set_location_assignment PIN_A15 -to HEX1_D[6] +set_location_assignment PIN_E14 -to HEX1_D[5] +set_location_assignment PIN_B14 -to HEX1_D[4] +set_location_assignment PIN_A14 -to HEX1_D[3] +set_location_assignment PIN_C13 -to HEX1_D[2] +set_location_assignment PIN_B13 -to HEX1_D[1] +set_location_assignment PIN_A13 -to HEX1_D[0] +set_location_assignment PIN_B15 -to HEX1_DP +set_location_assignment PIN_F14 -to HEX2_D[6] +set_location_assignment PIN_B17 -to HEX2_D[5] +set_location_assignment PIN_A17 -to HEX2_D[4] +set_location_assignment PIN_E15 -to HEX2_D[3] +set_location_assignment PIN_B16 -to HEX2_D[2] +set_location_assignment PIN_A16 -to HEX2_D[1] +set_location_assignment PIN_D15 -to HEX2_D[0] +set_location_assignment PIN_A18 -to HEX2_DP +set_location_assignment PIN_G15 -to HEX3_D[6] +set_location_assignment PIN_D19 -to HEX3_D[5] +set_location_assignment PIN_C19 -to HEX3_D[4] +set_location_assignment PIN_B19 -to HEX3_D[3] +set_location_assignment PIN_A19 -to HEX3_D[2] +set_location_assignment PIN_F15 -to HEX3_D[1] +set_location_assignment PIN_B18 -to HEX3_D[0] +set_location_assignment PIN_G16 -to HEX3_DP +set_location_assignment PIN_G8 -to DRAM_CAS_N +set_location_assignment PIN_G7 -to DRAM_CS_N +set_location_assignment PIN_E5 -to DRAM_CLK +set_location_assignment PIN_E6 -to DRAM_CKE +set_location_assignment PIN_B5 -to DRAM_BA_0 +set_location_assignment PIN_A4 -to DRAM_BA_1 +set_location_assignment PIN_F10 -to DRAM_DQ[15] +set_location_assignment PIN_E10 -to DRAM_DQ[14] +set_location_assignment PIN_A10 -to DRAM_DQ[13] +set_location_assignment PIN_B10 -to DRAM_DQ[12] +set_location_assignment PIN_C10 -to DRAM_DQ[11] +set_location_assignment PIN_A9 -to DRAM_DQ[10] +set_location_assignment PIN_B9 -to DRAM_DQ[9] +set_location_assignment PIN_A8 -to DRAM_DQ[8] +set_location_assignment PIN_F8 -to DRAM_DQ[7] +set_location_assignment PIN_H9 -to DRAM_DQ[6] +set_location_assignment PIN_G9 -to DRAM_DQ[5] +set_location_assignment PIN_F9 -to DRAM_DQ[4] +set_location_assignment PIN_E9 -to DRAM_DQ[3] +set_location_assignment PIN_H10 -to DRAM_DQ[2] +set_location_assignment PIN_G10 -to DRAM_DQ[1] +set_location_assignment PIN_D10 -to DRAM_DQ[0] +set_location_assignment PIN_E7 -to DRAM_LDQM +set_location_assignment PIN_B8 -to DRAM_UDQM +set_location_assignment PIN_F7 -to DRAM_RAS_N +set_location_assignment PIN_D6 -to DRAM_WE_N +set_location_assignment PIN_B12 -to CLOCK_50_2 +set_location_assignment PIN_C8 -to DRAM_ADDR[12] +set_location_assignment PIN_A7 -to DRAM_ADDR[11] +set_location_assignment PIN_B4 -to DRAM_ADDR[10] +set_location_assignment PIN_B7 -to DRAM_ADDR[9] +set_location_assignment PIN_C7 -to DRAM_ADDR[8] +set_location_assignment PIN_A6 -to DRAM_ADDR[7] +set_location_assignment PIN_B6 -to DRAM_ADDR[6] +set_location_assignment PIN_C6 -to DRAM_ADDR[5] +set_location_assignment PIN_A5 -to DRAM_ADDR[4] +set_location_assignment PIN_C3 -to DRAM_ADDR[3] +set_location_assignment PIN_B3 -to DRAM_ADDR[2] +set_location_assignment PIN_A3 -to DRAM_ADDR[1] +set_location_assignment PIN_C4 -to DRAM_ADDR[0] set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top \ No newline at end of file diff --git a/boards/Digilent DE0/Speech256_DE0.sdc b/boards/Digilent DE0/Speech256_DE0.sdc new file mode 100644 index 0000000..4ed0076 --- /dev/null +++ b/boards/Digilent DE0/Speech256_DE0.sdc @@ -0,0 +1,107 @@ +## Generated SDC file "RAMtest.out.sdc" + +## Copyright (C) 1991-2013 Altera Corporation +## Your use of Altera Corporation's design tools, logic functions +## and other software and tools, and its AMPP partner logic +## functions, and any output files from any of the foregoing +## (including device programming or simulation files), and any +## associated documentation or information are expressly subject +## to the terms and conditions of the Altera Program License +## Subscription Agreement, Altera MegaCore Function License +## Agreement, or other applicable license agreement, including, +## without limitation, that your use is for the sole purpose of +## programming logic devices manufactured by Altera and sold by +## Altera or its authorized distributors. Please refer to the +## applicable agreement for further details. + + +## VENDOR "Altera" +## PROGRAM "Quartus II" +## VERSION "Version 13.1.0 Build 162 10/23/2013 SJ Web Edition" + +## DATE "Thu Apr 06 23:04:52 2017" + +## +## DEVICE "EP3C16F484C6" +## + + +#************************************************************** +# Time Information +#************************************************************** + +set_time_format -unit ns -decimal_places 3 + + + +#************************************************************** +# Create Clock +#************************************************************** + +create_clock -name {CLOCK_50} -period 20.000 -waveform { 0.000 10.000 } [get_ports {CLOCK_50}] +create_clock -name {clk} -period 400.000 -waveform { 0.000 200.000 } [get_registers {clk}] + +#************************************************************** +# Create Generated Clock +#************************************************************** + + + +#************************************************************** +# Set Clock Latency +#************************************************************** + + + +#************************************************************** +# Set Clock Uncertainty +#************************************************************** + + + +#************************************************************** +# Set Input Delay +#************************************************************** + + + +#************************************************************** +# Set Output Delay +#************************************************************** + + + +#************************************************************** +# Set Clock Groups +#************************************************************** + + + +#************************************************************** +# Set False Path +#************************************************************** + + + +#************************************************************** +# Set Multicycle Path +#************************************************************** + + + +#************************************************************** +# Set Maximum Delay +#************************************************************** + + + +#************************************************************** +# Set Minimum Delay +#************************************************************** + + + +#************************************************************** +# Set Input Transition +#************************************************************** + diff --git a/boards/Digilent DE0/Speech256_de0.pin b/boards/Digilent DE0/Speech256_de0.pin new file mode 100644 index 0000000..369b1b8 --- /dev/null +++ b/boards/Digilent DE0/Speech256_de0.pin @@ -0,0 +1,558 @@ + -- Copyright (C) 1991-2009 Altera Corporation + -- Your use of Altera Corporation's design tools, logic functions + -- and other software and tools, and its AMPP partner logic + -- functions, and any output files from any of the foregoing + -- (including device programming or simulation files), and any + -- associated documentation or information are expressly subject + -- to the terms and conditions of the Altera Program License + -- Subscription Agreement, Altera MegaCore Function License + -- Agreement, or other applicable license agreement, including, + -- without limitation, that your use is for the sole purpose of + -- programming logic devices manufactured by Altera and sold by + -- Altera or its authorized distributors. Please refer to the + -- applicable agreement for further details. + -- + -- This is a Quartus II output file. It is for reporting purposes only, and is + -- not intended for use as a Quartus II input file. This file cannot be used + -- to make Quartus II pin assignments - for instructions on how to make pin + -- assignments, please see Quartus II help. + --------------------------------------------------------------------------------- + + + + --------------------------------------------------------------------------------- + -- NC : No Connect. This pin has no internal connection to the device. + -- DNU : Do Not Use. This pin MUST NOT be connected. + -- VCCINT : Dedicated power pin, which MUST be connected to VCC (1.2V). + -- VCCIO : Dedicated power pin, which MUST be connected to VCC + -- of its bank. + -- Bank 1: 3.3V + -- Bank 2: 3.3V + -- Bank 3: 3.3V + -- Bank 4: 3.3V + -- Bank 5: 3.3V + -- Bank 6: 3.3V + -- Bank 7: 3.3V + -- Bank 8: 3.3V + -- GND : Dedicated ground pin. Dedicated GND pins MUST be connected to GND. + -- It can also be used to report unused dedicated pins. The connection + -- on the board for unused dedicated pins depends on whether this will + -- be used in a future design. One example is device migration. When + -- using device migration, refer to the device pin-tables. If it is a + -- GND pin in the pin table or if it will not be used in a future design + -- for another purpose the it MUST be connected to GND. If it is an unused + -- dedicated pin, then it can be connected to a valid signal on the board + -- (low, high, or toggling) if that signal is required for a different + -- revision of the design. + -- GND+ : Unused input pin. It can also be used to report unused dual-purpose pins. + -- This pin should be connected to GND. It may also be connected to a + -- valid signal on the board (low, high, or toggling) if that signal + -- is required for a different revision of the design. + -- GND* : Unused I/O pin. For transceiver I/O banks (Bank 13, 14, 15, 16 and 17), + -- connect each pin marked GND* either individually through a 10k Ohm resistor + -- to GND or tie all pins together and connect through a single 10k Ohm resistor + -- to GND. + -- For non-transceiver I/O banks, connect each pin marked GND* directly to GND + -- or leave it unconnected. + -- RESERVED : Unused I/O pin, which MUST be left unconnected. + -- RESERVED_INPUT : Pin is tri-stated and should be connected to the board. + -- RESERVED_INPUT_WITH_WEAK_PULLUP : Pin is tri-stated with internal weak pull-up resistor. + -- RESERVED_INPUT_WITH_BUS_HOLD : Pin is tri-stated with bus-hold circuitry. + -- RESERVED_OUTPUT_DRIVEN_HIGH : Pin is output driven high. + --------------------------------------------------------------------------------- + + + + --------------------------------------------------------------------------------- + -- Pin directions (input, output or bidir) are based on device operating in user mode. + --------------------------------------------------------------------------------- + +Quartus II Version 9.0 Internal Build 220 05/13/2009 Service Pack 2 SJ Full Version +CHIP "DE0_Default" ASSIGNED TO AN: EP3C16F484C6 + +Pin Name/Usage : Location : Dir. : I/O Standard : Voltage : I/O Bank : User Assignment +------------------------------------------------------------------------------------------------------------- +GND : A1 : gnd : : : : +VCCIO8 : A2 : power : : 3.3V : 8 : +DRAM_ADDR[1] : A3 : output : 3.3-V LVTTL : : 8 : Y +DRAM_BA_1 : A4 : output : 3.3-V LVTTL : : 8 : Y +DRAM_ADDR[4] : A5 : output : 3.3-V LVTTL : : 8 : Y +DRAM_ADDR[7] : A6 : output : 3.3-V LVTTL : : 8 : Y +DRAM_ADDR[11] : A7 : output : 3.3-V LVTTL : : 8 : Y +DRAM_DQ[8] : A8 : bidir : 3.3-V LVTTL : : 8 : Y +DRAM_DQ[10] : A9 : bidir : 3.3-V LVTTL : : 8 : Y +DRAM_DQ[13] : A10 : bidir : 3.3-V LVTTL : : 8 : Y +GND+ : A11 : : : : 8 : +GND+ : A12 : : : : 7 : +HEX1_D[0] : A13 : output : 3.3-V LVTTL : : 7 : Y +HEX1_D[3] : A14 : output : 3.3-V LVTTL : : 7 : Y +HEX1_D[6] : A15 : output : 3.3-V LVTTL : : 7 : Y +HEX2_D[1] : A16 : output : 3.3-V LVTTL : : 7 : Y +HEX2_D[4] : A17 : output : 3.3-V LVTTL : : 7 : Y +HEX2_DP : A18 : output : 3.3-V LVTTL : : 7 : Y +HEX3_D[2] : A19 : output : 3.3-V LVTTL : : 7 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : A20 : : : : 7 : +VCCIO7 : A21 : power : : 3.3V : 7 : +GND : A22 : gnd : : : : +FL_BYTE_N : AA1 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[16] : AA2 : output : 3.3-V LVTTL : : 2 : Y +GPIO0_CLKOUT[1] : AA3 : output : 3.3-V LVTTL : : 3 : Y +GPIO0_D[15] : AA4 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO0_D[13] : AA5 : bidir : 3.3-V LVTTL : : 3 : Y +VCCIO3 : AA6 : power : : 3.3V : 3 : +GPIO1_D[16] : AA7 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO0_D[11] : AA8 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO1_D[15] : AA9 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO0_D[9] : AA10 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO1_CLKIN[1] : AA11 : input : 3.3-V LVTTL : : 3 : Y +GPIO0_CLKIN[1] : AA12 : input : 3.3-V LVTTL : : 4 : Y +GPIO0_D[7] : AA13 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO0_D[4] : AA14 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO0_D[2] : AA15 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO0_D[1] : AA16 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO1_D[6] : AA17 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO1_D[5] : AA18 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO1_D[2] : AA19 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO1_D[0] : AA20 : bidir : 3.3-V LVTTL : : 4 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : AA21 : : : : 5 : +SD_DAT0 : AA22 : bidir : 3.3-V LVTTL : : 5 : Y +GND : AB1 : gnd : : : : +VCCIO3 : AB2 : power : : 3.3V : 3 : +GPIO0_CLKOUT[0] : AB3 : output : 3.3-V LVTTL : : 3 : Y +GPIO0_D[14] : AB4 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO0_D[12] : AB5 : bidir : 3.3-V LVTTL : : 3 : Y +GND : AB6 : gnd : : : : +GPIO1_D[17] : AB7 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO0_D[10] : AB8 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO1_D[14] : AB9 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO0_D[8] : AB10 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO1_CLKIN[0] : AB11 : input : 3.3-V LVTTL : : 3 : Y +GPIO0_CLKIN[0] : AB12 : input : 3.3-V LVTTL : : 4 : Y +GPIO0_D[6] : AB13 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO0_D[5] : AB14 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO0_D[3] : AB15 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO0_D[0] : AB16 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO1_D[7] : AB17 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO1_D[4] : AB18 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO1_D[3] : AB19 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO1_D[1] : AB20 : bidir : 3.3-V LVTTL : : 4 : Y +VCCIO4 : AB21 : power : : 3.3V : 4 : +GND : AB22 : gnd : : : : +LEDG[9] : B1 : output : 3.3-V LVTTL : : 1 : Y +LEDG[8] : B2 : output : 3.3-V LVTTL : : 1 : Y +DRAM_ADDR[2] : B3 : output : 3.3-V LVTTL : : 8 : Y +DRAM_ADDR[10] : B4 : output : 3.3-V LVTTL : : 8 : Y +DRAM_BA_0 : B5 : output : 3.3-V LVTTL : : 8 : Y +DRAM_ADDR[6] : B6 : output : 3.3-V LVTTL : : 8 : Y +DRAM_ADDR[9] : B7 : output : 3.3-V LVTTL : : 8 : Y +DRAM_UDQM : B8 : output : 3.3-V LVTTL : : 8 : Y +DRAM_DQ[9] : B9 : bidir : 3.3-V LVTTL : : 8 : Y +DRAM_DQ[12] : B10 : bidir : 3.3-V LVTTL : : 8 : Y +GND+ : B11 : : : : 8 : +CLOCK_50_2 : B12 : input : 3.3-V LVTTL : : 7 : Y +HEX1_D[1] : B13 : output : 3.3-V LVTTL : : 7 : Y +HEX1_D[4] : B14 : output : 3.3-V LVTTL : : 7 : Y +HEX1_DP : B15 : output : 3.3-V LVTTL : : 7 : Y +HEX2_D[2] : B16 : output : 3.3-V LVTTL : : 7 : Y +HEX2_D[5] : B17 : output : 3.3-V LVTTL : : 7 : Y +HEX3_D[0] : B18 : output : 3.3-V LVTTL : : 7 : Y +HEX3_D[3] : B19 : output : 3.3-V LVTTL : : 7 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : B20 : : : : 7 : +LCD_DATA[5] : B21 : bidir : 3.3-V LVTTL : : 6 : Y +LCD_DATA[4] : B22 : bidir : 3.3-V LVTTL : : 6 : Y +LEDG[6] : C1 : output : 3.3-V LVTTL : : 1 : Y +LEDG[7] : C2 : output : 3.3-V LVTTL : : 1 : Y +DRAM_ADDR[3] : C3 : output : 3.3-V LVTTL : : 8 : Y +DRAM_ADDR[0] : C4 : output : 3.3-V LVTTL : : 8 : Y +GND : C5 : gnd : : : : +DRAM_ADDR[5] : C6 : output : 3.3-V LVTTL : : 8 : Y +DRAM_ADDR[8] : C7 : output : 3.3-V LVTTL : : 8 : Y +DRAM_ADDR[12] : C8 : output : 3.3-V LVTTL : : 8 : Y +GND : C9 : gnd : : : : +DRAM_DQ[11] : C10 : bidir : 3.3-V LVTTL : : 8 : Y +GND : C11 : gnd : : : : +GND : C12 : gnd : : : : +HEX1_D[2] : C13 : output : 3.3-V LVTTL : : 7 : Y +GND : C14 : gnd : : : : +RESERVED_INPUT_WITH_WEAK_PULLUP : C15 : : : : 7 : +GND : C16 : gnd : : : : +RESERVED_INPUT_WITH_WEAK_PULLUP : C17 : : : : 7 : +GND : C18 : gnd : : : : +HEX3_D[4] : C19 : output : 3.3-V LVTTL : : 7 : Y +LCD_DATA[7] : C20 : bidir : 3.3-V LVTTL : : 6 : Y +LCD_DATA[3] : C21 : bidir : 3.3-V LVTTL : : 6 : Y +LCD_DATA[2] : C22 : bidir : 3.3-V LVTTL : : 6 : Y +~ALTERA_ASDO_DATA1~ / RESERVED_INPUT_WITH_WEAK_PULLUP : D1 : input : 3.3-V LVTTL : : 1 : N +SW[9] : D2 : input : 3.3-V LVTTL : : 1 : Y +GND : D3 : gnd : : : : +VCCIO1 : D4 : power : : 3.3V : 1 : +VCCIO8 : D5 : power : : 3.3V : 8 : +DRAM_WE_N : D6 : output : 3.3-V LVTTL : : 8 : Y +GND : D7 : gnd : : : : +GND : D8 : gnd : : : : +VCCIO8 : D9 : power : : 3.3V : 8 : +DRAM_DQ[0] : D10 : bidir : 3.3-V LVTTL : : 8 : Y +VCCIO8 : D11 : power : : 3.3V : 8 : +VCCIO7 : D12 : power : : 3.3V : 7 : +HEX0_DP : D13 : output : 3.3-V LVTTL : : 7 : Y +VCCIO7 : D14 : power : : 3.3V : 7 : +HEX2_D[0] : D15 : output : 3.3-V LVTTL : : 7 : Y +VCCIO7 : D16 : power : : 3.3V : 7 : +RESERVED_INPUT_WITH_WEAK_PULLUP : D17 : : : : 7 : +VCCIO7 : D18 : power : : 3.3V : 7 : +HEX3_D[5] : D19 : output : 3.3-V LVTTL : : 7 : Y +LCD_DATA[6] : D20 : bidir : 3.3-V LVTTL : : 6 : Y +LCD_DATA[1] : D21 : bidir : 3.3-V LVTTL : : 6 : Y +LCD_DATA[0] : D22 : bidir : 3.3-V LVTTL : : 6 : Y +LEDG[5] : E1 : output : 3.3-V LVTTL : : 1 : Y +~ALTERA_FLASH_nCE_nCSO~ / RESERVED_INPUT_WITH_WEAK_PULLUP : E2 : input : 3.3-V LVTTL : : 1 : N +SW[7] : E3 : input : 3.3-V LVTTL : : 1 : Y +SW[8] : E4 : input : 3.3-V LVTTL : : 1 : Y +DRAM_CLK : E5 : output : 3.3-V LVTTL : : 8 : Y +DRAM_CKE : E6 : output : 3.3-V LVTTL : : 8 : Y +DRAM_LDQM : E7 : output : 3.3-V LVTTL : : 8 : Y +VCCIO8 : E8 : power : : 3.3V : 8 : +DRAM_DQ[3] : E9 : bidir : 3.3-V LVTTL : : 8 : Y +DRAM_DQ[14] : E10 : bidir : 3.3-V LVTTL : : 8 : Y +HEX0_D[0] : E11 : output : 3.3-V LVTTL : : 7 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : E12 : : : : 7 : +RESERVED_INPUT_WITH_WEAK_PULLUP : E13 : : : : 7 : +HEX1_D[5] : E14 : output : 3.3-V LVTTL : : 7 : Y +HEX2_D[3] : E15 : output : 3.3-V LVTTL : : 7 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : E16 : : : : 7 : +VCCD_PLL2 : E17 : power : : 1.2V : : +GNDA2 : E18 : gnd : : : : +VCCIO6 : E19 : power : : 3.3V : 6 : +GND : E20 : gnd : : : : +LCD_EN : E21 : output : 3.3-V LVTTL : : 6 : Y +LCD_RW : E22 : output : 3.3-V LVTTL : : 6 : Y +BUTTON[2] : F1 : input : 3.3-V LVTTL : : 1 : Y +LEDG[4] : F2 : output : 3.3-V LVTTL : : 1 : Y +GND : F3 : gnd : : : : +VCCIO1 : F4 : power : : 3.3V : 1 : +GNDA3 : F5 : gnd : : : : +VCCD_PLL3 : F6 : power : : 1.2V : : +DRAM_RAS_N : F7 : output : 3.3-V LVTTL : : 8 : Y +DRAM_DQ[7] : F8 : bidir : 3.3-V LVTTL : : 8 : Y +DRAM_DQ[4] : F9 : bidir : 3.3-V LVTTL : : 8 : Y +DRAM_DQ[15] : F10 : bidir : 3.3-V LVTTL : : 8 : Y +HEX0_D[1] : F11 : output : 3.3-V LVTTL : : 7 : Y +HEX0_D[5] : F12 : output : 3.3-V LVTTL : : 7 : Y +HEX0_D[6] : F13 : output : 3.3-V LVTTL : : 7 : Y +HEX2_D[6] : F14 : output : 3.3-V LVTTL : : 7 : Y +HEX3_D[1] : F15 : output : 3.3-V LVTTL : : 7 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : F16 : : : : 7 : +RESERVED_INPUT_WITH_WEAK_PULLUP : F17 : : : : 6 : +VCCA2 : F18 : power : : 2.5V : : +RESERVED_INPUT_WITH_WEAK_PULLUP : F19 : : : : 6 : +RESERVED_INPUT_WITH_WEAK_PULLUP : F20 : : : : 6 : +LCD_BLON : F21 : output : 3.3-V LVTTL : : 6 : Y +LCD_RS : F22 : output : 3.3-V LVTTL : : 6 : Y +GND+ : G1 : : : : 1 : +GND+ : G2 : : : : 1 : +BUTTON[1] : G3 : input : 3.3-V LVTTL : : 1 : Y +SW[3] : G4 : input : 3.3-V LVTTL : : 1 : Y +SW[4] : G5 : input : 3.3-V LVTTL : : 1 : Y +VCCA3 : G6 : power : : 2.5V : : +DRAM_CS_N : G7 : output : 3.3-V LVTTL : : 8 : Y +DRAM_CAS_N : G8 : output : 3.3-V LVTTL : : 8 : Y +DRAM_DQ[5] : G9 : bidir : 3.3-V LVTTL : : 8 : Y +DRAM_DQ[1] : G10 : bidir : 3.3-V LVTTL : : 8 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : G11 : : : : 8 : +HEX0_D[4] : G12 : output : 3.3-V LVTTL : : 7 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : G13 : : : : 7 : +RESERVED_INPUT_WITH_WEAK_PULLUP : G14 : : : : 7 : +HEX3_D[6] : G15 : output : 3.3-V LVTTL : : 7 : Y +HEX3_DP : G16 : output : 3.3-V LVTTL : : 7 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : G17 : : : : 6 : +RESERVED_INPUT_WITH_WEAK_PULLUP : G18 : : : : 6 : +VCCIO6 : G19 : power : : 3.3V : 6 : +GND : G20 : gnd : : : : +CLOCK_50 : G21 : input : 3.3-V LVTTL : : 6 : Y +GND+ : G22 : : : : 6 : +LEDG[3] : H1 : output : 3.3-V LVTTL : : 1 : Y +BUTTON[0] : H2 : input : 3.3-V LVTTL : : 1 : Y +GND : H3 : gnd : : : : +VCCIO1 : H4 : power : : 3.3V : 1 : +SW[1] : H5 : input : 3.3-V LVTTL : : 1 : Y +SW[2] : H6 : input : 3.3-V LVTTL : : 1 : Y +SW[6] : H7 : input : 3.3-V LVTTL : : 1 : Y +GND : H8 : gnd : : : : +DRAM_DQ[6] : H9 : bidir : 3.3-V LVTTL : : 8 : Y +DRAM_DQ[2] : H10 : bidir : 3.3-V LVTTL : : 8 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : H11 : : : : 8 : +HEX0_D[2] : H12 : output : 3.3-V LVTTL : : 7 : Y +HEX0_D[3] : H13 : output : 3.3-V LVTTL : : 7 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : H14 : : : : 7 : +RESERVED_INPUT_WITH_WEAK_PULLUP : H15 : : : : 7 : +RESERVED_INPUT_WITH_WEAK_PULLUP : H16 : : : : 6 : +VGA_R[1] : H17 : output : 3.3-V LVTTL : : 6 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : H18 : : : : 6 : +VGA_R[0] : H19 : output : 3.3-V LVTTL : : 6 : Y +VGA_R[2] : H20 : output : 3.3-V LVTTL : : 6 : Y +VGA_R[3] : H21 : output : 3.3-V LVTTL : : 6 : Y +VGA_G[0] : H22 : output : 3.3-V LVTTL : : 6 : Y +LEDG[0] : J1 : output : 3.3-V LVTTL : : 1 : Y +LEDG[1] : J2 : output : 3.3-V LVTTL : : 1 : Y +LEDG[2] : J3 : output : 3.3-V LVTTL : : 1 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : J4 : : : : 1 : +GND : J5 : gnd : : : : +SW[0] : J6 : input : 3.3-V LVTTL : : 1 : Y +SW[5] : J7 : input : 3.3-V LVTTL : : 1 : Y +VCCINT : J8 : power : : 1.2V : : +GND : J9 : gnd : : : : +VCCINT : J10 : power : : 1.2V : : +VCCINT : J11 : power : : 1.2V : : +VCCINT : J12 : power : : 1.2V : : +VCCINT : J13 : power : : 1.2V : : +VCCINT : J14 : power : : 1.2V : : +RESERVED_INPUT_WITH_WEAK_PULLUP : J15 : : : : 6 : +RESERVED_INPUT_WITH_WEAK_PULLUP : J16 : : : : 6 : +VGA_G[1] : J17 : output : 3.3-V LVTTL : : 6 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : J18 : : : : 6 : +GND : J19 : gnd : : : : +VCCIO6 : J20 : power : : 3.3V : 6 : +VGA_G[3] : J21 : output : 3.3-V LVTTL : : 6 : Y +VGA_B[2] : J22 : output : 3.3-V LVTTL : : 6 : Y +~ALTERA_DATA0~ / RESERVED_INPUT_WITH_WEAK_PULLUP : K1 : input : 3.3-V LVTTL : : 1 : N +~ALTERA_DCLK~ : K2 : output : 3.3-V LVTTL : : 1 : N +GND : K3 : gnd : : : : +VCCIO1 : K4 : power : : 3.3V : 1 : +nCONFIG : K5 : : : : 1 : +nSTATUS : K6 : : : : 1 : +RESERVED_INPUT_WITH_WEAK_PULLUP : K7 : : : : 1 : +RESERVED_INPUT_WITH_WEAK_PULLUP : K8 : : : : 1 : +VCCINT : K9 : power : : 1.2V : : +GND : K10 : gnd : : : : +GND : K11 : gnd : : : : +GND : K12 : gnd : : : : +GND : K13 : gnd : : : : +VCCINT : K14 : power : : 1.2V : : +RESERVED_INPUT_WITH_WEAK_PULLUP : K15 : : : : 6 : +RESERVED_INPUT_WITH_WEAK_PULLUP : K16 : : : : 6 : +VGA_G[2] : K17 : output : 3.3-V LVTTL : : 6 : Y +VGA_B[3] : K18 : output : 3.3-V LVTTL : : 6 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : K19 : : : : 6 : +MSEL3 : K20 : : : : 6 : +VGA_B[1] : K21 : output : 3.3-V LVTTL : : 6 : Y +VGA_B[0] : K22 : output : 3.3-V LVTTL : : 6 : Y +TMS : L1 : input : : : 1 : +TCK : L2 : input : : : 1 : +nCE : L3 : : : : 1 : +TDO : L4 : output : : : 1 : +TDI : L5 : input : : : 1 : +FL_ADDR[15] : L6 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[14] : L7 : output : 3.3-V LVTTL : : 2 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : L8 : : : : 1 : +VCCINT : L9 : power : : 1.2V : : +GND : L10 : gnd : : : : +GND : L11 : gnd : : : : +GND : L12 : gnd : : : : +GND : L13 : gnd : : : : +VCCINT : L14 : power : : 1.2V : : +RESERVED_INPUT_WITH_WEAK_PULLUP : L15 : : : : 6 : +RESERVED_INPUT_WITH_WEAK_PULLUP : L16 : : : : 6 : +MSEL2 : L17 : : : : 6 : +MSEL1 : L18 : : : : 6 : +VCCIO6 : L19 : power : : 3.3V : 6 : +GND : L20 : gnd : : : : +VGA_HS : L21 : output : 3.3-V LVTTL : : 6 : Y +VGA_VS : L22 : output : 3.3-V LVTTL : : 6 : Y +FL_ADDR[13] : M1 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[12] : M2 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[11] : M3 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[7] : M4 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[17] : M5 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[18] : M6 : output : 3.3-V LVTTL : : 2 : Y +FL_RY : M7 : input : 3.3-V LVTTL : : 2 : Y +FL_ADDR[6] : M8 : output : 3.3-V LVTTL : : 2 : Y +VCCINT : M9 : power : : 1.2V : : +GND : M10 : gnd : : : : +GND : M11 : gnd : : : : +GND : M12 : gnd : : : : +GND : M13 : gnd : : : : +VCCINT : M14 : power : : 1.2V : : +RESERVED_INPUT_WITH_WEAK_PULLUP : M15 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : M16 : : : : 5 : +MSEL0 : M17 : : : : 6 : +CONF_DONE : M18 : : : : 6 : +RESERVED_INPUT_WITH_WEAK_PULLUP : M19 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : M20 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : M21 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : M22 : : : : 5 : +FL_ADDR[10] : N1 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[9] : N2 : output : 3.3-V LVTTL : : 2 : Y +GND : N3 : gnd : : : : +VCCIO2 : N4 : power : : 3.3V : 2 : +FL_ADDR[4] : N5 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[5] : N6 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[3] : N7 : output : 3.3-V LVTTL : : 2 : Y +FL_CE_N : N8 : output : 3.3-V LVTTL : : 2 : Y +VCCINT : N9 : power : : 1.2V : : +GND : N10 : gnd : : : : +GND : N11 : gnd : : : : +GND : N12 : gnd : : : : +GND : N13 : gnd : : : : +RESERVED_INPUT_WITH_WEAK_PULLUP : N14 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : N15 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : N16 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : N17 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : N18 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : N19 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : N20 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : N21 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : N22 : : : : 5 : +FL_ADDR[19] : P1 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[8] : P2 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[20] : P3 : output : 3.3-V LVTTL : : 2 : Y +FL_WE_N : P4 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[1] : P5 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[2] : P6 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[0] : P7 : output : 3.3-V LVTTL : : 2 : Y +FL_DQ[1] : P8 : bidir : 3.3-V LVTTL : : 2 : Y +VCCINT : P9 : power : : 1.2V : : +VCCINT : P10 : power : : 1.2V : : +VCCINT : P11 : power : : 1.2V : : +VCCINT : P12 : power : : 1.2V : : +VCCINT : P13 : power : : 1.2V : : +RESERVED_INPUT_WITH_WEAK_PULLUP : P14 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : P15 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : P16 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : P17 : : : : 5 : +VCCIO5 : P18 : power : : 3.3V : 5 : +GND : P19 : gnd : : : : +RESERVED_INPUT_WITH_WEAK_PULLUP : P20 : : : : 5 : +PS2_KBDAT : P21 : bidir : 3.3-V LVTTL : : 5 : Y +PS2_KBCLK : P22 : bidir : 3.3-V LVTTL : : 5 : Y +FL_RST_N : R1 : output : 3.3-V LVTTL : : 2 : Y +FL_ADDR[21] : R2 : output : 3.3-V LVTTL : : 2 : Y +GND : R3 : gnd : : : : +VCCIO2 : R4 : power : : 3.3V : 2 : +RESERVED_INPUT_WITH_WEAK_PULLUP : R5 : : : : 2 : +FL_OE_N : R6 : output : 3.3-V LVTTL : : 2 : Y +FL_DQ[0] : R7 : bidir : 3.3-V LVTTL : : 2 : Y +FL_DQ[2] : R8 : bidir : 3.3-V LVTTL : : 2 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : R9 : : : : 3 : +GPIO0_D[22] : R10 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO1_D[22] : R11 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO1_D[23] : R12 : bidir : 3.3-V LVTTL : : 3 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : R13 : : : : 4 : +GPIO1_D[19] : R14 : bidir : 3.3-V LVTTL : : 4 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : R15 : : : : 4 : +GPIO1_CLKOUT[0] : R16 : output : 3.3-V LVTTL : : 4 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : R17 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : R18 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : R19 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : R20 : : : : 5 : +PS2_MSCLK : R21 : bidir : 3.3-V LVTTL : : 5 : Y +PS2_MSDAT : R22 : bidir : 3.3-V LVTTL : : 5 : Y +GND+ : T1 : : : : 2 : +GND+ : T2 : : : : 2 : +FL_WP_N : T3 : output : 3.3-V LVTTL : : 2 : Y +FL_DQ[10] : T4 : bidir : 3.3-V LVTTL : : 2 : Y +FL_DQ[8] : T5 : bidir : 3.3-V LVTTL : : 2 : Y +VCCA1 : T6 : power : : 2.5V : : +FL_DQ[9] : T7 : bidir : 3.3-V LVTTL : : 2 : Y +GPIO0_D[26] : T8 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO1_D[27] : T9 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO1_D[25] : T10 : bidir : 3.3-V LVTTL : : 3 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : T11 : : : : 3 : +GPIO1_D[21] : T12 : bidir : 3.3-V LVTTL : : 4 : Y +VCCINT : T13 : power : : 1.2V : : +GPIO1_D[18] : T14 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO1_D[11] : T15 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO1_CLKOUT[1] : T16 : output : 3.3-V LVTTL : : 4 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : T17 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : T18 : : : : 5 : +VCCIO5 : T19 : power : : 3.3V : 5 : +GND : T20 : gnd : : : : +GND+ : T21 : : : : 5 : +GND+ : T22 : : : : 5 : +FL_DQ[3] : U1 : bidir : 3.3-V LVTTL : : 2 : Y +FL_DQ[11] : U2 : bidir : 3.3-V LVTTL : : 2 : Y +GND : U3 : gnd : : : : +VCCIO2 : U4 : power : : 3.3V : 2 : +GNDA1 : U5 : gnd : : : : +VCCD_PLL1 : U6 : power : : 1.2V : : +GPIO0_D[31] : U7 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO1_D[29] : U8 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO1_D[26] : U9 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO1_D[24] : U10 : bidir : 3.3-V LVTTL : : 3 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : U11 : : : : 3 : +GPIO1_D[20] : U12 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO0_D[20] : U13 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO0_D[17] : U14 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO1_D[10] : U15 : bidir : 3.3-V LVTTL : : 4 : Y +VCCINT : U16 : power : : 1.2V : : +VCCINT : U17 : power : : 1.2V : : +VCCA4 : U18 : power : : 2.5V : : +RESERVED_INPUT_WITH_WEAK_PULLUP : U19 : : : : 5 : +RESERVED_INPUT_WITH_WEAK_PULLUP : U20 : : : : 5 : +UART_TXD : U21 : output : 3.3-V LVTTL : : 5 : Y +UART_RXD : U22 : input : 3.3-V LVTTL : : 5 : Y +FL_DQ[12] : V1 : bidir : 3.3-V LVTTL : : 2 : Y +FL_DQ[4] : V2 : bidir : 3.3-V LVTTL : : 2 : Y +FL_DQ[5] : V3 : bidir : 3.3-V LVTTL : : 2 : Y +FL_DQ[13] : V4 : bidir : 3.3-V LVTTL : : 2 : Y +GPIO0_D[30] : V5 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO1_D[30] : V6 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO1_D[31] : V7 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO0_D[27] : V8 : bidir : 3.3-V LVTTL : : 3 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : V9 : : : : 3 : +RESERVED_INPUT_WITH_WEAK_PULLUP : V10 : : : : 3 : +GPIO0_D[23] : V11 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO0_D[21] : V12 : bidir : 3.3-V LVTTL : : 4 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : V13 : : : : 4 : +GPIO0_D[16] : V14 : bidir : 3.3-V LVTTL : : 4 : Y +GPIO1_D[13] : V15 : bidir : 3.3-V LVTTL : : 4 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : V16 : : : : 4 : +VCCD_PLL4 : V17 : power : : 1.2V : : +GNDA4 : V18 : gnd : : : : +VCCIO5 : V19 : power : : 3.3V : 5 : +GND : V20 : gnd : : : : +UART_CTS : V21 : output : 3.3-V LVTTL : : 5 : Y +UART_RTS : V22 : input : 3.3-V LVTTL : : 5 : Y +FL_DQ[6] : W1 : bidir : 3.3-V LVTTL : : 2 : Y +FL_DQ[14] : W2 : bidir : 3.3-V LVTTL : : 2 : Y +GND : W3 : gnd : : : : +VCCIO2 : W4 : power : : 3.3V : 2 : +VCCIO3 : W5 : power : : 3.3V : 3 : +GPIO0_D[29] : W6 : bidir : 3.3-V LVTTL : : 3 : Y +GPIO0_D[28] : W7 : bidir : 3.3-V LVTTL : : 3 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : W8 : : : : 3 : +VCCIO3 : W9 : power : : 3.3V : 3 : +GPIO0_D[25] : W10 : bidir : 3.3-V LVTTL : : 3 : Y +VCCIO3 : W11 : power : : 3.3V : 3 : +VCCIO4 : W12 : power : : 3.3V : 4 : +GPIO0_D[19] : W13 : bidir : 3.3-V LVTTL : : 4 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : W14 : : : : 4 : +GPIO1_D[12] : W15 : bidir : 3.3-V LVTTL : : 4 : Y +VCCIO4 : W16 : power : : 3.3V : 4 : +GPIO1_D[9] : W17 : bidir : 3.3-V LVTTL : : 4 : Y +VCCIO4 : W18 : power : : 3.3V : 4 : +RESERVED_INPUT_WITH_WEAK_PULLUP : W19 : : : : 5 : +SD_WP_N : W20 : input : 3.3-V LVTTL : : 5 : Y +SD_DAT3 : W21 : bidir : 3.3-V LVTTL : : 5 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : W22 : : : : 5 : +FL_DQ[7] : Y1 : bidir : 3.3-V LVTTL : : 2 : Y +FL_DQ15_AM1 : Y2 : bidir : 3.3-V LVTTL : : 2 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : Y3 : : : : 3 : +RESERVED_INPUT_WITH_WEAK_PULLUP : Y4 : : : : 3 : +GND : Y5 : gnd : : : : +RESERVED_INPUT_WITH_WEAK_PULLUP : Y6 : : : : 3 : +GPIO1_D[28] : Y7 : bidir : 3.3-V LVTTL : : 3 : Y +RESERVED_INPUT_WITH_WEAK_PULLUP : Y8 : : : : 3 : +GND : Y9 : gnd : : : : +GPIO0_D[24] : Y10 : bidir : 3.3-V LVTTL : : 3 : Y +GND : Y11 : gnd : : : : +GND : Y12 : gnd : : : : +GPIO0_D[18] : Y13 : bidir : 3.3-V LVTTL : : 4 : Y +VCCIO4 : Y14 : power : : 3.3V : 4 : +GND : Y15 : gnd : : : : +GND : Y16 : gnd : : : : +GPIO1_D[8] : Y17 : bidir : 3.3-V LVTTL : : 4 : Y +GND : Y18 : gnd : : : : +VCCIO5 : Y19 : power : : 3.3V : 5 : +GND : Y20 : gnd : : : : +SD_CLK : Y21 : output : 3.3-V LVTTL : : 5 : Y +SD_CMD : Y22 : bidir : 3.3-V LVTTL : : 5 : Y diff --git a/boards/Digilent DE0/speech256_de0.v b/boards/Digilent DE0/speech256_de0.v new file mode 100644 index 0000000..2726953 --- /dev/null +++ b/boards/Digilent DE0/speech256_de0.v @@ -0,0 +1,109 @@ +// +// Speech256 DE0 board top level +// +// Niels Moseley - Moseley Instruments 2017 +// http://www.moseleyinstruments.com +// + +module Speech256_DE0 ( + CLOCK_50, + SW, + BUTTON, + LEDG, + UART_TXD +); + + input CLOCK_50; + input [0:5] SW; + input [0:2] BUTTON; + output [9:0] LEDG; + output UART_TXD; + + reg [5:0] data_in; + reg data_stb; + reg clk; + reg [3:0] divcnt; // clock divider counter + reg [2:0] cur_state, next_state; + + // debug signals for 16-bit DAC + wire sample_stb; + wire signed [15:0] sample_out; + + wire ldq; + wire rst_an; + + SPEECH256_TOP u_speech256_top ( + .clk (clk), + .rst_an (rst_an), + .ldq (ldq), + .data_in (SW), + .data_stb (data_stb), + .pwm_out (UART_TXD), + .sample_out (sample_out), + .sample_stb (sample_stb) + ); + + assign rst_an = 1'b1; + + parameter S_IDLE = 4'b000, + S_ALLOPHONE = 4'b001, + S_WAITDONE = 4'b010; + + always @(posedge CLOCK_50) + begin + + // clock divider to generate 2.5 MHz for Speech256 + if (divcnt > 9) + begin + clk <= !clk; + divcnt <= 0; + end + else + begin + divcnt <= divcnt + 1; + end + end + + always @(posedge clk) + begin + cur_state <= next_state; + end + + //assign LEDG[9:0] = sample_out[15:6]; + assign LEDG[0] = BUTTON[0]; + assign LEDG[1] = ldq; + assign LEDG[2] = SW[2]; + assign LEDG[3] = SW[3]; + + always @(*) + begin + // FSM defaults + data_stb <= 0; + next_state <= cur_state; + + case(cur_state) + S_IDLE: + begin + if ((ldq == 1) && (BUTTON[0] == 1)) + next_state <= S_ALLOPHONE; + else + next_state <= S_IDLE; + end + S_ALLOPHONE: + begin + data_stb <= 1; + next_state <= S_WAITDONE; + end + S_WAITDONE: + begin + if (ldq == 0) + next_state <= S_IDLE; + end + default: + begin + next_state <= S_IDLE; + end + endcase + end + +endmodule diff --git a/verilog/controller/controller.v b/verilog/controller/controller.v index 2a1717b..fb616a0 100644 --- a/verilog/controller/controller.v +++ b/verilog/controller/controller.v @@ -45,7 +45,7 @@ module CONTROLLER ( reg [11:0] rom_addr; reg [11:0] last_rom_addr; reg [2:0] rom_addr_sel; - reg rom_en; + wire rom_en; reg [3:0] jmpmsb; reg jmpmsb_load; @@ -105,21 +105,21 @@ module CONTROLLER ( .c10_out(coeff10bit) ); - always @(posedge clk, negedge rst_an) + assign rom_en = 1; + + always @(posedge clk or negedge rst_an) begin if (rst_an == 0) begin // reset values amp_out <= 0; period_out <= 8'd1; - rom_en <= 1; - rom_addr <= 0; + //rom_addr <= 0; last_rom_addr <= 0; cur_state <= 0; cur_allo <= 0; cur_cmd <= 0; - coeff_stb <= 0; - coeff_out <= 0; + //coeff_out <= 0; coeff_cnt <= 0; jmpmsb <= 0; ldq <= 0; diff --git a/verilog/filter/filter.v b/verilog/filter/filter.v index 53661cd..21bfcd3 100644 --- a/verilog/filter/filter.v +++ b/verilog/filter/filter.v @@ -6,13 +6,6 @@ // http://www.moseleyinstruments.com // -// -// MEH!, the FSM needs a rewrite -// -// * split into clocked and unclocked ALWAYS -// and proper state names. -// - module FILTER ( clk, rst_an, diff --git a/verilog/speech256_top/speech256_top.v b/verilog/speech256_top/speech256_top.v index b76d63e..c2127dc 100644 --- a/verilog/speech256_top/speech256_top.v +++ b/verilog/speech256_top/speech256_top.v @@ -75,7 +75,8 @@ module SPEECH256_TOP ( PWMDAC u_pwmdac ( .clk (clk), .rst_an (rst_an), - .din (sig_filter[15:8]), + //.din (sig_filter[15:8]), + .din (sig_filter[11:4]), // add +24dB gain .. FIXME: add saturation ?? .din_ack (pwmdac_ack), .dacout (pwm_out) ); diff --git a/verilog/spmul/spmul.v b/verilog/spmul/spmul.v index 12872a1..04b5b62 100644 --- a/verilog/spmul/spmul.v +++ b/verilog/spmul/spmul.v @@ -17,8 +17,8 @@ module SPMUL ( done ); - //////////// CLOCK ////////// - input clk; + //////////// CLOCK ////////// + input clk; //////////// RESET, ACTIVE LOW ////////// input rst_an; @@ -28,27 +28,44 @@ module SPMUL ( input signed [9:0] coef_in; input start; - //////////// MULTIPLIER OUTPUT ////////// - output reg signed [15:0] result_out; + //////////// MULTIPLIER OUTPUT ////////// + output reg signed [15:0] result_out; output reg done; //////////// internal signals ////////// reg signed [24:0] accumulator; reg signed [9:0] coefreg; reg signed [15:0] sigreg; - reg [3:0] state; // state machine state - wire signed [15:0] bmul; + reg push_result; + reg load_operands; + reg [3:0] cur_state; // cur_state machine cur_state + reg [3:0] next_state; - reg domul,accu_clr; + reg domulcycle, accu_clr; - // accumulator - always @(posedge clk, negedge rst_an) + // clocked process + always @(posedge clk or negedge rst_an) begin - if ((rst_an == 0) || (accu_clr == 1)) + if (rst_an == 0) begin accumulator <= 0; + coefreg <= 0; + cur_state <= 0; end - else if (domul == 1) + else + begin + if (accu_clr == 1) + begin + accumulator <= 0; + end + + if (load_operands == 1) + begin + coefreg <= coef_in; + sigreg <= sig_in; + end + + if (domulcycle == 1) begin // note: leave coefreg[9] untouched // as this is the sign bit... @@ -57,100 +74,112 @@ module SPMUL ( else accumulator <= {accumulator[23:0], 1'b0}; - coefreg[8:0] <= {coefreg[7:0], 1'b0}; + coefreg[8:0] <= {coefreg[7:0], 1'b0}; end + + if (push_result == 1) + begin + if (coefreg[9] == 0) + result_out <= accumulator[24:9]; + else + result_out <= $signed(~accumulator[24:9]) + 1; + end + + cur_state <= next_state; + end end - always @(posedge clk, negedge rst_an) + parameter S_IDLE = 4'b0000, + S_CYCLE1 = 4'b0001, + S_CYCLE2 = 4'b0010, + S_CYCLE3 = 4'b0011, + S_CYCLE4 = 4'b0100, + S_CYCLE5 = 4'b0101, + S_CYCLE6 = 4'b0110, + S_CYCLE7 = 4'b0111, + S_CYCLE8 = 4'b1000, + S_CYCLE9 = 4'b1001, + S_CYCLE10 = 4'b1010; + + // FSM combinational process + always @(*) begin - if (rst_an == 0) - begin - // reset values - result_out <= 0; - done <= 1; // always be ready to start.. - coefreg <= 0; - sigreg <= 0; - state <= 0; - domul <= 0; - accu_clr <= 1; - end - else - begin - // default values - accu_clr <= 0; - done <= 0; - domul <= 0; - state <= state + 4'b0001; - case(state) - 4'b0000: // IDLE state + + // FSM defaults + done <= 0; + next_state <= cur_state; + accu_clr <= 0; + domulcycle <= 0; + push_result <= 0; + load_operands <= 0; + + case(cur_state) + S_IDLE: // IDLE cur_state + begin + accu_clr <= 1; + if (start == 1) begin - coefreg <= coef_in; - sigreg <= sig_in; - accu_clr <= 1; - if (start == 1) - begin - state <= 4'b0001; - end - else - begin - done <= 1; - state <= 4'b0000; - end + load_operands <= 1; + next_state <= S_CYCLE1; end - 4'b0001: + else begin - domul <= 1; + done <= 1; + next_state <= S_IDLE; end - 4'b0010: - begin - domul <= 1; - end - 4'b0011: - begin - domul <= 1; - end - 4'b0100: - begin - domul <= 1; - end - 4'b0101: - begin - domul <= 1; - end - 4'b0110: - begin - domul <= 1; - end - 4'b0111: - begin - domul <= 1; - end - 4'b1000: - begin - domul <= 1; - end - 4'b1001: - begin - domul <= 1; - end - 4'b1010: - begin - domul <= 0; - end - 4'b1011: - begin - domul <= 0; - done <= 1; - // correct for the coeff sign bit - if (coefreg[9] == 0) - result_out <= accumulator[24:9]; - else - result_out <= $signed(~accumulator[24:9]) + 1; - state <= 0; - end - default: - state <= 0; - endcase - end + end + S_CYCLE1: + begin + domulcycle <= 1; + next_state <= S_CYCLE2; + end + S_CYCLE2: + begin + domulcycle <= 1; + next_state <= S_CYCLE3; + end + S_CYCLE3: + begin + domulcycle <= 1; + next_state <= S_CYCLE4; + end + S_CYCLE4: + begin + domulcycle <= 1; + next_state <= S_CYCLE5; + end + S_CYCLE5: + begin + domulcycle <= 1; + next_state <= S_CYCLE6; + end + S_CYCLE6: + begin + domulcycle <= 1; + next_state <= S_CYCLE7; + end + S_CYCLE7: + begin + domulcycle <= 1; + next_state <= S_CYCLE8; + end + S_CYCLE8: + begin + domulcycle <= 1; + next_state <= S_CYCLE9; + end + S_CYCLE9: + begin + domulcycle <= 1; + next_state <= S_CYCLE10; + end + S_CYCLE10: + begin + push_result <= 1; + next_state <= S_IDLE; + end + default: + cur_state <= 0; + endcase end endmodule diff --git a/verilog/spmul/spmul_tb.v b/verilog/spmul/spmul_tb.v index e2cf51f..27b96a9 100644 --- a/verilog/spmul/spmul_tb.v +++ b/verilog/spmul/spmul_tb.v @@ -29,13 +29,12 @@ module SPMUL_TB; clk = 0; rst_an = 0; sig = 16'h7FFF; - //coef = 10'h1FF; coef = 10'h3FF; // sign-magnitude - start = 0; + start = 1; #3 rst_an = 1; - #3 - start = 1; + #10 + start = 0; #1024; end @@ -43,7 +42,11 @@ module SPMUL_TB; #5 clk = !clk; always @(posedge done) - if (done == 1) + begin + if ((done == 1) && (start == 0)) + begin + $display("Expected: %d, got %d", -32703 , result); $finish; - + end + end endmodule