• Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by mkarlsson

  1. mkarlsson

    Flash Erase

    See page 77 in this document: The flash chip is erased in units (aka sectors) of 64kB so programming a 65kB bitfile will erase a 128kB area. Magnus
  2. 1) download this tar file 2) untar the file somewhere on you computer (7-zip can do this for you) 3) go to the location of the untar'ed files and run xsetup.exe 4) after installation you need to fix a few things in order to have it run on win10. See The PlanAhead part is optional (not needed for DesignLab)
  3. mkarlsson

    How does data get from the PC to the Spartan-6 Flash

    Xilinx call it indirect programming. See The second serial port is available as a regular serial port (virtual COM port) to the user for any purpose. It's commonly used with a soft CPU to implement an embedded system. Magnus
  4. mkarlsson

    How does data get from the PC to the Spartan-6 Flash

    Almost got it right First a a flash programming bitfile is sent to the FPGA via JTAG. This bitfile uses a special library component (BSCAN_SPARTAN6) that allows the logic fabric to access the JTAG port. Flash SPI programming commands are then sent to the FPGA via JTAG, which will forward them to the flash chip. Magnus
  5. A new version of the Open Bench Logic Sniffer code is now available for Pipistrello. This version has the capture buffer increased to 64 MB by using the onboard LPDRAM instead of using internal BRAM. The capture rate is still the same, i.e. it still support 200 MHz 8 and 16-bit capture as well as 100 MHz 32-bit capture. The serial communication speed is set to 921600 baud. The original SUMP protocol unfortunately has a capture size limitation (in both hardware and software) to a maximum of 256k samples (512k samples in mux mode). This version of the verilog code has an alternative set of capture size registers that will allow up to 256M samples. However, the SUMP client on the PC must be modified to take advantage of the new registers so I have modified JaWi's OLS client to allow longer captures. BTW, the bit file will also work with the current release of the SUMP client but with the capture size limitation mentioned above. Here is a link to a zip file that has the bit file, the full Xilinx ISE project and the modified version of JaWi's OLS client: Enjoy! BTW, if anyone is interested in using the built-in DRAM memory controller in Spartan-6 parts this code might be a good starting point. It's setup to use one 64-bit read/wire port but this can be changed by using different parameters when instantiating the memory controller block.
  6. mkarlsson

    Open Bench Logic Sniffer with 64MB capture buffer

    Sorry but I stopped following the sigrok/pulseview stuff years ago since the development was in my view not the way to go unless you are prepared to do all the compiling yourself. Windows is supported in a very limited way with the nightly build of whatever development code they have that day. However, you can build the windows installer of the last release code on a Linux system yourself if you follow the instructions. The biggest problem is that on windows you need to replace the FTDI driver for the FT2232 chip with a driver based on the Linux libftdi driver. I have not managed to get that working since early 2014. This is really a question to the sigrok team though.
  7. mkarlsson

    Back to Basics

    At work we have switched most of our Spartan-6 products to Artix-7 and for the most part the switch-over was painless, the only area that needed a bit work was places in the code where we directly instantiated low level design elements (like serdes blocks, BSCAN_SPARTAN6 etc.) that had to be re-coded using 7 series elements, and the new way of setting contstrains. However, one area that Xilinx keep messing up is LVDS outputs, which we use lots of. On the Spartan-6 part that we used, only 2 of the 4 banks could have LVDS outputs. On Artix-7 all banks can have LVDS outputs but the bank must have VCCIO set to 2.5V! This means that Digilent boards like Arty and CMOD A7 and Avnet boards like miniZed etc. can't do LVDS output at all since all banks are powered by 3.3V! This is pretty lame since LVDS is the future for high speed I/O, just look at UHS-II sd-card standard where 2 LVDS pairs are added for high speed applications. As for my FPGA "hobby" busyness, I have no desire to develop an Artix-7 or Zynq based board and compete with heavily subsidized products from Digilent and Avnet. And there won't be any more Spartan-6 based boards made by me either (Pipistrello LX45 and Pepino LX25 are sold out and discontinued and once the Pepino LX9 boards are sold there won't be any more boards made). End of the road... I totally agree. I have a long history of designing custom chips, starting in the 1980's with schematic-based design entry for ASICs. When we switched to text-based design entry (i.e. HDL) in the 1990's the productivity gain was incredible. We could do much more complex designs and still understand what it did, and we could use all the tools developed for software to maintain the code (like CVS for code repository, using the text editor that we liked most for design entry, and simple things like text compare). Going back to schematic-based design entry is in my mind a huge step back. Magnus
  8. mkarlsson

    SPI to initialize TFT

    For a more detailed description of the first line see Magnus
  9. mkarlsson

    SPI to initialize TFT

    idle is set to 1 if all bits in counter are 1 (unary reduction operator AND) if internalSck is high then cs is set to 0
  10. mkarlsson


    Hi Tim, Cool. I will include the Linux version. Yeah, the sigrok p-ols driver is fifo mode only. In serial mode the (i.e. with a serial mode bitstream loaded and the FT2232H is serial mode) the board is basically a Open Bench Logic Sniffer with higher baud rate (921600 instead of 115200) and more memory (64MB instead of 24kB) and it should be trivial to modify the sigrok ols driver to support pipistrello in serial mode. Note that the SUMP protocol limits the samples to 256k so if you want to sample more you need to use the extended range registers that I added (see the p-ols driver). As for the sampling of TMDS data, you should be able to use the HDMI connector for that but you would need to add the 50 ohm terminator resistor packs on the bottom side of the board (the layout is prepared for this). Initially the plan was to support both HDMI-out and HDMI-in and an earlier XL9 board I made worked great in both modes but I was sloppy when I did the Pipistrello layout and did not place the CLK pair on GCLK pins . However, if you just want to asynchronously sample the TMDS data at 4x the bit rate then this should work fine since you don't use the CLK pair as an input clock. You would need to change the Pipistrello OLS code to use SERDES for sampling the data etc. but you should be fine from memory bandwidth standpoint (4 bits at ~1Gb/s is 500 MB/s and the memory controller on Pipistrello can easily do that when using the maximum burst length). If you want to work on this then I can hopefully give you a hand. Cheers, Magnus
  11. mkarlsson


    Should be back now. Please note that this code is for Pipistrello and might have to be modified for other boards. Magnus
  12. No, that's not "equivalent" - you did not declare wb_data_i in the verilog version like you do in the vhdl version so it defaults to a single wire. Try this: input [100:0] wishbone_in; wire [31:0] wb_dat_i; assign wb_dat_i = wishbone_in [59:28]; Magnus
  13. mkarlsson

    Unknown Papilio Board

    On DUO there is a third possible reason for this error - the FT2232H chip on this board has two jtag controllers (port A and port B ) and if papilioprog is trying to open the wrong one you will get this error. If that's the case then one option is to specifically open the correct port using the "-d device name" option. Without the -d option papilioprog will open the first one it finds.
  14. mkarlsson

    Unknown Papilio Board

    This cryptic error message means that it can't find a jtag device connected to the FTDI chip (the error message have been changed in later versions of papilioprog). There are two possible cause for this error - you either have several FTDI devices connected to the computer and papilioprog is talking to the wrong one, or the papilio board has a problem with the jtag wiring from the FTDI chip to the FPGA. Magnus
  15. No, the ft232R does not have an MPSSE unit, which is what the Papilio loader is using for JTAG. Magnus
  16. mkarlsson

    Loading the SPI Flash on the Papilio Pro

    The only difference between my version of the bscan files and the papilioprog bscan files is that I also drive flash_wp and flash_hold. The flash chip on Pipistrello can do quad-spi mode where flash_wp and flash_hold are used as data lines. The pullups on the board for those two lines are too weak to overcome the default spartan6 pulldown on unused pins so I define them as inputs. See attached file. Magnus bscan_spi_spartan6.vhd
  17. mkarlsson

    Loading the SPI Flash on the Papilio Pro

    This basically means that the data returned from the flash is 0. As you said, if it works with iMPACT then it's most likely not a hardware problem. Could it be that you are using a bscan_spi_xxx bitfile designed for xc3sprog with fpgaprog? The fpgaprog/papilioprog bscan_spi_xxx files are incompatible with the bscan_spi files designed for xc3sprog and you would definitely not get the correct data back if you use the wrong bscan file. Magnus
  18. mkarlsson

    Gameduino on Pipistrello

    Just like Jack I have been playing with Gameduino, a really cool project by James Bowman. Originally it was a add-on shield for an Arduino board that implemented a sprite engine and much more, while the Arduino board did all the computing and sending commands to the Gameduino shield via a SPI interface. For more info see this link to the Gameduino page: with cool pictures and a complete description of the system To port this to Pipistrello I expanded the code by adding two more blocks so it's basically now made up of three blocks: * Original Gameduino block (no functional changes, just some code cleanup) * VGA-to-DVI converter to send out the display via HDMI to a DVI monitor instead of VGA * Microblaze_mcs system running at 100 MHz with added hardware I/O modules (SPI, timer, DIO, UARTs etc.) The Microblaze_mcs I/O system is designed to simplify the porting of the core Arduino code to this new platform. The result is a completely self-contained system that can run most of the example sketches for Gameduino without any extra hardware, using the familiar Arduino GUI. Links to a few bit files to show off what it can do (just download the bit file to the fpga, i.e. fpgaprog -v -f <bitfile.bit>) 256 sprites: collision: asteroids game: (pins A3 - A6 controls the game) Link to my version of the Arduino GUI (windows) with Microblaze support that can be used to compile and download the demo sketches (included as examples) Instructions: * Download the Arduino zip file (it's about 160 MB) to your computer (sorry, windows-only at the moment) * Unzip to any directory * Go to this directory and launch the Arduino GUI by clicking on the Arduino icon * In Tools -> Board select "Microblaze_mcs with Gameduino" * Connect the Pipistrello board to the computer, a DVI monitor and optionally a sound system * Load one of the Gameduino examples by going to File -> Examples -> Gameduino * Click on the Upload button. The sketch will be compiled, then merged with the base bit file and then downloaded to the Pipistrello board Enjoy! Magnus
  19. mkarlsson

    Interfacing memory to papilio fpga board

    No, there is no reason why a board like that would not work. I would keep the wires as short as possible though. One option is to make the layout to match the papilio wing headers and populate the board with pin headers to minimize the signal length. The memory you linked to has a 12ns access time and you should be able to do reads and writes at 25 - 40 MHz. A quick rule of thumb is to add 5ns address output delay and 5 ns data input delay to the 12ns access time = 22ns access cycle time. You should be able to use this memory to generate video signals at 8 bits/pixel, 640x480. The problem is that if you want to dynamically update the video image then you would need bandwidth for both video readout access and video update access. For 640x480 VGA that typically means the you need 50 MHz pixel access bandwidth (2x 25 MHz video pixel rate). If this is your goal then you might want to consider a 10nS memory part. Here is a link to a zip file with a Eagle board layout for a memory board that fits the Papilio headers: It implements a 32-bit wide 2MB memory system using two 512Kx16 SRAM chips and an address latch to save pins. This board has up to 100 MB/s bandwidth using 10nS memory chips and can be used to implement a 16-bit/pixel VGA buffer with read/write access bandwidth. While this is a bit more than what you plan to do, it might give you some ideas. Magnus
  20. This is a port of the Plus Too code from Big Mess o' Wires to Pepino LX9/1MB. This code base have been dormant for quite some time but the folks at MiST picked it up a while ago and added more features like keyboard and sound support etc. The code supports a virtual SCSI hard drive via the sd-card socket. This is based on the MIST scsi code but the disk interface is quite different - the MIST board have a ARM processor that is handling the sd-card read and write functions and talks to the FPGA via SPI, while in the Pepino implementation the FPGA is directly connected to the sd card using the native 4-bit SD protocol. The interesting part of this project is that the 128KB ROM data is stored in flash memory after the bit file and is executed directly from the flash chip (the need for this is due to the Pepino LX9 RAM limitation, the MacPlus needs the full 1MB of RAM). It's possible to do this since the flash chip on Pepino (Micron N25Q128A) can operate in quad-spi mode at up to 108 MHz clock rate. In quad-spi mode, 4 bits are transferred on each clock instead of 1 bit. However, due to access time restrictions there needs to be dummy cycles between the cmd/address part and the data transfer part based on the clock frequency used. The default number of dummy cycles is 10 matching the highest clock rate (108 MHz). So with the default dummy clock settings a 16-bit word transfer in quad-spi mode will take 2 + 6 + 10 + 4 = 22 clocks, corresponding to 1 byte command, 3 byte address, 10 dummy clocks and 2 byte data. (BTW, there is a possibility to eliminate the command byte by using XIP, eXecute-In-Place mode supported by this chip, but it was not needed in this case). In this project the spi bus is clocked at 65 MHz and the Mac 68000 processor is clocked at 8.25MHz. The 68000 memory access cycle takes 4 clocks for an effective memory access rate of about 2 MHz, which means that there is time for 32 spi clocks for each memory access (65 MHz/2.03125 MHz = 32). So the 22 clocks needed to read one instruction in quad-spi mode will easily fit in the 32 cycle window. The full ISE project can be found here: For more info and a MacPlus disk image etc., see this link:
  21. mkarlsson

    Unable to upload the bit file

    You will get this message if the FTDI chip can not find a JTAG device in the JTAG chain. This will typically happen if there is a problem on the board with the FPGA JTAG connection to the FTDI chip OR if there are other FTDI boards present on the computer and the papilio loader happens to open the wrong FTDI chip (the default behavior is to open the first FTDI chip that it finds). BTW, the "insane" error message have been fixed in later version of the papilio loader to more clearly identify the problem (i.e. no FPGA chip found).. Magnus
  22. mkarlsson

    Logic Analyzer with Papilio Duo

    FYI, I had a discussion a couple of years ago with Jan Willem Janssen (JaWi, the author of the ols client software) regarding bugs in the RLE code. The problem I found was that RLE processing in demux mode (i.e. 200 MHz sampling mode) was completely broken. This is what I wrote him back then: The reason I think demux mode is a hack is that only the input sampling module and the trigger module knows about demux mode, the rest of the pipeline is tricked into processing two 16-bit values as one 32-bit value. This works fine as long as the client receiving the data is processing it as a sequence of 16-bit values, but when you add RLE encoding to the mix then it starts to fall apart since the RLE encoder knows nothing about demux mode. For example, 32-bit RLE mode is using bit 31 as a flag (if set it indicates a repeat count) so you only have 31 channels in this mode and the most significant channel is always 0. This means that in demux mode the sample stored in bits 16-31 will have it's top channel value zeroed out bit not the value stored in bits 0 - 15. This could be fixed if the RLE module knows about demux mode. A more significant side-effect of processing two 16-bit values as one 32-bit value in the RLE encoder is that you are really RLE-encoding pairs of 16-bit values. If the stream of 16-bit values look like this: 0x5000, 0x5100, 0x5000, 0x5100, 0x5000, 0x5100 then the RLE encoder will process this as the value 0x51005000 repeated three times. To process this correctly the RLE decoder in the client must first create the original sequence of 32-bit values based on the RLE flag and RLE count, and then process them as a sequence 16-bit sample values. In other words, the process order in the client must be the reverse of the process order in the RTL code and must operate in the same context as the RTL code (first do RLE as 32-bit values, then the sample values as 16-bit values). However, looking at your code (in I believe this is not how it's done in your client, it's trying to do both at the same time. If I read your code correctly it looks like you are processing the data as a single16-bit value and if the RLE flag is set and in demux mode then you try to modify the repeat-count for this 16-bit value somehow by using the next 16-bit value and then multiplying the result it by 2, rather than processing it as repeated pairs of 16-bit values. It also looks like you are applying the 32-bit rleCountValue and rleCountMask to the 16-bit sample value in 16-bit demux mode? In other words, RLE in 200 MHz mode (a.k.a. demux mode) does not work in the client software. I don't think this has been fixed by JaWi. Magnus
  23. Well, they wanted to plug that possibility so if you install Vivado then they also update the Digilent plugin You can however revert to the ISE version by going to (assuming 64-bit Windows) C:\Xilinx\14.7\ISE_DS\common\bin\nt64\digilent and run install_digilent.exe It will prompt if you want to "downgrade" the plugin.
  24. Hi Thorsten, The video you are referring to was done 2012, well before the Papilio Duo board was introduced and is only applicable to the Papilio One boards. Papilio One uses a different FTDI chip than Papilio Duo (FT2232D vs. FT2232H) and the instructions in the video only works for FT2232D. Also, the Papilio One boards are shipped with a blank EEPROM so the instruction at the end of the video to restore the board to the way it was shipped by erasing the EEPROM is correct, but only for Papilio One. If you want to use the Xilinx cable then the FTDI pins used for JTAG must not interfere with the Xilinx cable. In normal UART mode (i.e. when the EEPROM is blank or Port A is configured as UART in the EEPROM) then those pins are used for TXD. RXD, RTS and CTS and will mess up the Xilinx cable signals. The solution is the reprogram the FTDI EEPROM to a mode where the signals are not driven by the FTDI chip. For the FT2232D chip, one way to do that is to program Port A to Opto Isolate mode. However, on FT2232H this mode does not exists for Port A, only for Port B. An alternative is to program Port A to 245 FIFO mode instead, this works for both FT2232D and FT2232H. Hope this helps, Magnus
  25. mkarlsson

    Logic Analyzer bug on Papilio One?

    The problem above is related to bugs in JaWi's SUMP client, not the FPGA board. When the pulldown menu says 6 kB capture it really means 6 kS, i.e. it's the number of samples not the number of bytes. But then in the time calculation he incorrectly scales the resulting time by the number of channel groups. 6 kS at say 1 MS/s will always take the same time (in this case about 6 msec) independent of how many channel groups are enabled. If you try to select 12 kB or 24 kB samples (really 12 kS or 24 kS) with all four channel groups enabled then the memory is not enough so the error message is correct. As an alternative to Jack's Sump Logic Analyzer bit files for Papilio One 250k/500k you could try one of the bit files here: , they are generated from the current Open Bench Logic Sniffer Verilog source files. Cheers, Magnus