VHD(hel)L

I found an interesting presentation today from the “Sketching in Hardware ’08” conference, something of which I’ve never heard before. I find the presentation interesting for many reasons, but one of them is definitely the mention of MyUSB – and there’s a nice looking USB board in the presentation too, which presumably uses MyUSB (since the library is mentioned). It’s nice to see even a little momentum being built up about MyUSB, as the more people using it the happer I become.

Since he seems to be bursting at the seams, I’ll also put another mention to Casainho’s Bicycle POV project over on Google Code. While the use of MyUSB is ancillary (used as a command and data transport from the host) the project itself is quite spectactular, and the latest pictures of the finished prototype boards are top-notch. All the best to Casainho, and I only ask that he take a picture of the final design showing a MyUSB/FourWalledCubicle themed picture ;).

Actually, It’s been an interesting week. On Sunday night I battled over timezones with another user, to help him get the MyUSB Mass Storage demo working on his custom AT90USB162 board. It turns out I’ve done the dumb thing of making the endpoints in the demo double banked (why do I keep doing this?!) which doesn’t work in that situation on the AT90USB162. Writing demos that work across the full USB AVR range is difficult when I only have an AT90USB1287 handy, but hopefully that will change in the near(ish) future and I’ll be able to fully test out the demos.

In lieu of payment for my assistance on Sunday, the user has agreed to send me a few of his custom boards. The boards themselves are (deliberately) simple – they’re actually business cards which will have my name, contact details, website and the like printed on them, with my resume and a few odds-and-ends located on the card’s dataflash, accessable when plugged into a computer over USB. It seems like a rather cool idea in my mind — a business card where the firmware of the board itself is an example of my skills — which is why I agreed to grab a few. Now all I need to do is figure out what to put on the card’s 1MB of space, other than my resume, picture and contact details. I’ll post pictures of the cards when they arrive, but the user should be posting his own information about them on AVRFreaks soon.

It also seems that the MassStore demo is broken on XP, but not for the usual reasons. The demo itself works fine as a disk — but Windows XP refuses to format the dataflashes if they’re not already formatted (which they are from the factory on Atmel’s demo boards). This is due to XP requiring the implementation of a few SCSI commands marked as non-mandatory, which nevertheless cause problems if not present. Fortunately I have backups of the old code in my local SVN and was able to re-implemented the needed SCSI commands, which are simple dummy handlers anyway.

This semester we’ve move on from blasphemous TI microcontrollers into the exciting world of CPLDs. That means I now have to learn the VHDL language, something I’m already hating. VHDL, in my experience, looks like the illegitemate inbred offspring of C, BASIC and Delphi. So many well established syntax patterns are broken in the language it makes my head hurt, and my body wish for a more C-like language for the chips.

 

Comments: 3

Leave a reply »

 
 
 

VHDL is rather an Ada offspring. For a more contemporary syntax try Verilog. (AFAIK unfortunately it’s not very well supported on PLDs; the contrary is true for ASIC synthesis)

PS. There are also some more extravagant alternatives like SIMSYNCH[1]. ;]

[1] http://swissnet.ai.mit.edu/~jaffer/synch_2

 

There’s a great picture of the benito in the todbot presentation as well (I hope to have the samples out in the mail next week broke my collarbone or you would have them by now). I just pushed a piece of MyUSB code to do serial to spi feel free to use it in the demo pile.

http://dorkbotpdx.org/blog/feurig/spi4_usb_to_spi_converter

 

As Jakub points out, VHDL is Ada derived. In USA and Japan, Verilog seems to be popular, whereas it seems that VHDL is more common in Europe.

Verilog is a terrible, terrible language. It’s a very “organic” feeling set of warts on C to make it kinda sorta represent some of what is really happening in hardware. Of course the Verilog people will disagree, but VHDL is much more precise and clean… it’s Ada heritage is clearly an asset when trying to model the concurrency of hardware.

The problem people from the Software world have with VHDL is they try as you mention to use their “established syntax patterns” as you mention to model hardware. This doesn’t give you optimal synthesis results, even if it does synthesize. Instead, you need to think in terms of Registers (this is RTL… Register Transfer Language after all), not program flow. Signals are not like “variables” in a C program (but VHDL variables are closer). Verilog’s “wire” concept is not properly formed, IMHO, but also not like a C variable.

My best advice is to try to think about what structure you are telling the synthesis tool to make. Then, it becomes more clear what is happening. Just get used to different syntax styles… as a friend of mine used to be fond of saying “you should be able to program in any Algol derived language!”

 

Leave a Reply

 
(will not be published)
 
 
Comment
 
 

 

Vital Stats

  • 35 Years Old
  • Australian
  • Lover of embedded systems
  • Firmware engineer
  • Self-Proclaimed Geek

Latest Blog Posts

RSS