sorressean wrote:
> Hello all,
> I am a totally blind student and am in a computer architecture class. For our end-of-semester project, we are to design a processor of our choice.
> I have a couple of questions. First, the students are using logisym which is not accessible with a screen reader. Verilog was the only solution we found that allows me to actually participate in this project.
> I am using Icarus Verilog as my compiler.
> I have a few questions which I hope will get me going on the right path.
> 1. is there a good reference for the version of Verilog that Icarus uses?
My favorite reference is the Doulos Golden Reference, which includes
Verilog 95 as well as Verilog 2001. I used Thomas and Moorby's book
when learning Verilog 95. That book is good to get started even if
it doesn't cover Verilog 2001.
> 2. What might be the best way to implement an ALU? My solution was a muxer, but I'm a bit confused here as to how this is implemented. In the least, I'll need the instructions and the registers. How does the math take place once you select the operation with your muxer?
I assume you mean multiplexer. This is essentially correct. At the
top level, the instruction selects the output of the ALU from the
possible functions like add, subtract, and, or, etc. Of course you
need to implement each of these functions to provide the data inputs
to the multiplexer.
> 3. How would one simulate voltage for clock cycles?
Not sure what you mean by voltage. The Verilog language treats
logic as levels of 1 or 0 regardless of the actual voltage used
to implement that logic. If you mean how to drive a clock into
your circuit for simulation, that is fairly easy using a simple
loop with time delay in the test bench as in:
reg clock = 0;
always clock = #5 !clock;
> 4. How do you simulate memory to be attached to the processor?
Again this depends on what sort of memory. If the memory will be
some off-the shelf chip, you might find a Verilog simulation model
at the chip manufacturer's website. If it's just simple static RAM
you can infer that in your test bench using an array like:
reg [7:0] memory [0:65535]; // 64 Kbytes of 8-bit wide memory
> 5. Is there an implimentation of registers that I can work with, or is there a good way to create my own?
>
The CPU's internal registers can be just a loose bunch of Verilog
regs like:
reg [7:0] A_reg;
reg [7:0] B_reg;
. . .
or you can use an array of registers, which makes it simpler to create
code that selects a register based on some bits of the instruction like:
reg [7:0] Registers [0:15]; // 15 8-bit registers you can address using
4 bits
> My biggest and overall issue is the design of this entire thing by itself. From what I can tell, each individual component will be a module in and of itself. So, the registers will be an individual module as will the ALU. So for the main cPU, I'll need to declare the registers as well as the ALU inside the CPU module. Given this:
> 1. Is there a way to declare an array or group of modules?
Verilog since Verilog 95 has the ability to declare an array of
instances. Thus if you had a bit-slice architecture you could
use an array of instances to generate a group of these slices
organized as a larger (wider) ALU.
> 2. If i have my ALU module declared on the CPU module, how will the ALU access registers? Will those have to be wired individually?
>
As I pointed out above, you can use individual registers or a
register "file". The latter can be addressed like memory using
bits from the instuction code.
> I'm sorry for what is probably a misguided and confusing message. I understand the basics, but I am a bit confused. Any suggestions and ideas would be amazing.
>
Not at all. You have to start somewhere, and your questions point to
some thought about the process. I'd suggest trying to find a user guide
for a simple early 8-bit CPU like the Motorola 6800. This might provide
more insight.
> Thanks,
You're welcome.
--
Gabor