Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Loading SRAM,SDRAM or FLASH on DE1, using Linux, without Qsys, SOPC or NIOS

I have a design which needs data preloaded into one or more of NVRAM and/or SRAM and/or SDRAM on a DE1.

I am using Quartus II Web Edition 11.1 sp1.

I am not using Qsys, SOPC or NIOS, as the design is very simple, doesn't use NIOS etc.

I am running on Linux.

The amount of data I want to preload is too much to pre-initialise onboard in the FGPA design itself (ie: in M4K or LE constructed memory).

Whats the simplest way I can do this?

(I am a beginner, and at the moment am getting to grips with Quartus, I'm rather hoping I don't have to learn Qsys, SOPC or NIOS to do this).

The Windows DE1 Control Panel doesn't seem to be available for Linux.

Thanks

{{{ Andy

19 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    SignalTap in particular looks promising.

    --- Quote End ---

    Here's a quick getting started guide for you.

    1) Bring up the SignalTap GUI.

    2) Click on the setup tab (you'll see it near the bottom left, its probably selected by default).

    3) Double click in the blank area. This will bring up the Node Finder GUI.

    4) On the 'Filter:' menu, select 'SignalTap II: pre-synthesis'. Then click on the list button.

    5) Double click on signals in the list on the left side of the GUI to add them to your signaltap signal list (they appear on the right). When you're done, click ok.

    6) Select a sampling clock. On the right side of the GUI click on the button next to the clock source. It brings up the Node Finder GUI again. Select pre-synthesis again, and then select a clock source, eg., clkin_50MHz (or whatever your external clock is called).

    7) Select a sample capture depth, eg., 2k (its on the right, under the clock selection)

    8) Save the SignalTap setup (click yes when it asks you if it should add the setup to the current design), and resynthesize your design.

    9) Download the new design and SignalTap should detect it (if not, on the right hand side of the Signaltap GUI, select the USB-Blaster and scan for the design).

    Have fun!

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Have set up SignalTap.

    However, the jtag side of it seems unreliable, at least for me.

    After downloading a new .pof, I need to stop Quartus, kill jtagd, start up Quartus, and then start SignalTap.

    This kinda breaks the edit, compile, debug cycle, which is not nice.

    If I don't do this, when I click on "Run Analysis" the "Status" reports as "Invalid data received".

    If I then click on "Read Data" data does come back, and it looks kinda believable, but it can be very misleading, because it doesn't know where the sample begins and ends - the end of the sample can be to the left of the start of the sample.

    This caused me to (incorrectly) think my program counter had magically jumped backwards for no reason!

    As I'm on 64 bit Fedora 14, to get Quartus working at all, I needed to put symlinks in for missing libraries, some of which support running jtagd - so my problems could be related to that.

    Having Quartus (including jtagd and SignalTap) work out of the box on more Linux flavours would be nice.

    I also get 10 lines of warnings when the USB blaster stuff is loaded at boot time like this:

    udevd[470]: BUS= will be removed in a future udev version, please use SUBSYSTEM= to match the event device, or SUBSYSTEMS= to match a parent device, in /etc/udev/rules.d/51-usbblaster.rules:8

    All in all, a great tool - shame about the jtagd problems.

    {{{ Andy
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Have set up SignalTap.

    However, the jtag side of it seems unreliable, at least for me.

    --- Quote End ---

    Yeah, I've noticed a few annoying things too.

    For example, if working with system-console, I need to make sure I close any JTAG connections before starting signal tap (the GUI), and then open a JTAG connection in system-console before starting signaltap acquire.

    Once I figured out the sequence that works, then its been ok.

    --- Quote Start ---

    I'm on 64 bit Fedora 14

    --- Quote End ---

    I have been doing my development under WinXP and Win7. I have got Quartus installed under VirtualBox + Ubuntu and Centos 6.2. Though I haven't played much with signaltap, so I don't know if the same sequence is required.

    --- Quote Start ---

    Having Quartus (including jtagd and SignalTap) work out of the box on more Linux flavours would be nice.

    --- Quote End ---

    From Altera's perspective, I'm sure they're thinking "Having less flavors of Linux to choose from would be nice ... " :)

    --- Quote Start ---

    I also get 10 lines of warnings when the USB blaster stuff is loaded at boot time like this:

    udevd[470]: BUS= will be removed in a future udev version, please use SUBSYSTEM= to match the event device, or SUBSYSTEMS= to match a parent device, in /etc/udev/rules.d/51-usbblaster.rules:8

    All in all, a great tool - shame about the jtagd problems.

    --- Quote End ---

    I haven't noticed those errors ... I'll have to keep an eye out for them.

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    FYI, problem solved now.

    Flash mapped into CPU memory space.

    SPI interface to SD card constructed and mapped into CPU IO space.

    Tiny on-chip ROM contains code to read SD and write flash.

    Really not that hard to do in the end.

    SPI is really quite straightforward, thanks to Wikipedia article and sample code on an Arduino site.

    {{{ Andy
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    FYI, problem solved now.

    Flash mapped into CPU memory space.

    SPI interface to SD card constructed and mapped into CPU IO space.

    Tiny on-chip ROM contains code to read SD and write flash.

    Really not that hard to do in the end.

    SPI is really quite straightforward, thanks to Wikipedia article and sample code on an Arduino site.

    --- Quote End ---

    So your Z80 processor boots now? Cool! :)

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Actually its been booting and been doing lots of stuff for quite a while.

    For example, driving (testing) the text mode video adapter I built.

    The T80, combined with z80soc, gives a good model to start from.

    Its just until now, all the code had to fit in on-chip (FPGA M4K or LE) memory.

    In my design, I will eventually have >=72KB of ROM, which is too much to do this way.

    {{{ Andy
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Guys,

    I have some doubts.

    I'm building a system based on another one that I have (DE2_NET - it is in DE2 CD ROM), so I'm trying to understand what the function of each memory element.

    We find these in the project (one of each):

    Avalon MM Tristate Bridge

    Flash Memory

    EPCS Serial Flash Controller

    SDRAM

    The Resect_vector is pointing to Flash Memory and the exception_vector to SDRAM.

    My doubts:

    I think that the the .elf is being downloaded to the flash memory, I'm correct?

    1. What's the function of each one?

    2. Why I need to use EPCS?

    3. I only can use flash memory whe I'm using a Avalon MM Tristate Bridge?

    Ps.: I'm reding some documentations but the differences are still not clear.

    Thanks
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Flash memory is probably a parallel memory chip while the EPCS is a serial configuration device for the FPGA. Both are able to contain the .elf file. Do you really have both memories on the board? Do you intend to use one for the FPGA configuration and another one for the software?

    With the EPCS there is a bootloader in the controller that copies the .elf contents to main RAM and runs the application there. With a parallel flash you have the choice between using a bootloader that would also copy the application to main memory, or execute the software directly from the flash.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks, now I understand!

    The flash memory is a paralel memory. I won't use the EPCS serial configuration.

    I'm storing the .elf into the flash and the library provides to me a software to copy the code and run over SDRAM.