OpenCores
URL https://opencores.org/ocsvn/usb_fpga_2_16/usb_fpga_2_16/trunk

Subversion Repositories usb_fpga_2_16

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /usb_fpga_2_16/trunk/examples/usb-fpga-2.16/2.16b
    from Rev 2 to Rev 3
    Reverse comparison

Rev 2 → Rev 3

/mmio/UCEcho.java
1,6 → 1,6
/*!
mmio -- Memory mapped I/O example for ZTEX USB-FPGA Module 1.15b
Copyright (C) 2009-2011 ZTEX GmbH.
mmio -- Memory mapped I/O example for ZTEX USB-FPGA Module 2.16b
Copyright (C) 2009-2014 ZTEX GmbH.
http://www.ztex.de
 
This program is free software; you can redistribute it and/or modify
/mmio/ucecho.c
1,6 → 1,6
/*!
mmio -- Memory mapped I/O example for ZTEX USB-FPGA Module 1.15b
Copyright (C) 2009-2011 ZTEX GmbH.
mmio -- Memory mapped I/O example for ZTEX USB-FPGA Module 2.16b
Copyright (C) 2009-2014 ZTEX GmbH.
http://www.ztex.de
 
This program is free software; you can redistribute it and/or modify
/intraffic/InTraffic.java
1,6 → 1,6
/*!
intraffic -- example showing how the EZ-USB FIFO interface is used on ZTEX USB-FPGA Module 1.15b
Copyright (C) 2009-2011 ZTEX GmbH.
intraffic -- example showing how the EZ-USB FIFO interface is used on ZTEX USB-FPGA Module 2.16b
Copyright (C) 2009-2014 ZTEX GmbH.
http://www.ztex.de
 
This program is free software; you can redistribute it and/or modify
/intraffic/intraffic.c
1,6 → 1,6
/*!
intraffic -- example showing how the EZ-USB FIFO interface is used on ZTEX USB-FPGA Module 1.15b
Copyright (C) 2009-2011 ZTEX GmbH.
intraffic -- example showing how the EZ-USB FIFO interface is used on ZTEX USB-FPGA Module 2.16b
Copyright (C) 2009-2014 ZTEX GmbH.
http://www.ztex.de
 
This program is free software; you can redistribute it and/or modify
/ucecho/UCEcho.java
1,6 → 1,6
/*!
ucecho -- uppercase conversion example for ZTEX USB-FPGA Module 1.2
Copyright (C) 2009-2011 ZTEX GmbH.
ucecho -- uppercase conversion and bitstream encryption example for ZTEX USB-FPGA Module 2.16b
Copyright (C) 2009-2014 ZTEX GmbH.
http://www.ztex.de
 
This program is free software; you can redistribute it and/or modify
/ucecho/ucecho.c
1,6 → 1,6
/*!
ucecho -- uppercase conversion example for ZTEX USB-FPGA Module 2.16
Copyright (C) 2009-2011 ZTEX GmbH.
ucecho -- uppercase conversion and bitstream encryption example for ZTEX USB-FPGA Module 2.16b
Copyright (C) 2009-2014 ZTEX GmbH.
http://www.ztex.de
 
This program is free software; you can redistribute it and/or modify
/ucecho/Readme
14,8 → 14,3
The driver (defined in UCEcho.java) uploads the the Firmware (ucecho.ihx)
to the EZ-USB Microcontroller and the Bitstream (fpga/ucecho.bit) to the
FPGA if necessary, sends user string to the device and reads them back.
 
Uploading the Firmware to EEPROM is also supported by the firmware (e.g.
using the FWLoader utility).
 
This example may serve a good starting point for own projects.
/lightshow/lightshow.sh
0,0 → 1,2
../../../../java/FWLoader/FWLoader -f -uf fpga/lightshow.runs/impl_1/lightshow.bit
 
lightshow/lightshow.sh Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: lightshow/fpga/lightshow.xpr =================================================================== --- lightshow/fpga/lightshow.xpr (nonexistent) +++ lightshow/fpga/lightshow.xpr (revision 3) @@ -0,0 +1,18 @@ + + + + + + + + + + + + Index: lightshow/fpga/lightshow.xdc =================================================================== --- lightshow/fpga/lightshow.xdc (nonexistent) +++ lightshow/fpga/lightshow.xdc (revision 3) @@ -0,0 +1,56 @@ +# CLKOUT/FXCLK +create_clock -name fxclk -period 10 [get_ports fxclk] +set_property PACKAGE_PIN Y18 [get_ports fxclk] +set_property IOSTANDARD LVCMOS33 [get_ports fxclk] + +# led1 +set_property PACKAGE_PIN B21 [get_ports {led1[0]}] ;# A6 / B21~IO_L21P_T3_DQS_16 +set_property PACKAGE_PIN A21 [get_ports {led1[1]}] ;# B6 / A21~IO_L21N_T3_DQS_16 +set_property PACKAGE_PIN D20 [get_ports {led1[2]}] ;# A7 / D20~IO_L19P_T3_16 +set_property PACKAGE_PIN C20 [get_ports {led1[3]}] ;# B7 / C20~IO_L19N_T3_VREF_16 +set_property PACKAGE_PIN B20 [get_ports {led1[4]}] ;# A8 / B20~IO_L16P_T2_16 +set_property PACKAGE_PIN A20 [get_ports {led1[5]}] ;# B8 / A20~IO_L16N_T2_16 +set_property PACKAGE_PIN C19 [get_ports {led1[6]}] ;# A9 / C19~IO_L13N_T2_MRCC_16 +set_property PACKAGE_PIN A19 [get_ports {led1[7]}] ;# B9 / A19~IO_L17N_T2_16 +set_property PACKAGE_PIN C18 [get_ports {led1[8]}] ;# A10 / C18~IO_L13P_T2_MRCC_16 +set_property PACKAGE_PIN A18 [get_ports {led1[9]}] ;# B10 / A18~IO_L17P_T2_16 +set_property IOSTANDARD LVCMOS33 [get_ports {led1[*]}] +set_property DRIVE 12 [get_ports {led1[*]}] + +# sw +set_property PACKAGE_PIN B18 [get_ports {sw[0]}] ;# A11 / B18~IO_L11N_T1_SRCC_16 +set_property PACKAGE_PIN D17 [get_ports {sw[1]}] ;# B11 / D17~IO_L12P_T1_MRCC_16 +set_property PACKAGE_PIN B17 [get_ports {sw[2]}] ;# A12 / B17~IO_L11P_T1_SRCC_16 +set_property PACKAGE_PIN C17 [get_ports {sw[3]}] ;# B12 / C17~IO_L12N_T1_MRCC_16 +set_property IOSTANDARD LVCMOS33 [get_ports {sw[*]}] +set_property PULLUP true [get_ports {sw[*]}] + +# led2 +set_property PACKAGE_PIN AB17 [get_ports {led2[0]}] ;# C3 / AB17~IO_L2N_T0_13 +set_property PACKAGE_PIN AB16 [get_ports {led2[1]}] ;# D3 / AB16~IO_L2P_T0_13 +set_property PACKAGE_PIN Y16 [get_ports {led2[2]}] ;# C4 / Y16~IO_L1P_T0_13 +set_property PACKAGE_PIN AA16 [get_ports {led2[3]}] ;# D4 / AA16~IO_L1N_T0_13 +set_property PACKAGE_PIN AA15 [get_ports {led2[4]}] ;# C5 / AA15~IO_L4P_T0_13 +set_property PACKAGE_PIN AB15 [get_ports {led2[5]}] ;# D5 / AB15~IO_L4N_T0_13 +set_property PACKAGE_PIN Y13 [get_ports {led2[6]}] ;# C6 / Y13~IO_L5P_T0_13 +set_property PACKAGE_PIN AA14 [get_ports {led2[7]}] ;# D6 / AA14~IO_L5N_T0_13 +set_property PACKAGE_PIN W14 [get_ports {led2[8]}] ;# C7 / W14~IO_L6P_T0_13 +set_property PACKAGE_PIN Y14 [get_ports {led2[9]}] ;# D7 / Y14~IO_L6N_T0_VREF_13 +set_property PACKAGE_PIN AA13 [get_ports {led2[10]}] ;# C8 / AA13~IO_L3P_T0_DQS_13 +set_property PACKAGE_PIN AB13 [get_ports {led2[11]}] ;# D8 / AB13~IO_L3N_T0_DQS_13 +set_property PACKAGE_PIN AB12 [get_ports {led2[12]}] ;# C9 / AB12~IO_L7N_T1_13 +set_property PACKAGE_PIN AB11 [get_ports {led2[13]}] ;# D9 / AB11~IO_L7P_T1_13 +set_property PACKAGE_PIN W12 [get_ports {led2[14]}] ;# C10 / W12~IO_L12N_T1_MRCC_13 +set_property PACKAGE_PIN W11 [get_ports {led2[15]}] ;# D10 / W11~IO_L12P_T1_MRCC_13 +set_property PACKAGE_PIN AA11 [get_ports {led2[16]}] ;# C11 / AA11~IO_L9N_T1_DQS_13 +set_property PACKAGE_PIN AA10 [get_ports {led2[17]}] ;# D11 / AA10~IO_L9P_T1_DQS_13 +set_property PACKAGE_PIN AA9 [get_ports {led2[18]}] ;# C12 / AA9~IO_L8P_T1_13 +set_property PACKAGE_PIN AB10 [get_ports {led2[19]}] ;# D12 / AB10~IO_L8N_T1_13 +set_property IOSTANDARD LVCMOS33 [get_ports {led2[*]}] +set_property DRIVE 12 [get_ports {led2[*]}] + +# bitstream settings +set_property BITSTREAM.CONFIG.CONFIGRATE 66 [current_design] +set_property BITSTREAM.CONFIG.SPI_32BIT_ADDR No [current_design] +set_property BITSTREAM.CONFIG.SPI_BUSWIDTH 2 [current_design] +set_property BITSTREAM.GENERAL.COMPRESS true [current_design] Index: lightshow/fpga/lightshow.vhd =================================================================== --- lightshow/fpga/lightshow.vhd (nonexistent) +++ lightshow/fpga/lightshow.vhd (revision 3) @@ -0,0 +1,110 @@ +library ieee; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_arith.all; +use IEEE.std_logic_unsigned.all; + +entity lightshow is + port( + led1 : out std_logic_vector(9 downto 0); -- LED1 on debug board + led2 : out std_logic_vector(19 downto 0); -- LED2 + LED3 on debug board + sw : in std_logic_vector(3 downto 0); + fxclk : in std_logic + ); +end lightshow; + +--signal declaration +architecture RTL of lightshow is + +type tPattern1 is array(9 downto 0) of integer range 0 to 255; +type tPattern2 is array(19 downto 0) of integer range 0 to 255; + +signal pattern1 : tPattern1 := (0, 10, 41, 92, 163, 255, 163, 92, 41, 10); -- pattern for LED1 +signal pattern20 : tPattern2 := (0, 1, 2, 9, 16, 25, 36, 49, 64, 81, 64, 49, 36, 25, 16, 9, 2, 1, 0, 0); -- 1st pattern for LED2 +signal pattern21 : tPattern2 := (0, 19, 77, 174, 77, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); -- 2nd pattern for LED2 +signal pattern2 : tPattern2; -- pattern20 + pattern21 + +signal cnt1,cnt20, cnt21 : std_logic_vector(22 downto 0); +signal pwm_cnt : std_logic_vector(19 downto 0); +signal pwm_cnt8 : std_logic_vector(7 downto 0); + +begin + pwm_cnt8 <= pwm_cnt(19 downto 12); + + dp_fxclk: process(fxclk) + begin + if fxclk' event and fxclk = '1' then + + -- pattern for led 1 + if ( cnt1 >= conv_std_logic_vector(7200000,23) ) -- 1/1.5 Hz + then + if ( sw(0) = '1' ) + then + pattern1(8 downto 0) <= pattern1(9 downto 1); + pattern1(9) <= pattern1(0); + else + pattern1(9 downto 1) <= pattern1(8 downto 0); + pattern1(0) <= pattern1(9); + end if; + cnt1 <= (others => '0'); + else + cnt1 <= cnt1 + 1; + end if; + + -- pattern for led 2 + if ( ( cnt20 >= conv_std_logic_vector(4800000,23) ) or ( (sw(2)= '1') and (cnt20 >= conv_std_logic_vector(1600000,23)) ) ) -- SW1 off: 1/3Hz, SW1 on: 1Hz + then + pattern20(18 downto 0) <= pattern20(19 downto 1); + pattern20(19) <= pattern20(0); + cnt20 <= (others => '0'); + else + cnt20 <= cnt20 + 1; + end if; + + if ( ( cnt21 >= conv_std_logic_vector(2000000,23) ) or ( (sw(3)= '1') and (cnt21 >= conv_std_logic_vector(500000,23)) ) ) + then + if ( sw(1) = '1' ) + then + pattern21(18 downto 0) <= pattern21(19 downto 1); + pattern21(19) <= pattern21(0); + else + pattern21(19 downto 1) <= pattern21(18 downto 0); + pattern21(0) <= pattern21(19); + end if; + cnt21 <= (others => '0'); + else + cnt21 <= cnt21 + 1; + end if; + + for i in 0 to 19 loop + pattern2(i) <= pattern20(i) + pattern21(i); + end loop; + + -- pwm + if ( pwm_cnt8 = conv_std_logic_vector(255,8) ) + then + pwm_cnt <= ( others => '0' ); + else + pwm_cnt <= pwm_cnt + 1; + end if; + -- led1 + for i in 0 to 9 loop + if ( pwm_cnt8 < pattern1(i) ) + then + led1(i) <= '1'; + else + led1(i) <= '0'; + end if; + end loop; + for i in 0 to 19 loop + if (pwm_cnt8 < pattern2(i) ) + then + led2(i) <= '1'; + else + led2(i) <= '0'; + end if; + end loop; + + end if; + end process dp_fxclk; + +end RTL; Index: lightshow/fpga/clean.sh =================================================================== --- lightshow/fpga/clean.sh (nonexistent) +++ lightshow/fpga/clean.sh (revision 3) @@ -0,0 +1,79 @@ +#!/bin/bash + +# This files / directories will be removed +rms="fpga.hw *.cache *.data/wt *.runs/.jobs *.runs/synth_*/* *.runs/impl_*/*" +# This files / directories in *.srcs/sources_*/ip/*/ will be removed +ip_rms="_tmp log.txt */docs */example_design */user_design/log.txt" +# Files with this extensions are not removed +keepext="vhd v xdc ucf bit bin" + +# This sould not be edited. +list_files() { + if [ "$2" != "" ]; then + echo "$1" + for i in $2; do + echo " $i" + done + fi +} + +check_ext() { + f=${1##*.} + for e in $keepext; do + if [ "$e" = "$f" ]; then + return 0 + fi + done + return 1 +} + +rmfiles="" +keepfiles="" +rmdirs="" +for i in $ip_rms; do + for j in *.srcs/sources_*/ip/*/$i; do + if [ -d "$j" ]; then + rmdirs+=" $j" + fi + if [ -f "$j" ]; then + if check_ext "$j"; then + keepfiles+=" $j" + else + rmfiles+=" $j" + fi + fi + done +done + +for j in $rms; do + if [ -d "$j" ]; then + rmdirs+=" $j" + fi + if [ -f "$j" ]; then + if check_ext "$j"; then + keepfiles+=" $j" + else + rmfiles+=" $j" + fi + fi +done + +list_files "This files will NOT be removed:" "$keepfiles" +list_files "This directories will be removed:" "$rmdirs" +list_files "This files will be removed:" "$rmfiles" + +if [ "$rmfiles" == "" -a "$rmdirs" == "" ]; then + c="yes" +else + echo -n 'Confirm this by entering "yes": ' + read c +fi + +if [ "$c" == "yes" ]; then + rm -fr *.runs/impl_*/.* 2>/dev/null + rm -fr *.runs/synth_*/.* 2>/dev/null + [ "$rmfiles" != "" ] && rm $rmfiles + [ "$rmdirs" != "" ] && rm -r $rmdirs + exit 0 +fi +exit 1
lightshow/fpga/clean.sh Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: lightshow/Readme =================================================================== --- lightshow/Readme (nonexistent) +++ lightshow/Readme (revision 3) @@ -0,0 +1,5 @@ +lightshow +--------- + +This example requires the Debug Board. It implements a light show using +the LED's. Effects are controlled by the switches.

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.