• 0
MIRKOSOFT

Bitstream selector for Nexys4DDR - can anybody help?

Question

Hi!

I own Nexys4DDR approx 1 year. I'm using it only for finished cores, so I'm in VHDL even not yet beginner, sadly for lack of time I began not to learn.

Can anybody help me to create bitstream selector for choose which bitstream will be loaded and used?

Why this Q and what I mean under help:

I'm using mostly few cores, but it's for me hard to accessible Nexys4DDR board to exchange microSD card, so I want to place them into one and onlly if I find new then change/add.

Help: I'm not able to create own project in VHDL, I can only follow instructions with help of possible mismatch or error. If is any public core available for this purpose can anybody recommend me one?

Really it looks: do it for me and I use it. Sadly it's similar, but not for my lazy mind and hands - I have no knowledge and when I go to compile any core I always learn anything about Vivado. I'm programmer in assembler of 8-bit computers and Visual Basic with beginning C++ and also website creating, so understand HTML and others. So VHDL is not hard to recognize any action in code, but it's different to watching work of any other like to create own.

Thank you for understanding and help.

Miro

Share this post


Link to post
Share on other sites

12 answers to this question

Recommended Posts

  • 0

So ... I have a solution to your problem, but only using the Arty and not Nexys DDR.  It's a solution in development, though, and so the documentation hasn't caught up to it yet.  But, basically, I proved again last night that I could: 1) load a configuration into the flash starting at the zero address, 2) using that configuration load another configuration into the flash at another address, and then 3) switch between the two configurations.  I could even load more configurations into the flash to select from among, but I am trying to leave some flash space available for some ZipCPU instructions.

Here's the catch though: It works for Arty and not Nexys.  This is easily fixed, but you would need to do get your hands dirty and do some tailoring to get this to work for you.  This would also make using multiple canned configurations somewhat difficult, since you would either need to power cycle between configurations to get the Nexys to the zero configuration (the one that gives you this capability) and then select between them, or you would need to add this capability into every canned configuration you used--at which point they wouldn't be canned.

Another approach might be to leave the board plugged into a host, and just reprogram the board via JTAG everytime you wished to switch configurations.  This approach would work for any canned configuration, and so it probably comes closest to meeting your needs.  The only problem here is that the Nexys would need to be connected to JTAG, and the JTAG control software would need to be run any time you wished to change configurations.

Some things to think about,

Dan

Share this post


Link to post
Share on other sites
  • 0

Hmm ... rereading over that last answer suggests it may need some more explaining.  Here's what's going on:

  1. Using the SD card port, you get access to one configuration only--the first one.  Neither the software nor the interface exists to do more.  (Sure, you could use the switches on the board ... but only once the board was configured, so you are in a catch 22)
  2. 7-series Xilinx chips have an internal configuration port.  They call this an ICAPE2 port.  You can control this port from within your design if you would like.  Using this port, you can command your design to reload its configuration.  You can also tell it where to start reading from the flash in order to to this.
  3. Using this configuration port, though, can be a real pain.  The instructions were never that clear on how to do so.  Therefore, I wrote a core to control the ICAPE2 port from a well known interface: a wishbone bus.  Discussions within the spec will tell you how, using the core, you can 1) set the address for where a configuration can be reloaded from, and 2) command the configuration to be reloaded.
  4. Getting a configuration into the flash, though, takes a touch more work.  For this I wrote a QSPI flash core, and then expanded it to work with the EQSPI (Extended Quad SPI, or extended quad serial peripheral interconnect driven ...) flash on the Arty.  This allows a configuration to read/write flash from a known interface again--the wishbone bus.  Writing the flash, though, is not nearly so simple, 'cause you need to send write enable commands to the flash, erase the flash, and then program the flash--a rather complex operation.  I run this reprogramming operation from a host computer, using a reprogram command I have built together with a flash driver to make things simple for the reprogramming command.
  5. At this point, the question is how to get information in and out of the board.  I've used several methods, although my most recent method converts UART characters to wishbone bus commands.  The interface from the host side is fairly simple, although the actual implementation is more complex and involves compression and what not.  The real fun part, as far as I'm concerned, is that I can then forward the UART port via TCP/IP to any computer in the house: the host PC, a laptop, even a raspberry pi if you would like.  The Verilog part of the design that receives this information is again complex, but it turns these UART commands into a standard interface (Wishbone bus again) that can then be used to interact with any device on board--provided that said devices are connected to such a bus.
  6. This allows me to not only configure the board, as I outlined above, but also to try out and test peripherals, and even to get, read out, and decode traces from various peripherals that might be under test.

So here's my point: starting from an alternative configuration is quite doable, as is loading and programming your flash.  Doing so from any arbitrary design is ... more complicated, as you will not have either the support logic or software infrastructure to make it happen.  So your choice is to 1) modify every design to have this infrastructure, 2) reload a single configuration having this infrastructure via cycling the power, or 3) use an alternative technique, such as loading from a JTAG port whatever configuration you need whenever you need it.

Hope this helps,

Dan

Share this post


Link to post
Share on other sites
  • 0

Hi Dan!

So, I used translator to understand it as far as possible and I have Q which is from your words:

Mean you that I need choose new core always after reset Nexys4DDR?

I need to select bitstream only at power-on - not more...

Your links includes also C++ code, are bit understanable, but not so far as is wanted.

So, is it so hardly to implement when I need to select core only at power-on?

Thank you for reply.

Miro

Edited by MIRKOSOFT

Share this post


Link to post
Share on other sites
  • 0

@MIRKOSOFT,

Ok, so let's try this again.  Suppose you store multiple configurations on your flash device.  On power up, you will always come up in configuration zero.  (The one at the start of the flash.)  You can then switch configurations from within the logic of the FPGA using the ICAPE2 interface.  This switch is very easy to do.  Xilinx discusses how to do it here, and I referenced an example core that would do it here (or here if OpenCores is down).  The core is nicely documented with a PDF specification, although the text is available (together with LaTeX markup) should you need to use a translator.   Basically, you need to set the WBSTAR register to the address of the configuration you would like to load, and then issue an IPROG command to the device--both using the ICAPE2 interface.

This is not hard to do at all--especially with the example cited.  I think you will have more difficulty building the rest of your design than this component.

Be aware, though, you'll need to guard against such things as what happens when Xilinx cannot switch configurations, or what happens when the switch fails?  There is a BOOTSTS register that can be read from the ICAPE2 interface to tell you about this.  That could keep you from getting into an endless boot loop where your logic tries to pick a new configuration, that new configuration fails, your logic tries again, it fails again, etc.

Yours,

Dan

Share this post


Link to post
Share on other sites
  • 0

Again we don't understand us together - or is translator not enough (in case of Slovak language it is normal).
I don't want to flash anything to Nexys4DDR - I have selected reading from microSD card - always had - I know it is slower, but my selection.

I want to place selector to microSD card - no flash.
Like simple bitstream which looks for other bitstreams on SD card and allows selection.

Is it harder to do?

Miro

Share this post


Link to post
Share on other sites
  • 0

Ok Dan.

So back to flash - can be bitstream selector flashed and selection will be between bitstreams on SD card?

If not, I need only this:

bitstream selector selecting between:

1. Apple II bitstream

2. PET2001 bitstream

3. Load bitstream from SD card

is it possible this way?

Miro

Share this post


Link to post
Share on other sites
  • 0

@MIRKOSOFT,

There are hardware jumpers on the board for selecting between different configuration sources.  None of those settings will get you what you want.

One problem you have is that there is only so much hardware support for configuration from Xilinx.  Xilinx has built its chips so that they can be configured from Flash, JTAG, or an external microcontroller.  Xilinx has not created any USB configuration possibilities, nor have they created any microSD card configuration possibilities.  Digilent provides you with these extra configuration possibilities by placing an external PIC24 microcontroller on board, and programming it for that purpose.  What you are asking for is a configuration capability that is 1) not native to the Xilinx FPGA chip, nor 2) programmed into the PIC24 microcontroller.  You would have to build/create such a capability.  Digilent does not provide it.

It sounds like what you want to do is to reprogram the PIC24 microcontroller so that it will select from among several possible options.  Your problem is going to be that neither the source code for the PIC nor the means of reprogramming it have been made publicly available by Digilent.  While it is theoretically possible to reprogram this chip to do as you would like, practically you would find it very difficult to do so.

The only way around this is to first load a different configuration into the FPGA---a configuration selection configuration, and to use this bootstrap configuration to get close to what you want.

Using this approach, it is possible to build a configuration that will 1) load from the flash, 2) allow the user to select from among configuration files within an SD card, 3) read that configuration file from the SD card, 4) write that file into a secondary configuration location in flash, and then 5) switch to the configuration at that secondary location.  This can all be done based upon user input to the board, and the logic on the board can do this selection.  It will take you a lot of work to get there though.

Can it be done?  No.  Not as you've defined it.

Can you do something similar?  Yes.

How hard would it be?  To select among SD card files, you will need a microcontroller within your FPGA that can understand the SD card filesystem.  Others have done similar things, but that is beyond my experience and current capability.  I can only get you as far as reading from the SD card itself, writing to the flash, and then reconfiguring from the flash.  I can't get you to where you would read a particular file from the SD card.

This is beyond me.

Dan

Share this post


Link to post
Share on other sites
  • 0

So, ok Dan, in all - thank you very much for help.
Really I meant that it is possible to do by software, ok, it is not.
I was looking for any boot sequence which displays where can and user select where continues booting...
My task will be always when I will need other core, will replace SD card.

I have last Q:
You wrote in your advice that Arty works not on Nexys4DDR...
I was compiling one project - first version was for Nexys3 and later Arty version - it was noted that works on Nexys4 and worked not - my test.
So how is it - Arty works not with Nexys4?

Thank you for all - advices, replies, help and patience.
I wish you all good.
Miro

Share this post


Link to post
Share on other sites
  • 0

@MIRKOSOFT,

Sorry, what I meant is that the code I am personally working on is being built for the Arty.  While it might work on a Nexys, I don't have a Nexys to test it on.

Please note that I am not a Digilent employee.  Digilent has examples that work with each of the Nexys boards.  I do not know what components you might take from these examples to do what you are asking to do.  This is why I was discussing my own IP.

Dan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now