--- Quote Start ---
Q1. I cam across this nice piece of code for a parallel barrel shifter from a book. I could barely understand it at first so I am wondering what level of expertise is this code at. Are there any particular tools that can convert diagrams or some sort of instructions into compact and effective code like this one or is it just experience that gets one there? If the latter, what is the methodology to write code like this for other particular situations, like a multiplier for example?
--- Quote End ---
Is there some reason you don't want to use built in barrel shifters? I think Altera calles it LPM_CLSHIFT and VHDL has shift functions as well. I doubt if you can make one more efficiently than they can. If you are trying to understand barrel shifters, this code may not be a good example. Also, there are many options (left vs right, logical vs rotate etc ) that is does not have.
--- Quote Start ---
Q2. I am designing a small cpu with vhdl. I am simulating the whole project in Modelsim and since I have the instructions loaded onto the memory wired to the cpu, i don't require a testbench necessarily. I am struggling though trying to figure out if all is working as should be as there are couple of signals and things going on. I added signals to a list window but wasn't of much use as I cannot open it with excel. Do you guys use any techniques to automate testing other than a testbench? Something that verifies each step?
--- Quote End ---
Why don't you want to use a testbench? I believe you can export the waveform to csv file that you could in fact open in Excel, but why? A testbench can read stimulus and result vectors from files and verify results. But it can do all sorts of other things as well. Will your CPU have an adder? You could easily write code to verify that instead of massive stimulus files.