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

Subversion Repositories usb_fpga_1_11

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /usb_fpga_1_11/trunk/examples/usb-fpga-1.11/1.11b
    from Rev 4 to Rev 5
    Reverse comparison

Rev 4 → Rev 5

/intraffic/InTraffic.java
1,6 → 1,6
/*!
intraffic -- example showing how the EZ-USB FIFO interface is used on ZTEX USB FPGA Module 1.11
Copyright (C) 2009-2010 ZTEX e.K.
intraffic -- example showing how the EZ-USB FIFO interface is used on ZTEX USB-FPGA Module 1.11b
Copyright (C) 2009-2011 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.11
Copyright (C) 2009-2010 ZTEX e.K.
intraffic -- example showing how the EZ-USB FIFO interface is used on ZTEX USB-FPGA Module 1.11b
Copyright (C) 2009-2011 ZTEX GmbH.
http://www.ztex.de
 
This program is free software; you can redistribute it and/or modify
/intraffic/fpga/intraffic.ucf
13,8 → 13,8
NET "SLOE" LOC = "T3" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # PA2
NET "CONT" LOC = "R11" | IOSTANDARD = LVCMOS33 ; # PA3
NET "FIFOADR0" LOC = "T10" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # PA4
NET "FIFOADR1" LOC = "H14" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # PA5
NET "PKTEND" LOC = "H13" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # PA6
NET "FIFOADR1" LOC = "N11" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # PA5
NET "PKTEND" LOC = "T11" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # PA6
# NET "PA7" LOC = "H11" | IOSTANDARD = LVCMOS33 ;
 
NET "FD<0>" LOC = "C16" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ;
/intraffic/fpga/intraffic.ise Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
/intraffic/fpga/intraffic.xise
97,7 → 97,7
<property xil_pn:name="Drive Awake Pin During Suspend/Wake Sequence spartan6" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Drive Done Pin High" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="EDIF" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Enable BitStream Compression" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Enable BitStream Compression" xil_pn:value="true" xil_pn:valueState="non-default"/>
<property xil_pn:name="Enable Cyclic Redundancy Checking (CRC) spartan6" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Enable Debugging of Serial Mode BitStream" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Enable Enhanced Design Summary" xil_pn:value="true" xil_pn:valueState="default"/>
/ucecho/UCEcho.java
1,6 → 1,6
/*!
ucecho -- uppercase conversion example for ZTEX USB FPGA Module 1.11
Copyright (C) 2009-2010 ZTEX e.K.
ucecho -- uppercase conversion example for ZTEX USB-FPGA Module 1.11b
Copyright (C) 2009-2011 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 1.11
Copyright (C) 2009-2010 ZTEX e.K.
ucecho -- uppercase conversion example for ZTEX USB-FPGA Module 1.11b
Copyright (C) 2009-2011 ZTEX GmbH.
http://www.ztex.de
 
This program is free software; you can redistribute it and/or modify
/ucecho/Readme
9,7 → 9,7
the FPGA and can be read back from Endpoint 2.
 
This example does the same as the example in directory ../../all/ucecho
except that the uppercase - lowercase conversion made by the FPGA.
except that the uppercase - lowercase conversion is made by the FPGA.
 
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
/ucecho/fpga/ucecho.ise Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
/ucecho/fpga/ucecho.xise
27,6 → 27,7
<properties>
<property xil_pn:name="Device" xil_pn:value="xc6slx16" xil_pn:valueState="non-default"/>
<property xil_pn:name="Device Family" xil_pn:value="Spartan6" xil_pn:valueState="non-default"/>
<property xil_pn:name="Enable BitStream Compression" xil_pn:value="true" xil_pn:valueState="non-default"/>
<property xil_pn:name="Implementation Top" xil_pn:value="Architecture|ucecho|RTL" xil_pn:valueState="non-default"/>
<property xil_pn:name="Implementation Top Instance Path" xil_pn:value="/ucecho" xil_pn:valueState="non-default"/>
<property xil_pn:name="Package" xil_pn:value="ftg256" xil_pn:valueState="non-default"/>
/lightshow/lightshow.sh
0,0 → 1,4
#make -C ../../../java distclean all || exit
#make distclean all || exit
#make || exit
java -cp Lightshow.jar Lightshow $@
lightshow/lightshow.sh Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: lightshow/lightshow-prog.sh =================================================================== --- lightshow/lightshow-prog.sh (nonexistent) +++ lightshow/lightshow-prog.sh (revision 5) @@ -0,0 +1,7 @@ +# programms the EEPROM and the FPGA for standalone usage +#make -C ../../../../java distclean all || exit +#make distclean all || exit + +java -cp Lightshow.jar Lightshow $@ +../../../../java/FWLoader -ue lightshow.ihx -um fpga/lightshow.bit +
lightshow/lightshow-prog.sh Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: lightshow/avr/lightshow.ihx =================================================================== --- lightshow/avr/lightshow.ihx (nonexistent) +++ lightshow/avr/lightshow.ihx (revision 5) @@ -0,0 +1,45 @@ +:100000000C94FA000C941B010C941B010C941B0122 +:100010000C941B010C941B010C941B010C941B01F0 +:100020000C941B010C941B010C941B010C941B01E0 +:100030000C941B010C941B010C941B010C941B01D0 +:100040000C941B010C941B010C941B010C941B01C0 +:100050000C941B010C941B010C941B010C941B01B0 +:100060000C941B010C941B010C941B010C941B01A0 +:100070000C941B010C941B010C941B010C941B0190 +:100080000C941B010C941B010C941B010C941B0180 +:100090000C941B010C941B010C941B010C941B0170 +:1000A0000C941B010C941B010C941B010C941B0160 +:1000B0000C941B010C941B010C941B010C941B0150 +:1000C0000C941B010C941B010C941B010C941B0140 +:1000D0000C941B010C941B010C941B010C941B0130 +:1000E0000C941B010C941B010C941B010C941B0120 +:1000F0000C941B010C941B010C941B010C941B0110 +:100100000C941B010C941B010C941B010C941B01FF +:100110000C941B010C941B010C941B010C941B01EF +:100120000C941B010C941B010C941B010C941B01DF +:100130000C941B010C941B010C941B010C941B01CF +:100140000C941B010C941B010C941B010C941B01BF +:100150000C941B010C941B010C941B010C941B01AF +:100160000C941B010C941B010C941B010C941B019F +:100170000C941B010C941B010C941B010C941B018F +:100180000C941B010C941B010C941B010C941B017F +:100190000C941B010C941B010C941B010C941B016F +:1001A0000C941B010C941B010C941B010C941B015F +:1001B0000C941B010C941B010C941B010C941B014F +:1001C0000C941B010C941B010C941B010C941B013F +:1001D0000C941B010C941B010C941B010C941B012F +:1001E0000C941B010C941B010C941B010C941B011F +:1001F0000C941B0111241FBECFEFDFE3DEBFCDBF88 +:1002000000E00CBF10E2A0E0B0E2E2EBF2E000E0C0 +:100210000BBF02C007900D92A030B107D9F710E2D2 +:10022000A0E0B0E201C01D92A030B107E1F70E944A +:100230001D010C9457010C94000088ED77E084BFF9 +:10024000709350008091510087708730D9F788ED06 +:1002500071E084BF7093600084BF7093680084BFB6 +:100260007093400088ED71E084BF7093960082E047 +:10027000E0EBF0E0848380E8809360061092000752 +:100280001092E006809160068F60809360068FEF89 +:100290008093A006A0E6B6E0E0EAF6E080910807C9 +:1002A00014968C9314978091E8068483F7CFF89482 +:0202B000FFCF7E +:00000001FF Index: lightshow/avr/avrdude.sh =================================================================== --- lightshow/avr/avrdude.sh (nonexistent) +++ lightshow/avr/avrdude.sh (revision 5) @@ -0,0 +1,2 @@ +make || exit +avrdude -p x128a1 -c avrispmkii -P usb -e -U flash:w:test.ihx:i
lightshow/avr/avrdude.sh Property changes : Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: lightshow/avr/lightshow.c =================================================================== --- lightshow/avr/lightshow.c (nonexistent) +++ lightshow/avr/lightshow.c (revision 5) @@ -0,0 +1,76 @@ +/*! + lightshow -- lightshow on Experimental Board 1.10 + Copyright (C) 2009-2010 ZTEX e.K. + http://www.ztex.de + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 3 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see http://www.gnu.org/licenses/. +!*/ + +#include + +#define F_CPU 32000000UL +#include + +typedef uint8_t byte; + +int main(void) +{ + // enable 32.768 kHz, 32 MHz, 2 Mhz clocks + asm volatile ( + "ldi r24,0xd8" "\n\t" + "ldi r23,7" "\n\t" + "out 0x34,r24" "\n\t" + "sts 0x50,r23" + ::: "r24", "r23" + ); + + // wait until clocks are ready + while ( (OSC.STATUS & 7) != 7 ) { } + + // enable run time configuration of 32 MHz and 2 MHz clocks; select 32 MHz clock as system clock + asm volatile ( + "ldi r24,0xd8" "\n\t" + "ldi r23,1" "\n\t" + "out 0x34,r24" "\n\t" + "sts 0x60,r23" "\n\t" + "out 0x34,r24" "\n\t" + "sts 0x68,r23" "\n\t" + "out 0x34,r24" "\n\t" + "sts 0x40,r23" + ::: "r24", "r23" + ); + + // disable JTAG at portb + asm volatile ( + "ldi r24,0xd8" "\n\t" + "ldi r23,1" "\n\t" + "out 0x34,r24" "\n\t" + "sts 0x96,r23" "\n\t" + ::: "r24", "r23" + ); + + // clock output to PD7 + PORTCFG.CLKEVOUT = 2; + PORTD.DIR = 128; + + PORTJ.DIR = 0; // input: 4 LED's + PORTH.DIR = 0; // input: 8 LED's + PORTD.DIR |= 15; // output: 4 LED's + PORTF.DIR = 255; // output: 8 LED's + + while (1) { + PORTD.OUT = PORTJ.IN; + PORTF.OUT = PORTH.IN; + } +} + Index: lightshow/avr/Makefile =================================================================== --- lightshow/avr/Makefile (nonexistent) +++ lightshow/avr/Makefile (revision 5) @@ -0,0 +1,16 @@ +AVRGCC=avr-gcc -std=gnu99 -save-temps -mmcu=atxmega128a1 -O2 +OBJ2HEX=avr-objcopy + +all: lightshow.ihx + +%.obj : %.c + $(AVRGCC) $< -o $@ + +%.ihx : %.obj + $(OBJ2HEX) -R .eeprom -O ihex $< $@ + +clean: + rm -f *.o *.i *.s *.obj *.old *.bak *~ + +distclean: + rm -f *.ihx Index: lightshow/Lightshow.java =================================================================== --- lightshow/Lightshow.java (nonexistent) +++ lightshow/Lightshow.java (revision 5) @@ -0,0 +1,130 @@ +/*! + lightshow -- lightshow on ZTEX USB-FPGA Module 1.11b plus Experimental Board 1.10 + Copyright (C) 2009-2011 ZTEX GmbH. + http://www.ztex.de + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 3 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see http://www.gnu.org/licenses/. +!*/ + +import java.io.*; +import java.util.*; + +import ch.ntb.usb.*; + +import ztex.*; + +// ***************************************************************************** +// ******* ParameterException ************************************************** +// ***************************************************************************** +// Exception the prints a help message +class ParameterException extends Exception { + public final static String helpMsg = new String ( + "Parameters:\n"+ + " -d Device Number (default: 0)\n" + + " -f Force uploads\n" + + " -p Print bus info\n" + + " -h This help" ); + + public ParameterException (String msg) { + super( msg + "\n" + helpMsg ); + } +} + +// ***************************************************************************** +// ******* Test0 *************************************************************** +// ***************************************************************************** +class Lightshow extends Ztex1v1 { + +// ******* Lightshow *********************************************************** +// constructor + public Lightshow ( ZtexDevice1 pDev ) throws UsbException { + super ( pDev ); + } + +// ******* main **************************************************************** + public static void main (String args[]) { + + int devNum = 0; + boolean force = false; + boolean workarounds = false; + + try { +// init USB stuff + LibusbJava.usb_init(); + +// scan the USB bus + ZtexScanBus1 bus = new ZtexScanBus1( ZtexDevice1.ztexVendorId, ZtexDevice1.ztexProductId, true, false, 1); + if ( bus.numberOfDevices() <= 0) { + System.err.println("No devices found"); + System.exit(0); + } + +// scan the command line arguments + for (int i=0; i=args.length) throw new Exception(); + devNum = Integer.parseInt( args[i] ); + } + catch (Exception e) { + throw new ParameterException("Device number expected after -d"); + } + } + else if ( args[i].equals("-f") ) { + force = true; + } + else if ( args[i].equals("-p") ) { + bus.printBus(System.out); + System.exit(0); + } + else if ( args[i].equals("-p") ) { + bus.printBus(System.out); + System.exit(0); + } + else if ( args[i].equals("-h") ) { + System.err.println(ParameterException.helpMsg); + System.exit(0); + } + else throw new ParameterException("Invalid Parameter: "+args[i]); + } + + +// create the main class + Lightshow ztex = new Lightshow ( bus.device(devNum) ); + +// upload the firmware if necessary + if ( force || ! ztex.valid() || ! ztex.dev().productString().equals("lightshow for EXP-1.10") ) { + System.out.println("Firmware upload time: " + ztex.uploadFirmware( "lightshow.ihx", force ) + " ms"); + } + +// check for Experimental Bord 1.10 + if ( ! ztex.xmegaEnabled() ) + throw new Exception("Experimental Board 1.10 required"); + +// upload the bitstream if necessary + System.out.println("FPGA configuration time: " + ztex.configureFpga( "fpga/lightshow.bit" , true ) + " ms"); + +// bitstream if necessary + System.out.println("AVR Firmware upload time: " + ztex.xmegaWriteFirmware( new IhxFile("avr/lightshow.ihx" ) ) + " ms"); + +// program the ATxmega + System.out.println( ztex ); + + } + catch (Exception e) { + System.out.println("Error: "+e.getLocalizedMessage() ); + } + } + +} Index: lightshow/lightshow.c =================================================================== --- lightshow/lightshow.c (nonexistent) +++ lightshow/lightshow.c (revision 5) @@ -0,0 +1,43 @@ +/*! + lightshow -- lightshow on ZTEX USB-FPGA Module 1.11b plus Experimental Board 1.10 + Copyright (C) 2009-2011 ZTEX GmbH. + http://www.ztex.de + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 3 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see http://www.gnu.org/licenses/. +!*/ + +#include[ztex-conf.h] // Loads the configuration macros, see ztex-conf.h for the available macros +#include[ztex-utils.h] // include basic functions + +IDENTITY_UFM_1_11(10.12.0.0,0); +EXTENSION_EXP_1_10; + +// this product string is also used for identification by the host software +#define[PRODUCT_STRING]["lightshow for EXP-1.10"] + +// enable Flash support +ENABLE_FLASH; +ENABLE_FLASH_BITSTREAM; + +// include the main part of the firmware kit, define the descriptors, ... +#include[ztex.h] + +void main(void) +{ +// init everything + init_USB(); + + while ( 1 ) { + } +} + Index: lightshow/fpga/lightshow.xise =================================================================== --- lightshow/fpga/lightshow.xise (nonexistent) +++ lightshow/fpga/lightshow.xise (revision 5) @@ -0,0 +1,326 @@ + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Index: lightshow/fpga/lightshow.ucf =================================================================== --- lightshow/fpga/lightshow.ucf (nonexistent) +++ lightshow/fpga/lightshow.ucf (revision 5) @@ -0,0 +1,40 @@ +NET "CLK" TNM_NET = "CLK"; +TIMESPEC "TS_CLK" = PERIOD "CLK" 20 ns HIGH 50 %; +# NET "CLK" LOC = "K14" | IOSTANDARD = LVCMOS33 ; # EZ-USB clock +NET "CLK" LOC = "N8" | IOSTANDARD = LVCMOS33 ; # xmega clock + +# NET "pe<0>" LOC = "A13" | IOSTANDARD = LVCMOS33 ; +# NET "pe<1>" LOC = "C11" | IOSTANDARD = LVCMOS33 ; +# NET "pe<2>" LOC = "A11" | IOSTANDARD = LVCMOS33 ; +# NET "pe<3>" LOC = "B10" | IOSTANDARD = LVCMOS33 ; +# NET "pe<4>" LOC = "D11" | IOSTANDARD = LVCMOS33 ; +# NET "pe<5>" LOC = "F10" | IOSTANDARD = LVCMOS33 ; +# NET "pe<6>" LOC = "A12" | IOSTANDARD = LVCMOS33 ; +# NET "pe<7>" LOC = "E10" | IOSTANDARD = LVCMOS33 ; + +NET "led<0>" LOC = "C9" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # ph<0> +NET "led<1>" LOC = "D8" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # ph<1> +NET "led<2>" LOC = "C7" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # ph<2> +NET "led<3>" LOC = "F7" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # ph<3> +NET "led<4>" LOC = "D6" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # ph<4> +NET "led<5>" LOC = "B6" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # ph<5> +NET "led<6>" LOC = "D5" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # ph<6> +NET "led<7>" LOC = "B5" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # ph<7> +NET "led<8>" LOC = "P4" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # pj<0> +NET "led<9>" LOC = "M6" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # pj<1> +NET "led<10>" LOC = "P6" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # pj<2> +NET "led<11>" LOC = "N6" | IOSTANDARD = LVCMOS33 | DRIVE = 12 ; # pj<3> + +# NET "pj<4>" LOC = "M7" | IOSTANDARD = LVCMOS33 ; +# NET "pj<5>" LOC = "T7" | IOSTANDARD = LVCMOS33 ; +# NET "pj<6>" LOC = "M9" | IOSTANDARD = LVCMOS33 ; +# NET "pj<7>" LOC = "P8" | IOSTANDARD = LVCMOS33 ; + +# NET "pk<0>" LOC = "R12" | IOSTANDARD = LVCMOS33 ; +# NET "pk<1>" LOC = "L12" | IOSTANDARD = LVCMOS33 ; +# NET "pk<2>" LOC = "L13" | IOSTANDARD = LVCMOS33 ; +# NET "pk<3>" LOC = "N14" | IOSTANDARD = LVCMOS33 ; +# NET "pk<4>" LOC = "L14" | IOSTANDARD = LVCMOS33 ; +# NET "pk<5>" LOC = "R15" | IOSTANDARD = LVCMOS33 ; +# NET "pk<6>" LOC = "M15" | IOSTANDARD = LVCMOS33 ; +# NET "pk<7>" LOC = "N16" | IOSTANDARD = LVCMOS33 ; Index: lightshow/fpga/lightshow.ise =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: lightshow/fpga/lightshow.ise =================================================================== --- lightshow/fpga/lightshow.ise (nonexistent) +++ lightshow/fpga/lightshow.ise (revision 5)
lightshow/fpga/lightshow.ise Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: lightshow/fpga/lightshow.vhd =================================================================== --- lightshow/fpga/lightshow.vhd (nonexistent) +++ lightshow/fpga/lightshow.vhd (revision 5) @@ -0,0 +1,84 @@ +library ieee; +use IEEE.std_logic_1164.all; +use IEEE.std_logic_arith.all; +use IEEE.std_logic_unsigned.all; + +entity lightshow is + port( + led : out std_logic_vector(11 downto 0); + CLK : in std_logic -- 32 MHz + ); +end lightshow; + +--signal declaration +architecture RTL of lightshow is + +type tPattern is array(11 downto 0) of integer range 0 to 15; + +signal pattern1 : tPattern := (0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1); +signal pattern2 : tPattern := (6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5); +signal pattern3 : tPattern := (0, 1, 4, 9, 4, 1, 0, 0, 0, 0, 0, 0); + +type tXlatTable1 is array(0 to 12) of integer range 0 to 1023; +constant xt1 : tXlatTable1 := (0, 0, 1, 4, 13, 31, 64, 118, 202, 324, 493, 722, 1023); +type tXlatTable2 is array(0 to 9) of integer range 0 to 255; +--constant xt2 : tXlatTable2 := (0, 1, 11, 38, 90, 175, 303, 481, 718, 1023); +constant xt2 : tXlatTable2 := (0, 0, 3, 9, 22, 44, 76, 120, 179, 255); + +signal cp1 : std_logic_vector(22 downto 0); +signal cp2 : std_logic_vector(22 downto 0); +signal cp3 : std_logic_vector(22 downto 0); +signal d : std_logic_vector(16 downto 0); + +begin + dpCLK: process(CLK) + begin + if CLK' event and CLK = '1' then + + if ( cp1 = conv_std_logic_vector(3000000,23) ) + then + pattern1(10 downto 0) <= pattern1(11 downto 1); + pattern1(11) <= pattern1(0); + cp1 <= (others => '0'); + else + cp1 <= cp1 + 1; + end if; + + if ( cp2 = conv_std_logic_vector(2200000,23) ) + then + pattern2(10 downto 0) <= pattern2(11 downto 1); + pattern2(11) <= pattern2(0); + cp2 <= (others => '0'); + else + cp2 <= cp2 + 1; + end if; + + if ( cp3 = conv_std_logic_vector(1500000,23) ) + then + pattern3(11 downto 1) <= pattern3(10 downto 0); + pattern3(0) <= pattern3(11); + cp3 <= (others => '0'); + else + cp3 <= cp3 + 1; + end if; + + if ( d = conv_std_logic_vector(1278*64-1,17) ) + then + d <= (others => '0'); + else + d <= d + 1; + end if; + + for i in 0 to 11 loop + if ( d(16 downto 6) < conv_std_logic_vector( xt1(pattern1(i) + pattern2(i)) + xt2(pattern3(i)) ,11) ) + then + led(i) <= '1'; + else + led(i) <= '0'; + end if; + end loop; + + end if; + end process dpCLK; + +end RTL; Index: lightshow/fpga/clean.sh =================================================================== --- lightshow/fpga/clean.sh (nonexistent) +++ lightshow/fpga/clean.sh (revision 5) @@ -0,0 +1,80 @@ +#!/bin/bash + +# This files / directories from this directory will not be removed +# Filenames with spaces or other spuid characters will be ignored +sourcefiles="*.vhd *.ucf *.sh *.ise *.bit *.bin *.xise" +subdirs="ipcore_dir" + + +# This sould not be edited. +list_files() { + if [ "$2" != "" ]; then + echo "$1" + for i in $2; do + echo " $i" + done + fi +} + +rmfiles="" +rmdirs="" +keepfiles="" +keepdirs="" +allfiles=`ls -A` +for f in $allfiles; do + keep=false + for i in $sourcefiles; do + if [ "$i" == "$f" ]; then + keep=true + fi + done + for i in $subdirs; do + if [ "$i" == "$f" ]; then + keep=true + fi + done + if [ -d "$f" ]; then + if $keep; then + keepdirs+=" $f" + else + rmdirs+=" $f" + fi + fi + if [ -f "$f" ]; then + if $keep; then + keepfiles+=" $f" + else + rmfiles+=" $f" + fi + fi +done + +echo +echo "Directory $PWD:" +list_files "This directories will NOT be removed:" "$keepdirs" +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 + [ "$rmfiles" != "" ] && rm $rmfiles + [ "$rmdirs" != "" ] && rm -r $rmdirs + + for d in $subdirs; do + if [ -x "$d/clean.sh" ]; then + cd $d + ./clean.sh || exit 1 + cd .. + fi + done + + 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/Makefile =================================================================== --- lightshow/Makefile (nonexistent) +++ lightshow/Makefile (revision 5) @@ -0,0 +1,21 @@ +######################### +# configuration section # +######################### + +ZTEXPREFIX=../../../.. + +JARTARGET=Lightshow.jar +CLASSTARGETS=Lightshow.class +CLASSEXTRADEPS= +#CLASSEXTRADEPS:=$(shell echo $(ZTEXPREFIX)/java/ztex/*.java) + +IHXTARGETS=lightshow.ihx +IHXEXTRADEPS= +#IHXEXTRADEPS:=$(shell echo $(ZTEXPREFIX)/include/*.h) +EXTRAJARFILES=lightshow.ihx avr/lightshow.ihx fpga/lightshow.bit + +################################ +# DO NOT CHANAGE THE FOLLOWING # +################################ + +include $(ZTEXPREFIX)/Makefile.mk Index: lightshow/lightshow.bat =================================================================== --- lightshow/lightshow.bat (nonexistent) +++ lightshow/lightshow.bat (revision 5) @@ -0,0 +1,2 @@ +java -cp Lightshow.jar Lightshow +pause Index: lightshow/Readme =================================================================== --- lightshow/Readme (nonexistent) +++ lightshow/Readme (revision 5) @@ -0,0 +1,6 @@ +lightshow +--------- + +This example requires the Experimental Board 1.10. + +It implements a light show using the LED's on the board. Index: Makefile =================================================================== --- Makefile (revision 4) +++ Makefile (revision 5) @@ -1,4 +1,4 @@ -DIRS=ucecho intraffic memtest +DIRS=ucecho intraffic memtest lightshow .PHONY: default all clean distclean
/memtest/memtest.c
1,6 → 1,6
/*!
memtest -- DDR SDRAM FIFO for testing memory on ZTEX USB FPGA Module 1.11
Copyright (C) 2009-2010 ZTEX e.K.
memtest -- DDR SDRAM FIFO for testing memory on ZTEX USB-FPGA Module 1.11b
Copyright (C) 2009-2011 ZTEX GmbH.
http://www.ztex.de
 
This program is free software; you can redistribute it and/or modify
38,7 → 38,7
#define[PRODUCT_STRING]["memtest example for UFM 1.11"]
 
// 0 : counter mode; 1: shift pattern mode
xdata BYTE mode = 0;
__xdata BYTE mode = 0;
 
// this is called automatically after FPGA configuration
#define[POST_FPGA_CONFIG][POST_FPGA_CONFIG
/memtest/fpga-11/memtest.xise
107,7 → 107,7
<property xil_pn:name="Drive Awake Pin During Suspend/Wake Sequence spartan6" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Drive Done Pin High" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="EDIF" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Enable BitStream Compression" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Enable BitStream Compression" xil_pn:value="true" xil_pn:valueState="non-default"/>
<property xil_pn:name="Enable Cyclic Redundancy Checking (CRC) spartan6" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Enable Debugging of Serial Mode BitStream" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Enable Enhanced Design Summary" xil_pn:value="true" xil_pn:valueState="default"/>
/memtest/fpga-11/memtest.bit Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
/memtest/fpga-11/memtest.ise Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
/memtest/fpga/memtest.xise
109,7 → 109,7
<property xil_pn:name="Drive Awake Pin During Suspend/Wake Sequence spartan6" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Drive Done Pin High" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="EDIF" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Enable BitStream Compression" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Enable BitStream Compression" xil_pn:value="true" xil_pn:valueState="non-default"/>
<property xil_pn:name="Enable Cyclic Redundancy Checking (CRC) spartan6" xil_pn:value="true" xil_pn:valueState="default"/>
<property xil_pn:name="Enable Debugging of Serial Mode BitStream" xil_pn:value="false" xil_pn:valueState="default"/>
<property xil_pn:name="Enable Enhanced Design Summary" xil_pn:value="true" xil_pn:valueState="default"/>
/memtest/MemTest.java
1,6 → 1,6
/*!
memtest -- DDR SDRAM FIFO for testing memory on ZTEX USB FPGA Module 1.11
Copyright (C) 2009-2010 ZTEX e.K.
memtest -- DDR SDRAM FIFO for testing memory on ZTEX USB-FPGA Module 1.11b
Copyright (C) 2009-2011 ZTEX GmbH.
http://www.ztex.de
 
This program is free software; you can redistribute it and/or modify
31,7 → 31,7
public final static String helpMsg = new String (
"Parameters:\n"+
" -d <number> Device Number (default: 0)\n" +
" -c Counter test aptttern\n" +
" -c Counter test pattern\n" +
" -f Force uploads\n" +
" -p Print bus info\n" +
" -w Enable certain workarounds\n"+

powered by: WebSVN 2.1.0

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