This blog post was supposed to get the previous tutorial's UART running on real hardware. However, my plans were derailed swiftly starting with a glitch.
The tutorial's design would have allowed you to switch an LED on and off remotely, as per the following:
- When an 'E' character is received, then the LED will be switched on, and it will send an 'E' back
- When 'D' is received, then the LED will be switched off, and it will send back a 'D'
- When any other character is received it will send back a '+' if the LED is on, and '.' if it's off
The UART receiver worked as expected, switching the LED on and off reliably. However, this is what my computer received back from the FPGA:
They should all be 'E', 'D', '+', or '.' characters, and not the funny characters you see above. Clearly something isn't working right.
So far, no big deal. I could use this to teach you why behavioural simulations don't guarantee that it'll work on actual hardware. Behavioural simulations assume ideal hardware with zero delays across logic gates and connections. Real hardware does have delays, and the those delays can be the difference between success and failure.
Running an accurate timing simulation (based on the generated hardware) is what was needed to track down the root cause. So, I started up Xilinx ISE and tried to start its simulator. Instead I got:
ERROR:Simulator:861 - Failed to link the design
That's weird; the design linked okay when generating the hardware. Searching the internet showed that other people had hit the same problem. I tried a few of the suggestions, but none of them worked.
Eventually I discovered that Xilinx ISE officially doesn't support Windows 8 or higher, and that this likely won't change. Xilinx ISE has reached its end-of-life (link); their new suite called Vivado is the future. Alas, Vivado only supports Xilinx's latest devices, and the Spartan6 FPGA on my Papilio Pro is too old.
There's no way I was going to downgrade my entire machine to Windows 7 for this. And so, everything came grinding to a halt.
I like the Papilio Pro board, but debugging designs without a working timing simulator is like trying to drive in the dark without lights; you can't see what you're doing. So I've had no choice but to order a new development kit.
The new board is the Terasic Cyclone V GX Starter Kit. It's not too expensive, and has the features I was looking for:
- An FPGA with a reasonable amount of resources
- A reasonable amount of RAM
- An HDMI output connector (yes, I'm a graphics guy)
- Some expansion ports for connecting other hardware
- Various other devices and ports (e.g., audio out, SD-card slot, etc.)
I've never used Altera devices before, but I've been told that their software is better. My experience with Xilinx's software hasn't been great, so I certainly hope so. I'll find out once it arrives.
So, that's the current situation. The UART tutorial is on hold until I have the new hardware and have learnt how to use Altera's software. There's always a learning curve when trying something new... Wish me luck.