Category - FPGA related posts

1
Memory controllers in FPGAs are the bane of my existence, help needed
2
my mini-review of the IKALOGIC Scanalogic-2 PRO logic analyzer

Memory controllers in FPGAs are the bane of my existence, help needed

I want to put together a softcore 68K computer system, just something simple.

I’ve purchased, but not yet received, the Terasic Cyclone V GX Starter Kit, an Altera FPGA eval board.

It looks pretty sweet and includes some fun stuff I’ve never done like HDMI connectors, has some easy to access onboard SRAM, has built in FTDI USB support, built in programmer, built-in flash for non-volatile storage, 77K logic elements, and the list goes on.  Looks like a really sweet board EXCEPT for one line on the datasheet:

4Gb LPDDR2 x32 bits data bus

“Oh no! Not yet a different memory chip or interface”

What’s nice is that there are (2) HARD memory controllers built-in to the FPGA, and so you don’t have to waste logic elements for defining your own. While I’m not sure what I was thinking, I really expected the interface to the memory to be very simple…. You know something like a FIFO-front end where you’d specific address, read/write, data, and then throw some read_data_valid switch and voila. Well, of course, I’m wrong.

Again, I’m in the middle of a memory controller nightmare.

For my Altera DE0, I modified the memory controller found here. It works like a champ, and the interface is pretty darn simple.

I could really use some help putting together a simple to use DDR2 controller to access this chip:

MT42L128M32D1LF-25 WT

It’s configured like this: 16 Meg x 32 x 8 banks x 1 die. Rows are addressed like this “16K (A[13:0])” and columns “1K (A[9:0])” using Single Channel Addressing. Cycle Time is “-25 = 2.5ns, tCK RL = 6”

What I don’t know is whether I can even start with a SDRAM controller and then expand on that, or if a completely different approach is warranted. I know that DDR2 is still SDRAM, and the interface to the new memory chip is very similar. I don’t really need the double-pumping or the increased data rate — I’d take anything to get off the ground.

Ideally, I’d find a verilog module for a controller with an example module that instantiates it, writes to some addresses, and then reads them back and verifies them.

A google search, as well as investigation on OpenCores hasn’t yielded much. This Altera youtube video is promising, but it stopped short on showing the HDL-specific details on how to instantiate it, and how to actually USE the module that gets created. This is assuming that everything goes swimmingly during the fairly complicated MegaWizard process.

If you’ve got any experience or helpful tips, I’d appreciate it.

my mini-review of the IKALOGIC Scanalogic-2 PRO logic analyzer

As many of you know, I maintain a comparison page of sub$1000 logic analyzers here.  I previously owned both a LogicPort and a Saleae Logic unit.

I just received in the mail an IKALOGIC Scanalogic-2 PRO logic analyzer.  This is a small low-cost($79 via MCPros) logic analyzer which is about half the price of an 8-channel Saleae Logic.

The rough specs on the unit are:

  • 4 channels (both for input, and for output (signal generation))
  • 20 million samples per second
  • 256K samples per channel
  • Multiple serial decoders for SPI, I2C, 1-WIRE, UART, CAN, LIN,Manchester
  • Multiple voltage support: 2V, 2.8V, 3.3V, 3.6V and 5V logic
  • Free Windows-based ScanaStudio software

It ships with the following stuff:

* the small blue unit itself

* a multicolor 5-port lead with micrograbbers(including GND)

* a 3-ft USB cable

* a quick-start ~4″ x 6″ card

 

 

 

My source for the specs, manual, software, etc can be found at IKALOGIC’s site here.

The two screws holding the small plastic case together make it super tempting to pry inside and see the hardware that the scanalogic-2 is based on:

As is with the Saleae Logic unit, the 5-port lead that includes the micrograbbers isn’t polarized or keyed in anyway, which could lead users to accidentally connect ground to something they were trying to measure.  They did include a “Probes Legend” in the Configuration / Device tab to help show the proper orientation of the cables.

I connected the SL2 (I can’t keep using the full name) to my Commodore Amiga, specifically the DENISE chip, to test it out.  I hooked it up to two clocks, one called 7M on the YELLOW and CCK (color clock) on the BLUE lead.

Here’s an image of it in use: (Click for full size)

The micrograbbers were nice and attached quickly and securely.

The software ScanaStudio installed with no problems on my Windows 7 machine, and recognized the hardware as soon as I connected it without driver related problems.  The software itself seems pretty clean, intuitive, and looks relatively well-designed.

IKALOGIC made the design decision to use the mostly driver-less HID class to interface the SL2.  While this makes installation a breeze and limits driver issues, it also slows down the maximum transfer rate which means that post-acquisition, there is a delay of about 30 seconds before the data is displayed on the screen.  The wait isn’t too bad, but other devices on the market are near-instantaneous.

The device works as advertised, and the software behaves as you would expect.

Here’s a screenshot of the SL2 in action:

In the above image, I recorded two clocks being provided to DENISE and then highlighted a section by selecting it.  It shows the total time of the selection, the frequency, and duty cycle.

The software has some useful features like the ability to export a screenshot, export the data to CSV, export printer-friendly images, and so on.  The triggering is simple (Falling, Rising, or Logic Change) on either ALL channels or an individual channel.  There is also a neat auto-refresh mode where the device will periodically go out and make another acquisition.

I didn’t really play with the signal generation capabilities or the various signal decoders yet.

I contacted support for a couple minor issues, and the email response was lightning fast and addressed my issues completely…..

Overall, this is a small straight-forward, low-cost unit, which could help in many hobby projects.  If you need to take a quick look at an SPI bus, or help debug a small interface, this could come in really handy.