Forum Discussion
Altera_Forum
Honored Contributor
12 years agoWell... in your most recent paste of code, your "if ( s_chipselect_n == 0 )" doesn't have any "else" to it, so SRAM_CE_n in particular is going to be stuck low the first time the if() gets hit.
Taking a step back: In your original code and statement of problem, ignoring the correctness of your approach, if it works in one compile and doesn't work in another compile, this is a somewhat typical symptom of bad / insufficient timing constraints. You should fix that first. As far as your direct attempt at simply mapping SRAM pins to Avalon pins, you can probably get something workable that way using the _hw.tcl parameters to control the strobes if necessary. But I think the "Generic Tri-State Controller" component in Qsys is possibly the off-the-shelf component you are seeking. It has presets for several NOR flash and SRAM chips, and I don't think your chip can be too different.